]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/ground/arith/nat_le_minus.ma
milestone update in ground, partial commit
[helm.git] / matita / matita / contribs / lambdadelta / ground / arith / nat_le_minus.ma
1 (**************************************************************************)
2 (*       ___                                                              *)
3 (*      ||M||                                                             *)
4 (*      ||A||       A project by Andrea Asperti                           *)
5 (*      ||T||                                                             *)
6 (*      ||I||       Developers:                                           *)
7 (*      ||T||         The HELM team.                                      *)
8 (*      ||A||         http://helm.cs.unibo.it                             *)
9 (*      \   /                                                             *)
10 (*       \ /        This file is distributed under the terms of the       *)
11 (*        v         GNU General Public License Version 2                  *)
12 (*                                                                        *)
13 (**************************************************************************)
14
15 include "ground/arith/nat_minus.ma".
16 include "ground/arith/nat_le_pred.ma".
17
18 (* ORDER FOR NON-NEGATIVE INTEGERS ******************************************)
19
20 (* Constructions with nminus ************************************************)
21
22 (*** minus_le *)
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/
26 qed.
27
28 lemma nle_minus_succ_sn (m) (n): ↑n - m ≤ ↑(n - m).
29 // qed.
30
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/
35 qed.
36
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/
41 qed.
42
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/
47 qed.
48
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.
52
53 (* Inversions with nminus ***************************************************)
54
55 (*** eq_minus_O *)
56 lemma nle_inv_eq_zero_minus (m) (n): m ≤ n → 𝟎 = m - n.
57 #m #n #H elim H -n //
58 qed-.
59
60 (* Destructions with nminus *************************************************)
61
62 (*** minus_Sn_m *)
63 lemma nminus_succ_sn (m) (n): m ≤ n → ↑(n-m) = ↑n - m.
64 #m #n #H @(nle_ind_alt … H) -m -n //
65 qed-.
66
67 (*** minus_minus_m_m *)
68 lemma nminus_minus_dx_refl_sn (m) (n): m ≤ n → m = n - (n - m).
69 #m #n #H elim H -n //
70 #n #Hmn #IH <(nminus_succ_sn … Hmn) -Hmn //
71 qed-.