X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=matita%2Flibrary%2Fnat%2Fdiv_and_mod.ma;h=d7750e39ad7c03e4424d1d221e50710843d7e87a;hb=01b688447c18c1992b0c19ac5583ca9fee692514;hp=65ba0e9e5127a77ed8c69bb13f50300a058e3213;hpb=e95f5d784fe7830fe9ed10b3e782ef2206fea896;p=helm.git diff --git a/matita/library/nat/div_and_mod.ma b/matita/library/nat/div_and_mod.ma index 65ba0e9e5..d7750e39a 100644 --- a/matita/library/nat/div_and_mod.ma +++ b/matita/library/nat/div_and_mod.ma @@ -17,6 +17,7 @@ set "baseuri" "cic:/matita/nat/div_and_mod". include "datatypes/constructors.ma". include "nat/minus.ma". + let rec mod_aux p m n: nat \def match (leb m n) with [ true \Rightarrow m @@ -215,11 +216,12 @@ qed. (* some properties of div and mod *) theorem div_times: \forall n,m:nat. ((S n)*m) / (S n) = m. intros. -apply (div_mod_spec_to_eq ((S n)*m) (S n) ? ? ? O). -goal 15. (* ?11 is closed with the following tactics *) -apply div_mod_spec_div_mod. -unfold lt.apply le_S_S.apply le_O_n. -apply div_mod_spec_times. +apply (div_mod_spec_to_eq ((S n)*m) (S n) ? ? ? O); +[2: apply div_mod_spec_div_mod. + unfold lt.apply le_S_S.apply le_O_n. +| skip +| apply div_mod_spec_times +] qed. theorem div_n_n: \forall n:nat. O < n \to n / n = S O. @@ -330,3 +332,14 @@ let rec n_divides_aux p n m acc \def (* n_divides n m = if m divides n q times, with remainder r *) definition n_divides \def \lambda n,m:nat.n_divides_aux n n m O. + + +(*a simple variant of div_times theorem *) +theorem div_times_ltO: \forall a,b:nat. O \lt b \to +a*b/b = a. +intros. +rewrite > sym_times. +rewrite > (S_pred b H). +apply div_times. +qed. +