Divisor-weighted error sum bounded by the sup weight times a BV sum bound
Provedgpy_divWeightedErrSum_le_of_bvSumBoundLet be a model for prime counts in arithmetic progressions, let be a height, and let be a level with for a parameter . Let the divisor-weighted error sum be , where counts ordered factorizations of into positive factors and is the max coprime-residue error. Suppose that for every coprime residue system , the BV-type sum over moduli in the BV range is at most , and that the weight is at most for . Then\n\n
\n\nThe BV sum bound controls the unweighted max-error sum over (the term vanishes, and every lies in the BV range), so the sup-factor bound applies — again with the sup factor as the obstruction. Formalization Note: the divisor count, the max coprime-residue error, and the prime count in a residue class are unfolded into explicit finite sums, filters, and cardinalities.
import Mathlib open Classical
theorem gpy_divWeightedErrSum_le_of_bvSumBound {k : ℕ} (M : ℕ → ℕ → ℝ)
(Y' R : ℕ) {η : ℝ} (B W : ℝ) (hWnn : 0 ≤ W)
(hlev : (R : ℝ) ^ 2 < (Y' : ℝ) ^ (1 / 2 - η))
(hBV : ∀ v : ℕ → ℕ, (∀ q, Nat.Coprime (v q) q) →
∑ q ∈ (Finset.range ⌈(Y' : ℝ) ^ (1 / 2 - η)⌉₊).filter
(fun q : ℕ => 1 ≤ q ∧ (q : ℝ) < (Y' : ℝ) ^ (1 / 2 - η)),
abs ((((Finset.range (Y' + 1)).filter
(fun p => Nat.Prime p ∧ p ≡ v q [MOD q])).card : ℝ) - M Y' q) ≤ B)
(hw : ∀ L ∈ Finset.range (R ^ 2 + 1),
(((Fintype.piFinset (fun _ : Fin (k + 1) => Finset.Icc 1 L)).filter
(fun d => ∏ i, d i = L)).card : ℝ) ^ 2 ≤ W) :
(∑ L ∈ Finset.range (R ^ 2 + 1),
(((Fintype.piFinset (fun _ : Fin (k + 1) => Finset.Icc 1 L)).filter
(fun d => ∏ i, d i = L)).card : ℝ) ^ 2
* (if hne : (((Finset.range L).filter (fun r => Nat.Coprime r L)).image
(fun r => abs ((((Finset.range (Y' + 1)).filter
(fun p => Nat.Prime p ∧ p ≡ r [MOD L])).card : ℝ) - M Y' L))).Nonempty
then (((Finset.range L).filter (fun r => Nat.Coprime r L)).image
(fun r => abs ((((Finset.range (Y' + 1)).filter
(fun p => Nat.Prime p ∧ p ≡ r [MOD L])).card : ℝ) - M Y' L))).max' hne
else 0)) ≤ W * B := by sorry