Existing in Mathlib · Number theory
Classification of Pythagorean Triples
An integer triple satisfies x² + y² = z² exactly when, for some integers k, m, and n, its two leg coordinates are k(m² − n²) and k(2mn) in either order, while z is either k(m² + n²) or its negative.
- integer Pythagorean triples
- Diophantine equations
- Euclidean parameterization
- integer scaling
- leg symmetry
- sign symmetry
Exact theorem
Exact Mathlib statement
theorem PythagoreanTriple.classification {x y z : ℤ} : PythagoreanTriple x y z ↔ ∃ k m n, (x = k * (m ^ 2 - n ^ 2) ∧ y = k * (2 * m * n) ∨ x = k * (2 * m * n) ∧ y = k * (m ^ 2 - n ^ 2)) ∧ (z = k * (m ^ 2 + n ^ 2) ∨ z = -k * (m ^ 2 + n ^ 2))The theorem at a glance
Classification of Pythagorean triples at a glance
A visual guide to the theorem's hypotheses, structure, and conclusion; the exact statement gives the formal detail.
Classification of Pythagorean triples at a glance

Detailed visual description
The poster states the biconditional over integers, gives both possible orders of the two leg coordinates, and gives both possible signs of the third coordinate. A central square-and-ribbon construction keeps the common scale k visible across all three coordinates. The scope footer explicitly excludes positivity, primitivity, coprimality, parity, and uniqueness claims.
Statement structure
From hypotheses to conclusion
This map summarizes the statement's structure; the exact Mathlib declaration remains authoritative.
Interchangeable leg constructions and two reflected outcomes

Detailed visual description
A cobalt cut-square motif and an emerald doubled-rectangle motif occupy the left side. Two wide antique-gold bands cross before meeting the two legs of one central right triangle. A single unornamented charcoal-and-gold band encloses the construction. The hypotenuse feeds a four-square hub at right, which splits into exactly two identical concentric endpoint motifs, one above and one below. No third branch or sign glyph appears.
Why it matters
A mathematical landmark
The classification turns the elementary-looking equation x² + y² = z² into a complete parameterization of every integer solution. Mathlib's endpoint is unusually instructive because it exposes the full generality often suppressed in textbook shorthand: an arbitrary integer scale, either order of the legs, and either sign of z, with no primitive, positivity, parity, coprimality, or uniqueness condition in the final statement.
ProofAtlas record
What has been checked
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 integer if-and-only-if classification of Pythagorean triples. Here PythagoreanTriple x y z is exactly x * x + y * y = z * z. The parameters k, m, and n are integers; the two leg formulas may be swapped, and z may be either k * (m ^ 2 + n ^ 2) or -k * (m ^ 2 + n ^ 2). The endpoint does not require a primitive or positive triple, does not require the parameters to be coprime or of opposite parity, and does not claim unique or canonical parameters. It is not the rational-unit-circle formulation.
- The theorem covers all integer Pythagorean triples, not only positive or primitive triples.
- The endpoint places no coprimality, opposite-parity, positivity, or ordering conditions on k, m, and n.
- The theorem does not assert that the parameters are unique or canonical.
- The theorem is not a rational-unit-circle classification; rational parametrization is an internal proof method.
- ProofAtlas is indexing an existing Mathlib declaration, and generated explanations and visuals are not proof evidence.
Source and local evidence
Where the theorem comes from
- Existing declaration
PythagoreanTriple.classificationin mathlib- Relationship
- The checked artifact is the upstream declaration itself
- Local Lean evidence
artifact.library.mathlib.pythagorean-triples-classification.v001