Mathlib theorem · Existing formal mathematics

Existing in Mathlib · Algebra

Binomial Theorem

In any commutative semiring, expanding the nth power of x + y gives a finite sum with one term for each m from 0 through n: choose m of the n factors to contribute x, let the others contribute y, and weight the resulting monomial by n.choose m.

Exact theorem

Exact Mathlib statement

theorem add_pow [CommSemiring R] (x y : R) (n : ℕ) : (x + y) ^ n = ∑ m ∈ range (n + 1), x ^ m * y ^ (n - m) * n.choose m

The theorem at a glance

The binomial theorem at a glance

A visual guide to the theorem's hypotheses, structure, and conclusion; the exact statement gives the formal detail.

The n-fold product of x + y becomes a finite sum after choices are grouped by the number m of factors contributing x. Explanatory diagram.
Detailed visual description

The poster foregrounds Mathlib's exact commutative-semiring identity. Its central representative n = 3 construction uses gold sun tokens for x and cobalt ring tokens for y, displays all eight three-position selections, and groups them with multiplicities 1, 3, 3, and 1. The surrounding copy keeps the general range (n + 1), the exponents m and n - m, the coefficient n.choose m, and the finite natural-power boundary explicit.

Statement structure

From hypotheses to conclusion

Statement map for Binomial TheoremA natural power of a sum in a commutative semiring expands as an exact finite binomial-coefficient sum. The pinned upstream declaration is add_pow. The exact checked statement is theorem add_pow [CommSemiring R] (x y : R) (n : ℕ) : (x + y) ^ n = ∑ m ∈ range (n + 1), x ^ m * y ^ (n - m) * n.choose m.Mathematical readingA natural power of a sumin a commutativesemiring expands as anexact finitebinomial-coefficientsum.Pinned declarationmathlib · add_powExact checked formtheorem add_pow[CommSemiring R] (x y :R) (n : ℕ) : (x + y) ^ n= ∑ m ∈ range (n + 1), x^ m * y ^ (n - m) *n.choose mStatement map for Binomial TheoremA natural power of a sum in a commutative semiring expands as an exact finite binomial-coefficient sum. The pinned upstream declaration is add_pow. The exact checked statement is theorem add_pow [CommSemiring R] (x y : R) (n : ℕ) : (x + y) ^ n = ∑ m ∈ range (n + 1), x ^ m * y ^ (n - m) * n.choose m.Mathematical readingA natural power of a sumin a commutativesemiring expands as anexact finitebinomial-coefficientsum.Pinned declarationmathlib · add_powExact checked formtheorem add_pow[CommSemiring R] (x y :R) (n : ℕ) : (x + y) ^ n= ∑ m ∈ range (n + 1), x^ m * y ^ (n - m) *n.choose m

This map summarizes the statement's structure; the exact Mathlib declaration remains authoritative.

Exactly eight three-token outcomes separate into the finite group sizes one, three, three, and one. Explanatory scientific diagram.
Detailed visual description

Three stacked gold-and-cobalt choice gates feed eight hard-ended horizontal bands. The bands contain all three-token color patterns, ordered as one all-cobalt band, three one-gold bands, three two-gold bands, and one all-gold band; lines merge those four groups into four bounded medallions.

Why it matters

A mathematical landmark

The binomial theorem is a foundational bridge between algebraic expansion and combinatorial counting. Mathlib's add_pow states it at the natural generality of a commutative semiring and makes the finite index range, complementary exponents, and binomial coefficient completely explicit.

ProofAtlas record

What has been checked

Upstream indexedPinned source bytes verified locally
Locally reproducedExact upstream declaration replayed
Reviewed pageCurrent public presentation reviewed
Accepted Atlas resultNot recorded for the preferred artifact

Mathlib is the source of the theorem; the local Lean replay and page review are separate.

Claim boundary

No new theorem is claimed

This page indexes Mathlib's commutative-semiring binomial theorem add_pow. For x and y in a commutative semiring and n in ℕ, it gives one finite sum indexed by range (n + 1), with summand x ^ m * y ^ (n - m) * n.choose m. It is not an analytic infinite-series statement, does not extend the exponent beyond natural numbers, and does not claim the formula for arbitrary noncommuting elements.

Source and local evidence

Where the theorem comes from

Existing declaration
add_pow in mathlib
Relationship
The checked artifact is the upstream declaration itself
Local Lean evidence
artifact.library.mathlib.binomial-theorem.v001
Source
Open the pinned upstream reference