Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Chapter 10 (tenth order): Chan's Eq. (10.15) formal series, AP divisor sums and identity statement

Definition
QseriesFormalization_Pending_Chapter10_TenthOrder

by FormallyCorrect · Oct 23, 2026 · Mathlib 0df444a (Lean v4.33.1)

chan-invitation-qseriesidentitiesmock-thetaq-series

This bundle defines Chan's sign ρ(r,s)\rho(r,s)ρ(r,s) (111 on the closed first quadrant, −1-1−1 on the open third quadrant), the mod-3 filter δ(r)\delta(r)δ(r), the QQQ-exponent k2+l2+r2+3rs+s2+3r+3s+1k^2+l^2+r^2+3rs+s^2+3r+3s+1k2+l2+r2+3rs+s2+3r+3s+1 of Eq. (10.15) after q=Q3q=Q^3q=Q3, and the coefficient term and window-based finite coefficient χN\chi_NχN​ of the four-variable indefinite theta side, giving the formal series (chan1015LHSPS). It defines the product side −(Q3;Q3)∞5(Q6;Q6)∞−2∑(−1)kQ3k(5k−3)/2-(Q^3;Q^3)_\infty^5(Q^6;Q^6)_\infty^{-2}\sum(-1)^kQ^{3k(5k-3)/2}−(Q3;Q3)∞5​(Q6;Q6)∞−2​∑(−1)kQ3k(5k−3)/2, arithmetic-progression divisor-sum series σr,m\sigma_{r,m}σr,m​ (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 000. The coefficient at NNN is defined by the finite box ∣k∣,∣l∣≤⌊N⌋|k|,|l|\le\lfloor\sqrt N\rfloor∣k∣,∣l∣≤⌊N​⌋ and ∣r∣,∣s∣≤N+2|r|,|s|\le N+2∣r∣,∣s∣≤N+2; identification with an unrestricted supported sum is a separate theorem.

Definition code
-- 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
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 10. Lean source: https://github.com/xiangyazi24/invitation-to-qseries-lean/blob/5df34b280b6a9c4a68ab09105b4e5d3c7bbe88d1/QseriesFormalization/Pending/Chapter10_TenthOrder.lean (definitions of this module that the uploaded theorems need; ported to Lean v4.33.1 / Mathlib 0df444a).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me