Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Chapter 19 definition: kkk-section of a power series at residue rrr

Definition
QseriesFormalization_Chapter19_Section5

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

chan-invitation-qseriesformal-power-seriespartition-congruences

This bundle defines the kkk-section at residue rrr of a power series φ=∑anXn\varphi=\sum a_nX^nφ=∑an​Xn over a commutative semiring as the series ∑nakn+rXn\sum_n a_{kn+r}X^n∑n​akn+r​Xn, that is, the subsequence at the literal indices kn+rkn+rkn+r. For k>0k>0k>0 and r<kr<kr<k, this is the full compressed residue-rrr subsequence. It is the foundation for the mod-5 and general Ramanujan-congruence arguments.

Definition code
-- Generated by qseries-p2m/p2m/generate.py from QseriesFormalization.Chapter19_Section5: skeleton subtraction
-- keeps 1 declaration(s); proofs kept; project imports -> Definitions bundles.
import Mathlib.Combinatorics.Enumerative.Partition.GenFun
import Mathlib.RingTheory.PowerSeries.Basic
import Mathlib.RingTheory.PowerSeries.Expand
import Mathlib.RingTheory.PowerSeries.Inverse
import Mathlib
import Mathlib.Combinatorics.Enumerative.Partition.Basic
import Mathlib.Tactic.Linarith

/-!
# Chapter 19 — k-sections of power series (foundation for MBI / general Ramanujan)

To prove `∀ n, 5 ∣ p(5n+4)` and the other Ramanujan congruence families
unconditionally, we need Hirschhorn-style algebra on (ZMod p)⟦X⟧ that
extracts the coefficients in a fixed residue class.  The natural tool is
the **k-section operator** at residue r:

  section_kr φ := mk (fun n => coeff φ (k·n + r))

This file defines that operator and proves its basic algebraic properties.
These are foundation lemmas for the MBI proof (Pending/Chapter16_MBI.lean)
and for discharging the formal-PS vanishing hypothesis needed by Chapter
19's `ramanujan_from_pochInf_vanishes`.

All theorems in this file are unconditional (no sorry, no axiom beyond
the core three).
-/

namespace QseriesFormalization
namespace PartIV
namespace Ch19

open PowerSeries

/-- **k-section at residue r** of a power series.

`section_kr R k r φ` is the power series whose `n`-th coefficient is the
`(k·n + r)`-th coefficient of `φ`. -/
noncomputable def section_kr (R : Type*) [CommSemiring R] (k r : ℕ)
    (φ : PowerSeries R) : PowerSeries R :=
  PowerSeries.mk (fun n => PowerSeries.coeff (R := R) (k * n + r) φ)

end Ch19
end PartIV
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 19. Lean source: https://github.com/xiangyazi24/invitation-to-qseries-lean/blob/5df34b280b6a9c4a68ab09105b4e5d3c7bbe88d1/QseriesFormalization/Chapter19_Section5.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