Skip to content

feat(PowerSeries): pentagonal number theorem#33143

Open
wwylele wants to merge 7 commits intoleanprover-community:masterfrom
wwylele:pentagonal
Open

feat(PowerSeries): pentagonal number theorem#33143
wwylele wants to merge 7 commits intoleanprover-community:masterfrom
wwylele:pentagonal

Conversation

@wwylele
Copy link
Copy Markdown
Collaborator

@wwylele wwylele commented Dec 20, 2025

The proof is split in two files: Mathlib/Topology/Algebra/InfiniteSum/Pentagonal.lean for the algebraic part, and Mathlib/RingTheory/PowerSeries/Pentagonal.lean for the summability part. In the near future, I also plan to prove the real/complex version that branches off from the algebraic part.


@github-actions
Copy link
Copy Markdown

github-actions bot commented Dec 20, 2025

PR summary 3bad2b8ecd

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference
Mathlib.Topology.Algebra.InfiniteSum.Pentagonal (new file) 1271
Mathlib.RingTheory.PowerSeries.Pentagonal (new file) 1450

Declarations diff

+ aux
+ aux_sub_aux
+ coeff_prod_one_sub_X_eventually_eq_negOnePow
+ coeff_prod_one_sub_X_eventually_eq_zero
+ multipliable_one_sub_X_pow
+ pentagonal_injective
+ pentagonal_nonneg
+ summable_powMulProdOneSubPow_X
+ summable_pow_pentagonal
+ summable_pow_pentagonal'
+ summable_pow_pentagonal_sub
+ tendsto_order_neg_X_pow
+ tendsto_order_powMulProdOneSubPow_X
+ tendsto_order_pow_pentagonal_sub
+ toNat_pentagonal_inj
+ toNat_pentagonal_injective
+ tprod_one_sub_X_pow
+ tprod_one_sub_X_pow'
+ tprod_one_sub_X_pow_eq_tsum_nat
+ tprod_one_sub_pow_eq_powMulProdOneSubPow
+ tprod_one_sub_pow_eq_powMulProdOneSubPow_zero
+ tsum_powMulProdOneSubPow
+ two_pentagonal
+ two_pentagonal_inj

You can run this locally as follows
## summary with just the declaration names:
./scripts/pr_summary/declarations_diff.sh <optional_commit>

## more verbose report:
./scripts/pr_summary/declarations_diff.sh long <optional_commit>

The doc-module for scripts/pr_summary/declarations_diff.sh contains some details about this script.


Increase in tech debt: (relative, absolute) = (12.00, 0.00)
Current number Change Type
10195 12 backward.isDefEq

Current commit afdefc7f6d
Reference commit 3bad2b8ecd

You can run this locally as

./scripts/reporting/technical-debt-metrics.sh pr_summary
  • The relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

@mathlib4-dependent-issues-bot mathlib4-dependent-issues-bot added the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Dec 20, 2025
@mathlib4-dependent-issues-bot mathlib4-dependent-issues-bot removed the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Dec 26, 2025
@mathlib4-dependent-issues-bot
Copy link
Copy Markdown
Collaborator

This PR/issue depends on:

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements the pentagonal number theorem for formal power series. The proof is split into an algebraic part (handling topological rings with summability/multipliability assumptions) and a power series-specific part (proving the necessary summability conditions). The main theorem establishes that the infinite product ∏(1 - x^(n+1)) equals a sum over pentagonal number exponents.

Key changes:

  • Adds algebraic infrastructure for the pentagonal number theorem in topological rings
  • Proves the complete pentagonal number theorem for formal power series
  • Updates the Freek 100 theorem list to reference the new declaration

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.

