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/arith/nat.ma".
16 include "ground/arith/ynat.ma".
18 (* NAT-INJECTION FOR NON-NEGATIVE INTEGERS WITH INFINITY ********************)
21 definition yinj_nat (n) ≝ match n with
26 definition ynat_bind_nat: (nat → ynat) → ynat → (ynat → ynat).
34 (* Basic constructions ******************************************************)
36 lemma yinj_nat_zero: 𝟎 = yinj_nat (𝟎).
39 lemma yinj_nat_inj (p): yinj p = yinj_nat (ninj p).
42 lemma ynat_bind_nat_inj (f) (y) (n):
43 f n = ynat_bind_nat f y (yinj_nat n).
46 lemma ynat_bind_nat_inf (f) (y):
47 y = ynat_bind_nat f y (∞).
50 (* Basic inversions *********************************************************)
52 lemma eq_inv_yinj_nat_inf (n1): yinj_nat n1 = ∞ → ⊥.
54 [ <yinj_nat_zero #H destruct
55 | <yinj_nat_inj #H destruct
59 lemma eq_inv_inf_yinj_nat (n2): ∞ = yinj_nat n2 → ⊥.
60 /2 width=2 by eq_inv_yinj_nat_inf/ qed-.
63 lemma eq_inv_yinj_nat_bi (n1) (n2): yinj_nat n1 = yinj_nat n2 → n1 = n2.
64 * [| #p1 ] * [2,4: #p2 ]
65 [ <yinj_nat_zero <yinj_nat_inj #H destruct
66 | <yinj_nat_inj <yinj_nat_inj #H destruct //
68 | <yinj_nat_inj <yinj_nat_zero #H destruct
72 (* Basic eliminations *******************************************************)
74 lemma ynat_split_nat_inf (Q:predicate …):
75 (∀n. Q (yinj_nat n)) → Q (∞) → ∀y. Q y.