Chapter 15 Wronskian-independent route: pentagonal products, Gaussian-integer weights, norm shells and orbit maps
DefinitionQseriesFormalization_Pending_Chapter15_WronskianIndependentchan-invitation-qseriesidentitiespentagonal-numberssums-of-squares
This large bundle sets up the Chapter 15 argument. It abbreviates the pentagonal series and products , the logarithmic theta derivative, the logarithmic factor , and the AP-sigma Lambert factor with its integer coefficients. It models Gaussian integers as pairs of integers with multiplication, conjugation, norm, the elements and , unit rotations, the sign , the Jacobi-side weight , the Wronskian-side weight and the Wronskian core . It also defines the raw and expanded coefficients of the pentagonal Wronskian and of , norm shells of norm (and general norm ), exact divisibility by with quotient maps, the pentagonal sector, and the orbit and inverse maps between the pentagonal, Jacobi-pair and Gaussian parametrizations.
Definition code
-- Generated by qseries-p2m/p2m/generate.py from QseriesFormalization.Pending.Chapter15_WronskianIndependent: skeleton subtraction
-- keeps 68 declaration(s); proofs kept; project imports -> Definitions bundles.
import Definitions.Def_QseriesFormalization_Pending_Chapter15_FormalDeriv
import Definitions.Def_QseriesFormalization_Pending_Chapter10_TenthOrder
import Mathlib.RingTheory.PowerSeries.Derivative
import Mathlib.RingTheory.PowerSeries.Inverse
import Mathlib.Topology.Algebra.InfiniteSum.NatInt
import Mathlib.Combinatorics.Enumerative.Partition.GenFun
import Mathlib.RingTheory.PowerSeries.Basic
import Mathlib.RingTheory.PowerSeries.Expand
import Mathlib.Analysis.SpecificLimits.Normed
import Mathlib.Analysis.Normed.Ring.InfiniteSum
import Mathlib
import Mathlib.Combinatorics.Enumerative.Partition.Basic
import Mathlib.Tactic.Linarith
import Mathlib.Analysis.SpecialFunctions.Log.Summable
import Mathlib.Analysis.Normed.Group.Tannery
namespace QseriesFormalization.Pending.Ch13RRCF end QseriesFormalization.Pending.Ch13RRCF
namespace QseriesFormalization.Pending.Ch16MBIProof end QseriesFormalization.Pending.Ch16MBIProof
namespace QseriesFormalization.Pending.JacobiCubeAnalyticToFormal end QseriesFormalization.Pending.JacobiCubeAnalyticToFormal
/-!
# Chapter 15 — independent Wronskian coefficient reduction
This file deliberately avoids importing `Chapter15_R_ODE` and any theorem
depending on `chan_theorem_11_7`. The remaining open mathematical point is the
all-degree finite double-sum identity between the pentagonal Wronskian
coefficients and the Jacobi-cube Cauchy-square coefficients.
-/
namespace QseriesFormalization
namespace Pending
namespace Ch15WronskianIndependent
open Filter
open PowerSeries
open scoped Topology PowerSeries PowerSeries.WithPiTopology
open QseriesFormalization.PartIV.Ch19
open QseriesFormalization.Pending.Ch15FormalDeriv
open QseriesFormalization.Pending.Ch16MBIProof
open QseriesFormalization.Pending.Ch13RRCF
open QseriesFormalization.Pending.Ch10TenthOrder
open QseriesFormalization.Pending.JacobiCubeAnalyticToFormal
open QseriesFormalization.Pending.JTPFormalPSPentagonal
/-! ## Quintuple-product logarithmic-derivative route scaffolding -/
/-- Chapter-15 shorthand for the pentagonal `0,1,4` product/series. -/
noncomputable abbrev P014 : ℚ⟦X⟧ :=
pentagonal014SeriesPS ℚ
/-- Chapter-15 shorthand for the pentagonal `0,2,3` product/series. -/
noncomputable abbrev P023 : ℚ⟦X⟧ :=
pentagonal023SeriesPS ℚ
/-- Product-side shorthand for `(q,q^4,q^5;q^5)_∞`. -/
noncomputable abbrev P014_product : ℚ⟦X⟧ :=
pentagonalProduct014PS ℚ
/-- Product-side shorthand for `(q^2,q^3,q^5;q^5)_∞`. -/
noncomputable abbrev P023_product : ℚ⟦X⟧ :=
pentagonalProduct023PS ℚ
/-- Chapter-15 shorthand for `(X^5; X^5)_∞ = expand 5 (X; X)_∞`. -/
noncomputable abbrev expandFiveQpochRat : ℚ⟦X⟧ :=
PowerSeries.expand 5 (by decide) (qPochInfPS ℚ)
/-- The formal logarithmic theta derivative `Theta(f) / f`. -/
noncomputable abbrev thetaLog (f : ℚ⟦X⟧) : ℚ⟦X⟧ :=
thetaDlog f
/-- The logarithmic factor predicted by the quintuple-product route. -/
noncomputable abbrev quintupleLogFactor : ℚ⟦X⟧ :=
(1 : ℚ⟦X⟧) + (5 : ℚ⟦X⟧) * (thetaLog P014 - thetaLog P023)
/-- Chan's residue-class Lambert side, written through AP divisor-sigma
series and without importing `Chapter15_R_ODE`. -/
noncomputable abbrev apSigmaLambertFactor : ℚ⟦X⟧ :=
1 + (5 : ℚ⟦X⟧) *
((apDivisorSigmaPS ℚ 2 5 + apDivisorSigmaPS ℚ 3 5) -
(apDivisorSigmaPS ℚ 1 5 + apDivisorSigmaPS ℚ 4 5))
/-! ### Executable coefficient model for the cleared logarithmic target -/
/-- Integer coefficients of the AP-sigma Lambert factor
`1 + 5*((Σ₂+Σ₃)-(Σ₁+Σ₄))`. -/
def apSigmaLambertCoeffZ (n : ℕ) : ℤ :=
if n = 0 then 1
else 5 *
((apDivisorSigmaCoeffZ 2 5 n + apDivisorSigmaCoeffZ 3 5 n) -
(apDivisorSigmaCoeffZ 1 5 n + apDivisorSigmaCoeffZ 4 5 n))
/-! ### Direct coefficient model for the eta-quotient side -/
set_option maxRecDepth 8192 in
set_option maxHeartbeats 1200000 in
/-! ### Prime-power local Eisenstein structure -/
/-! ### Theta-log recurrence form of the eta-quotient gap -/
/-! ## Gaussian-integer scaffolding for the 5-string proof -/
abbrev GaussianInt := ℤ × ℤ
/-- Multiplication in `ℤ[i]`, represented as pairs. -/
def gaussMul (z w : GaussianInt) : GaussianInt :=
(z.1 * w.1 - z.2 * w.2, z.1 * w.2 + z.2 * w.1)
/-- Complex conjugation in `ℤ[i]`. -/
def gaussConj (z : GaussianInt) : GaussianInt :=
(z.1, -z.2)
/-- Norm squared `a^2 + b^2` on `ℤ[i]`. -/
def gaussNormSq (z : GaussianInt) : ℤ :=
z.1 ^ 2 + z.2 ^ 2
def pi5 : GaussianInt := (1, 2)
def piBar5 : GaussianInt := (1, -2)
/-- Multiplication by the four units `1,i,-1,-i`. -/
def gaussUnitRotate (i : Fin 4) (z : GaussianInt) : GaussianInt :=
match i.1 with
| 0 => z
| 1 => (-z.2, z.1)
| 2 => (-z.1, -z.2)
| _ => (z.2, -z.1)
/-- `(-1)^(a+1)`, expressed by parity. -/
def gaussEps (a : ℤ) : ℤ :=
if a % 2 = 0 then -1 else 1
/-- Jacobi-side representation weight. -/
def gaussH (z : GaussianInt) : ℤ :=
gaussEps z.1 * (z.1 ^ 2 - z.2 ^ 2)
/-- Parity sign for an integer quotient. -/
def paritySign (n : ℤ) : ℤ :=
if n % 2 = 0 then 1 else -1
/-- Wronskian-side weight attached to one rotated `(R,S)` pair. The condition
`x ≡ 2 (mod 5)` is the congruence `x = 10m - 3` from the blueprint, with
`x = R - 2S`, `y = 2R + S`. -/
def wronskianRSWeight (R S : ℤ) : ℤ :=
let x := R - 2 * S
let y := 2 * R + S
if x % 5 = 2 then
paritySign ((x + y + 4) / 10) * ((x ^ 2 - y ^ 2) / 8)
else
0
/-- Wronskian-side representation weight, summing over the four unit rotations
of `(R,S) = (A-B,A+B)`. -/
def gaussK (z : GaussianInt) : ℤ :=
∑ i : Fin 4,
let RS := gaussUnitRotate i (z.1 - z.2, z.1 + z.2)
wronskianRSWeight RS.1 RS.2
def wronskianCore (a b : ℤ) : ℤ :=
(((-a - 3 * b) ^ 2 - (3 * a - b) ^ 2) / 8)
def gaussA (z : GaussianInt) : ℤ :=
z.1 ^ 2 - z.2 ^ 2
def gaussB (z : GaussianInt) : ℤ :=
z.1 * z.2
def piEndpointPart (z : GaussianInt) : ℤ :=
2 * gaussA z - 3 * gaussB z
/-! ## Explicit coefficient reindexing maps -/
def triangularIndex (r : ℕ) : ℕ :=
r * (r + 1) / 2
def jacobiToGauss (r s : ℕ) : GaussianInt :=
((r : ℤ) + (s : ℤ) + 1, (r : ℤ) - (s : ℤ))
def pentagonalToGauss (k l : ℤ) : GaussianInt :=
(-k + 3 * l, -3 * k - l + 1)
/-! ## Coefficientwise Wronskian reduction to Jacobi cube -/
/-- Raw Cauchy-product coefficient of
`P14*P23 + 5*(P23*theta(P14) - P14*theta(P23))`. -/
noncomputable def pentagonalWronskianCoeff (N : ℕ) : ℚ :=
(∑ ij ∈ Finset.HasAntidiagonal.antidiagonal N,
pentagonal014Coeff ℚ ij.1 * pentagonal023Coeff ℚ ij.2) +
5 *
((∑ ij ∈ Finset.HasAntidiagonal.antidiagonal N,
pentagonal023Coeff ℚ ij.1 * pentagonal014Coeff ℚ ij.2 * (ij.2 : ℚ)) -
(∑ ij ∈ Finset.HasAntidiagonal.antidiagonal N,
pentagonal014Coeff ℚ ij.1 * pentagonal023Coeff ℚ ij.2 * (ij.2 : ℚ)))
/-- Cauchy-product coefficient of `(jacobiThetaPS ℚ)^2`. -/
def jacobiThetaSquareCoeff (N : ℕ) : ℚ :=
∑ ij ∈ Finset.HasAntidiagonal.antidiagonal N,
((jacobiTripleSign ij.1 : ℤ) : ℚ) * ((jacobiTripleSign ij.2 : ℤ) : ℚ)
def jacobiSignAt (r : ℕ) : ℚ :=
(((-1 : ℤ) ^ r * (2 * (r : ℤ) + 1) : ℤ) : ℚ)
def jacobiThetaSquareCoeffExpanded (N : ℕ) : ℚ :=
∑ r ∈ Finset.range (N + 1),
∑ s ∈ Finset.range (N + 1),
if triangularIndex r + triangularIndex s = N then
jacobiSignAt r * jacobiSignAt s
else 0
def pentagonalCoeffPairWeight (k l : ℤ) : ℚ :=
negOnePowInt ℚ k * negOnePowInt ℚ l *
(1 + 5 * ((pentagonal014Exp k : ℚ) - (pentagonal023Exp l : ℚ)))
noncomputable def pentagonalWronskianCoeffExpanded (N : ℕ) : ℚ :=
∑ k ∈ Finset.Icc (-(N + 1 : ℤ)) (N + 1 : ℤ),
∑ l ∈ Finset.Icc (-(N + 1 : ℤ)) (N + 1 : ℤ),
if pentagonal014Exp k + pentagonal023Exp l = N then
pentagonalCoeffPairWeight k l
else 0
noncomputable def pentagonalShellPairs (N : ℕ) : Finset (ℤ × ℤ) :=
(Finset.Icc (-(N + 1 : ℤ)) (N + 1 : ℤ)).product
(Finset.Icc (-(N + 1 : ℤ)) (N + 1 : ℤ)) |>.filter
(fun kl => pentagonal014Exp kl.1 + pentagonal023Exp kl.2 = N)
noncomputable def normShellBox (N : ℕ) : Finset ℤ :=
Finset.Icc (-(2 * (N : ℤ) + 1)) (2 * (N : ℤ) + 1)
/-- Full norm-shell Jacobi weight, normalized by the four sign symmetries.
The expected final orbit proof shows both expanded coefficient sums equal this
intermediate quantity. -/
noncomputable def fullNormShellHQuarterSum (N : ℕ) : ℚ :=
(∑ A ∈ normShellBox N,
∑ B ∈ normShellBox N,
if A ^ 2 + B ^ 2 = 4 * (N : ℤ) + 1 then ((gaussH (A,B) : ℤ) : ℚ) else 0) / 4
def jacobiShellPairs (N : ℕ) : Finset (ℕ × ℕ) :=
(Finset.range (N + 1)).product (Finset.range (N + 1)) |>.filter
(fun rs => triangularIndex rs.1 + triangularIndex rs.2 = N)
noncomputable def fullNormShell (N : ℕ) : Finset GaussianInt :=
(normShellBox N).product (normShellBox N) |>.filter
(fun z => z.1 ^ 2 + z.2 ^ 2 = 4 * (N : ℤ) + 1)
def pentagonalSectorPred (z : GaussianInt) : Prop :=
(-z.1 - 3 * z.2) % 5 = 2 ∧ (3 * z.1 - z.2) % 5 = 4
instance : DecidablePred pentagonalSectorPred := by
intro z
unfold pentagonalSectorPred
infer_instance
noncomputable def pentagonalSector (N : ℕ) : Finset GaussianInt :=
(fullNormShell N).filter pentagonalSectorPred
noncomputable def fullNormShellKSum (N : ℕ) : ℚ :=
∑ z ∈ fullNormShell N, ((gaussK z : ℤ) : ℚ)
/-! ### Wide norm shells for 5-recurrence bookkeeping -/
noncomputable def normShellBoxByNorm (M : ℕ) : Finset ℤ :=
Finset.Icc (-(M : ℤ)) (M : ℤ)
noncomputable def normShellByNorm (M : ℕ) : Finset GaussianInt :=
(normShellBoxByNorm M).product (normShellBoxByNorm M) |>.filter
(fun z => z.1 ^ 2 + z.2 ^ 2 = (M : ℤ))
noncomputable def normShellHSumByNorm (M : ℕ) : ℚ :=
∑ z ∈ normShellByNorm M, ((gaussH z : ℤ) : ℚ)
noncomputable def normShellKSumByNorm (M : ℕ) : ℚ :=
∑ z ∈ normShellByNorm M, ((gaussK z : ℤ) : ℚ)
def piDividesExact (z : GaussianInt) : Prop :=
(z.1 + 2 * z.2) % 5 = 0 ∧ (-2 * z.1 + z.2) % 5 = 0
def piBarDividesExact (z : GaussianInt) : Prop :=
(z.1 - 2 * z.2) % 5 = 0 ∧ (2 * z.1 + z.2) % 5 = 0
instance : DecidablePred piDividesExact := by
intro z
unfold piDividesExact
infer_instance
instance : DecidablePred piBarDividesExact := by
intro z
unfold piBarDividesExact
infer_instance
def gaussPiDiv (z : GaussianInt) : GaussianInt :=
((z.1 + 2 * z.2) / 5, (-2 * z.1 + z.2) / 5)
def gaussPiBarDiv (z : GaussianInt) : GaussianInt :=
((z.1 - 2 * z.2) / 5, (2 * z.1 + z.2) / 5)
def gaussFiveDiv (z : GaussianInt) : GaussianInt :=
(z.1 / 5, z.2 / 5)
def pentagonalSectorInverse (z : GaussianInt) : ℤ × ℤ :=
(((-z.1 - 3 * z.2 + 3) / 10), ((3 * z.1 - z.2 + 1) / 10))
def pentagonalSelectedRotation (z : GaussianInt) : Fin 4 :=
if (-z.1 - 3 * z.2) % 5 = 2 then ⟨0, by norm_num⟩
else if (-3 * z.1 + z.2) % 5 = 2 then ⟨1, by norm_num⟩
else if (z.1 + 3 * z.2) % 5 = 2 then ⟨2, by norm_num⟩
else ⟨3, by norm_num⟩
def pentagonalSelectedInverseRotation (z : GaussianInt) : Fin 4 :=
match (pentagonalSelectedRotation z).1 with
| 0 => ⟨0, by norm_num⟩
| 1 => ⟨3, by norm_num⟩
| 2 => ⟨2, by norm_num⟩
| _ => ⟨1, by norm_num⟩
def pentagonalSectorRepresentative (z : GaussianInt) : GaussianInt :=
gaussUnitRotate (pentagonalSelectedRotation z) z
noncomputable def pentagonalUnitOrbitDomain (N : ℕ) : Finset (Fin 4 × GaussianInt) :=
(Finset.univ : Finset (Fin 4)).product (pentagonalSector N)
def pentagonalUnitOrbitPoint (x : Fin 4 × GaussianInt) : GaussianInt :=
gaussUnitRotate x.1 x.2
noncomputable def pentagonalUnitOrbitImage (N : ℕ) : Finset GaussianInt :=
(pentagonalUnitOrbitDomain N).image pentagonalUnitOrbitPoint
def pentagonalFullShellInverse (z : GaussianInt) : Fin 4 × GaussianInt :=
(pentagonalSelectedInverseRotation z, pentagonalSectorRepresentative z)
def jacobiOrbitPoint (i : Fin 4) (rs : ℕ × ℕ) : GaussianInt :=
let z := jacobiToGauss rs.1 rs.2
match i.1 with
| 0 => z
| 1 => (z.2, z.1)
| 2 => (-z.2, -z.1)
| _ => (-z.1, -z.2)
def jacobiOrbitDomain (N : ℕ) : Finset (Fin 4 × (ℕ × ℕ)) :=
(Finset.univ : Finset (Fin 4)).product (jacobiShellPairs N)
def oddAbsIndex (x : ℤ) : ℕ :=
(x.natAbs - 1) / 2
def fullShellInversePair (z : GaussianInt) : ℕ × ℕ :=
(oddAbsIndex (z.1 + z.2), oddAbsIndex (z.1 - z.2))
def fullShellInverseSign (z : GaussianInt) : Fin 4 :=
if 0 < z.1 - z.2 then
if 0 < z.1 + z.2 then ⟨0, by norm_num⟩ else ⟨2, by norm_num⟩
else
if 0 < z.1 + z.2 then ⟨1, by norm_num⟩ else ⟨3, by norm_num⟩
def fullShellInverse (z : GaussianInt) : Fin 4 × (ℕ × ℕ) :=
(fullShellInverseSign z, fullShellInversePair z)
end Ch15WronskianIndependent
end Pending
end QseriesFormalization
Source
Lean formalization (Xiang Huang) of Hei-Chi Chan, An Invitation to q-Series: From Jacobi's Triple Product Identity to Ramanujan's "Most Beautiful Identity" (World Scientific, 2011), Chapter 15. Lean source: https://github.com/xiangyazi24/invitation-to-qseries-lean/blob/5df34b280b6a9c4a68ab09105b4e5d3c7bbe88d1/QseriesFormalization/Pending/Chapter15_WronskianIndependent.lean (definitions of this module that the uploaded theorems need; ported to Lean v4.33.1 / Mathlib 0df444a).