X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=matita%2Fmatita%2Fcontribs%2Flambdadelta%2Fground_2%2Flib%2Farith.ma;h=1c13de648461fd98930fda4c197b28cab400c2fb;hb=e0f7a5025addf275e40372da3a39b0adacc8106f;hp=e3e22484394c91625310912317448ae62121db81;hpb=a4998de03fae0f36cde8abf17f45ea115845e849;p=helm.git diff --git a/matita/matita/contribs/lambdadelta/ground_2/lib/arith.ma b/matita/matita/contribs/lambdadelta/ground_2/lib/arith.ma index e3e224843..1c13de648 100644 --- a/matita/matita/contribs/lambdadelta/ground_2/lib/arith.ma +++ b/matita/matita/contribs/lambdadelta/ground_2/lib/arith.ma @@ -12,16 +12,16 @@ (* *) (**************************************************************************) -include "ground_2/notation/constructors/successor_1.ma". -include "ground_2/notation/functions/predecessor_1.ma". +include "ground_2/notation/constructors/uparrow_1.ma". +include "ground_2/notation/functions/downarrow_1.ma". include "arithmetics/nat.ma". include "ground_2/lib/relations.ma". (* ARITHMETICAL PROPERTIES **************************************************) -interpretation "nat successor" 'Successor m = (S m). +interpretation "nat successor" 'UpArrow m = (S m). -interpretation "nat predecessor" 'Predecessor m = (pred m). +interpretation "nat predecessor" 'DownArrow m = (pred m). interpretation "nat min" 'and x y = (min x y). @@ -35,7 +35,7 @@ normalize // qed. lemma pred_S: ∀m. pred (S m) = m. // qed. -lemma plus_S1: ∀x,y. ⫯(x+y) = (⫯x) + y. +lemma plus_S1: ∀x,y. ↑(x+y) = (↑x) + y. // qed. lemma max_O1: ∀n. n = (0 ∨ n). @@ -44,14 +44,14 @@ lemma max_O1: ∀n. n = (0 ∨ n). lemma max_O2: ∀n. n = (n ∨ 0). // qed. -lemma max_SS: ∀n1,n2. ⫯(n1∨n2) = (⫯n1 ∨ ⫯n2). +lemma max_SS: ∀n1,n2. ↑(n1∨n2) = (↑n1 ∨ ↑n2). #n1 #n2 elim (decidable_le n1 n2) #H normalize [ >(le_to_leb_true … H) | >(not_le_to_leb_false … H) ] -H // qed. (* Equations ****************************************************************) -lemma plus_SO: ∀n. n + 1 = ⫯n. +lemma plus_SO: ∀n. n + 1 = ↑n. // qed. lemma minus_plus_m_m_commutative: ∀n,m:nat. n = m + n - m. @@ -62,6 +62,10 @@ lemma plus_minus_minus_be: ∀x,y,z. y ≤ z → z ≤ x → (x - z) + (z - y) = #x #z #y #Hzy #Hyx >plus_minus // >commutative_plus >plus_minus // qed-. +lemma lt_succ_pred: ∀m,n. n < m → m = ↑↓m. +#m #n #Hm >S_pred /2 width=2 by ltn_to_ltO/ +qed-. + fact plus_minus_minus_be_aux: ∀i,x,y,z. y ≤ z → z ≤ x → i = z - y → x - z + i = x - y. /2 width=1 by plus_minus_minus_be/ qed-. @@ -145,16 +149,16 @@ lemma monotonic_lt_pred: ∀m,n. m < n → 0 < m → pred m < pred n. @le_S_S_to_le >S_pred /2 width=3 by transitive_lt/ qed. -lemma lt_S_S: ∀x,y. x < y → ⫯x < ⫯y. +lemma lt_S_S: ∀x,y. x < y → ↑x < ↑y. /2 width=1 by le_S_S/ qed. -lemma lt_S: ∀n,m. n < m → n < ⫯m. +lemma lt_S: ∀n,m. n < m → n < ↑m. /2 width=1 by le_S/ qed. -lemma max_S1_le_S: ∀n1,n2,n. (n1 ∨ n2) ≤ n → (⫯n1 ∨ n2) ≤ ⫯n. +lemma max_S1_le_S: ∀n1,n2,n. (n1 ∨ n2) ≤ n → (↑n1 ∨ n2) ≤ ↑n. /4 width=2 by to_max, le_maxr, le_S_S, le_S/ qed-. -lemma max_S2_le_S: ∀n1,n2,n. (n1 ∨ n2) ≤ n → (n1 ∨ ⫯n2) ≤ ⫯n. +lemma max_S2_le_S: ∀n1,n2,n. (n1 ∨ n2) ≤ n → (n1 ∨ ↑n2) ≤ ↑n. /2 width=1 by max_S1_le_S/ qed-. lemma arith_j: ∀x,y,z. x-y-1 ≤ x-(y-z)-1. @@ -187,8 +191,8 @@ qed-. lemma lt_le_false: ∀x,y. x < y → y ≤ x → ⊥. /3 width=4 by lt_refl_false, lt_to_le_to_lt/ qed-. -lemma succ_inv_refl_sn: ∀x. ⫯x = x → ⊥. -#x #H @(lt_le_false x (⫯x)) // +lemma succ_inv_refl_sn: ∀x. ↑x = x → ⊥. +#x #H @(lt_le_false x (↑x)) // qed-. lemma le_plus_xSy_O_false: ∀x,y. x + S y ≤ 0 → ⊥. @@ -225,7 +229,7 @@ lapply (monotonic_le_plus_l n1 … Hm) -Hm >H -H /2 width=2 by le_plus_to_le/ qed-. -lemma lt_S_S_to_lt: ∀x,y. ⫯x < ⫯y → x < y. +lemma lt_S_S_to_lt: ∀x,y. ↑x < ↑y → x < y. /2 width=1 by le_S_S_to_le/ qed-. (* Note this should go in nat.ma *) @@ -237,17 +241,17 @@ lemma discr_x_minus_xy: ∀x,y. x = x - y → x = 0 ∨ y = 0. #H destruct qed-. -lemma lt_inv_O1: ∀n. 0 < n → ∃m. ⫯m = n. +lemma lt_inv_O1: ∀n. 0 < n → ∃m. ↑m = n. * /2 width=2 by ex_intro/ #H cases (lt_le_false … H) -H // qed-. -lemma lt_inv_S1: ∀m,n. ⫯m < n → ∃∃p. m < p & ⫯p = n. +lemma lt_inv_S1: ∀m,n. ↑m < n → ∃∃p. m < p & ↑p = n. #m * /3 width=3 by lt_S_S_to_lt, ex2_intro/ #H cases (lt_le_false … H) -H // qed-. -lemma lt_inv_gen: ∀y,x. x < y → ∃∃z. x ≤ z & ⫯z = y. +lemma lt_inv_gen: ∀y,x. x < y → ∃∃z. x ≤ z & ↑z = y. * /3 width=3 by le_S_S_to_le, ex2_intro/ #x #H elim (lt_le_false … H) -H // qed-. @@ -255,6 +259,22 @@ qed-. lemma plus_inv_O3: ∀x,y. x + y = 0 → x = 0 ∧ y = 0. /2 width=1 by plus_le_0/ qed-. +lemma plus_inv_S3_sn: ∀x1,x2,x3. x1+x2 = ↑x3 → + ∨∨ ∧∧ x1 = 0 & x2 = ↑x3 + | ∃∃y1. x1 = ↑y1 & y1 + x2 = x3. +* /3 width=1 by or_introl, conj/ +#x1 #x2 #x3