{
  "artifactId": "artifact.library.mathlib.pell-equation-solvability.v001",
  "candidateOnly": false,
  "category": "Number Theory",
  "claimBoundary": "This page indexes Mathlib's exact solvability equivalence for Pell's equation. With d : ℤ and 0 < d, it states that an integer pair (x, y) with x ^ 2 - d * y ^ 2 = 1 and y ≠ 0 exists if and only if ¬IsSquare d. The positivity hypothesis and the nontriviality condition y ≠ 0 are essential parts of the selected declaration. It does not classify solutions, assert infinitude, identify a fundamental or least solution, supply an algorithm, or cover nonpositive d.",
  "collectionSlug": "landmark-theorems-in-mathlib",
  "exactFormalStatement": "theorem Pell.exists_iff_not_isSquare {d : ℤ} (h₀ : 0 < d) : (∃ x y : ℤ, x ^ 2 - d * y ^ 2 = 1 ∧ y ≠ 0) ↔ ¬IsSquare d",
  "family": "Diophantine equations",
  "id": "library.mathlib.pell-equation-solvability.v001",
  "links": {
    "collection": "/collections/landmark-theorems-in-mathlib/",
    "collectionData": "/data/collections/mathlib-landmarks.json",
    "entry": "/library-theorems/pell-equation-solvability/",
    "entryData": "/data/library-theorems/pell-equation-solvability.json",
    "evidence": "/proofs/artifact.library.mathlib.pell-equation-solvability.v001.html",
    "evidenceData": "/data/proofs/artifact.library.mathlib.pell-equation-solvability.v001.evidence.json",
    "source": "/sources/upstream/pell-equation-solvability/"
  },
  "landmark": {
    "completeFormalType": "theorem Pell.exists_iff_not_isSquare {d : ℤ} (h₀ : 0 < d) : (∃ x y : ℤ, x ^ 2 - d * y ^ 2 = 1 ∧ y ≠ 0) ↔ ¬IsSquare d",
    "concepts": [
      "Pell equation",
      "Diophantine equations",
      "integer squares",
      "irrational square roots",
      "Diophantine approximation",
      "modular pigeonhole argument"
    ],
    "plainLanguage": "For a positive integer d, the Pell equation has an integer solution with y nonzero exactly when d is not a square.",
    "poster": {
      "alt": "An ivory number-theory poster places the positive integer parameter d above the exact Pell equation equivalence, then traces irrational square-root approximation, repetition of a bounded Pell-form value, a modular collision, and the square-case factorization obstruction.",
      "byteSize": 3061087,
      "caption": "For 0 < d, a nontrivial integer solution of x² − d y² = 1 exists exactly when d is not a square.",
      "description": "The poster states the exact iff for d : ℤ under 0 < d. Its checked-route section moves from irrationality of √d through rational approximation, a repeated nonzero value m and congruent numerator-denominator pairs, to a nontrivial Pell solution; the reverse direction factors the equation when d = a². The exact-scope footer excludes classification, infinitude, and minimal-solution claims.",
      "derivatives": [
        {
          "byteSize": 128040,
          "height": 960,
          "mediaType": "image/webp",
          "publicPath": "/assets/library-theorems/pell-equation-solvability/theorem-poster-v2-640.webp",
          "sha256": "sha256:3b56437f460a493ee7ce625a9fdafe47cb9eb32584e06f1f596bff0ba6263abd",
          "width": 640
        },
        {
          "byteSize": 265758,
          "height": 1536,
          "mediaType": "image/webp",
          "publicPath": "/assets/library-theorems/pell-equation-solvability/theorem-poster-v2-1024.webp",
          "sha256": "sha256:a18b973f5a8ed68944f6f6726b3bf9d913af0aeb9d6b1cc9af339463e745ba09",
          "width": 1024
        }
      ],
      "generatedAt": "2026-07-27T22:36:55-04:00",
      "height": 1536,
      "mediaType": "image/png",
      "modelRequested": null,
      "publicPath": "/assets/library-theorems/pell-equation-solvability/theorem-poster-v2.png",
      "sha256": "sha256:a0b23fa927d230674afedfe133be576fa2fb76ee165dff023d9ff62b74e51444",
      "title": "Pell equation solvability at a glance",
      "width": 1024,
      "kind": "theorem_poster",
      "transcript": "NUMBER THEORY · DIOPHANTINE EQUATIONS\nPELL EQUATION SOLVABILITY\nd ∈ ℤ · 0 < d\n∃ x y ∈ ℤ, x² − d y² = 1 AND y ≠ 0\nIF AND ONLY IF d IS NOT A SQUARE\nTHE CHECKED ROUTE\n1 · A nonsquare d makes √d irrational\n2 · Rational approximations repeat one nonzero Pell value m\n3 · A modular collision produces a nontrivial solution\n4 · If d = a², factorization rules one out\nEXACT SCOPE\nOne existence equivalence. No classification, infinitude, or minimal solution."
    },
    "visual": {
      "alt": "A dark engraved integer lattice carries the two branches of a Pell hyperbola. Four symmetry-related green off-axis lattice points sit on the nonsquare side, while a square-parameter inset factors into crossing diagonals and retains only the two y = 0 points; opposing gold arcs bind the two directions of the equivalence.",
      "byteSize": 2444242,
      "caption": "The nonsquare condition and the existence of an off-axis integer point on x² − d y² = 1 are the two directions of the exact positive-d equivalence.",
      "description": "The landscape separates the theorem's two logical directions without turning them into a classification. The main integer lattice highlights a symmetry-related set of nontrivial points with y ≠ 0 on a Pell hyperbola under 0 < d and ¬IsSquare d. A contrasting square-case factorization inset shows why d = a² leaves no off-axis integer solution. Opposing gold arcs connect the condition and existence motifs.",
      "derivatives": [
        {
          "byteSize": 46042,
          "height": 427,
          "mediaType": "image/webp",
          "publicPath": "/assets/library-theorems/pell-equation-solvability/theorem-schematic-v2-640.webp",
          "sha256": "sha256:5194dcc59502de3313f4e66e53766df24bbd2667862fbb20e368b896fd5f66d3",
          "width": 640
        },
        {
          "byteSize": 122126,
          "height": 800,
          "mediaType": "image/webp",
          "publicPath": "/assets/library-theorems/pell-equation-solvability/theorem-schematic-v2-1200.webp",
          "sha256": "sha256:5fd33068ef621734044f3a71182768e95a5e4e1dde42cbc710d221f7ba8086e0",
          "width": 1200
        }
      ],
      "generatedAt": "2026-07-27T22:11:52-04:00",
      "height": 1024,
      "mediaType": "image/png",
      "modelRequested": "gpt-image-2",
      "publicPath": "/assets/library-theorems/pell-equation-solvability/theorem-schematic-v2.png",
      "sha256": "sha256:92cb61c652ffbb57aa39bd8c7745c7b641ea858d7efb12b6926610a9767a535f",
      "title": "A nontrivial lattice point exactly for nonsquare d",
      "width": 1536
    },
    "walkthrough": null,
    "whyLandmark": "Pell's equation is a central Diophantine equation, and this declaration captures its basic solvability boundary as an exact equivalence. Mathlib's source is especially instructive because it constructs the nonsquare direction from irrational approximation and a finite congruence collision, then proves the converse by factorization when d is a square."
  },
  "nonClaims": [
    "The theorem assumes 0 < d; it is not a statement for every integer d.",
    "The conclusion is the existence of at least one integer solution with y ≠ 0, not a classification or enumeration of all solutions.",
    "The declaration does not prove infinitude of the solution set or identify a fundamental, unique, canonical, or minimal solution.",
    "The checked proof uses irrational approximation and a finite congruence collision; Mathlib's source explicitly leaves a connection to continued fractions as future work.",
    "ProofAtlas is indexing an existing Mathlib theorem, and generated explanations and visuals are not proof evidence."
  ],
  "publicExportEligible": true,
  "relationship": "upstream_direct",
  "schemaVersion": "library-theorem-entry-data.v1",
  "statementId": "statement.library.mathlib.pell-equation-solvability.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": "For positive d, the Pell equation has a nontrivial integer solution if and only if d is not a square.",
  "targetId": "target.library.mathlib.pell-equation-solvability.v001",
  "title": "Pell Equation Solvability",
  "upstreamOrigin": {
    "declarationName": "Pell.exists_iff_not_isSquare",
    "immutableSourceUrl": "https://github.com/leanprover-community/mathlib4/blob/5e932f97dd25535344f80f9dd8da3aab83df0fe6/Mathlib/NumberTheory/Pell.lean#L388",
    "packageName": "mathlib",
    "repositoryUrl": "https://github.com/leanprover-community/mathlib4",
    "sourceArtifactHash": "sha256:ac09716ec72e9d69cc505b7505473a1734408c36178f361155543952aafe86cb",
    "sourceByteLength": 29404,
    "sourceCommit": "5e932f97dd25535344f80f9dd8da3aab83df0fe6",
    "sourceFile": "Mathlib/NumberTheory/Pell.lean",
    "sourceLine": 388,
    "verificationKind": "git_worktree"
  },
  "publicPresentationReview": {
    "status": "reviewed"
  }
}
