X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=matita%2Fmatita%2Flib%2Farithmetics%2Fdiv_and_mod.ma;h=44b796e6b37f5107dd6370e129cf7839c7f09b9e;hb=48c011f52853dd106dbf9cbbd1b9da61277fba3b;hp=cf19b8203596b3ad47d1c948d39d08ec5c08aced;hpb=53452958508001e7af3090695b619fe92135fb9e;p=helm.git diff --git a/matita/matita/lib/arithmetics/div_and_mod.ma b/matita/matita/lib/arithmetics/div_and_mod.ma index cf19b8203..44b796e6b 100644 --- a/matita/matita/lib/arithmetics/div_and_mod.ma +++ b/matita/matita/lib/arithmetics/div_and_mod.ma @@ -153,7 +153,7 @@ theorem mod_S: ∀n,m:nat. O < m → S (n \mod m) < m → ((S n) \mod m) = S (n \mod m). #n #m #posm #H @(div_mod_spec_to_eq2 (S n) m … (n / m) ? (div_mod_spec_div_mod …)) -// @div_mod_spec_intro// (applyS eq_f) // +// @div_mod_spec_intro// applyS eq_f // qed. theorem mod_O_n: ∀n:nat.O \mod n = O. @@ -177,8 +177,8 @@ theorem or_div_mod: ∀n,q. O < q → ((S (n \mod q)(div_mod n m) in ⊢ (? % ?) >commutative_plus +>(div_mod n m) in ⊢ (? % ?); >commutative_plus @monotonic_lt_plus_l @lt_mod_m_m // qed. theorem le_div: ∀n,m. O < n → m/n ≤ m. #n #m #posn ->(div_mod m n) in ⊢ (? ? %) @(transitive_le ? (m/n*n)) /2/ +>(div_mod m n) in ⊢ (? ? %); @(transitive_le ? (m/n*n)) /2/ qed. theorem le_plus_mod: ∀m,n,q. O < q → @@ -228,9 +228,9 @@ theorem le_plus_mod: ∀m,n,q. O < q → @(div_mod_spec_to_eq2 … (m/q + n/q) ? (div_mod_spec_div_mod … posq)). @div_mod_spec_intro [@not_le_to_lt // - |>(div_mod n q) in ⊢ (? ? (? ? %) ?) + |>(div_mod n q) in ⊢ (? ? (? ? %) ?); (applyS (eq_f … (λx.plus x (n \mod q)))) - >(div_mod m q) in ⊢ (? ? (? % ?) ?) + >(div_mod m q) in ⊢ (? ? (? % ?) ?); (applyS (eq_f … (λx.plus x (m \mod q)))) // ] ] @@ -241,10 +241,10 @@ theorem le_plus_div: ∀m,n,q. O < q → #m #n #q #posq @(le_times_to_le … posq) @(le_plus_to_le_r ((m+n) \mod q)) (* bruttino *) ->commutative_times in ⊢ (? ? %) (div_mod m q) in ⊢ (? ? (? % ?)) >(div_mod n q) in ⊢ (? ? (? ? %)) ->commutative_plus in ⊢ (? ? (? % ?)) >associative_plus in ⊢ (? ? %) -commutative_times in ⊢ (? ? %); (div_mod m q) in ⊢ (? ? (? % ?)); >(div_mod n q) in ⊢ (? ? (? ? %)); +>commutative_plus in ⊢ (? ? (? % ?)); >associative_plus in ⊢ (? ? %); +(plus_minus_m_m … Hlecb) /2/ -qed. - -theorem lt_minus_to_plus: ∀a,b,c. a - b < c → a < c + b. -#a #b #c #H @not_le_to_lt -@(not_to_not … (lt_to_not_le …H)) /2/ -qed. - -theorem lt_minus_to_plus_r: ∀a,b,c. c ≤ a → - a < b + c → a - c < b. -#a #b #c #lea #H @not_le_to_lt -@(not_to_not … (lt_to_not_le …H)) /2/ -qed. - theorem lt_to_le_times_to_lt_S_to_div: ∀a,c,b:nat. O < b → (b*c) ≤ a → a < (b*(S c)) → a/b = c. #a #c #b #posb#lea #lta @(div_mod_spec_to_eq … (a-b*c) (div_mod_spec_div_mod … posb …)) -@div_mod_spec_intro [@lt_minus_to_plus_r // |/2/] +@div_mod_spec_intro [@lt_plus_to_minus // |/2/] qed. theorem div_times_times: ∀a,b,c:nat. O < c → O < b →