]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/ground/arith/ynat.ma
b4aac4eff753341a1dfa8b702cebf4ca96b1b632
[helm.git] / matita / matita / contribs / lambdadelta / ground / arith / ynat.ma
1 (**************************************************************************)
2 (*       ___                                                              *)
3 (*      ||M||                                                             *)
4 (*      ||A||       A project by Andrea Asperti                           *)
5 (*      ||T||                                                             *)
6 (*      ||I||       Developers:                                           *)
7 (*      ||T||         The HELM team.                                      *)
8 (*      ||A||         http://helm.cs.unibo.it                             *)
9 (*      \   /                                                             *)
10 (*       \ /        This file is distributed under the terms of the       *)
11 (*        v         GNU General Public License Version 2                  *)
12 (*                                                                        *)
13 (**************************************************************************)
14
15 include "ground/arith/pnat.ma".
16 include "ground/notation/functions/zero_0.ma".
17 include "ground/notation/functions/infinity_0.ma".
18
19 (* NON-NEGATIVE INTEGERS WITH INFINITY **************************************)
20
21 (*** ynat *)
22 inductive ynat: Type[0] ≝
23 | yzero: ynat
24 | yinj : pnat → ynat
25 | yinf : ynat
26 .
27
28 coercion yinj.
29
30 interpretation
31   "zero (non-negative integers with infinity)"
32   'Zero = yzero.
33
34 interpretation
35   "infinity (non-negative integers with infinity)"
36   'Infinity = yinf.
37
38 (* Inversion lemmas *********************************************************)
39
40 (* Note: destruct *)
41 (*** yinj_inj *)
42 lemma eq_inv_yinj_bi (y1) (y2): yinj y1 = yinj y2 → y1 = y2.
43 #x #y #H destruct //
44 qed-.
45
46 (* Basic properties *********************************************************)
47
48 (*** eq_ynat_dec *)
49 lemma eq_ynat_dec (y1,y2:ynat): Decidable (y1 = y2).
50 * [| #p1 |] *
51 [1,9: /2 width=1 by or_introl/ |2,5,8: #p2 ]
52 [2: elim (eq_pnat_dec p1 p2)
53     /4 width=1 by eq_inv_yinj_bi, or_intror, or_introl/
54 |*: @or_intror #H destruct
55 ]
56 qed-.