Documentation

CslibFrontier.Foundations.NumberTheory.PrimeCollisionWindow

Collisions in closed prime windows #

This is a quantified interpretation of [Gol07d], Exercise 9.7 (r5.pdf, PDF64/printed446). The source says only L = poly(log M); it specifies neither an error parameter nor a polynomial degree. For every positive error tolerance, one constant works for all input bounds, window sizes and fixed distinct pairs. This is a pairwise statement, not a simultaneous guarantee for every pair. Uniform sampling is among the primes; no efficient prime sampler or runtime bound is asserted.

Main results #

The primes in the closed interval [lo, hi].

theorem Nat.exists_closedPrimes_collision_bound {δ : ℝ} (hδ : 0 < δ) :
∃ (C : ℝ), 0 < C ∧ ∀ (M L : ℕ), 2 ≤ M → C * ↑M.log2 ^ 2 ≤ ↑L → ∀ Q ∈ [closedPrimes 3 L, L.closedPrimes (2 * L)], Q.Nonempty ∧ ∀ (a b : ℕ), a ≤ M → b ≤ M → a ≠ b → ↑{p ∈ Q | a ≡ b [MOD p]}.card / ↑Q.card ≤ δ

Quantified interpretation of Exercise 9.7 for both closed prime windows. The same C works for every M, L and fixed pair a ≠ b.

theorem Nat.exists_ceil_closedPrimes_collision_bound {δ : ℝ} (hδ : 0 < δ) :
∃ (C : ℝ), 0 < C ∧ ∀ (M : ℕ), 2 ≤ M → have L := ⌈C * ↑M.log2 ^ 2⌉₊; ∀ Q ∈ [closedPrimes 3 L, L.closedPrimes (2 * L)], Q.Nonempty ∧ ∀ (a b : ℕ), a ≤ M → b ≤ M → a ≠ b → ↑{p ∈ Q | a ≡ b [MOD p]}.card / ↑Q.card ≤ δ

Choosing the ceiling of the quadratic threshold gives natural window sizes.