Section Paradox.
Variable Lambda : Set.
Variable lambda : (Lambda -> False) ->Lambda.
Variable matchL  : Lambda -> forall Q:Prop, ((Lambda ->False) -> Q) -> Q.
(* understand matchL Q l (fun h : Lambda -> False => t)  as match l return Q with lambda h => t end *)
Definition application (f x: Lambda) :False :=
matchL f False (fun h => h x).
Definition Delta : Lambda := lambda (fun x : Lambda => application x x).
Definition loop : False := application Delta Delta.
End Paradox.
Inductive itree : Set :=
| ileaf : itree
| inode : Z-> (nat -> itree) -> itree.
Definition isingle l := inode l (fun i => ileaf).
Definition t1 := inode 0 (fun n => isingle (Z.of_nat (2*n))).
Definition t2 := inode 0
(fun n : nat =>
inode (Z.of_nat n)
(fun p => isingle (Z.of_nat (n*p)))).
Inductive itree_le : itree-> itree -> Prop :=
| le_leaf : forall t, itree_le  ileaf t
| le_node  : forall l l' s s',
Z.le l l' ->
(forall i, exists j:nat, itree_le (s i) (s' j)) ->
itree_le  (inode  l s) (inode  l' s').

Theorem itree_le_trans :
forall t t', itree_le t t' ->
forall t'', itree_le t' t'' -> itree_le t t''.