Repository navigation
Add PentagonalNumberTheoremAnalytic: Euler's pentagonal number theorem by two independent proofs #446
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Vilin97
merged 36 commits into
LeanPool:main
from
JonCYeh:conrad/pentagonal-number-theorem
Sep 21, 2026
Merged
Add PentagonalNumberTheoremAnalytic: Euler's pentagonal number theorem by two independent proofs #446
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
38582aa
Add PentagonalNumberTheoremAnalytic
JonCYeh 88d9a56
Address review: correct two overclaims, narrow imports, fix stale docs
JonCYeh 393a157
Address remaining review findings: dead helper, namespace containment
JonCYeh b7ff3fb
Satisfy the pool-wide naming linter
JonCYeh 165d8c7
Merge remote-tracking branch 'origin/main' into pr-446
github-actions[bot] c336c0f
Address maintainer review: module names, JTP assembly, doc claim
JonCYeh 576ab60
Merge branch 'conrad/pentagonal-number-theorem' of https://github.com…
932556e
Reflow the formal Jacobi scope sentence in the project card
2545129
Merge remote-tracking branch 'origin/main' into conrad/pentagonal-num…
8195b46
Fix entry metadata: qualify Franklin names, add generated project card
c3eb0af
Merge remote-tracking branch 'origin/main' into pr-446
github-actions[bot] 9732c45
Merge remote-tracking branch 'origin/main' into pr-446
github-actions[bot] c630747
Merge remote-tracking branch 'origin/main' into pr-446
github-actions[bot] 07807e3
Merge remote-tracking branch 'origin/main' into pr-446
github-actions[bot] ac4e3c5
Merge remote-tracking branch 'origin/main' into pr-446
github-actions[bot] bf84460
Merge remote-tracking branch 'origin/main' into pr-446
github-actions[bot] 7b1cba1
Merge remote-tracking branch 'origin/main' into pr-446
github-actions[bot] 1c30173
Merge remote-tracking branch 'origin/main' into pr-446
github-actions[bot] f8837dc
Merge remote-tracking branch 'origin/main' into pr-446
github-actions[bot] 0412d84
Merge remote-tracking branch 'origin/main' into pr-446
github-actions[bot] 9ebe12b
Merge remote-tracking branch 'origin/main' into pr-446
github-actions[bot] a7baa0f
Merge remote-tracking branch 'origin/main' into pr-446
github-actions[bot] 4f646c0
Merge remote-tracking branch 'origin/main' into pr-446
github-actions[bot] b66e62a
Merge remote-tracking branch 'origin/main' into pr-446
github-actions[bot] 59dcaab
Merge remote-tracking branch 'origin/main' into pr-446
github-actions[bot] 14599b8
Repair the build against Mathlib v4.34.0
b367954
Merge remote-tracking branch 'origin/main' into pr-446
github-actions[bot] 9dbde1d
Merge remote-tracking branch 'origin/main' into pr-446
github-actions[bot] 0ab4a5e
Merge remote-tracking branch 'origin/main' into pr-446
github-actions[bot] befcbe5
Merge remote-tracking branch 'origin/main' into pr-446
github-actions[bot] 19e9796
Merge remote-tracking branch 'origin/main' into pr-446
github-actions[bot] 8b56d70
Merge remote-tracking branch 'origin/main' into pr-446
github-actions[bot] e5fbd7f
Merge remote-tracking branch 'origin/main' into pr-446
github-actions[bot] 97a2cb9
Merge branch 'main' into conrad/pentagonal-number-theorem
JonCYeh 644e0ef
Merge remote-tracking branch 'origin/main' into pr-446
github-actions[bot] 5b846a0
Merge remote-tracking branch 'origin/main' into pr-446
github-actions[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| /- | ||
| Copyright (c) 2026 Jonathan Conrad, Paula Muermann, Maryna Viazovska. All rights reserved. | ||
| Released under Apache 2.0 license as described in the file LICENSE. | ||
| Authors: Jonathan Conrad, Paula Muermann, Maryna Viazovska | ||
| -/ | ||
|
|
||
| import LeanPool.PentagonalNumberTheoremAnalytic.Franklin | ||
| import LeanPool.PentagonalNumberTheoremAnalytic.QSeries | ||
|
|
||
| /-! | ||
| # Euler's pentagonal number theorem, two independent proofs, and the Jacobi triple product | ||
|
|
||
| Source: url:https://viazovska.github.io/PentagonalNumberTheorem | ||
| Authors: Jonathan Conrad, Paula Muermann, Maryna Viazovska | ||
| Status: verified | ||
| Main declarations: `PentagonalNumberTheorem.Franklin.euler_pentagonal_number_theorem_packaged` | ||
| Tags: number-theory, partitions, q-series, pentagonal-number-theorem, jacobi-triple-product | ||
| MSC: 11P81, 11P84, 05A17, 05A19, 33D15 | ||
| -/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| /- | ||
| Copyright (c) 2026 Jonathan Conrad, Paula Muermann, Maryna Viazovska. All rights reserved. | ||
| Released under Apache 2.0 license as described in the file LICENSE. | ||
| Authors: Jonathan Conrad, Paula Muermann, Maryna Viazovska | ||
| -/ | ||
|
|
||
| import LeanPool.PentagonalNumberTheoremAnalytic.Franklin.Defs | ||
| import LeanPool.PentagonalNumberTheoremAnalytic.Franklin.FormalPowerSeries | ||
| import LeanPool.PentagonalNumberTheoremAnalytic.Franklin.Helpers | ||
| import LeanPool.PentagonalNumberTheoremAnalytic.Franklin.Lemmas |
126 changes: 126 additions & 0 deletions
126
LeanPool/PentagonalNumberTheoremAnalytic/Franklin/Defs.lean
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,126 @@ | ||
| /- | ||
| Copyright (c) 2026 Jonathan Conrad, Paula Muermann, Maryna Viazovska. All rights reserved. | ||
| Released under Apache 2.0 license as described in the file LICENSE. | ||
| Authors: Jonathan Conrad, Paula Muermann, Maryna Viazovska | ||
| -/ | ||
| import Mathlib.Algebra.BigOperators.Group.Finset.Basic | ||
| import Mathlib.Algebra.BigOperators.Ring.Finset | ||
| import Mathlib.Algebra.Order.BigOperators.Group.Finset | ||
| import Mathlib.Combinatorics.Enumerative.Partition.GenFun | ||
| import Mathlib.Data.Finset.Powerset | ||
| import Mathlib.Data.Nat.Choose.Basic | ||
| import Mathlib.Order.Interval.Finset.Nat | ||
| import Mathlib.RingTheory.PowerSeries.Basic | ||
| import Mathlib.RingTheory.PowerSeries.PiTopology | ||
| import Mathlib.Tactic.Linarith | ||
| import Mathlib.Tactic.Ring | ||
| import Mathlib.Tactic.FieldSimp | ||
| import Mathlib.Tactic.Positivity | ||
|
|
||
| /-! | ||
| # Pentagonal Number Theorem — Definitions | ||
|
|
||
| Core definitions for the formalization of the Euler Pentagonal Number Theorem | ||
| via Franklin's involution. | ||
|
|
||
| ## Main definitions | ||
|
|
||
| * `consecutiveTopRun`: length of the maximal consecutive run ending at `m` in `S` | ||
| * `distinctPartitions`: partitions of `n` into distinct positive parts | ||
| * `distinctPartitionsEven`, `distinctPartitionsOdd`: partitions with an even (resp. odd) | ||
| number of parts | ||
| * `pe`, `po`: cardinalities of `distinctPartitionsEven n`, `distinctPartitionsOdd n` | ||
| * `partBase`, `partMax`, `partSlope`, `partSlopeSet`: structural invariants of a partition | ||
| * `distinctPartitionsAlpha`, `distinctPartitionsBeta`, `distinctPartitionsSpecial`: | ||
| three-way decomposition of `distinctPartitions n` by Franklin's involution | ||
| * `smkSet`, `spkSet`: the special pentagonal partitions `S_{−k}` and `S_k` | ||
| * `alphaOp`, `betaOp`: Franklin's involution maps on `distinctPartitionsAlpha` and | ||
| `distinctPartitionsBeta` | ||
| -/ | ||
| open Finset | ||
|
|
||
| namespace PentagonalNumberTheorem.Franklin | ||
|
|
||
| /-- The length of the maximal consecutive run of elements of `S` ending at `m`, counted downward. -/ | ||
| def consecutiveTopRun (S : Finset ℕ) : ℕ → ℕ | ||
| | 0 => if (0 : ℕ) ∈ S then 1 else 0 | ||
| | m + 1 => if m + 1 ∈ S then 1 + consecutiveTopRun S m else 0 | ||
|
|
||
| /-- The set of subsets `S ⊆ {1, …, n}` with `∑_{s ∈ S} s = n`, i.e., partitions of `n` into | ||
| distinct positive parts. -/ | ||
| def distinctPartitions (n : ℕ) : Finset (Finset ℕ) := | ||
| (Icc 1 n).powerset.filter (fun S ↦ S.sum id = n) | ||
|
|
||
| /-- Partitions of `n` into distinct positive parts with an even number of parts. -/ | ||
| def distinctPartitionsEven (n : ℕ) : Finset (Finset ℕ) := | ||
| (distinctPartitions n).filter (fun S ↦ S.card % 2 = 0) | ||
|
|
||
| /-- Partitions of `n` into distinct positive parts with an odd number of parts. -/ | ||
| def distinctPartitionsOdd (n : ℕ) : Finset (Finset ℕ) := | ||
| (distinctPartitions n).filter (fun S ↦ S.card % 2 = 1) | ||
|
|
||
| /-- Number of partitions of `n` into an even number of distinct positive parts. -/ | ||
| def pe (n : ℕ) : ℕ := (distinctPartitionsEven n).card | ||
|
|
||
| /-- Number of partitions of `n` into an odd number of distinct positive parts. -/ | ||
| def po (n : ℕ) : ℕ := (distinctPartitionsOdd n).card | ||
|
|
||
| /-- The smallest element of a partition, returning 0 for the empty set. -/ | ||
| def partBase (S : Finset ℕ) : ℕ := | ||
| if h : S.Nonempty then S.min' h else 0 | ||
|
|
||
| /-- The largest element of a partition, returning 0 for the empty set. -/ | ||
| def partMax (S : Finset ℕ) : ℕ := | ||
| if h : S.Nonempty then S.max' h else 0 | ||
|
|
||
| /-- The length of the maximal consecutive run from `max(S)` downward in `S`. -/ | ||
| def partSlope (S : Finset ℕ) : ℕ := consecutiveTopRun S (partMax S) | ||
|
|
||
| /-- The interval `{max(S) − slope(S) + 1, …, max(S)}` (the "slope set" of `S`). -/ | ||
| def partSlopeSet (S : Finset ℕ) : Finset ℕ := | ||
| Icc (partMax S - partSlope S + 1) (partMax S) | ||
|
|
||
| /-- Partitions `S ∈ distinctPartitions n` that are nonempty and satisfy | ||
| `(b ≤ s ∧ b ∉ D) ∨ b + 1 ≤ s`, with `b = partBase S`, `s = partSlope S`. -/ | ||
| def distinctPartitionsAlpha (n : ℕ) : Finset (Finset ℕ) := | ||
| (distinctPartitions n).filter (fun S ↦ | ||
| 0 < S.card ∧ | ||
| ((partBase S ≤ partSlope S ∧ ¬(partMax S - partSlope S + 1 ≤ partBase S)) ∨ | ||
| partBase S + 1 ≤ partSlope S)) | ||
|
|
||
| /-- Partitions `S ∈ distinctPartitions n` that are nonempty and satisfy | ||
| `(s < b ∧ b ∉ D) ∨ s + 2 ≤ b`, with `b = partBase S`, `s = partSlope S`. -/ | ||
| def distinctPartitionsBeta (n : ℕ) : Finset (Finset ℕ) := | ||
| (distinctPartitions n).filter (fun S ↦ | ||
| 0 < S.card ∧ | ||
| ((partSlope S < partBase S ∧ ¬(partMax S - partSlope S + 1 ≤ partBase S)) ∨ | ||
| partSlope S + 2 ≤ partBase S)) | ||
|
|
||
| /-- Partitions of `n` into distinct parts that are either empty or satisfy | ||
| `base(S) ∈ slopeSet(S)` with `base(S) = slope(S)` or `base(S) = slope(S) + 1`. -/ | ||
| def distinctPartitionsSpecial (n : ℕ) : Finset (Finset ℕ) := | ||
| (distinctPartitions n).filter (fun S ↦ | ||
| S.card = 0 ∨ | ||
| (0 < S.card ∧ | ||
| partMax S - partSlope S + 1 ≤ partBase S ∧ | ||
| (partBase S = partSlope S ∨ partBase S = partSlope S + 1))) | ||
|
|
||
| /-- The pentagonal partition `S_{−k} = {k, k+1, …, 2k−1}` of `(3k²−k)/2`. -/ | ||
| def smkSet (k : ℕ) : Finset ℕ := Icc k (2 * k - 1) | ||
|
|
||
| /-- The pentagonal partition `S_k = {k+1, k+2, …, 2k}` of `(3k²+k)/2`. -/ | ||
| def spkSet (k : ℕ) : Finset ℕ := Icc (k + 1) (2 * k) | ||
|
|
||
| /-- For `S ∈ 𝒫_α(n)` with base `b` and max `m`, `α(S) = (S \ {b, m−b+1}) ∪ {m+1}`. -/ | ||
| def alphaOp (S : Finset ℕ) : Finset ℕ := | ||
| let b := partBase S | ||
| let m := partMax S | ||
| insert (m + 1) ((S.erase b).erase (m - b + 1)) | ||
|
|
||
| /-- For `S ∈ 𝒫_β(n)` with slope `s` and max `m`, `β(S) = (S ∪ {s, m−s}) \ {m}`. -/ | ||
| def betaOp (S : Finset ℕ) : Finset ℕ := | ||
| let s := partSlope S | ||
| let m := partMax S | ||
| (insert s (insert (m - s) S)).erase m | ||
|
|
||
| end PentagonalNumberTheorem.Franklin | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.