Per-modulus monomial piece regrouped by products via the good count
Provedgpy_monomialPairSumAtL_eq_goodCount_sumLet be a tuple of shifts, let be a level, let be monomial indices, let be a coordinate, and let be a modulus. The monomial piece at exact modulus is the sum over good support pairs with combined modulus of . Grouping the pairs by their products and , the piece equals
where is the number of support pairs with , , good at , and combined modulus . The Möbius and log-power factor depends only on , so it factors out of the fiber sum, leaving exactly this good count. This regrouping stages the remaining combinatorial problem: everything about the pair sum except the good count is now one-variable. Formalization Note: the support set, the good-pair condition, and the good count are all unfolded into explicit finite sums, filters, and cardinalities.
import Mathlib open Classical
theorem gpy_monomialPairSumAtL_eq_goodCount_sum {k : ℕ} (h : Fin k → ℕ) (R : ℕ)
(a b : ℕ) (i : Fin k) (L : ℕ) :
(∑ d ∈ (Fintype.piFinset (fun _ => Finset.Icc 1 R)).filter (fun d => ∏ i, d i ≤ R),
∑ e ∈ (Fintype.piFinset (fun _ => Finset.Icc 1 R)).filter (fun d => ∏ i, d i ≤ R),
if (Finset.lcm Finset.univ (fun j => Nat.lcm (d j) (e j)) = L
∧ (∃ w, (∀ j, Nat.lcm (d j) (e j) ∣ w + h j) ∧
Nat.Coprime (w + h i) (Finset.lcm Finset.univ (fun j => Nat.lcm (d j) (e j)))))
then (ArithmeticFunction.moebius (∏ j, d j) : ℝ)
* (ArithmeticFunction.moebius (∏ j, e j) : ℝ)
* (-(Real.log ((∏ j, d j : ℕ) : ℝ) / Real.log R)) ^ a
* (-(Real.log ((∏ j, e j : ℕ) : ℝ) / Real.log R)) ^ b
else 0)
= ∑ D ∈ Finset.Icc 1 R, ∑ E ∈ Finset.Icc 1 R,
(ArithmeticFunction.moebius D : ℝ) * (ArithmeticFunction.moebius E : ℝ)
* (-(Real.log (D : ℝ) / Real.log R)) ^ a
* (-(Real.log (E : ℝ) / Real.log R)) ^ b
* ((((Fintype.piFinset (fun _ => Finset.Icc 1 R)).filter (fun d => ∏ i, d i ≤ R)
×ˢ (Fintype.piFinset (fun _ => Finset.Icc 1 R)).filter (fun d => ∏ i, d i ≤ R)).filter
(fun p => ∏ j, p.1 j = D ∧ ∏ j, p.2 j = E ∧
(∃ w, (∀ j, Nat.lcm (p.1 j) (p.2 j) ∣ w + h j) ∧
Nat.Coprime (w + h i) (Finset.lcm Finset.univ (fun j => Nat.lcm (p.1 j) (p.2 j)))) ∧
Finset.lcm Finset.univ (fun j => Nat.lcm (p.1 j) (p.2 j)) = L)).card : ℝ) := by sorry