Chapter 8 finite Rogers--Ramanujan: Gaussian sum and alternating finite side
DefinitionQseriesFormalization_Pending_Chapter08_FiniteRRchan-invitation-qseriespentagonal-numbersq-binomialrogers-ramanujan
This bundle defines Chan's finite Gaussian-polynomial sum and the alternating side as a bilateral finite sum with a symmetric bound . Supporting definitions are the exponent, the lower index, a Gaussian binomial with integer lower index (zero when negative), the per- term, a residual of the recurrence and a carry term used in the telescoping proof.
The definitions are over a field with totalized integer powers: raised to a negative integer is .
Definition code
-- Generated by qseries-p2m/p2m/generate.py from QseriesFormalization.Pending.Chapter08_FiniteRR: skeleton subtraction
-- keeps 9 declaration(s); proofs kept; project imports -> Definitions bundles.
import Definitions.Def_QseriesFormalization_DefCoreQSeries
import Mathlib.Analysis.Normed.Group.Tannery
import Mathlib
import Mathlib.Analysis.SpecialFunctions.Log.Summable
/-!
# Chapter 8 finite Rogers-Ramanujan sum side
Chan's Section 8.1 writes
`E_n(a) = sum_j q^(j^2 + a*j) [n-j-1 choose j]_q` and proves the
second-order recurrence
`E_{n+1}(a) = E_n(a) + q^(n+a-1) E_{n-1}(a)`.
The zero-based definition below is `EFinite q a N = E_{N+1}(a)`.
-/
namespace QseriesFormalization
namespace PartII
namespace Ch08
section Field
variable {R : Type*} [Field R]
/-- The finite Gaussian-polynomial sum side of Chan Theorem 8.1.
This is Chan's `E_{N+1}(a)`: `sum_j q^(j^2+a*j) [N-j choose j]_q`. -/
noncomputable def EFinite (q : R) (a N : Nat) : R :=
∑ j ∈ Finset.range (N + 1), q ^ (j ^ 2 + a * j) * gaussianBinom q (N - j) j
/-! ### Chan's finite alternating Gaussian-polynomial side -/
/-- Integer exponent in Chan's alternating side:
`j(5j+1)/2 - 2aj`. -/
def DFiniteExponent (a : Nat) (j : Int) : Int :=
(j * (5 * j + 1)) / 2 - 2 * (a : Int) * j
/-- Integer lower index in Chan's alternating side:
`⌊(N+3a-5j)/2⌋`. Lean's integer division by positive `2` is floor division. -/
def DFiniteLower (a N : Nat) (j : Int) : Int :=
((N : Int) + 3 * (a : Int) - 5 * j) / 2
/-- A Gaussian binomial with an integer lower index, interpreted as zero
when the lower index is negative. If the lower index is above the top, the
existing `gaussianBinom_eq_zero_of_lt` lemma supplies the zero value. -/
noncomputable def gaussianBinomIntLower (q : R) (top : Nat) (k : Int) : R :=
if 0 ≤ k then gaussianBinom q top k.toNat else 0
/-- A symmetric finite bound large enough to contain all possible nonzero
terms of Chan's finite alternating sum. -/
def DFiniteBound (a N : Nat) : Nat :=
N + 3 * a + 2
/-- One summand of Chan's finite alternating Gaussian-polynomial side. -/
noncomputable def DFiniteTerm (q : R) (a N : Nat) (j : Int) : R :=
(-1 : R) ^ j * q ^ DFiniteExponent a j *
gaussianBinomIntLower q (N + a) (DFiniteLower a N j)
/-- Chan's finite alternating Gaussian-polynomial side of Theorem 8.1:
`Σ_j (-1)^j q^(j(5j+1)/2-2aj) [N+a ; ⌊(N+3a-5j)/2⌋]_q`.
The finite bilateral sum uses `DFiniteBound`; outside this bound the integer
lower q-binomial index is out of range. -/
noncomputable def DFinite (q : R) (a N : Nat) : R :=
bilateralSum (DFiniteTerm q a N) (DFiniteBound a N)
/-! ### Alternating-side recurrence for the Rogers-Ramanujan cases -/
noncomputable def DFiniteResidual (q : R) (a N : Nat) (j : Int) : R :=
DFiniteTerm q a (N + 2) j - DFiniteTerm q a (N + 1) j -
q ^ (N + a + 1) * DFiniteTerm q a N j
noncomputable def DFiniteCarry (q : R) (a N : Nat) (j : Int) : R :=
if ((N : Int) + 3 * (a : Int) - 5 * j) % 2 = 0 then
(-1 : R) ^ j * q ^ DFiniteExponent a j *
q ^ (DFiniteLower a N j + 1).toNat *
gaussianBinomIntLower q (N + a) (DFiniteLower a N j + 1)
else 0
/-! ### Recurrence uniqueness bridge -/
end Field
end Ch08
end PartII
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 8. Lean source: https://github.com/xiangyazi24/invitation-to-qseries-lean/blob/5df34b280b6a9c4a68ab09105b4e5d3c7bbe88d1/QseriesFormalization/Pending/Chapter08_FiniteRR.lean (definitions of this module that the uploaded theorems need; ported to Lean v4.33.1 / Mathlib 0df444a).