File Description
docs/1000.yaml Updates the pentagonal number theorem entry to reference the new proof declaration
Mathlib/Topology/Algebra/InfiniteSum/Pentagonal.lean Proves the algebraic part of the pentagonal number theorem with auxiliary sequences and recurrence relations
Mathlib/RingTheory/PowerSeries/Pentagonal.lean Proves summability conditions and completes the pentagonal number theorem for power series
Mathlib.lean Adds the two new files to the public import list

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jcommelin jcommelin added the awaiting-author A reviewer has asked the author a question or requested changes. label Jan 29, 2026
@wwylele
Copy link
Copy Markdown
Collaborator Author

wwylele commented Jan 29, 2026

I rebased the commits to catch up with CI and mathlib version changes. The new code change is still in a separate commit
-awaiting-author

@github-actions github-actions bot removed the awaiting-author A reviewer has asked the author a question or requested changes. label Jan 29, 2026
@wwylele wwylele requested a review from jcommelin January 30, 2026 18:36
@joneugster joneugster added the t-algebra Algebra (groups, rings, fields, etc) label Jan 31, 2026

set_option backward.isDefEq.respectTransparency false in
theorem coeff_prod_one_sub_X_eventually_eq_negOnePow (k : ℤ) :
∀ᶠ s in atTop, (∏ n ∈ s, (1 - X ^ (n + 1) : R⟦X⟧)).coeff (k * (3 * k - 1) / 2).toNat =
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than having two theorems, maybe you could define the pentagonal power series as an element of R⟦X⟧ (without topological space assumptions), and compare coefficients directly?

Copy link
Copy Markdown
Collaborator Author

@wwylele wwylele Mar 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried it in one of my previous version, but it doesn't look pretty. The full formula for the general coefficient would be

coeff n = if "n = (k * (3 * k - 1) / 2) has a solution k" then (-1)^k else 0

and then this generates new design questions, such as whether I should explicitly construct the solution or go with Exists.choose, and this if doesn't look more useful than two separate lemmas.

I honestly don't have much motivation to introduce new nontrivial defs and API for it when this PR is already pretty long (both in line of code and in review time). Maybe next PR?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to show that "next PR" is not an empty promise, I do eventually define the explicit power series at #33157 https://github.com/leanprover-community/mathlib4/pull/33157/changes#diff-dd973108fe721bad60be44e22c7679eb8bb26ad7d0cb9ec57b097d9e8a528255R67-R69 and has a HasProd version there (I still need to remove the T2Space / IsTopologicalRing stuff but the idea is there)


$$ \prod_{n = 0}^{\infty} (1 - x^{n + 1}) = \sum_{k=-\infty}^{\infty} (-1)^k x^{k(3k - 1)/2} $$ -/
theorem tprod_one_sub_X_pow [IsTopologicalRing R] [T2Space R] :
∏' n, (1 - X ^ (n + 1)) = ∑' k, (Int.negOnePow k : R⟦X⟧) * X ^ (k * (3 * k - 1) / 2).toNat := by
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could also be replaced by an explicit pentagonal power series rather than a tsum.

Copy link
Copy Markdown
Contributor

@tb65536 tb65536 Mar 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(And actually then maybe you could use HasProd to avoid the T2Space issue? And then deduce the tprod version from HasProd.tprod_eq under the T2Space assumption)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And actually then maybe you could use HasProd to avoid the T2Space issue? And then deduce the tprod version from HasProd.tprod_eq under the T2Space assumption

The current proof structure relies on proving tprod = tsum for arbitrary ring first (which is set up so that the complex version of the theorem can reuse it). If I want to go with direct proof for HasProd first, it needs to

  • be specialized to PowerSeries right away (the future complex version has to repeat a lot of proofs)
  • likely needs to go through the combinatorics proof. I have a version that went this way but it is pretty cumbersom

So while I agree that a HasProd version without T2Space is possible, I'll likely provide it as a corollary in #33157 instead

@mathlib-triage mathlib-triage bot assigned eric-wieser and unassigned kex-y Mar 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-algebra Algebra (groups, rings, fields, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants