]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/ground/lib/arith_2b.ma
arithmetics for λδ
[helm.git] / matita / matita / contribs / lambdadelta / ground / lib / arith_2b.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/lib/arith.ma".
16
17 (* ARITHMETICAL PROPERTIES FOR λδ-2B ****************************************)
18
19 lemma arith_l4 (m11) (m12) (m21) (m22):
20                m21+m22-(m11+m12) = m21-m11-m12+(m22-(m11-m21)-(m12-(m21-m11))).
21 #m11 #m12 #m21 #m22 >minus_plus
22 elim (le_or_ge (m11+m12) m21) #Hm1121
23 [ lapply (transitive_le m11 ??? Hm1121) // #Hm121
24   lapply (le_plus_to_minus_l … Hm1121) #Hm12211
25   <plus_minus // @eq_f2 // >(eq_minus_O m11 ?) // >(eq_minus_O m12 ?) //
26 | >(eq_minus_O m21 ?) // <plus_O_n <minus_plus <commutative_plus
27   elim (le_or_ge m11 m21) #Hm121
28   [ lapply (le_plus_to_minus_comm … Hm1121) #Hm2112
29     >(eq_minus_O m11 ?) // <plus_minus_associative // <minus_le_minus_minus_comm //
30   | >(eq_minus_O m21 ?) // <minus_le_minus_minus_comm //
31   ]
32 ]
33 qed.
34
35 lemma arith_l3 (m) (n1) (n2): n1+n2-m = n1-m+(n2-(m-n1)).
36 // qed.
37
38 lemma arith_l2 (n1) (n2): ↑n2-n1 = 1-n1+(n2-(n1-1)).
39 #n1 #n2 <arith_l3 //
40 qed.
41
42 lemma arith_l1: ∀x. 1 = 1-x+(x-(x-1)).
43 #x <arith_l2 //
44 qed.