{
  "artifactId": "artifact.library.mathlib.pythagorean-triples-classification.v001",
  "candidateOnly": false,
  "category": "Number theory",
  "claimBoundary": "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.",
  "collectionSlug": "landmark-theorems-in-mathlib",
  "exactFormalStatement": "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))",
  "family": "Diophantine equations",
  "id": "library.mathlib.pythagorean-triples-classification.v001",
  "links": {
    "collection": "/collections/landmark-theorems-in-mathlib/",
    "collectionData": "/data/collections/mathlib-landmarks.json",
    "entry": "/library-theorems/pythagorean-triples-classification/",
    "entryData": "/data/library-theorems/pythagorean-triples-classification.json",
    "evidence": "/proofs/artifact.library.mathlib.pythagorean-triples-classification.v001.html",
    "evidenceData": "/data/proofs/artifact.library.mathlib.pythagorean-triples-classification.v001.evidence.json",
    "source": "/sources/upstream/pythagorean-triples-classification/"
  },
  "landmark": {
    "completeFormalType": "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))",
    "concepts": [
      "integer Pythagorean triples",
      "Diophantine equations",
      "Euclidean parameterization",
      "integer scaling",
      "leg symmetry",
      "sign symmetry"
    ],
    "plainLanguage": "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.",
    "poster": {
      "alt": "An ivory editorial poster places the equation x squared plus y squared equals z squared above a symmetric parameter loom: the difference-of-squares and doubled-product leg forms cross into either x-y order, while a gold sum-of-squares form branches to the two possible signs of z.",
      "byteSize": 2507371,
      "caption": "Every integer Pythagorean triple, including scaled and signed cases, has the displayed parameter form—and every displayed parameter choice gives a Pythagorean triple.",
      "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.",
      "derivatives": [
        {
          "byteSize": 119890,
          "height": 960,
          "mediaType": "image/webp",
          "publicPath": "/assets/library-theorems/pythagorean-triples-classification/theorem-poster-v1-640.webp",
          "sha256": "sha256:c4518598efb54be52b6b253a56f9c9949d76445764db9b9930e63ef08a0c1117",
          "width": 640
        },
        {
          "byteSize": 249646,
          "height": 1536,
          "mediaType": "image/webp",
          "publicPath": "/assets/library-theorems/pythagorean-triples-classification/theorem-poster-v1-1024.webp",
          "sha256": "sha256:98b55422a3a5b0c2b0c08b05eabf66c4ef7f3e1773d06c17369854ef0b1c89d8",
          "width": 1024
        }
      ],
      "generatedAt": "2026-07-27T10:52:14-04:00",
      "height": 1536,
      "mediaType": "image/png",
      "modelRequested": "gpt-image-2",
      "publicPath": "/assets/library-theorems/pythagorean-triples-classification/theorem-poster-v1.png",
      "sha256": "sha256:77f11b1861b7f36dec0669e2964d81265ee5b7228a88bee8c1f19c86e8549e10",
      "title": "Classification of Pythagorean triples at a glance",
      "width": 1024,
      "kind": "theorem_poster",
      "transcript": "NUMBER THEORY · DIOPHANTINE EQUATIONS\nCLASSIFICATION OF PYTHAGOREAN TRIPLES\nx² + y² = z²\nIF AND ONLY IF\nFOR SOME k, m, n ∈ ℤ\nLEGS · EITHER ORDER\nx = k(m² − n²), y = k(2mn)\nOR x = k(2mn), y = k(m² − n²)\nTHIRD COORDINATE · EITHER SIGN\nz = k(m² + n²)\nOR z = −k(m² + n²)\nALL INTEGER PYTHAGOREAN TRIPLES\nNo positivity, primitivity, coprimality, or parity hypothesis.\nNo unique or canonical parameters are claimed."
    },
    "visual": {
      "alt": "A dark engraved landscape turns a square-difference tile and a doubled-product weave into two crossing leg ribbons, while a sum-of-squares crown branches into reflected positive and negative z outlets; a common scaling band encircles the construction.",
      "byteSize": 3193948,
      "caption": "The same integer parameters produce the two leg forms in either order and the third coordinate with either sign.",
      "description": "The low-text schematic begins with a Pythagorean square identity and an integer-parameter seal. A cut-square motif for m² − n² and an interwoven double-rectangle motif for 2mn cross through a symmetric interchange so neither is fixed to x or y. Above them, a joined-square motif for m² + n² splits into two reflected z branches. One continuous outer band represents the common integer scale k without suggesting positivity or uniqueness.",
      "derivatives": [
        {
          "byteSize": 65666,
          "height": 427,
          "mediaType": "image/webp",
          "publicPath": "/assets/library-theorems/pythagorean-triples-classification/theorem-schematic-v1-640.webp",
          "sha256": "sha256:df1be37dfc7dc55b90f2f7fc714322b7852454255e19a5b3da8c2bca96ce4ec8",
          "width": 640
        },
        {
          "byteSize": 206718,
          "height": 800,
          "mediaType": "image/webp",
          "publicPath": "/assets/library-theorems/pythagorean-triples-classification/theorem-schematic-v1-1200.webp",
          "sha256": "sha256:2955e3dc2ee240bdb30a3170bf6d4330e3d7d96a179c11835627f1cf566d8a36",
          "width": 1200
        }
      ],
      "generatedAt": "2026-07-27T10:52:14-04:00",
      "height": 1024,
      "mediaType": "image/png",
      "modelRequested": "gpt-image-2",
      "publicPath": "/assets/library-theorems/pythagorean-triples-classification/theorem-schematic-v1.png",
      "sha256": "sha256:156ada66fb455e2f7099f6c358e97b110a49e3b583c236b1c26ef080d2fb8772",
      "title": "Integer parameters, interchangeable legs, and two signs",
      "width": 1536
    },
    "walkthrough": null,
    "whyLandmark": "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."
  },
  "nonClaims": [
    "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."
  ],
  "publicExportEligible": true,
  "relationship": "upstream_direct",
  "schemaVersion": "library-theorem-entry-data.v1",
  "statementId": "statement.library.mathlib.pythagorean-triples-classification.v001",
  "statusAxes": {
    "acceptedAtlasResult": "Not recorded for the preferred artifact",
    "locallyReproduced": "Exact upstream declaration replayed",
    "reviewedPage": "Current public presentation reviewed",
    "upstreamIndexed": "Pinned source bytes verified locally"
  },
  "summary": "All integer solutions of x² + y² = z² are exactly the scaled Euclidean parameter forms, with the legs interchangeable and either sign allowed for z.",
  "targetId": "target.library.mathlib.pythagorean-triples-classification.v001",
  "title": "Classification of Pythagorean Triples",
  "upstreamOrigin": {
    "declarationName": "PythagoreanTriple.classification",
    "immutableSourceUrl": "https://github.com/leanprover-community/mathlib4/blob/5e932f97dd25535344f80f9dd8da3aab83df0fe6/Mathlib/NumberTheory/PythagoreanTriples.lean#L623",
    "packageName": "mathlib",
    "repositoryUrl": "https://github.com/leanprover-community/mathlib4",
    "sourceArtifactHash": "sha256:8d6e5dc06f9c3d869723cd539cf876641bf78c4a994f0f0427e3e925b914719c",
    "sourceByteLength": 25927,
    "sourceCommit": "5e932f97dd25535344f80f9dd8da3aab83df0fe6",
    "sourceFile": "Mathlib/NumberTheory/PythagoreanTriples.lean",
    "sourceLine": 623,
    "verificationKind": "git_worktree"
  },
  "publicPresentationReview": {
    "status": "reviewed"
  }
}
