Existing in Mathlib · Number Theory
Euler's Totient Theorem
Whenever x and n are coprime natural numbers, x raised to Euler's totient φ(n) is congruent to 1 modulo n.
- Euler totient
- modular congruence
- coprime natural numbers
- units modulo n
- finite groups
- exponentiation
Exact theorem
Exact Mathlib statement
theorem Nat.ModEq.pow_totient {x n : ℕ} (h : Nat.Coprime x n) : x ^ φ n ≡ 1 [MOD n]The theorem at a glance
Euler's totient theorem at a glance
A visual guide to the theorem's hypotheses, structure, and conclusion; the exact statement gives the formal detail.
Euler's totient theorem at a glance

Detailed visual 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.
Statement structure
Statement and scope
Read the exact Mathlib declaration
This map summarizes the statement's structure; the exact Mathlib declaration remains authoritative.
Ten residue positions and a four-state return orbit

Detailed visual description
Exactly ten large medallions form one decagon perimeter at left. Four positions have emerald centers with double outlines, while six have ivory centers with single charcoal outlines. There is no center medallion, spoke, radius, or chord. At right, exactly four emerald double-ring medallions form a separate clockwise cycle with exactly four curved arrows. The pixels present one positive composite-modulus example only; they do not state positivity as a theorem hypothesis, identify a prime modulus, or claim a least order.
Why it matters
A mathematical landmark
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.
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 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.
- 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.
Source and local evidence
Where the theorem comes from
- Existing declaration
Nat.ModEq.pow_totientin mathlib- Relationship
- The checked artifact is the upstream declaration itself
- Local Lean evidence
artifact.library.mathlib.euler-totient-theorem.v001