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/generated/pull_2.ma".
16 include "ground/arith/nat_le_minus.ma".
17 include "ground/arith/nat_lt_pred.ma".
19 (* STRICT ORDER FOR NON-NEGATIVE INTEGERS ***********************************)
21 (* Constructions with nminus ************************************************)
23 (*** monotonic_lt_minus_l *)
24 lemma nlt_minus_bi_dx (o) (m) (n): o ≤ m → m < n → m - o < n - o.
26 lapply (nle_minus_bi_dx … o Hmn) -Hmn
27 <(nminus_succ_sn … Hom) //
30 (*** monotonic_lt_minus_r *)
31 lemma nlt_minus_bi_sn (o) (m) (n):
32 m < o -> m < n → o-n < o-m.
34 lapply (nle_minus_bi_sn … o H) -H #H
35 @(nle_nlt_trans … H) -n
36 @nlt_i >(nminus_succ_sn … Ho) //
39 (* Inversions with nminus ***************************************************)
41 lemma nlt_inv_minus_bi_dx (o) (m) (n):
42 m - o < n - o → m < n.
43 #o @(nat_ind_succ … o) -o
44 /3 width=1 by nlt_inv_pred_bi/
47 (* Destructions with nminus *************************************************)
49 (*** minus_pred_pred *)
50 lemma nminus_pred_bi (m) (n): 𝟎 < m → 𝟎 < n → n - m = ↓n - ↓m.
52 >(nlt_des_gen … Hm) in ⊢ (??%?); -Hm
53 >(nlt_des_gen … Hn) in ⊢ (??%?); -Hn
57 lemma nlt_des_minus_dx (o) (m) (n): m < n - o → o < n.
58 #o @(nat_ind_succ … o) -o
59 [ #m #n <nminus_zero_dx
60 /2 width=3 by nle_nlt_trans/
61 | #o #IH #m #n <nminus_succ_dx_pred_sn #H
62 /3 width=2 by nlt_inv_pred_dx/
66 (* Advanced eliminators for nle with nlt and nminus *************************)
68 (*** nat_elim_le_sn *)
69 lemma nle_ind_sn (Q:relation …):
70 (∀m1,m2. (∀m. m < m2-m1 → Q (m2-m) m2) → m1 ≤ m2 → Q m1 m2) →
71 ∀n1,n2. n1 ≤ n2 → Q n1 n2.
73 >(nminus_minus_dx_refl_sn … Hn) -Hn
74 lapply (nle_minus_sn_refl_sn n2 n1)
76 @(nat_ind_lt … d) -d -n1 #d
78 >(nminus_minus_dx_refl_sn … Hd) in ⊢ (%→?); -Hd
80 @IH -IH [| // ] #m #Hn
81 /4 width=3 by nlt_des_le, nlt_nle_trans/