theoremkernel_population_residue_bound (S : Finsetℤ) (root : ℤ→ℕ)
(m D : ℕ) (hm : 0 < m) (h u : ℤ) (hu : u ≠0) (hred : h.natAbs.Coprime m)
(X : ℝ) (hroot : ∀ x ∈S, u * (root x : ℤ) ^ 2 = (m : ℤ) * x - h)
(hspan : ∀ x ∈S, ∀ y ∈S, |((x - y : ℤ) : ℝ)| ≤X)
(hD : Real.sqrt ((m : ℝ) * X / |(u : ℝ)|) ≤D) :
(S.card : ℝ) ≤ (2 : ℝ) ^ (m.primeFactors.card + 1) * ((D : ℝ) / m + 2) :=by
proof · 8
lines
let : NeZero m := ⟨hm.ne'⟩
have hcount := nat_residue_population_card_le (kernelRootPopulation S root) m D hm
(kernelRootPopulation_diameter S root m D h u hu X hroot hspan hD)
havehres : (((kernelRootPopulation S root).image (funt : ℕ=> (t : ZMod m))).card : ℝ) ≤
(2 : ℝ) ^ (m.primeFactors.card + 1) :=by
exact_mod_cast kernel_root_residues_card_le S root m h u hred hroot
rw [kernelRootPopulation_card S root m hm h u hroot] at hcount
exact hcount.trans (mul_le_mul_of_nonneg_right hres (by positivity))
privatetheoremsqrt_modulus_cancel (m Xv : ℝ) (hm : 0 < m) :
Real.sqrt m * (Real.sqrt (m * X / v) / m) = Real.sqrt (X / v) :=by
proof · 5
lines
haveheq : m * X / v = m * (X / v) :=by ring
rw [heq, Real.sqrt_mul hm.le]
calc
_ = (Real.sqrt m ^ 2 / m) * Real.sqrt (X / v) :=by ring
_ = _ :=by rw [Real.sq_sqrt hm.le, div_self hm.ne', one_mul]
The denominator loss is absorbed into an absolute constant. The remaining
sqrt(m) term is subpower for the common centers constructed in the application.