X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=matita%2Fmatita%2Flib%2Farithmetics%2Fprimes.ma;h=7c5df29f35151cebe5d3c6664368c8ee9f2ece73;hb=94188b0cbaff6340464d90cc13ee246ea7ec3284;hp=71e372f96722f893ebd3889a0b78eaf59f37d1fb;hpb=7ad16d18416a08382d62747fce4a0ac18ee557e0;p=helm.git diff --git a/matita/matita/lib/arithmetics/primes.ma b/matita/matita/lib/arithmetics/primes.ma index 71e372f96..7c5df29f3 100644 --- a/matita/matita/lib/arithmetics/primes.ma +++ b/matita/matita/lib/arithmetics/primes.ma @@ -255,18 +255,17 @@ smallest_factor n = (min n 2 (λm.(eqb (n \mod m) O))). #n #lt1n normalize >lt_to_leb_false // qed. -(* it works ! -theorem example1 : smallest_factor 3 = 3. +example example1 : smallest_factor 3 = 3. normalize // qed. -theorem example2: smallest_factor 4 = 2. +example example2: smallest_factor 4 = 2. normalize // qed. -theorem example3 : smallest_factor 7 = 7. +example example3 : smallest_factor 7 = 7. normalize // -qed. *) +qed. theorem le_SO_smallest_factor: ∀n:nat. n ≤ 1 → smallest_factor n = n. @@ -291,7 +290,7 @@ theorem divides_smallest_factor_n : ∀n:nat. 0 < n → #n #posn (cases (le_to_or_lt_eq … posn)) [#lt1n @mod_O_to_divides [@lt_O_smallest_factor //] >smallest_factor_to_min // @eqb_true_to_eq @f_min_true - @(ex_intro … n) % /2/ @eq_to_eqb_true /2/ + @(ex_intro … n) % /2/ |#H H //] +#n #H cut ((leb 2 n ∧ (eqb (smallest_factor n) n)) = false) [@H] @leb_elim [#_ #H1 @(not_to_not … (prime_to_smallest_factor … )) @eqb_false_to_not_eq @H1 @@ -446,14 +445,14 @@ lemma nth_primeS: ∀n.nth_prime (S n) = // qed. (* it works *) -theorem example11 : nth_prime 2 = 5. +example example11 : nth_prime 2 = 5. normalize // qed. -theorem example12: nth_prime 3 = 7. +example example12: nth_prime 3 = 7. normalize // qed. -theorem example13 : nth_prime 4 = 11. +example example13 : nth_prime 4 = 11. normalize // qed. (* done in 13.1369330883s -- qualcosa non va: // lentissimo @@ -465,7 +464,7 @@ qed. theorem prime_nth_prime : ∀n:nat.prime (nth_prime n). #n (cases n) [@primeb_true_to_prime // - |#m >nth_primeS @primeb_true_to_prime @f_min_true + |#m >nth_primeS @primeb_true_to_prime @(f_min_true primeb) @(ex_intro nat ? (smallest_factor (S (nth_prime m)!))) % [% // @le_S_S @(transitive_le … (le_smallest_factor_n …))