(* This file is generated by Why3's Coq driver *)
(* Beware! Only edit allowed sections below    *)
Require Import BuiltIn.
Require BuiltIn.
Require int.Int.
Require int.MinMax.

(* Why3 assumption *)
Inductive tree :=
  | Empty : tree
  | Node : tree -> Numbers.BinNums.Z -> tree -> tree.
Axiom tree_WhyType : WhyType tree.
Existing Instance tree_WhyType.

(* Why3 assumption *)
Fixpoint size (t:tree) {struct t}: Numbers.BinNums.Z :=
  match t with
  | Empty => 0%Z
  | Node l _ r => ((1%Z + (size l))%Z + (size r))%Z
  end.

Require Import Lia.

(* Why3 goal *)
Theorem size_nonneg : forall (t:tree), (0%Z <= (size t))%Z.
(* Why3 intros t. *)
(* YOU MAY EDIT THE PROOF BELOW *)
induction t; intuition.
unfold size; fold size; lia.
Qed.

