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_pred.ma".
16 include "ground/arith/ynat_nat.ma".
18 (* PREDECESSOR FOR NON-NEGATIVE INTEGERS WITH INFINITY **********************)
20 definition ypred_aux (n): ynat ≝
24 definition ypred: ynat → ynat ≝
25 ynat_bind_nat ypred_aux (∞).
28 "successor (non-negative integers with infinity)"
29 'DownArrow x = (ypred x).
31 (* Constructions ************************************************************)
34 lemma ypred_inj (n): yinj_nat (↓n) = ↓(yinj_nat n).
35 @(ynat_bind_nat_inj ypred_aux)
39 lemma ypred_inf: ∞ = ↓∞.
42 (* Inversions ***************************************************************)
44 lemma eq_inv_ypred_inj (x) (n):
46 ∃∃m. x = yinj_nat m & n = ↓m.
47 #x #n @(ynat_split_nat_inf … x) -x
48 [ #m <ypred_inj #H <(eq_inv_yinj_nat_bi … H) -n
49 /2 width=3 by ex2_intro/
50 | #H elim (eq_inv_inf_yinj_nat … H)
54 (*** ypred_inv_refl *)
55 lemma ypred_inv_refl (x): x = ↓x → ∨∨ 𝟎 = x | ∞ = x.
56 #x @(ynat_split_nat_inf … x) -x //
58 lapply (eq_inv_yinj_nat_bi … H) -H #H
59 lapply (npred_inv_refl … H) -H #H
60 /2 width=1 by or_introl/