]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/matita/library/nat/minus.ma
New entry: fermat's little theorem (almost complete).
[helm.git] / helm / matita / library / nat / minus.ma
index 079e902ad39ba9213b28b7b58062ed9e9db39dcb..8302f7ce5873aee8dc6f7893065068e0fb38feb7 100644 (file)
@@ -88,14 +88,16 @@ apply H.elim H1.
 apply sym_plus.
 qed.
 
-theorem plus_to_minus :\forall n,m,p:nat.m \leq n \to
+theorem plus_to_minus :\forall n,m,p:nat.
 n = m+p \to n-m = p.
 intros.
 apply inj_plus_r m.
-rewrite < H1.
+rewrite < H.
 rewrite < sym_plus.
 symmetry.
-apply plus_minus_m_m.assumption.
+apply plus_minus_m_m.rewrite > H.
+rewrite > sym_plus.
+apply le_plus_n.
 qed.
 
 theorem minus_S_S : \forall n,m:nat.
@@ -118,8 +120,8 @@ intros 2.
 apply nat_elim2 (\lambda n,m.n \leq m \to n-m = O).
 intros.simplify.reflexivity.
 intros.apply False_ind.
-(* ancora problemi con il not *)
-apply not_le_Sn_O n1 H.
+apply not_le_Sn_O.
+goal 13.apply H.
 intros.
 simplify.apply H.apply le_S_S_to_le. apply H1.
 qed.
@@ -235,9 +237,9 @@ theorem distr_times_minus: \forall n,m,p:nat. n*(m-p) = n*m-n*p
 
 theorem eq_minus_minus_minus_plus: \forall n,m,p:nat. (n-m)-p = n-(m+p).
 intros.
-cut m+p \le n \or \not m+p \le n.
+cut m+p \le n \or m+p \nleq n.
   elim Hcut.
-    symmetry.apply plus_to_minus.assumption.
+    symmetry.apply plus_to_minus.
     rewrite > assoc_plus.rewrite > sym_plus p.rewrite < plus_minus_m_m.
       rewrite > sym_plus.rewrite < plus_minus_m_m.
         reflexivity.
@@ -259,8 +261,6 @@ p+(n-m) = n-(m-p).
 intros.
 apply sym_eq.
 apply plus_to_minus.
-apply le_plus_to_minus.
-apply trans_le ? n.assumption.rewrite < sym_plus.apply le_plus_n.
 rewrite < assoc_plus.
 rewrite < plus_minus_m_m.
 rewrite < sym_plus.