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_le.ma".
17 (* NON-NEGATIVE INTEGERS ****************************************************)
20 definition nlt: relation2 nat nat ≝
24 "less (non-negative integers)"
27 (* Basic constructions ******************************************************)
29 lemma nlt_i (m) (n): ↑m ≤ n → m < n.
32 lemma nlt_refl_succ (n): n < ↑n.
36 lemma nlt_zero_succ (m): 𝟎 < ↑m.
37 /2 width=1 by nle_succ_bi/ qed.
39 (*** le_to_or_lt_eq *)
40 lemma nle_lt_eq_e (m) (n): m ≤ n → ∨∨ m < n | m = n.
41 #m #n * -n /3 width=1 by nle_succ_bi, or_introl/
45 lemma eq_gt_e (n): ∨∨ 𝟎 = n | 𝟎 < n.
46 #n elim (nle_lt_eq_e (𝟎) n ?)
47 /2 width=1 by or_introl, or_intror/
51 lemma nlt_ge_e (m) (n): ∨∨ m < n | n ≤ m.
52 #m #n elim (nle_ge_e m n) /2 width=1 by or_intror/
53 #H elim (nle_lt_eq_e … H) -H /2 width=1 by nle_refl, or_introl, or_intror/
57 lemma le_false_nlt (m) (n): (n ≤ m → ⊥) → m < n.
58 #m #n elim (nlt_ge_e m n) [ // ]
62 (*** lt_to_le_to_lt *)
63 lemma nlt_le_trans (o) (m) (n): m < o → o ≤ n → m < n.
64 /2 width=3 by nle_trans/ qed-.
66 lemma le_nlt_trans (o) (m) (n): m ≤ o → o < n → m < n.
67 /3 width=3 by nle_succ_bi, nle_trans/ qed-.
69 (* Basic inversions *********************************************************)
72 lemma nlt_ge_false (m) (n): m < n → n ≤ m → ⊥.
73 /3 width=4 by nle_inv_succ_sn_refl, nlt_le_trans/ qed-.
76 lemma nlt_inv_refl (m): m < m → ⊥.
77 /2 width=4 by nlt_ge_false/ qed-.
79 lemma nlt_inv_zero_dx (m): m < 𝟎 → ⊥.
80 /2 width=4 by nlt_ge_false/ qed-.
82 (* Basic destructions *******************************************************)
85 lemma nlt_des_le (m) (n): m < n → m ≤ n.
86 /2 width=3 by nle_trans/ qed-.
89 lemma nlt_des_lt_O_sn (m) (n): m < n → 𝟎 < n.
90 /3 width=3 by le_nlt_trans/ qed-.
92 (* Main constructions *******************************************************)
95 theorem nlt_trans: Transitive … nlt.
96 /3 width=3 by nlt_des_le, nlt_le_trans/ qed-.
98 (* Advanced eliminations ****************************************************)
100 lemma nat_ind_lt_le (Q:predicate …):
101 (∀n. (∀m. m < n → Q m) → Q n) → ∀n,m. m ≤ n → Q m.
102 #Q #H1 #n @(nat_ind … n) -n
103 [ #m #H <(nle_inv_zero_dx … H) -m
104 @H1 -H1 #o #H elim (nlt_inv_zero_dx … H)
105 | /5 width=3 by nlt_le_trans, nle_inv_succ_bi/
110 lemma nat_ind_lt (Q:predicate …):
111 (∀n. (∀m. m < n → Q m) → Q n) → ∀n. Q n.
112 /4 width=2 by nat_ind_lt_le/ qed-.