From: Enrico Tassi Date: Thu, 20 Jul 2006 11:22:15 +0000 (+0000) Subject: reorganization X-Git-Tag: 0.4.95@7852~1170 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=3889d8624f9589749cf5b3ce4297db0f1a557779;p=helm.git reorganization --- diff --git a/matita/library/nat/div_and_mod.ma b/matita/library/nat/div_and_mod.ma index 2f186dd31..a9f40cc89 100644 --- a/matita/library/nat/div_and_mod.ma +++ b/matita/library/nat/div_and_mod.ma @@ -296,3 +296,17 @@ qed. variant inj_times_l1:\forall n. O < n \to \forall p,q:nat.p*n = q*n \to p=q \def lt_O_to_injective_times_l. + +(* n_divides computes the pair (div,mod) *) + +(* p is just an upper bound, acc is an accumulator *) +let rec n_divides_aux p n m acc \def + match n \mod m with + [ O \Rightarrow + match p with + [ O \Rightarrow pair nat nat acc n + | (S p) \Rightarrow n_divides_aux p (n / m) m (S acc)] + | (S a) \Rightarrow pair nat nat acc n]. + +(* 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. diff --git a/matita/library/nat/primes1.ma b/matita/library/nat/primes1.ma deleted file mode 100644 index 3ec61ee4a..000000000 --- a/matita/library/nat/primes1.ma +++ /dev/null @@ -1,38 +0,0 @@ -(**************************************************************************) -(* ___ *) -(* ||M|| *) -(* ||A|| A project by Andrea Asperti *) -(* ||T|| *) -(* ||I|| Developers: *) -(* ||T|| A.Asperti, C.Sacerdoti Coen, *) -(* ||A|| E.Tassi, S.Zacchiroli *) -(* \ / *) -(* \ / Matita is distributed under the terms of the *) -(* v GNU Lesser General Public License Version 2.1 *) -(* *) -(**************************************************************************) - -set "baseuri" "cic:/matita/nat/primes1". - -include "datatypes/constructors.ma". -include "nat/primes.ma". - -(* p is just an upper bound, acc is an accumulator *) -let rec n_divides_aux p n m acc \def - match n \mod m with - [ O \Rightarrow - match p with - [ O \Rightarrow pair nat nat acc n - | (S p) \Rightarrow n_divides_aux p (n / m) m (S acc)] - | (S a) \Rightarrow pair nat nat acc n]. - -(* 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. - -(* -theorem n_divides_to_Prop: \forall n,m,p,a. - match n_divides_aux p n m a with - [ (pair q r) \Rightarrow n = m \sup a *r]. -intros. -apply nat_case (n \mod m). *) - diff --git a/matita/library/nat/sigma_and_pi.ma b/matita/library/nat/sigma_and_pi.ma index 4f5f6cba0..fe3a2d8b5 100644 --- a/matita/library/nat/sigma_and_pi.ma +++ b/matita/library/nat/sigma_and_pi.ma @@ -15,7 +15,6 @@ set "baseuri" "cic:/matita/nat/sigma_and_pi". include "nat/factorial.ma". -include "nat/lt_arith.ma". include "nat/exp.ma". let rec sigma n f m \def