X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=matita%2Fmatita%2Flib%2Farithmetics%2Fnat.ma;h=edb99b8c0c9dac85517e253e9282d7f34597bd89;hb=8a5391064ec6e84333444453f836ef9cb91fee7b;hp=cc6b19debaf147377cf02e9bfb39c26eea1201a5;hpb=bdc0a7a8c1de693a40f116742f5d2d3f3290c381;p=helm.git diff --git a/matita/matita/lib/arithmetics/nat.ma b/matita/matita/lib/arithmetics/nat.ma index cc6b19deb..edb99b8c0 100644 --- a/matita/matita/lib/arithmetics/nat.ma +++ b/matita/matita/lib/arithmetics/nat.ma @@ -135,9 +135,6 @@ theorem injective_plus_r: ∀n:nat.injective nat nat (λm.n+m). theorem injective_plus_l: ∀n:nat.injective nat nat (λm.m+n). /2/ qed. -theorem not_eq_S: ∀n,m:nat. n ≠ m → S n ≠ S m. -/2/ qed. - theorem times_Sn_m: ∀n,m:nat. m+n*m = S n*m. // qed. @@ -192,6 +189,9 @@ lemma plus_plus_comm_23: ∀x,y,z. x + y + z = x + z + y. (* Negated equalities *******************************************************) +theorem not_eq_S: ∀n,m:nat. n ≠ m → S n ≠ S m. +/2/ qed. + theorem not_eq_O_S : ∀n:nat. 0 ≠ S n. #n @nmk #eqOS (change with (not_zero O)) >eqOS // qed. @@ -242,7 +242,7 @@ theorem monotonic_le_plus_l: theorem le_plus: ∀n1,n2,m1,m2:nat. n1 ≤ n2 → m1 ≤ m2 → n1 + m1 ≤ n2 + m2. #n1 #n2 #m1 #m2 #len #lem @(transitive_le ? (n1+m2)) -/2/ qed-. +/2/ qed. theorem le_plus_n :∀n,m:nat. m ≤ n + m. /2/ qed. @@ -299,6 +299,12 @@ theorem le_plus_to_minus_r: ∀a,b,c. a + b ≤ c → a ≤ c -b. #a #b #c #H @(le_plus_to_le_r … b) /2/ qed. +lemma lt_to_le: ∀x,y. x < y → x ≤ y. +/2 width=2/ qed. + +lemma inv_eq_minus_O: ∀x,y. x - y = 0 → x ≤ y. +// qed-. + (* lt *) theorem transitive_lt: transitive nat lt. @@ -595,8 +601,13 @@ theorem increasing_to_le: ∀f:nat → nat. @(ex_intro ?? (S a)) /2/ qed. +(* thus is le_plus lemma le_plus_compatible: ∀x1,x2,y1,y2. x1 ≤ y1 → x2 ≤ y2 → x1 + x2 ≤ y1 + y2. -/3 by le_minus_to_plus, monotonic_le_plus_r, transitive_le/ qed. +#x1 #y1 #x2 #y2 #H1 #H2 /2/ @le_plus // /2/ /3 by le_minus_to_plus, monotonic_le_plus_r, transitive_le/ qed. +*) + +lemma minus_le: ∀x,y. x - y ≤ x. +/2 width=1/ qed. (* lt *) @@ -634,6 +645,14 @@ theorem monotonic_lt_minus_l: ∀p,q,n. n ≤ q → q < p → q - n < p - n. @lt_plus_to_minus_r