{
  "artifactId": "artifact.library.mathlib.euler-totient-theorem.v001",
  "candidateOnly": false,
  "category": "Number Theory",
  "claimBoundary": "This page indexes Mathlib's natural-number congruence form of the Fermat–Euler totient theorem: if Nat.Coprime x n, then x ^ φ n ≡ 1 [MOD n]. The selected declaration has no prime-modulus or positivity hypothesis, concludes congruence rather than equality in ℕ, and does not say that φ n is the multiplicative order of x or the least exponent that returns x to 1.",
  "collectionSlug": "landmark-theorems-in-mathlib",
  "exactFormalStatement": "theorem Nat.ModEq.pow_totient {x n : ℕ} (h : Nat.Coprime x n) : x ^ φ n ≡ 1 [MOD n]",
  "family": "Modular arithmetic",
  "id": "library.mathlib.euler-totient-theorem.v001",
  "links": {
    "collection": "/collections/landmark-theorems-in-mathlib/",
    "collectionData": "/data/collections/mathlib-landmarks.json",
    "entry": "/library-theorems/euler-totient-theorem/",
    "entryData": "/data/library-theorems/euler-totient-theorem.json",
    "evidence": "/proofs/artifact.library.mathlib.euler-totient-theorem.v001.html",
    "evidenceData": "/data/proofs/artifact.library.mathlib.euler-totient-theorem.v001.evidence.json",
    "source": "/sources/upstream/euler-totient-theorem/"
  },
  "landmark": {
    "completeFormalType": "theorem Nat.ModEq.pow_totient {x n : ℕ} (h : Nat.Coprime x n) : x ^ φ n ≡ 1 [MOD n]",
    "concepts": [
      "Euler totient",
      "modular congruence",
      "coprime natural numbers",
      "units modulo n",
      "finite groups",
      "exponentiation"
    ],
    "plainLanguage": "Whenever x and n are coprime natural numbers, x raised to Euler's totient φ(n) is congruent to 1 modulo n.",
    "poster": {
      "alt": "An ivory modular-arithmetic poster states the coprimality hypothesis and totient-power congruence above a residue dial labeled 0 through 9 with center 10; the four highlighted unit residues cycle 1 to 3 to 9 to 7 and back to 1, beside a separate cardinality 4.",
      "byteSize": 2721280,
      "caption": "For positive n, coprimality places x in a unit group of cardinality φ(n), while the checked source closes n = 0 separately before returning to natural-number congruence.",
      "description": "The poster leads with Nat.Coprime x n and the exact conclusion x ^ φ n ≡ 1 [MOD n]. A composite-modulus example n = 10 highlights the four invertible residues and the multiplication-by-3 cycle 1 → 3 → 9 → 7 → 1. Four source-faithful route lines pass from coprimality to a ZMod unit, scope the unit-group-cardinality identity to n > 0, apply the finite-group cardinality power law there, and coerce the result back to natural-number congruence; the footer notes the separate n = 0 branch. It explicitly rejects a prime-modulus hypothesis, natural-number equality, and any least-exponent claim.",
      "derivatives": [
        {
          "byteSize": 138316,
          "height": 960,
          "mediaType": "image/webp",
          "publicPath": "/assets/library-theorems/euler-totient-theorem/theorem-poster-v2-640.webp",
          "sha256": "sha256:aa04bf95eaedd28fb0f2d0481d05a5332c521016a8d64926375320cb13006af6",
          "width": 640
        },
        {
          "byteSize": 296540,
          "height": 1536,
          "mediaType": "image/webp",
          "publicPath": "/assets/library-theorems/euler-totient-theorem/theorem-poster-v2-1024.webp",
          "sha256": "sha256:10a3fa45127740b26b3afdf9caa07dcaeb94c9a4597e98265cdf39f1e3a3deb2",
          "width": 1024
        }
      ],
      "generatedAt": "2026-07-27T17:32:22-04:00",
      "height": 1536,
      "mediaType": "image/png",
      "modelRequested": "gpt-image-2",
      "publicPath": "/assets/library-theorems/euler-totient-theorem/theorem-poster-v2.png",
      "sha256": "sha256:3aea9f5b11063a1e221ca88a31b61a2cd878b58c9045fc982f9c350f7cbd8769",
      "title": "Euler's totient theorem at a glance",
      "width": 1024,
      "kind": "theorem_poster",
      "transcript": "NUMBER THEORY · MODULAR ARITHMETIC\nEULER'S TOTIENT THEOREM\nNat.Coprime x n\nx ^ φ(n) ≡ 1 [MOD n]\nCOPRIME RESIDUES RETURN TO 1\nCOMPOSITE MODULUS EXAMPLE\nn = 10 · x = 3 · φ(10) = 4\n0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n4\n= φ(10)\n1\n3\n9\n7\n1 → 3 → 9 → 7 → 1\nHOW THE CHECKED ROUTE MOVES\n1 · Coprimality makes x a unit modulo n\n2 · For n > 0, the unit group has φ(n) elements\n3 · Every unit raised to the group cardinality is 1\n4 · Coerce back to a natural-number congruence\nEXACT SCOPE\nAll natural n under Nat.Coprime; n = 0 closes separately. No primality. Congruence only; φ(n) need not be least."
    },
    "visual": {
      "alt": "An illustrated wheel shows exactly ten residues, 0 through 9, and highlights exactly the four units 1, 3, 7, and 9; beside it, the four-state orbit 1 → 3 → 9 → 7 → 1 returns to the identity.",
      "byteSize": 2771434,
      "caption": "For the representative positive composite modulus 10, exactly the four units 1, 3, 7, and 9 form the unit group, and repeated multiplication by 3 follows 1 → 3 → 9 → 7 → 1.",
      "description": "A representative positive composite-modulus wheel has exactly ten residue positions labeled 0 through 9. Precisely the four unit residues 1, 3, 7, and 9 receive the shared emerald-and-gold treatment; the six nonunits 0, 2, 4, 5, 6, and 8 remain muted. A separate four-node directed orbit follows 1 → 3 → 9 → 7 and closes at the existing identity 1. The schematic illustrates the positive-n cardinality branch only; the exact theorem has no positivity hypothesis, and the source closes n = 0 separately.",
      "derivatives": [
        {
          "byteSize": 39194,
          "height": 427,
          "mediaType": "image/webp",
          "publicPath": "/assets/library-theorems/euler-totient-theorem/theorem-schematic-v3-640.webp",
          "sha256": "sha256:31b04b2fcda732b8e753d61e65f376daf22b4a127de8edf631241b224bcabfee",
          "width": 640
        },
        {
          "byteSize": 124262,
          "height": 800,
          "mediaType": "image/webp",
          "publicPath": "/assets/library-theorems/euler-totient-theorem/theorem-schematic-v3-1200.webp",
          "sha256": "sha256:838005b2a4874dba4b9ea1574f6cadf1910059997ed0220ef66d2181883f6cce",
          "width": 1200
        }
      ],
      "generatedAt": "2026-07-28T09:18:02Z",
      "height": 1024,
      "mediaType": "image/png",
      "modelRequested": "gpt-image-2",
      "publicPath": "/assets/library-theorems/euler-totient-theorem/theorem-schematic-v3.png",
      "sha256": "sha256:01817fb89c128f38de5b96c98c211a0bb42a5e2bb25caf3572482ba06bfda9a3",
      "title": "Unit residues and the totient return",
      "width": 1536
    },
    "walkthrough": null,
    "whyLandmark": "Euler's totient theorem is a foundational bridge between elementary modular arithmetic and finite group structure. Mathlib's compact proof makes that bridge explicit by converting coprimality into a unit of ZMod n, identifying the unit-group cardinality with φ(n), and transporting the resulting unit equality back to a natural-number congruence."
  },
  "nonClaims": [
    "The selected declaration does not assume that n is prime and must not be presented as Fermat's little theorem.",
    "The conclusion is x ^ φ n ≡ 1 [MOD n], not an equality of natural numbers and not the ZMod unit equality used inside the proof.",
    "The theorem does not claim that φ n is the multiplicative order of x or the least positive exponent returning x to 1 modulo n.",
    "The declaration has no positivity hypothesis on n; generated examples with a positive composite modulus are illustrative only.",
    "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.euler-totient-theorem.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": "If x and n are coprime natural numbers, then x raised to Euler's totient φ(n) is congruent to 1 modulo n.",
  "targetId": "target.library.mathlib.euler-totient-theorem.v001",
  "title": "Euler's Totient Theorem",
  "upstreamOrigin": {
    "declarationName": "Nat.ModEq.pow_totient",
    "immutableSourceUrl": "https://github.com/leanprover-community/mathlib4/blob/5e932f97dd25535344f80f9dd8da3aab83df0fe6/Mathlib/FieldTheory/Finite/Basic.lean#L553",
    "packageName": "mathlib",
    "repositoryUrl": "https://github.com/leanprover-community/mathlib4",
    "sourceArtifactHash": "sha256:808bb4eddb8a4b48785e4430f944fe0827c96842dffa0c08cd21b5659bd85d44",
    "sourceByteLength": 36477,
    "sourceCommit": "5e932f97dd25535344f80f9dd8da3aab83df0fe6",
    "sourceFile": "Mathlib/FieldTheory/Finite/Basic.lean",
    "sourceLine": 553,
    "verificationKind": "git_worktree"
  },
  "publicPresentationReview": {
    "status": "reviewed"
  }
}
