From cee763a744e6f75bb5c174f809a4fe25f9071a0c Mon Sep 17 00:00:00 2001 From: Enrico Tassi Date: Thu, 20 Jul 2006 11:22:15 +0000 Subject: [PATCH] reorganization --- .../matita/library/nat/div_and_mod.ma | 14 +++++++ helm/software/matita/library/nat/primes1.ma | 38 ------------------- .../matita/library/nat/sigma_and_pi.ma | 1 - 3 files changed, 14 insertions(+), 39 deletions(-) delete mode 100644 helm/software/matita/library/nat/primes1.ma diff --git a/helm/software/matita/library/nat/div_and_mod.ma b/helm/software/matita/library/nat/div_and_mod.ma index 2f186dd31..a9f40cc89 100644 --- a/helm/software/matita/library/nat/div_and_mod.ma +++ b/helm/software/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/helm/software/matita/library/nat/primes1.ma b/helm/software/matita/library/nat/primes1.ma deleted file mode 100644 index 3ec61ee4a..000000000 --- a/helm/software/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/helm/software/matita/library/nat/sigma_and_pi.ma b/helm/software/matita/library/nat/sigma_and_pi.ma index 4f5f6cba0..fe3a2d8b5 100644 --- a/helm/software/matita/library/nat/sigma_and_pi.ma +++ b/helm/software/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 -- 2.39.2