]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/matita/library/nat/div_and_mod.ma
Committing all the recent development of Andrea after the merge between his
[helm.git] / helm / matita / library / nat / div_and_mod.ma
index ca8b6c3faaaec0cd8c89c5bce373ba0efd9a588a..619ba68151a48183109400077fc9e1d034d6919a 100644 (file)
@@ -15,7 +15,7 @@
 set "baseuri" "cic:/matita/nat/div_and_mod".
 
 include "nat/minus.ma".
-include "nat/orders_op.ma".
+include "nat/le_arith.ma".
 include "nat/compare.ma".
 
 let rec mod_aux p m n: nat \def
@@ -174,3 +174,41 @@ apply le_times_r.
 apply lt_to_le.
 apply H6.
 qed.
+
+theorem div_mod_spec_times : \forall n,m:nat.div_mod_spec ((S n)*m) (S n) m O.
+intros.constructor 1.
+simplify.apply le_S_S.apply le_O_n.
+rewrite < plus_n_O.rewrite < sym_times.reflexivity.
+qed.
+
+theorem div_times: \forall n,m:nat. div ((S n)*m) (S n) = m.
+intros.
+apply div_mod_spec_to_eq ((S n)*m) (S n) ? ? ? O.
+apply div_mod_spec_div_mod.
+simplify.apply le_S_S.apply le_O_n.
+apply div_mod_spec_times.
+qed.
+
+theorem injective_times_r: \forall n:nat.injective nat nat (\lambda m:nat.(S n)*m).
+change with \forall n,p,q:nat.(S n)*p = (S n)*q \to p=q.
+intros.
+rewrite < div_times n.
+rewrite < div_times n q.
+apply eq_f2.assumption.
+reflexivity.
+qed.
+
+variant inj_times_r : \forall n,p,q:nat.(S n)*p = (S n)*q \to p=q \def
+injective_times_r.
+
+theorem injective_times_l: \forall n:nat.injective nat nat (\lambda m:nat.m*(S n)).
+change with \forall n,p,q:nat.p*(S n) = q*(S n) \to p=q.
+intros.
+apply inj_times_r n p q.
+rewrite < sym_times.
+rewrite < sym_times q.
+assumption.
+qed.
+
+variant inj_times_l : \forall n,p,q:nat. p*(S n) = q*(S n) \to p=q \def
+injective_times_l.