]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/ground/arith/nat_le_minus.ma
arithmetics for λδ
[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_minus_O (m) (n): 𝟎 = m - n → m ≤ n.
33 #m #n @(nat_ind_succ_2 … m n) //
34 /3 width=1 by nle_succ_bi/
35 qed.
36
37 (*** monotonic_le_minus_l *)
38 lemma nle_minus_sn_bi (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_dx_bi (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 (* Inversions with nminus ***************************************************)
50
51 (*** eq_minus_O *)
52 lemma nle_inv_eq_minus_O (m) (n): m ≤ n → 𝟎 = m - n.
53 #m #n #H elim H -n //
54 qed-.
55
56 (* Destructions with nminus *************************************************)
57
58 (*** minus_Sn_m *)
59 lemma nminus_succ_sn (m) (n): m ≤ n → ↑(n-m) = ↑n - m.
60 #m #n #H @(nle_ind_alt … H) -m -n //
61 qed-.
62
63 (*** minus_minus_m_m *)
64 lemma nminus_minus_dx_refl_sn (m) (n): m ≤ n → m = n - (n - m).
65 #m #n #H elim H -n //
66 #n #Hmn #IH <(nminus_succ_sn … Hmn) -Hmn //
67 qed-.