File: Mathlib/NumberTheory/MulChar/Lemmas.lean

full_name: MulChar.eq_iff
code: /-- Two multiplicative characters on a monoid whose unit group is generated by `g`
are equal if and only if they agree on `g`. -/
lemma eq_iff {R R' : Type*} [CommMonoid R] [CommMonoidWithZero R'] {g : Rˣ}
    (hg : ∀ x, x ∈ Subgroup.zpowers g) (χ₁ χ₂ : MulChar R R') :
    χ₁ = χ₂ ↔ χ₁ g.val = χ₂ g.val 
goal: χ₁ = χ₂ ↔ χ₁ ↑g = χ₂ ↑g

full_name: MulChar.starComp
code: /-- Define the conjugation (`star`) of a multiplicative character by conjugating pointwise. -/
@[simps!]
def starComp [StarRing R'] (χ : MulChar R R') : MulChar R R' 
goal: MulChar R R'

full_name: MulChar.starComp_apply
code: /-- Define the conjugation (`star`) of a multiplicative character by conjugating pointwise. -/
@[simps!]
def starComp [StarRing R'] (χ : MulChar R R') : MulChar R R' 
goal: χ.starComp a = (starRingEnd R') (χ a)

full_name: MulChar.instStarMul
code: instance instStarMul [StarRing R'] : StarMul (MulChar R R') 
goal: StarMul (MulChar R R')

full_name: MulChar.star_apply
code: @[simp]
lemma star_apply [StarRing R'] (χ : MulChar R R') (a : R) : (star χ) a = star (χ a) 
goal: (star χ) a = star (χ a)

full_name: MulChar.apply_mem_rootsOfUnity
code: /-- The values of a multiplicative character on `R` are `n`th roots of unity, where `n = #Rˣ`. -/
lemma apply_mem_rootsOfUnity [Fintype Rˣ] (a : Rˣ) {χ : MulChar R R'} :
    equivToUnitHom χ a ∈ rootsOfUnity ⟨Fintype.card Rˣ, Fintype.card_pos⟩ R' 
goal: (MulChar.equivToUnitHom χ) a ∈ rootsOfUnity ⟨Fintype.card Rˣ, ⋯⟩ R'

full_name: MulChar.star_eq_inv
code: /-- The conjugate of a multiplicative character with values in `ℂ` is its inverse. -/
lemma star_eq_inv (χ : MulChar R ℂ) : star χ = χ⁻¹ 
goal: star χ = χ⁻¹

full_name: MulChar.star_apply'
code: lemma star_apply' (χ : MulChar R ℂ) (a : R) : star (χ a) = χ⁻¹ a 
goal: star (χ a) = χ⁻¹ a

full_name: MulChar.Monoid.orderUnits
code: /-- The order of the unit group of a finite monoid as a `PNat` (for use in `rootsOfUnity`). -/
abbrev Monoid.orderUnits : ℕ+ 
goal: ℕ+

full_name: MulChar.ofRootOfUnity
code: /-- Given a finite monoid `M` with unit group `Mˣ` cyclic of order `n` and an `n`th root of
unity `ζ` in `R`, there is a multiplicative character `M → R` that sends a given generator
of `Mˣ` to `ζ`. -/
noncomputable def ofRootOfUnity {ζ : Rˣ} (hζ : ζ ∈ rootsOfUnity (Monoid.orderUnits M) R)
    {g : Mˣ} (hg : ∀ x, x ∈ Subgroup.zpowers g) :
    MulChar M R 
goal: MulChar M R

full_name: MulChar.ofRootOfUnity_spec
code: lemma ofRootOfUnity_spec {ζ : Rˣ} (hζ : ζ ∈ rootsOfUnity (Monoid.orderUnits M) R)
    {g : Mˣ} (hg : ∀ x, x ∈ Subgroup.zpowers g) :
    ofRootOfUnity hζ hg g = ζ 
goal: (MulChar.ofRootOfUnity hζ hg) ↑g = ↑ζ

full_name: MulChar.equiv_rootsOfUnity
code: /-- The group of multiplicative characters on a finite monoid `M` with cyclic unit group `Mˣ`
of order `n` is isomorphic to the group of `n`th roots of unity in the target `R`. -/
noncomputable def equiv_rootsOfUnity [inst_cyc : IsCyclic Mˣ] :
    MulChar M R ≃* rootsOfUnity (Monoid.orderUnits M) R 
goal: MulChar M R ≃* ↥(rootsOfUnity (MulChar.Monoid.orderUnits M) R)

full_name: MulChar.exists_mulChar_orderOf
code: /-- There is a character of order `n` on `F` if `#F ≡ 1 mod n` and the target contains
a primitive `n`th root of unity. -/
lemma exists_mulChar_orderOf {n : ℕ} (h : n ∣ Fintype.card F - 1) {ζ : R}
    (hζ : IsPrimitiveRoot ζ n) :
    ∃ χ : MulChar F R, orderOf χ = n 
goal: ∃ χ, orderOf χ = n

full_name: MulChar.orderOf_dvd_card_sub_one
code: /-- If there is a multiplicative character of order `n` on `F`, then `#F ≡ 1 mod n`. -/
lemma orderOf_dvd_card_sub_one (χ : MulChar F R) : orderOf χ ∣ Fintype.card F - 1 
goal: orderOf χ ∣ Fintype.card F - 1

full_name: MulChar.exists_mulChar_orderOf_eq_card_units
code: /-- There is always a character on `F` of order `#F-1` with values in a ring that has
a primitive `(#F-1)`th root of unity. -/
lemma exists_mulChar_orderOf_eq_card_units [DecidableEq F]
    {ζ : R} (hζ : IsPrimitiveRoot ζ (Monoid.orderUnits F)) :
    ∃ χ : MulChar F R, orderOf χ = Fintype.card Fˣ 
goal: ∃ χ, orderOf χ = Fintype.card Fˣ

full_name: MulChar.apply_mem_rootsOfUnity_orderOf
code: lemma apply_mem_rootsOfUnity_orderOf (χ : MulChar F R) {a : F} (ha : a ≠ 0) :
    ∃ ζ ∈ rootsOfUnity ⟨orderOf χ, χ.orderOf_pos⟩ R, ζ = χ a 
goal: ∃ ζ ∈ rootsOfUnity ⟨orderOf χ, ⋯⟩ R, ↑ζ = χ a

full_name: MulChar.apply_mem_rootsOfUnity_of_pow_eq_one
code: /-- The non-zero values of a multiplicative character `χ` such that `χ^n = 1`
are `n`th roots of unity. -/
lemma apply_mem_rootsOfUnity_of_pow_eq_one {χ : MulChar F R} {n : ℕ} (hn : n ≠ 0) (hχ : χ ^ n = 1)
    {a : F} (ha : a ≠ 0) :
    ∃ ζ ∈ rootsOfUnity ⟨n, Nat.pos_of_ne_zero hn⟩ R, ζ = χ a 
goal: ∃ ζ ∈ rootsOfUnity ⟨n, ⋯⟩ R, ↑ζ = χ a

full_name: MulChar.exists_apply_eq_pow
code: /-- If `χ` is a multiplicative character with `χ^n = 1` and `μ` is a primitive `n`th root
of unity, then, for `a ≠ 0`, there is some `k` such that `χ a = μ^k`. -/
lemma exists_apply_eq_pow {χ : MulChar F R} {n : ℕ} (hn : n ≠ 0) (hχ : χ ^ n = 1) {μ : R}
    (hμ : IsPrimitiveRoot μ n) {a : F} (ha : a ≠ 0) :
    ∃ k < n, χ a = μ ^ k 
goal: ∃ k < n, χ a = μ ^ k

full_name: MulChar.apply_mem_algebraAdjoin_of_pow_eq_one
code: /-- The values of a multiplicative character `χ` such that `χ^n = 1` are contained in `ℤ[μ]` when
`μ` is a primitive `n`th root of unity. -/
lemma apply_mem_algebraAdjoin_of_pow_eq_one {χ : MulChar F R} {n : ℕ} (hn : n ≠ 0) (hχ : χ ^ n = 1)
    {μ : R} (hμ : IsPrimitiveRoot μ n) (a : F) :
    χ a ∈ Algebra.adjoin ℤ {μ} 
goal: χ a ∈ Algebra.adjoin ℤ {μ}

full_name: MulChar.apply_mem_algebraAdjoin
code: /-- The values of a multiplicative character of order `n` are contained in `ℤ[μ]` when
`μ` is a primitive `n`th root of unity. -/
lemma apply_mem_algebraAdjoin {χ : MulChar F R} {μ : R} (hμ : IsPrimitiveRoot μ (orderOf χ))
    (a : F) :
    χ a ∈ Algebra.adjoin ℤ {μ} 
goal: χ a ∈ Algebra.adjoin ℤ {μ}