]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/matita/library/nat/ord.ma
Zoli's note (in Italian) about a constructive version of Lebesgue's dominated
[helm.git] / helm / software / matita / library / nat / ord.ma
index c45bfe701df66faeb665c9296c2e31690f609ff6..340e33a865fb809d8beb35e632f4e129fa2bd0dc 100644 (file)
@@ -16,8 +16,8 @@ set "baseuri" "cic:/matita/nat/ord".
 
 include "datatypes/constructors.ma".
 include "nat/exp.ma".
-include "nat/gcd.ma".
-include "nat/relevant_equations.ma". (* required by auto paramod *)
+include "nat/nth_prime.ma".
+include "nat/relevant_equations.ma". (* required by autobatch paramod *)
 
 let rec p_ord_aux p n m \def
   match n \mod m with
@@ -166,8 +166,7 @@ apply p_ord_exp
   apply le_times_l.
   assumption.
   apply le_times_r.assumption.
-alias id "not_eq_to_le_to_lt" = "cic:/matita/algebra/finite_groups/not_eq_to_le_to_lt.con".
-apply not_eq_to_le_to_lt.
+  apply not_eq_to_le_to_lt.
   unfold.intro.apply H1.
   rewrite < H3.
   apply (witness ? r r ?).simplify.apply plus_n_O.
@@ -213,7 +212,7 @@ apply (absurd ? ? H10 H5).
 apply (absurd ? ? H10 H7).
 (* rewrite > H6.
 rewrite > H8. *)
-auto paramodulation.
+autobatch paramodulation.
 unfold prime in H. elim H. assumption.
 qed.
 
@@ -240,6 +239,7 @@ rewrite < times_n_SO.
 apply exp_n_SO.
 qed.
 
+(* p_ord and divides *)
 theorem divides_to_p_ord: \forall p,a,b,c,d,n,m:nat. 
 O < n \to O < m \to prime p 
 \to divides n m \to p_ord n p = pair ? ? a b \to
@@ -259,7 +259,7 @@ cut (S O < p)
          apply (lt_to_not_eq O ? H).
          rewrite > H7.
          rewrite < H10.
-         auto
+         autobatch
         ]
       |elim c
         [rewrite > sym_gcd.
@@ -270,7 +270,7 @@ cut (S O < p)
           |apply lt_O_exp.apply lt_to_le.assumption
           |rewrite > sym_gcd.
            (* hint non trova prime_to_gcd_SO e
-              auto non chiude il goal *)
+              autobatch non chiude il goal *)
            apply prime_to_gcd_SO
             [assumption|assumption]
           |assumption
@@ -297,7 +297,7 @@ cut (S O < p)
               |apply lt_O_exp.apply lt_to_le.assumption
               |rewrite > sym_gcd.
               (* hint non trova prime_to_gcd_SO e
-                 auto non chiude il goal *)
+                 autobatch non chiude il goal *)
                apply prime_to_gcd_SO
                 [assumption|assumption]
               |rewrite > sym_gcd. assumption
@@ -313,7 +313,55 @@ cut (S O < p)
     ]
   |elim H2.assumption
   ]
-qed.     
+qed.    
+
+(* p_ord and primes *)
+theorem not_divides_to_p_ord_O: \forall n,i.
+Not (divides (nth_prime i) n) \to p_ord n (nth_prime i) = 
+pair nat nat O n.
+intros.
+apply p_ord_exp1
+  [apply lt_O_nth_prime_n
+  |assumption
+  |autobatch
+  ]
+qed.
+
+theorem p_ord_O_to_not_divides: \forall n,i,r.
+O < n \to
+p_ord n (nth_prime i) = pair nat nat O r 
+\to Not (divides (nth_prime i) n).
+intros.
+lapply (p_ord_to_exp1 ? ? ? ? ? ? H1)
+  [apply lt_SO_nth_prime_n
+  |assumption
+  |elim Hletin.
+   simplify in H3.
+   rewrite > H3.
+   rewrite < plus_n_O.
+   assumption
+  ]
+qed.
+
+theorem p_ord_to_not_eq_O : \forall n,p,q,r.
+  (S O) < n \to
+  p_ord n (nth_prime p) = pair nat nat q r \to
+  Not (r=O).
+intros.
+unfold.intro.
+cut (O < n)
+  [lapply (p_ord_to_exp1 ? ? ? ? ? ? H1)
+    [apply lt_SO_nth_prime_n.
+    |assumption
+    |elim Hletin.
+     apply (lt_to_not_eq ? ? Hcut).
+     rewrite > H4.
+     rewrite > H2.
+     apply times_n_O
+    ]
+  |apply (trans_lt ? (S O))[apply lt_O_S|assumption]
+  ]
+qed.
 
 definition ord :nat \to nat \to nat \def
 \lambda n,p. fst ? ? (p_ord n p).
@@ -407,4 +455,4 @@ theorem mod_p_ord_inv:
 intros.rewrite > eq_p_ord_inv.
 apply mod_plus_times.
 assumption.
-qed.
\ No newline at end of file
+qed.