The Carmichael function #
Main definitions #
ArithmeticFunction.Carmichael: the Carmichael functionλ, also known as the reduced totient function.
Main results #
- A formula for
λ nin terms of the prime factorization ofn, given by the following theorems:carmichael_two_pow_of_le_two,carmichael_two_pow_of_ne_two,carmichael_pow_of_prime_ne_two, andcarmichael_factorization.
Notation #
We use the standard notation λ to represent the Carmichael function,
which is accessible in the scope ArithmeticFunction.Carmichael.
Since the notation conflicts with the anonymous function notation, it is impossible to use this
notation in statements, but the pretty-printer will use it when showing the goal state.
Tags #
arithmetic functions, totient
λ is the Carmichael function, also known as the reduced totient function,
defined as the exponent of the unit group of ZMod n.
Equations
- ArithmeticFunction.Carmichael = { toFun := fun (x : ℕ) => match x with | 0 => 0 | n.succ => Nat.find ⋯, map_zero' := ArithmeticFunction.Carmichael._proof_3 }
Instances For
λ is the Carmichael function, also known as the reduced totient function,
defined as the exponent of the unit group of ZMod n.
Equations
- ArithmeticFunction.Carmichael.«termλ» = Lean.ParserDescr.node `ArithmeticFunction.Carmichael.«termλ» 1024 (Lean.ParserDescr.symbol "λ")
Instances For
This takes in an NeZero n instance instead of an n ≠ 0 hypothesis.
@[simp]
theorem
ArithmeticFunction.carmichael_finset_prod
{α : Type u_2}
{s : Finset α}
{f : α → ℕ}
(h : (↑s).Pairwise (Function.onFun Nat.Coprime f))
:
@[simp]
Note that 2 ^ (n - 1) = 1 when n = 0.
@[simp]
Note that 2 ^ (n - 2) = 1 when n ≤ 1.