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/