Chapter 10 (tenth order): Chan's Eq. (10.15) formal series, AP divisor sums and identity statement
DefinitionQseriesFormalization_Pending_Chapter10_TenthOrderThis bundle defines Chan's sign ( on the closed first quadrant, on the open third quadrant), the mod-3 filter , the -exponent of Eq. (10.15) after , and the coefficient term and window-based finite coefficient of the four-variable indefinite theta side, giving the formal series (chan1015LHSPS). It defines the product side , arithmetic-progression divisor-sum series (finite and infinite) and finite AP products. Finally it defines the proposition chan1015IdentityStatement that these two sides are equal; that definition states, but does not prove, the identity.
Precisely, the exponent definition applies integer-to-natural truncation, replacing a negative integer value by . The coefficient at is defined by the finite box and ; identification with an unrestricted supported sum is a separate theorem.
-- Generated by qseries-p2m/p2m/generate.py from QseriesFormalization.Pending.Chapter10_TenthOrder: skeleton subtraction
-- keeps 16 declaration(s); proofs kept; project imports -> Definitions bundles.
import Definitions.Def_QseriesFormalization_DefCoreQSeries
import Mathlib
import Mathlib.Combinatorics.Enumerative.Partition.GenFun
import Mathlib.RingTheory.PowerSeries.Basic
import Mathlib.RingTheory.PowerSeries.Expand
import Mathlib.RingTheory.PowerSeries.Inverse
import Mathlib.Topology.Algebra.InfiniteSum.NatInt
import Mathlib.RingTheory.PowerSeries.Derivative
import Mathlib.Combinatorics.Enumerative.Partition.Basic
import Mathlib.Tactic.Linarith
import Mathlib.Analysis.SpecificLimits.Normed
import Mathlib.Analysis.Normed.Ring.InfiniteSum
import Mathlib.Analysis.SpecialFunctions.Log.Summable
import Mathlib.Analysis.Normed.Group.Tannery
namespace QseriesFormalization.Pending.Ch15FormalDeriv end QseriesFormalization.Pending.Ch15FormalDeriv
namespace QseriesFormalization.Pending.Ch16MBIProof end QseriesFormalization.Pending.Ch16MBIProof
/-!
# Chapter 10 — Tenth-order mock theta functions φ and ψ
Chan's Ch10 main identity (Eq 10.10/10.15) involves the tenth-order
mock theta functions. This file defines them and states the target.
-/
namespace QseriesFormalization.Pending.Ch10TenthOrder
open Filter
open PowerSeries
open scoped Topology PowerSeries PowerSeries.WithPiTopology
open QseriesFormalization.PartIV.Ch19
open QseriesFormalization.Pending.JTPFormalPSPentagonal
open QseriesFormalization.Pending.Ch15FormalDeriv
open QseriesFormalization.Pending.Ch16MBIProof
/-! ## Tenth-order `φ` and `ψ`
Chan/Ramanujan's tenth-order `φ` and `ψ` use the denominator
`(q;q²)_{n+1} = (1-q)(1-q³)⋯(1-q^{2n+1})`. The coefficient definitions
below compute the inverse of each finite odd product by truncated convolution.
-/
/-! ### Low-degree coefficient checks
The next two kernel-normalization certificates match OEIS A053281 and A053282
through degree `25`.
-/
/-! ## Chan Eq. (10.15), formal target after `Q = q^(1/3)`
The displayed Eq. (10.15) in Chan is
```text
∑_{k,l,r,s} ρ_{r,s} (-1)^{k+l+r+s}
(δ(k)-δ(r))(δ(l)-δ(s))
q^((k²+l²+r²+3rs+s²+3r+3s+1)/3)
= - (q;q)_∞^5 / (q²;q²)_∞^2
∑_n (-1)^n q^(n(5n+3)/2).
```
The definitions below replace `q` by `Q^3`, so the exponent on the left is
integral:
```text
Q^(k²+l²+r²+3rs+s²+3r+3s+1).
```
The right-hand side becomes
```text
- (Q³;Q³)_∞^5 / (Q⁶;Q⁶)_∞^2
∑_n (-1)^n Q^(3n(5n+3)/2).
```
The final theorem is not asserted here; these definitions make the exact
formal-power-series proposition available without introducing any proof hole.
-/
/-- Chan's sign `ρ_{r,s}` from Eq. (10.12), integer-valued. -/
def rhoInt (r s : ℤ) : ℤ :=
if 0 ≤ r ∧ 0 ≤ s then 1 else if r < 0 ∧ s < 0 then -1 else 0
/-- The mod-3 filter `δ(r)` from Eq. (10.13), integer-valued. -/
def delta3Int (r : ℤ) : ℤ :=
if (3 : ℤ) ∣ r then 1 else 0
/-- The integral `Q`-exponent obtained from Chan's Eq. (10.15) after `q = Q^3`. -/
def chan1015QExponent (k l r s : ℤ) : ℕ :=
(k * k + l * l + r * r + 3 * r * s + s * s + 3 * r + 3 * s + 1).toNat
/-- One coefficient contribution in the four-variable indefinite theta side. -/
def chan1015CoeffTerm (R : Type*) [CommRing R] (N : ℕ) (k l r s : ℤ) : R :=
if chan1015QExponent k l r s = N then
((rhoInt r s : ℤ) : R) *
negOnePowInt R (k + l + r + s) *
(((delta3Int k - delta3Int r : ℤ) : R)) *
(((delta3Int l - delta3Int s : ℤ) : R))
else 0
/-- Largest `m ≤ N` with `m² ≤ N`, used as the `k,l` coefficient window. -/
def squareWindow (N : ℕ) : ℕ :=
((List.range (N + 1)).filter (fun m => m * m ≤ N)).foldl Nat.max 0
/-- Coefficient of `Q^N` in the formal four-variable indefinite theta side.
The `k,l` variables use the square-root window forced by their positive
quadratic contribution. The `r,s` variables keep the conservative
`[-(N+2), N+2]` window from the original coefficient formula. -/
noncomputable def chan1015LHSCoeff (R : Type*) [CommRing R] (N : ℕ) : R :=
let B : ℤ := N + 2
let K : ℤ := squareWindow N
∑ k ∈ Finset.Icc (-K) K,
∑ l ∈ Finset.Icc (-K) K,
∑ r ∈ Finset.Icc (-B) B,
∑ s ∈ Finset.Icc (-B) B,
chan1015CoeffTerm R N k l r s
/-- Formal four-variable indefinite theta side of Chan Eq. (10.15), after `q = Q^3`. -/
noncomputable def chan1015LHSPS (R : Type*) [CommRing R] : R⟦X⟧ :=
PowerSeries.mk (chan1015LHSCoeff R)
/-- `(Q^d; Q^d)_∞` as a formal power series. -/
noncomputable def qPochInfAtPowerPS (d : ℕ) (hd : d ≠ 0) : ℚ⟦X⟧ :=
PowerSeries.expand d hd (qPochInfPS ℚ)
/-! ### `thetaOp` bridge for arithmetic-progression products
This is the Chapter 10 analogue of the Lambert-to-product bridge used in
`Chapter15_WronskianBridge`: the logarithmic theta derivative of
`(q^r;q^m)_∞` is the negative AP divisor-sigma series.
-/
noncomputable def divisorGeomPSLocal (R : Type*) [CommRing R] (d : ℕ) : R⟦X⟧ :=
PowerSeries.mk fun n => if d ∣ n ∧ 0 < n then (1 : R) else 0
noncomputable def qPochAPFinitePS (R : Type*) [CommRing R]
(r m N : ℕ) : R⟦X⟧ :=
∏ n ∈ Finset.range N, apFactorPS R r m n
noncomputable def apDivisorSigmaFinitePS (R : Type*) [CommRing R]
(r m N : ℕ) : R⟦X⟧ :=
PowerSeries.mk fun n =>
∑ k ∈ Finset.range N,
if r + m * k ∣ n ∧ 0 < n then ((r + m * k : ℕ) : R) else 0
noncomputable def apDivisorSigmaPS (R : Type*) [CommRing R]
(r m : ℕ) : R⟦X⟧ :=
PowerSeries.mk fun n =>
∑ k ∈ Finset.range (n + 1),
if r + m * k ∣ n ∧ 0 < n then ((r + m * k : ℕ) : R) else 0
/-- The pentagonal series on the right of Eq. (10.15), after `q = Q^3`.
The source series is `∑ (-1)^k X^((5k²-3k)/2)`. Reindexing `k ↦ -k` gives
Chan's `∑ (-1)^n q^(n(5n+3)/2)`, and `expand 3` substitutes `q = Q^3`. -/
noncomputable def chan1015PentagonalPS : ℚ⟦X⟧ :=
PowerSeries.expand 3 (by decide : (3 : ℕ) ≠ 0) (pentagonal014SeriesPS ℚ)
/-- Product side of Chan Eq. (10.15), after `q = Q^3`. -/
noncomputable def chan1015RHSPS : ℚ⟦X⟧ :=
-((qPochInfAtPowerPS 3 (by decide : (3 : ℕ) ≠ 0)) ^ 5 *
((qPochInfAtPowerPS 6 (by decide : (6 : ℕ) ≠ 0)) ^ 2)⁻¹ *
chan1015PentagonalPS)
/-! ### Computable coefficients for Chan Eq. (10.15) RHS -/
/-- Integer coefficient of an arithmetic-progression divisor-sigma series. -/
def apDivisorSigmaCoeffZ (r m n : ℕ) : ℤ :=
∑ k ∈ Finset.range (n + 1),
if r + m * k ∣ n ∧ 0 < n then ((r + m * k : ℕ) : ℤ) else 0
/-! ### Recurrence closure lemmas for the all-coefficients route -/
/-- The exact formal-power-series proposition corresponding to Chan Eq. (10.15)
after the substitution `q = Q^3`. -/
def chan1015IdentityStatement : Prop :=
chan1015LHSPS ℚ = chan1015RHSPS
end QseriesFormalization.Pending.Ch10TenthOrder