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_minus.ma".
16 include "ground/arith/nat_le_pred.ma".
18 (* ORDER FOR NON-NEGATIVE INTEGERS ******************************************)
20 (* Constructions with nminus ************************************************)
23 lemma nle_minus_sn_refl_sn (m) (n): m - n ≤ m.
24 #m #n @(nat_ind_succ … n) -n //
25 #n #IH /2 width=3 by nle_trans/
28 lemma nle_minus_succ_sn (m) (n): ↑n - m ≤ ↑(n - m).
31 (*** inv_eq_minus_O *)
32 lemma nle_eq_zero_minus (m) (n): 𝟎 = m - n → m ≤ n.
33 #m #n @(nat_ind_2_succ … m n) //
34 /3 width=1 by nle_succ_bi/
37 (*** monotonic_le_minus_l *)
38 lemma nle_minus_bi_dx (m) (n) (o): m ≤ n → m-o ≤ n-o.
39 #m #n #o @(nat_ind_succ … o) -o //
40 #o #IH #Hmn /3 width=1 by nle_pred_bi/
43 (*** monotonic_le_minus_r *)
44 lemma nle_minus_bi_sn (m) (n) (o): m ≤ n → o-n ≤ o-m.
45 #m #n #o #H elim H -n //
46 #n #_ #IH /2 width=3 by nle_trans/
49 (*** minus_le_trans_sn *)
50 lemma nle_minus_sn (o) (m) (n): m ≤ n → m - o ≤ n.
51 /2 width=3 by nle_trans/ qed.
53 (* Inversions with nminus ***************************************************)
56 lemma nle_inv_eq_zero_minus (m) (n): m ≤ n → 𝟎 = m - n.
60 (* Destructions with nminus *************************************************)
63 lemma nminus_succ_sn (m) (n): m ≤ n → ↑(n-m) = ↑n - m.
64 #m #n #H @(nle_ind_alt … H) -m -n //
67 (*** minus_minus_m_m *)
68 lemma nminus_minus_dx_refl_sn (m) (n): m ≤ n → m = n - (n - m).
70 #n #Hmn #IH <(nminus_succ_sn … Hmn) -Hmn //