1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
15 include "ground_2/star.ma".
16 include "ground_2/ynat/ynat_iszero.ma".
17 include "ground_2/ynat/ynat_pred.ma".
19 (* INFINITARY NATURAL NUMBERS ***********************************************)
22 coinductive yle: relation ynat ≝
24 | yle_S: ∀m,n. yle m n → yle (⫯m) (⫯n)
27 interpretation "natural 'less or equal to'" 'leq x y = (yle x y).
29 (* Inversion lemmas *********************************************************)
31 fact yle_inv_O2_aux: ∀m,x. m ≤ x → x = 0 → m = 0.
33 #m #x #_ #H elim (discr_YS_YO … H) (**) (* destructing lemma needed *)
36 lemma yle_inv_O2: ∀m. m ≤ 0 → m = 0.
37 /2 width =3 by yle_inv_O2_aux/ qed-.
39 fact yle_inv_S1_aux: ∀x,y. x ≤ y → ∀m. x = ⫯m → ∃∃n. m ≤ n & y = ⫯n.
41 [ #y #m #H elim (discr_YO_YS … H) (**) (* destructing lemma needed *)
42 | #x #y #Hxy #m #H destruct /2 width=3 by ex2_intro/
46 lemma yle_inv_S1: ∀m,y. ⫯m ≤ y → ∃∃n. m ≤ n & y = ⫯n.
47 /2 width=3 by yle_inv_S1_aux/ qed-.
49 lemma yle_inv_S: ∀m,n. ⫯m ≤ ⫯n → m ≤ n.
50 #m #n #H elim (yle_inv_S1 … H) -H
54 (* Properties ***************************************************************)
56 let corec yle_refl: reflexive … yle ≝ ?.
57 * [ @yle_O | #x @yle_S // ]
60 let corec yle_Y: ∀m. m ≤ ∞ ≝ ?.
61 * [ @yle_O | #m <Y_rew @yle_S // ]
64 let corec yle_S_dx: ∀m,n. m ≤ n → m ≤ ⫯n ≝ ?.
65 #m #n * -m -n [ #n @yle_O | #m #n #H @yle_S /2 width=1 by/ ]
68 lemma yle_refl_S_dx: ∀x. x ≤ ⫯x.
69 /2 width=1 by yle_refl, yle_S_dx/ qed.
71 lemma yle_pred_sn: ∀m,n. m ≤ n → ⫰m ≤ n ≝ ?.
72 * // #m #n #H elim (yle_inv_S1 … H) -H
73 #x #Hm #H destruct /2 width=1 by yle_S_dx/
76 lemma yle_refl_pred_sn: ∀x. ⫰x ≤ x.
77 /2 width=1 by yle_refl, yle_pred_sn/ qed.
79 let corec yle_trans: Transitive … yle ≝ ?.
80 #x #y * -x -y [ #x #z #_ @yle_O ]
81 #x #y #Hxy #z #H elim (yle_inv_S1 … H) -H
83 @yle_S @(yle_trans … Hxy … Hyz) (**) (* cofix not guarded by constructors *)