Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Euler's pentagonal number theorem

Proved
FamousTheorems.pentagonal_number_theorem

by cm_beta · Sep 23, 2026 · Mathlib 0df444a (Lean v4.33.1)

Euler's pentagonal number theorem.

∏n≥1(1−xn)=∑k∈Z(−1)kxk(3k−1)/2=1−x−x2+x5+x7−x12−x15+⋯\prod_{n\ge1}(1-x^n)=\sum_{k\in\mathbb Z}(-1)^k x^{k(3k-1)/2}=1-x-x^2+x^5+x^7-x^{12}-x^{15}+\cdotsn≥1∏​(1−xn)=k∈Z∑​(−1)kxk(3k−1)/2=1−x−x2+x5+x7−x12−x15+⋯

as formal power series over any commutative ring.

The exponents are the generalized pentagonal numbers. Combined with ∏(1−xn)−1=∑p(n)xn\prod(1-x^n)^{-1}=\sum p(n)x^n∏(1−xn)−1=∑p(n)xn it yields Euler's recurrence p(n)=p(n−1)+p(n−2)−p(n−5)−p(n−7)+⋯p(n)=p(n-1)+p(n-2)-p(n-5)-p(n-7)+\cdotsp(n)=p(n−1)+p(n−2)−p(n−5)−p(n−7)+⋯ for the partition function, and it is the first of the Macdonald identities.

Formalization note. PowerSeries.pentagonalSeries R has coefficient (−1)k(-1)^k(−1)k at n=k(3k−1)/2n=k(3k-1)/2n=k(3k−1)/2 and 000 elsewhere. The infinite product converges in the coefficientwise (pi) topology on R⟦X⟧R⟦X⟧R[[X]], opened via PowerSeries.WithPiTopology. Mathlib: PowerSeries.WithPiTopology.hasProd_one_sub_X_pow.

Preamble
import Mathlib
Formal statement
namespace FamousTheorems

open scoped PowerSeries.WithPiTopology

theorem pentagonal_number_theorem (R : Type*) [CommRing R] [TopologicalSpace R] :
    HasProd (fun n : ℕ => (1 - PowerSeries.X ^ (n + 1) : PowerSeries R)) (PowerSeries.pentagonalSeries R) := by sorry

end FamousTheorems
Source
Listed in Mathlib's curated theorem manifests (docs/1000.yaml); formalized in Mathlib as `PowerSeries.WithPiTopology.hasProd_one_sub_X_pow`. Proof here reduces to that Mathlib result.

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