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/notation/functions/one_0.ma".
16 include "ground/notation/functions/uparrow_1.ma".
17 include "ground/lib/relations.ma".
19 (* POSITIVE INTEGERS ********************************************************)
21 inductive pnat: Type[0] ≝
27 "unit (positive integers)"
31 "successor (positive integers)"
32 'UpArrow p = (psucc p).
34 (* Basic inversions *********************************************************)
37 lemma eq_inv_psucc_bi: injective … psucc.
41 lemma psucc_inv_refl (p): p = ↑p → ⊥.
44 | #p #IH #H /3 width=1 by eq_inv_psucc_bi/
48 (* Basic constructions ******************************************************)
50 lemma eq_pnat_dec (p1,p2:pnat): Decidable (p1 = p2).
51 #p1 elim p1 -p1 [| #p1 #IH ] * [2,4: #p2 ]
52 [1,4: @or_intror #H destruct
53 | elim (IH p2) -IH #H destruct
54 /4 width=1 by eq_inv_psucc_bi, or_intror, or_introl/
55 | /2 width=1 by or_introl/
59 (* Basic eliminations *******************************************************)
61 lemma pnat_ind_2 (Q:relation2 …):
63 (∀p. Q p (𝟏) → Q (↑p) (𝟏)) →
64 (∀p,q. Q p q → Q (↑p) (↑q)) →
66 #Q #IH1 #IH2 #IH3 #p elim p -p [ // ]
67 #p #IH #q elim q -q /2 width=1 by/