How large would a unique totient preimage have to be?
Result page Proof blueprint → Paper PDF Verification archive Palomar Registry GitHub
Carmichael guessed that every Euler totient value is shared by at least two numbers. Lean proves unconditionally that a lone solution exceeds 10¹⁰¹¹⁹, its totient exceeds 10¹⁰¹¹⁸, and any totient whose preimages are all multiples of 10 is at least 10⁶⁰.
Every whole number x ≥ 1 with no other y having φ(y) = φ(x) satisfies x > 10¹⁰¹¹⁹ and φ(x) > 10¹⁰¹¹⁸, with liminf V₁(X)/V(X) < 10⁻⁵⁰⁵⁹ over whole numbers X; and every totient value m whose positive preimages are all multiples of 10 satisfies m ≥ 10⁶⁰ (certified across all 8,243 roots in Lean).
Euler's totient φ(x) counts the numbers from 1 to x coprime to x, and values are commonly shared: φ(36) = φ(42) = 12. Carmichael conjectured in 1922 that no value has a unique preimage, and Ford proved in 1998 that any counterexample exceeds 10¹⁰,⁰⁰³,⁷⁰⁰,⁰⁰⁰. Inside Lean, two Lucas prime ladders prove x > 10¹⁰¹¹⁹ and φ(x) > 10¹⁰¹¹⁸, a compressed 8,243-root descent forest proves m ≥ 10⁶⁰ for multiples-of-10 totients, and formal soundness, reciprocal-sum, and bit-transfer theorems connect the external 1.965-billion-prime certificate to x, m > 10¹⁰⁰,⁰⁰⁰,¹⁶⁰,⁹⁹⁴.
Re-proved switching rules drive prime ladders and billion-prime lower bounds
Walkthrough: 8 of 10 main results in Lean (Corollary 2's lower limit is stated over whole numbers X); 2 combine Lean with external computations
Both classical foundations below are re-proved inside Lean here rather than assumed from outside the proof.
Published inputs
- Carmichael (1922) & Klee (1947) (Re-proved in Lean): Divisibility rules forcing prime-square factors of any lone totient solution.
- Brillhart–Lehmer–Selfridge (1975) & Ford (1998) (Re-proved in Lean): Prime-chain primality certificates and switching rules for forced prime ladders.
What this paper adds
- Prime ladders & density bounds: Two Lucas prime ladders (81 and 80 primes); Rarity of lone totient values
- 100-billion-digit certificates: Lean transfer theorem + 1.965 billion primes
- Multiples-of-10 solutions (to 10⁶⁰ in Lean): Every preimage divisible by 10
Counterexamples exceed 10¹⁰¹¹⁹ in Lean (10¹⁰⁰,⁰⁰⁰,¹⁶⁰,⁹⁹⁴ with certs); k = 10 ≥ 10⁶⁰ in Lean
Every Carmichael counterexample exceeds 10¹⁰¹¹⁹ (with φ(x) > 10¹⁰¹¹⁸) and every multiples-of-10 totient witness is at least 10⁶⁰ unconditionally in Lean, while the 1.965-billion-prime external check lifts x and φ(x) past 100 billion digits.
8 of 10 main results proved unconditionally in Lean (including Corollary 2 over whole-number X and Theorem 10, m ≥ 10⁶⁰); 2 (Theorem 3 and Corollary 4) combine Lean's soundness, reciprocal-sum, and bit-transfer theorems with the external 1.965-billion-prime Lucas computation.
Listed as open in the paper
- Whether any counterexample to Carmichael’s totient conjecture exists at all remains open.
- Whether any totient value has all its preimages divisible by 10 remains open above 10⁶⁰.
Adjacent prior work (not used as inputs)
- Carmichael (1907)
- Masai & Valette (1982); Schlafly & Wagon (1994)
- Erdős (1958); Pomerance (1974); Ford (2014)
Why a counterexample is a multiple of 4, 9 and 49
Call x ≥ 1 a counterexample if no other number y has φ(y) = φ(x). Since φ(36) = φ(42) = 12, neither 36 nor 42 is one.
If x is odd, then φ(2x) = φ(x), for example φ(9) = φ(18) = 6. If x is twice an odd number, then φ(x/2) = φ(x), for example φ(7) = φ(14) = 6. Either way x has a partner, so a counterexample is a multiple of 4.
Now suppose 4 divides x. If 3 does not divide x, then φ(3x/2) = φ(x), for example φ(6) = φ(4) = 2. If 3 divides x only once, write x = 3z; then φ(2z) = φ(x), for example φ(8) = φ(12) = 4. So a counterexample is a multiple of 9.
Next, 7 − 1 = 6 = 2·3, and 2 and 3 both divide x more than once. If 7 does not divide x, swap a factor 6 for 7: from 36 this gives 42. If 7 divides x only once, swap that 7 for a 6. Either swap keeps φ the same, so 49 divides x too.
Lean checks these steps. The same swaps force 43², since 1 + 2·3·7 = 43. Splitting into two cases by the power of 3, Lean then builds 81 primes in one case and 80 in the other whose squares must divide x, which gives more than 10,119 digits in both cases.
The interactive page explains each key step in full.
Counterexamples and the switching rule
A counterexample is a number x ≥ 1 that no other number y matches with φ(y) = φ(x). Lean proves that a counterexample is a multiple of 4, and proves Ford's switching rule: if d divides x with no common factor with x/d, every prime factor of φ(d) divides x, e divides x/d divided by the product of its different prime factors, and P = 1 + e·φ(d) is prime, then P² divides x. Otherwise a swap would give a second number with the same totient. Lean holds some of these pieces twice, and this is why. Lean states the theorems in a separate statement file, with its own copy of the definitions, so that what is claimed can be checked without reading any proof; the library proves them. Where a piece is in both files, the library's copy is marked as the library's.
Ford's switching rule
Let x be a counterexample and d a divisor of x with no common factor with x/d. If rad(φ(d)) divides x, e divides (x/d)/rad(x/d), and P = 1 + e·φ(d) is prime, then P² divides x.
theorem CarmichaelChallenge.ford_lemma_7_2 {x : ℕ} {d : ℕ} {e : ℕ} (hx : IsCarmichaelCounterexample x) (hd : d ∣ x) (hcop : d.Coprime (x / d)) (hrad : rad d.totient ∣ x) (he : e ∣ x / d / rad (x / d)) (hP : Nat.Prime (1 + e * d.totient)) : (1 + e * d.totient) ^ 2 ∣ x- Every counterexample is a multiple of 4
- Under the switching rule's conditions, P divides x
- If P divides x and so do the primes of P − 1, then P² divides x
Forced prime squares in two cases
Applying the switching rule with d = 1 forces 3², 7² and 43² to divide every counterexample, and the chain stops because 1 + 2·3·7·43 = 1807 = 13·139 is not prime. Lean then splits on the power of 3: either 9 divides x but 27 does not (Case I, which forces 13²), or 27 divides x (Case II, which forces 19²). In each case, if the squares of some primes K at least 5 divide x, then the square of 6·∏K + 1 divides x whenever it is prime, and so does the square of 12·∏K + 1 in Case I or 18·∏K + 1 in Case II.
- Every counterexample is in Case I or Case II
- Every counterexample is a multiple of 9
- Every counterexample is a multiple of 49
- Every counterexample is a multiple of 43²
- The chain with d = 1 stops at 43
- The rule 6k + 1
- The rule 12k + 1 in Case I
- The rule 18k + 1 in Case II
- The square of a forced prime of Case I divides every Case I counterexample
- The square of a forced prime of Case II divides every Case II counterexample
- 36 times the forced squares divides a counterexample
- In Case II, 108 times the forced squares divides a counterexample
From forced squares to a digit count
A certificate lists groups of forced primes for each case, a lower bound on the number of binary digits of each group's squared product, and a fraction u/v with 10ᵘ < 2ᵛ. Lean proves that any such pair of certificates gives 10ᵈ ≤ x for every counterexample, and 10ᵈ < x when d ≥ 1, where d is the smaller of the two digit counts. As a worked case, Lean rebuilds Carmichael's 1922 chains of 7 primes in each case, checks their primality, and gets 10³⁷ < x.
- A two-case certificate bounds every counterexample, strictly
- A two-case certificate bounds every counterexample
- A Case I certificate bounds every Case I counterexample
- A Case II certificate bounds every Case II counterexample
- Counting binary digits gives decimal digits, strictly
- Counting binary digits gives decimal digits
- The Lucas test for primality
- Every counterexample is larger than 10³⁷
Two ladders of 81 and 80 primes
Lean checks two Lucas primality ladders totaling 161 prime entries (81 primes in Case I giving x, φ(x) > 10¹⁰²⁴⁰, and 80 primes in Case II giving x > 10¹⁰¹¹⁹ and φ(x) > 10¹⁰¹¹⁸), using 10⁵⁹ < 2¹⁹⁶ to sharpen the unconditional kernel bound to x > 10¹⁰¹¹⁹.
Every Carmichael counterexample exceeds 10¹⁰¹¹⁹
Combines the 81-prime Case I ladder and 80-prime Case II ladder with 10⁵⁹ < 2¹⁹⁶ to prove x > 10¹⁰¹¹⁹ unconditionally in Lean.
theorem CarmichaelChallenge.carmichael_counterexample_gt_10_pow_10119 {x : ℕ} (hx : IsCarmichaelCounterexample x) : 10 ^ 10119 < x- Every counterexample is larger than 10¹⁰¹¹⁷
- In Case I every counterexample is larger than 10¹⁰²⁴⁰
- In Case II every counterexample is larger than 10¹⁰¹¹⁷
- The Case I ladder check passes with 10,240 digits
- The Case II ladder check passes with 10,117 digits
- A passed Case I ladder check gives a Case I certificate
- A passed Case II ladder check gives a Case II certificate
- A passed Case I ladder gives forced primes without repeats
- A passed Case II ladder gives forced primes without repeats
- A passed ladder step gives a prime
Values taken only once are rare
Edition 5 formalizes the Section 3 reciprocal-sum decomposition inside Lean (ReciprocalSum and Seeds100B), closing the earlier written-estimate gap. From the 161-prime ladders Lean proves φ(x) > 10¹⁰¹¹⁸ and liminf V₁(X)/V(X) < 10⁻⁵⁰⁵⁹ over whole numbers X, and proves the bit-transfer bridge for the 100-billion-digit seed batches.
Conditional transfer to 10¹⁰⁰,⁰⁰⁰,¹⁶⁰,⁹⁹⁴ and 10⁻⁵⁰,⁰⁰⁰,⁰⁸⁰,⁴⁹⁷
If finite sets of forced primes satisfy the bit-count, cover, and reciprocal-sum hypotheses supplied by the external seed-batch run, then x > 10¹⁰⁰,⁰⁰⁰,¹⁶⁰,⁹⁹⁴, φ(x) > 10¹⁰⁰,⁰⁰⁰,¹⁶⁰,⁹⁹⁴, and liminf V₁(X)/V(X) < 10⁻⁵⁰,⁰⁰⁰,⁰⁸⁰,⁴⁹⁷ over whole numbers X.
theorem CarmichaelChallenge.hundred_billion_value_and_density_from_seed_batches {S₁ : Finset ℕ} {T₁ : Finset ℕ} {B₁ : Finset ℕ} {A₁ : Finset ℕ} {S₂ : Finset ℕ} {T₂ : Finset ℕ} {B₂ : Finset ℕ} {A₂ : Finset ℕ} (hS₁ : ∀ p ∈ S₁, ForcedCase1 p) (hS₂ : ∀ p ∈ S₂, ForcedCase2 p) (hbits₁ : 2 ^ 332193344302 ≤ 36 * ∏ p ∈ S₁, p ^ 2) (hbits₂ : 2 ^ 332193676061 ≤ 108 * ∏ p ∈ S₂, p ^ 2) (hcov₁ : S₁ ⊆ T₁ ∪ B₁ ∪ A₁) (hT₁ : ∀ s ∈ T₁, 0 < s) (ht₁ : ∑ s ∈ T₁, 1 / ↑s ≤ 1 / 3) (hB₁_min : ∀ p ∈ B₁, 10 ^ 8 ≤ p) (hB₁_card : B₁.card ≤ 10 ^ 6) (hA₁ : ∀ P ∈ A₁, ∃ c ∈ {6, 12}, ∃ K ∈ T₁.powerset, 1 ≤ K.card ∧ K.card ≤ 4 ∧ P = c * ∏ s ∈ K, s + 1) (hcov₂ : S₂ ⊆ T₂ ∪ B₂ ∪ A₂) (hT₂ : ∀ s ∈ T₂, 0 < s) (ht₂ : ∑ s ∈ T₂, 1 / ↑s ≤ 1 / 3) (hB₂_min : ∀ p ∈ B₂, 10 ^ 8 ≤ p) (hB₂_card : B₂.card ≤ 10 ^ 6) (hA₂ : ∀ P ∈ A₂, ∃ c ∈ {6, 18}, ∃ K ∈ T₂.powerset, 1 ≤ K.card ∧ K.card ≤ 4 ∧ P = c * ∏ s ∈ K, s + 1) : (∀ (x : ℕ), IsCarmichaelCounterexample x → 10 ^ 100000160994 < x ∧ 10 ^ 100000160994 < x.totient) ∧ Filter.liminf (fun X => ↑(V1 X) / ↑(V X)) Filter.atTop < 1 / 10 ^ 50000080497- Seed-batch reciprocal-sum bound < 1/2 inside Lean
Totient value > 10¹⁰¹¹⁸ and lower density < 10⁻⁵⁰⁵⁹
Proves φ(x) > 10¹⁰¹¹⁸ for every counterexample and Filter.liminf V₁(X)/V(X) < 1/10⁵⁰⁵⁹ over whole numbers X.
theorem CarmichaelChallenge.carmichael_in_kernel_value_and_density_10118 : (∀ (x : ℕ), IsCarmichaelCounterexample x → 10 ^ 10118 < x.totient) ∧ Filter.liminf (fun X => ↑(V1 X) / ↑(V X)) Filter.atTop < 1 / 10 ^ 5059
- The lower limit of V₁(X)/V(X) is below 1/10⁵⁰⁵⁷
Two forced squares bound the lower limit of V₁(X)/V(X)
Let a₁, a₂ ≥ 2. If every counterexample is a multiple of a₁² or of a₂², then the lower limit of V₁(X)/V(X) as X grows is at most 2/min(a₁, a₂).
theorem CarmichaelChallenge.liminf_V1_div_V_le_two_div_min {a₁ : ℕ} {a₂ : ℕ} (ha₁ : 2 ≤ a₁) (ha₂ : 2 ≤ a₂) (hcov : ∀ (x : ℕ), IsCarmichaelCounterexample x → a₁ ^ 2 ∣ x ∨ a₂ ^ 2 ∣ x) : Filter.liminf (fun X => ↑(V1 X) / ↑(V X)) Filter.atTop ≤ 2 / ↑(min a₁ a₂)Values whose preimages are all multiples of a² number at most V(X/a) (Ford's Lemmas 7.4 and 7.5)
For every a ≥ 2 and every X, V(X; a²) ≤ V(⌊X/a⌋).
theorem CarmichaelChallenge.ford_lemma_7_4_7_5 {X : ℕ} {a : ℕ} (ha : 2 ≤ a) : VDiv X a ≤ V (X / a)Forced squares with small reciprocal sum bound φ(x)
Let x ≥ 1, b be 36 or 108, and S a set of primes at least 5 with b·∏ p² over S dividing x. If 6·10ᴰ ≤ b·∏ p² and the sum of 1/p over S is below 1/2, then 10ᴰ < φ(x).
theorem CarmichaelChallenge.totient_value_gt_of_forced_primes {D : ℕ} {b : ℕ} {x : ℕ} {S : Finset ℕ} (hx : 0 < x) (hb : b = 36 ∨ b = 108) (hS : ∀ p ∈ S, Nat.Prime p ∧ 5 ≤ p) (hdvd : b * ∏ p ∈ S, p ^ 2 ∣ x) (hbig : 6 * 10 ^ D ≤ b * ∏ p ∈ S, p ^ 2) (hrec : ∑ p ∈ S, 1 / ↑p < 1 / 2) : 10 ^ D < x.totient- Forced primes with small reciprocal sums bound φ(x) and the lower limit
- Large forced squares give a small lower limit
- V₁(X)/V(X) is small for arbitrarily large X
- V₁(X) ≤ 2·V(X/min(a₁, a₂))
Klee, Pomerance and Erdős
Lean proves Klee's 1947 results for the smallest counterexample: 4 divides it, 8 does not, and none of the primes 5, 17, 257 and 65537 divides it. It proves Pomerance's 1974 condition: a number x ≥ 1 is a counterexample whenever p² divides x for every prime p with p − 1 dividing φ(x). It also proves Erdős's 1958 step that builds a larger counterexample from one and a suitable prime, and his conclusion of infinitely many counterexamples with the supply of such primes taken as a hypothesis.
The smallest counterexample is a multiple of 4 but not of 8, and not of 5, 17, 257 or 65537
If x₀ is the smallest counterexample, then 4 divides x₀, while none of 8, 5, 17, 257 and 65537 divides x₀.
theorem CarmichaelChallenge.minimal_counterexample_structure {x₀ : ℕ} (hx₀ : IsMinimalCounterexample x₀) : 4 ∣ x₀ ∧ ¬8 ∣ x₀ ∧ ¬5 ∣ x₀ ∧ ¬17 ∣ x₀ ∧ ¬257 ∣ x₀ ∧ ¬65537 ∣ x₀Pomerance's condition gives a counterexample
If x ≥ 1 and p² divides x for every prime p with p − 1 dividing φ(x), then x is a counterexample.
theorem CarmichaelChallenge.pomerance_sufficient_condition {x : ℕ} (hx : 0 < x) (hpom : ∀ (p : ℕ), Nat.Prime p → p - 1 ∣ x.totient → p ^ 2 ∣ x) : IsCarmichaelCounterexample xφ(y) = 10 exactly for y = 11 and y = 22
For every whole number y, φ(y) = 10 holds exactly when y is 11 or 22.
theorem CarmichaelChallenge.totient_eq_ten_iff (y : ℕ) : y.totient = 10 ↔ y = 11 ∨ y = 22
- 8 does not divide a reduced counterexample
- No prime 2ᵐ + 1 with m ≥ 2 divides a reduced counterexample
- Erdős's fiber rule
- Erdős's step to a larger counterexample
Values whose preimages are all multiples of 10
Ford showed that if no totient has all preimages divisible by 6, Carmichael's conjecture holds. For multiples of 10, Lean proves both m ≥ 32,000 directly and, in Edition 5, m ≥ 10⁶⁰ unconditionally across all 8,243 admissible valuation-pair roots via 3,154 kernel-verified Lucas primes and 1,327 compressed descent trees.
- Pure-kernel k = 10 rung certificate up to 10⁶⁰
Every multiples-of-10 totient witness is at least 10⁶⁰ (unconditional)
Proves 10⁶⁰ ≤ m for every totient value m whose positive preimages are all divisible by 10, discharging all 8,243 roots inside Lean.
theorem CarmichaelChallenge.k10_divisible_totient_ge_10_pow_60 {m : ℕ} (hm : IsDivisibleTotientWitness 10 m) : 10 ^ 60 ≤ mA value whose preimages are all multiples of 10 is at least 32,000
If m is a value of φ and every y ≥ 1 with φ(y) = m is a multiple of 10, then m ≥ 32,000.
theorem CarmichaelChallenge.k10_witness_ge_32000 {m : ℕ} (hm : IsDivisibleTotientWitness 10 m) : 32000 ≤ mIf no value has all its preimages divisible by 6, there is no counterexample
Suppose no m is a value of φ all of whose preimages y ≥ 1 are multiples of 6. Then no whole number is a counterexample.
theorem CarmichaelChallenge.no_k6_witness_implies_carmichael (h6 : ¬∃ m, IsDivisibleTotientWitness 6 m) (x : ℕ) : ¬IsCarmichaelCounterexample x
Every preimage of 110 is a multiple of 11
110 = φ(121), and every y ≥ 1 with φ(y) = 110 is a multiple of 11.
theorem CarmichaelChallenge.k11_witness_110 : IsDivisibleTotientWitness 11 110
- Every preimage is a multiple of 100, and 40 divides m
- The switching rule for keeping 5
- The switching rule for keeping 2
- A rung certificate for 10ᴷ gives 10ᴷ ≤ m
- A closed descent tree bounds m
- The switching rule with several primes
- A closed case tree bounds every counterexample that meets its conditions