]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambda_delta/Ground_2/arith.ma
the support for candidates of reducibility continues ...
[helm.git] / matita / matita / contribs / lambda_delta / Ground_2 / arith.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 "arithmetics/nat.ma".
16 include "Ground_2/star.ma".
17
18 (* ARITHMETICAL PROPERTIES **************************************************)
19
20 (* Equations ****************************************************************)
21
22 lemma le_plus_minus: ∀m,n,p. p ≤ n → m + n - p = m + (n - p).
23 /2 by plus_minus/ qed.
24
25 lemma le_plus_minus_comm: ∀n,m,p. p ≤ m → m + n - p = m - p + n.
26 /2 by plus_minus/ qed.
27
28 lemma arith_b1: ∀a,b,c1. c1 ≤ b → a - c1 - (b - c1) = a - b.
29 #a #b #c1 #H >minus_minus_comm >minus_le_minus_minus_comm //
30 qed.
31
32 lemma arith_b2: ∀a,b,c1,c2. c1 + c2 ≤ b → a - c1 - c2 - (b - c1 - c2) = a - b.
33 #a #b #c1 #c2 #H >minus_plus >minus_plus >minus_plus /2 width=1/
34 qed.
35
36 lemma arith_c1x: ∀x,a,b,c1. x + c1 + a - (b + c1) = x + a - b.
37 /3 by monotonic_le_minus_l, le_to_le_to_eq, le_n/ qed.
38
39 lemma arith_h1: ∀a1,a2,b,c1. c1 ≤ a1 → c1 ≤ b →
40                 a1 - c1 + a2 - (b - c1) = a1 + a2 - b.
41 #a1 #a2 #b #c1 #H1 #H2 >plus_minus // /2 width=1/
42 qed.
43
44 (* inversion & forward lemmas ***********************************************)
45
46 axiom eq_nat_dec: ∀n1,n2:nat. Decidable (n1 = n2).
47
48 axiom lt_dec: ∀n1,n2. Decidable (n1 < n2).
49
50 lemma lt_or_eq_or_gt: ∀m,n. ∨∨ m < n | n = m | n < m.
51 #m #n elim (lt_or_ge m n) /2 width=1/
52 #H elim H -m /2 width=1/
53 #m #Hm * #H /2 width=1/ /3 width=1/
54 qed-.
55
56 lemma lt_refl_false: ∀n. n < n → False.
57 #n #H elim (lt_to_not_eq … H) -H /2 width=1/
58 qed-.
59
60 lemma lt_zero_false: ∀n. n < 0 → False.
61 #n #H elim (lt_to_not_le … H) -H /2 width=1/
62 qed-.
63
64 lemma false_lt_to_le: ∀x,y. (x < y → False) → y ≤ x.
65 #x #y #H elim (decidable_lt x y) /2 width=1/
66 #Hxy elim (H Hxy)
67 qed-.
68
69 (*
70 lemma pippo: ∀x,y,z. x < z → y < z - x → x + y < z.
71 /3 width=2/
72
73 lemma le_or_ge: ∀m,n. m ≤ n ∨ n ≤ m.
74 #m #n elim (lt_or_ge m n) /2 width=1/ /3 width=2/
75 qed-.
76 *)