Documentation

CslibFrontier.Foundations.NumberTheory.PrimeWindowBounds

Explicit prime products above an excluded cutoff #

The existing elementary prime-count estimate suffices at the exact manuscript cutoff Y = 2 * Z ^ 4, 16 ≤ Z: first obtain 4 * Z primes at most Y, and then remove the at most Z primes at most the excluded cutoff. Every remaining prime contributes a factor at least two. This uses Nat.le_card_primesLE_mul_log, whose original source credit remains in PrimeCounting. The general window lemmas apply to any cutoffs. The later corollaries give the exact cutoff and binary-width estimates used in Proposition 2.6 (“Sign from residues”, Section 2) of Existential–universal real sentences in the counting hierarchy, manuscript revision adc7f1241b42e322a6451854ab7e4b4c146bf78a. These are numerical corollaries of the existing counting bound, using a different proof from the manuscript's binomial argument. They do not assert the proposition's computational sign-recovery conclusion. The width bounds concern ordinary binary lengths, without asserting computational certificates.

Main results #

Membership in a prime window is exactly primality and its two range tests.

theorem Nat.sub_le_card_primesLE_sdiff_of_mul_log_le {w Y L : ℕ} (hY : (w + 1) * (2 * log 2 (w + 1) + 4) ≤ Y) :

Removing the primes at most L loses at most L of an explicit prime-count lower bound.

Each prime in a window contributes a factor at least two, including the empty window.

theorem Nat.prod_primesLE_sdiff_le_two_pow (Y L : ℕ) :
∏ p ∈ Y.primesLE \ L.primesLE, p ≤ 2 ^ (Y * Y.size)

The upper prime-product bound in the manuscript, with binary length Nat.size.

theorem Nat.four_mul_prime_count_cutoff_le {Z : ℕ} (hZ : 16 ≤ Z) :
(4 * Z + 1) * (2 * log 2 (4 * Z + 1) + 4) ≤ 2 * Z ^ 4

The existing elementary prime-count cutoff for 4Z lies below 2Z⁴ when Z ≥ 16.

theorem Nat.four_mul_le_card_primesLE_two_mul_pow_four {Z : ℕ} (hZ : 16 ≤ Z) :
4 * Z ≤ (2 * Z ^ 4).primesLE.card

There are at least 4Z primes at most the manuscript's prime cutoff.

theorem Nat.three_mul_le_card_primesLE_sdiff {Z L : ℕ} (hZ : 16 ≤ Z) (hL : L ≤ Z) :
3 * Z ≤ ((2 * Z ^ 4).primesLE \ L.primesLE).card

Excluding all primes at most any L ≤ Z leaves at least 3Z primes.

theorem Nat.two_pow_three_mul_le_prod_primesLE_sdiff {Z L : ℕ} (hZ : 16 ≤ Z) (hL : L ≤ Z) :
2 ^ (3 * Z) ≤ ∏ p ∈ (2 * Z ^ 4).primesLE \ L.primesLE, p

The product of primes L < p ≤ 2Z⁴ is at least 2^(3Z) for L ≤ Z and Z ≥ 16.

theorem Nat.six_mul_two_pow_lt_prod_primesLE_sdiff {Z L m : ℕ} (hZ : 16 ≤ Z) (hL : L ≤ Z) (hm : m ≤ Z) :
6 * 2 ^ m < ∏ p ∈ (2 * Z ^ 4).primesLE \ L.primesLE, p

For m ≤ Z, the prime product exceeds six times the maximum allowed integer magnitude.

theorem Nat.size_two_mul_pow_four_le (Z : ℕ) :
(2 * Z ^ 4).size ≤ 4 * Z.size + 3

2Z⁴ has binary length at most 4 size Z + 3, using only existing size arithmetic.

theorem Nat.size_sign_prime_cutoff_le (m L : ℕ) :
(2 * max 16 (max m L) ^ 4).size ≤ 4 * max 5 (max m.size L.size) + 3

The sign-recovery prime cutoff has binary length linear in the lengths of its input bounds.

theorem Nat.size_prime_window_doubling_index_le {Z k : ℕ} (hk : k ≤ 2 * Z ^ 4 * (2 * Z ^ 4).size + 1) :
k.size ≤ 8 * Z.size + 8

The doubling range has binary width linear in the width of Z.

theorem Nat.prime_window_precision_le (Z : ℕ) :
(2 * Z ^ 4).size + 10 ≤ 4 * Z.size + 13

The dyadic precision exponent itself is linear in the binary width of Z.

theorem Nat.size_prime_window_precision_le (Z : ℕ) :
((2 * Z ^ 4).size + 10).size ≤ 4 * Z.size + 8

The precision exponent also has an explicit binary-width bound.

theorem Nat.prime_window_sum_width_le (Z : ℕ) :
2 * (2 * Z ^ 4).size + 11 ≤ 8 * Z.size + 17

The width allowance 2 * Y.size + 11 for a rounded sum is linear in Z.size.