{
  "artifactId": "artifact.library.mathlib.fermat-little-theorem.v001",
  "candidateOnly": false,
  "category": "Number theory",
  "claimBoundary": "This target indexes Mathlib's natural-number congruence form: if p is prime and n is coprime to p, then n^(p-1) is congruent to 1 modulo p. It does not state the alternate n^p congruent to n form, primality converses, or a new proof.",
  "collectionSlug": "landmark-theorems-in-mathlib",
  "exactFormalStatement": "theorem Nat.ModEq.pow_card_sub_one_eq_one {p : ℕ} (hp : Nat.Prime p) {n : ℕ} (hpn : n.Coprime p) : n ^ (p - 1) ≡ 1 [MOD p]",
  "family": "Prime congruences",
  "id": "library.mathlib.fermat-little-theorem.v001",
  "links": {
    "collection": "/collections/landmark-theorems-in-mathlib/",
    "collectionData": "/data/collections/mathlib-landmarks.json",
    "entry": "/library-theorems/fermat-little-theorem/",
    "entryData": "/data/library-theorems/fermat-little-theorem.json",
    "evidence": "/proofs/artifact.library.mathlib.fermat-little-theorem.v001.html",
    "evidenceData": "/data/proofs/artifact.library.mathlib.fermat-little-theorem.v001.evidence.json",
    "source": "/sources/upstream/fermat-little-theorem/"
  },
  "landmark": {
    "completeFormalType": "theorem Nat.ModEq.pow_card_sub_one_eq_one {p : ℕ} (hp : Nat.Prime p) {n : ℕ} (hpn : n.Coprime p) : n ^ (p - 1) ≡ 1 [MOD p]",
    "concepts": [
      "Fermat's Little Theorem",
      "prime modulus",
      "modular exponentiation",
      "coprimality"
    ],
    "plainLanguage": "Choose a prime modulus p and a number n not divisible by p. Raising n to the power p−1 returns the unit residue 1 after reduction modulo p.",
    "poster": {
      "alt": "Editorial theorem poster shows the prime and coprime hypotheses, the congruence n to the p-minus-one power modulo p, one power orbit ending at 1, and a four-step guide.",
      "byteSize": 2109265,
      "caption": "The selected Mathlib theorem states the coprime exponent form of Fermat's Little Theorem.",
      "description": "The retained poster presents the exact prime-modulus hypotheses, exponent p−1 conclusion, reading sequence, and boundary excluding the alternate n^p form, converses, and primality tests.",
      "derivatives": [
        {
          "byteSize": 75988,
          "height": 960,
          "mediaType": "image/webp",
          "publicPath": "/assets/library-theorems/fermat-little-theorem/theorem-poster-v3-640.webp",
          "sha256": "sha256:d9b1eda1fcdbc8fc0d46fc3ea0a65323a981ae1a64150be80dfeb2f3700be1ec",
          "width": 640
        },
        {
          "byteSize": 133908,
          "height": 1536,
          "mediaType": "image/webp",
          "publicPath": "/assets/library-theorems/fermat-little-theorem/theorem-poster-v3-1024.webp",
          "sha256": "sha256:8cc441bdd3b12278e95c7c9946a7ef14f24eecbb141e62700487e2f4ff3e090a",
          "width": 1024
        }
      ],
      "generatedAt": "2026-07-22T05:15:00Z",
      "height": 1536,
      "mediaType": "image/png",
      "modelRequested": "gpt-image-2",
      "publicPath": "/assets/library-theorems/fermat-little-theorem/theorem-poster-v3.png",
      "sha256": "sha256:572f9d706cd45b510c1d43e79a1c669beb98c673c4004a3405345721baec2014",
      "title": "Fermat's Little Theorem — exact coprime exponent form",
      "width": 1024,
      "kind": "theorem_poster",
      "transcript": "NUMBER THEORY · PRIME MODULUS\nFERMAT'S LITTLE THEOREM\np is prime\nAND\nn.Coprime p\nn^(p − 1) ≡ 1 [MOD p]\nA coprime residue raised to p − 1 returns 1 modulo p.\nSTART WITH A UNIT MODULO p\nRAISE TO THE EXPONENT p − 1\nRETURN TO THE UNIT RESIDUE\nHOW TO READ IT\n1 · Choose a prime p\n2 · Choose n coprime to p\n3 · Form n^(p − 1)\n4 · Reduce modulo p to get 1\nEXACT SCOPE\nCoprime exponent form only. Not the n^p ≡ n form, a converse, or a primality test."
    },
    "visual": {
      "alt": "A gold modular orbit advances through successive powers of one emerald unit and closes at a distinguished ivory unit residue.",
      "byteSize": 3290705,
      "caption": "For prime p and n coprime to p, the exponent p−1 returns n to residue 1 modulo p.",
      "description": "The theorem begins with a prime modulus and a coprime natural number, then concludes a precise congruence after p−1 repeated multiplications.",
      "derivatives": [
        {
          "byteSize": 53568,
          "height": 427,
          "mediaType": "image/webp",
          "publicPath": "/assets/library-theorems/fermat-little-theorem/theorem-schematic-v1-640.webp",
          "sha256": "sha256:2a91db370dae0a861516d2c90b470562925cd274985ee58cecc658415448dddd",
          "width": 640
        },
        {
          "byteSize": 209280,
          "height": 800,
          "mediaType": "image/webp",
          "publicPath": "/assets/library-theorems/fermat-little-theorem/theorem-schematic-v1-1200.webp",
          "sha256": "sha256:195a88cd6604c39df85c951481c63ce85f64ed9ae03dc01d91cafcb2c2751a14",
          "width": 1200
        }
      ],
      "generatedAt": "2026-07-21T22:44:36Z",
      "height": 1024,
      "mediaType": "image/png",
      "modelRequested": "gpt-image-2",
      "publicPath": "/assets/library-theorems/fermat-little-theorem/theorem-schematic-v1.png",
      "sha256": "sha256:60c3f69fc754bb7a2bc94fa0064413df258f928a0b63627cc81f72eddcc11a73",
      "title": "A unit residue returns to one",
      "width": 1536
    },
    "walkthrough": null,
    "whyLandmark": "Fermat's Little Theorem is a basic structural fact about arithmetic modulo a prime and a starting point for modern primality tests, finite-field calculations, and public-key cryptography."
  },
  "nonClaims": [
    "The selected declaration is the coprime exponent form, not the alternate n^p congruent to n form.",
    "It is not a converse and does not characterize primes.",
    "ProofAtlas is indexing an existing Mathlib theorem, not claiming new mathematics."
  ],
  "publicExportEligible": true,
  "relationship": "upstream_direct",
  "schemaVersion": "library-theorem-entry-data.v1",
  "statementId": "statement.library.mathlib.fermat-little-theorem.v001",
  "statusAxes": {
    "acceptedAtlasResult": "Not recorded for the preferred artifact",
    "locallyReproduced": "Exact upstream declaration replayed",
    "reviewedPage": "2 of 3 presentation reviews recorded",
    "upstreamIndexed": "Pinned source bytes verified locally"
  },
  "summary": "If p is prime and n is coprime to p, then n^(p-1) is congruent to 1 modulo p.",
  "targetId": "target.library.mathlib.fermat-little-theorem.v001",
  "title": "Fermat's Little Theorem",
  "upstreamOrigin": {
    "declarationName": "Nat.ModEq.pow_card_sub_one_eq_one",
    "immutableSourceUrl": "https://github.com/leanprover-community/mathlib4/blob/5e932f97dd25535344f80f9dd8da3aab83df0fe6/Mathlib/FieldTheory/Finite/Basic.lean#L663",
    "packageName": "mathlib",
    "repositoryUrl": "https://github.com/leanprover-community/mathlib4",
    "sourceArtifactHash": "sha256:808bb4eddb8a4b48785e4430f944fe0827c96842dffa0c08cd21b5659bd85d44",
    "sourceByteLength": 36477,
    "sourceCommit": "5e932f97dd25535344f80f9dd8da3aab83df0fe6",
    "sourceFile": "Mathlib/FieldTheory/Finite/Basic.lean",
    "sourceLine": 663,
    "verificationKind": "git_worktree"
  },
  "publicPresentationReview": {
    "status": "reviewed"
  }
}
