]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/ground/arith/nat_le_minus.ma
e3da0c92262e6682a676a87f120711c8be8169db
[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 elim n -n //
25 #n #IH /2 width=3 by nle_trans/
26 qed.
27
28 (*** inv_eq_minus_O *)
29 lemma nle_eq_minus_O (m) (n): 𝟎 = m - n → m ≤ n.
30 #m #n @(nat_ind_2 … m n) //
31 /3 width=1 by nle_succ_bi/
32 qed.
33
34 (*** monotonic_le_minus_l *)
35 lemma nle_minus_sn_bi (m) (n) (o): m ≤ n → m-o ≤ n-o.
36 #m #n #o elim o -o //
37 #o #IH #Hmn /3 width=1 by nle_pred_bi/
38 qed.
39
40 (*** monotonic_le_minus_r *)
41 lemma nle_minus_dx_bi (m) (n) (o): m ≤ n → o-n ≤ o-m.
42 #m #n #o #H elim H -n //
43 #n #_ #IH /2 width=3 by nle_trans/
44 qed.
45
46 (* Inversions with nminus ***************************************************)
47
48 (*** eq_minus_O *)
49 lemma nle_inv_eq_minus_O (m) (n): m ≤ n → 𝟎 = m - n.
50 #m #n #H elim H -n //
51 qed-.
52
53 (* Destructions with nminus *************************************************)
54
55 (*** minus_Sn_m *)
56 lemma nminus_succ_sn (m) (n): m ≤ n → ↑(n-m) = ↑n - m.
57 #m #n #H @(nle_ind_alt … H) -m -n //
58 qed-.
59
60 (*** minus_minus_m_m *)
61 lemma nminus_minus_dx_refl_sn (m) (n): m ≤ n → m = n - (n - m).
62 #m #n #H elim H -n //
63 #n #Hmn #IH <(nminus_succ_sn … Hmn) -Hmn //
64 qed-.