File: Mathlib/Algebra/Group/AddChar.lean

full_name: AddChar.toFun
code: /-- `AddChar A M` is the type of maps `A → M`, for `A` an additive monoid and `M` a multiplicative
monoid, which intertwine addition in `A` with multiplication in `M`.

We only put the typeclasses needed for the definition, although in practice we are usually
interested in much more specific cases (e.g. when `A` is a group and `M` a commutative ring).
 -/
structure AddChar where
  /-- The underlying function.

  Do not use this function directly. Instead use the coercion coming from the `FunLike`
  instance. -/
  toFun : A → M
  /-- The function maps `0` to `1`.

  Do not use this directly. Instead use `AddChar.map_zero_eq_one`. -/
  map_zero_eq_one' : toFun 0 = 1
  /-- The function maps addition in `A` to multiplication in `M`.

  Do not use this directly. Instead use `AddChar.map_add_eq_mul`. -/
  map_add_eq_mul' : ∀ a b : A, toFun (a + b) = toFun a * toFun b
goal: A → M

full_name: AddChar
code: /-- `AddChar A M` is the type of maps `A → M`, for `A` an additive monoid and `M` a multiplicative
monoid, which intertwine addition in `A` with multiplication in `M`.

We only put the typeclasses needed for the definition, although in practice we are usually
interested in much more specific cases (e.g. when `A` is a group and `M` a commutative ring).
 -/
structure AddChar where
  /-- The underlying function.

  Do not use this function directly. Instead use the coercion coming from the `FunLike`
  instance. -/
  toFun : A → M
  /-- The function maps `0` to `1`.

  Do not use this directly. Instead use `AddChar.map_zero_eq_one`. -/
  map_zero_eq_one' : toFun 0 = 1
  /-- The function maps addition in `A` to multiplication in `M`.

  Do not use this directly. Instead use `AddChar.map_add_eq_mul`. -/
  map_add_eq_mul' : ∀ a b : A, toFun (a + b) = toFun a * toFun b
goal: Type (max u_1 u_2)

full_name: AddChar.map_add_eq_mul'
code: /-- `AddChar A M` is the type of maps `A → M`, for `A` an additive monoid and `M` a multiplicative
monoid, which intertwine addition in `A` with multiplication in `M`.

We only put the typeclasses needed for the definition, although in practice we are usually
interested in much more specific cases (e.g. when `A` is a group and `M` a commutative ring).
 -/
structure AddChar where
  /-- The underlying function.

  Do not use this function directly. Instead use the coercion coming from the `FunLike`
  instance. -/
  toFun : A → M
  /-- The function maps `0` to `1`.

  Do not use this directly. Instead use `AddChar.map_zero_eq_one`. -/
  map_zero_eq_one' : toFun 0 = 1
  /-- The function maps addition in `A` to multiplication in `M`.

  Do not use this directly. Instead use `AddChar.map_add_eq_mul`. -/
  map_add_eq_mul' : ∀ a b : A, toFun (a + b) = toFun a * toFun b
goal: self.toFun (a + b) = self.toFun a * self.toFun b

full_name: AddChar.map_zero_eq_one'
code: /-- `AddChar A M` is the type of maps `A → M`, for `A` an additive monoid and `M` a multiplicative
monoid, which intertwine addition in `A` with multiplication in `M`.

We only put the typeclasses needed for the definition, although in practice we are usually
interested in much more specific cases (e.g. when `A` is a group and `M` a commutative ring).
 -/
structure AddChar where
  /-- The underlying function.

  Do not use this function directly. Instead use the coercion coming from the `FunLike`
  instance. -/
  toFun : A → M
  /-- The function maps `0` to `1`.

  Do not use this directly. Instead use `AddChar.map_zero_eq_one`. -/
  map_zero_eq_one' : toFun 0 = 1
  /-- The function maps addition in `A` to multiplication in `M`.

  Do not use this directly. Instead use `AddChar.map_add_eq_mul`. -/
  map_add_eq_mul' : ∀ a b : A, toFun (a + b) = toFun a * toFun b
goal: self.toFun 0 = 1

full_name: AddChar.instFunLike
code: /-- Define coercion to a function. -/
instance instFunLike : FunLike (AddChar A M) A M 
goal: FunLike (AddChar A M) A M

full_name: AddChar.ext
code: @[ext] lemma ext (f g : AddChar A M) (h : ∀ x : A, f x = g x) : f = g 
goal: f = g

full_name: AddChar.coe_mk
code: @[simp] lemma coe_mk (f : A → M)
    (map_zero_eq_one' : f 0 = 1) (map_add_eq_mul' : ∀ a b : A, f (a + b) = f a * f b) :
    AddChar.mk f map_zero_eq_one' map_add_eq_mul' = f 
goal: ⇑{ toFun := f, map_zero_eq_one' := map_zero_eq_one', map_add_eq_mul' := map_add_eq_mul' } = f

full_name: AddChar.map_zero_eq_one
code: /-- An additive character maps `0` to `1`. -/
@[simp] lemma map_zero_eq_one (ψ : AddChar A M) : ψ 0 = 1 
goal: ψ 0 = 1

full_name: AddChar.map_add_eq_mul
code: /-- An additive character maps sums to products. -/
lemma map_add_eq_mul (ψ : AddChar A M) (x y : A) : ψ (x + y) = ψ x * ψ y 
goal: ψ (x + y) = ψ x * ψ y

full_name: AddChar.toMonoidHom
code: /-- Interpret an additive character as a monoid homomorphism. -/
def toMonoidHom (φ : AddChar A M) : Multiplicative A →* M 
goal: Multiplicative A →* M

full_name: AddChar.toMonoidHom_apply
code: @[simp] lemma toMonoidHom_apply (ψ : AddChar A M) (a : Multiplicative A) :
  ψ.toMonoidHom a = ψ (Multiplicative.toAdd a) 
goal: ψ.toMonoidHom a = ψ (Multiplicative.toAdd a)

full_name: AddChar.map_nsmul_eq_pow
code: /-- An additive character maps multiples by natural numbers to powers. -/
lemma map_nsmul_eq_pow (ψ : AddChar A M) (n : ℕ) (x : A) : ψ (n • x) = ψ x ^ n 
goal: ψ (n • x) = ψ x ^ n

full_name: AddChar.toMonoidHomEquiv
code: /-- Additive characters `A → M` are the same thing as monoid homomorphisms from `Multiplicative A`
to `M`. -/
def toMonoidHomEquiv : AddChar A M ≃ (Multiplicative A →* M) 
goal: AddChar A M ≃ (Multiplicative A →* M)

full_name: AddChar.coe_toMonoidHomEquiv
code: @[simp, norm_cast] lemma coe_toMonoidHomEquiv (ψ : AddChar A M) :
    ⇑(toMonoidHomEquiv ψ) = ψ ∘ Multiplicative.toAdd 
goal: ⇑(AddChar.toMonoidHomEquiv ψ) = ⇑ψ ∘ ⇑Multiplicative.toAdd

full_name: AddChar.coe_toMonoidHomEquiv_symm
code: @[simp, norm_cast] lemma coe_toMonoidHomEquiv_symm (ψ : Multiplicative A →* M) :
    ⇑(toMonoidHomEquiv.symm ψ) = ψ ∘ Multiplicative.ofAdd 
goal: ⇑(AddChar.toMonoidHomEquiv.symm ψ) = ⇑ψ ∘ ⇑Multiplicative.ofAdd

full_name: AddChar.toMonoidHomEquiv_apply
code: @[simp] lemma toMonoidHomEquiv_apply (ψ : AddChar A M) (a : Multiplicative A) :
    toMonoidHomEquiv ψ a = ψ (Multiplicative.toAdd a) 
goal: (AddChar.toMonoidHomEquiv ψ) a = ψ (Multiplicative.toAdd a)

full_name: AddChar.toMonoidHomEquiv_symm_apply
code: @[simp] lemma toMonoidHomEquiv_symm_apply (ψ : Multiplicative A →* M) (a : A) :
    toMonoidHomEquiv.symm ψ a = ψ (Multiplicative.ofAdd a) 
goal: (AddChar.toMonoidHomEquiv.symm ψ) a = ψ (Multiplicative.ofAdd a)

full_name: AddChar.toAddMonoidHom
code: /-- Interpret an additive character as a monoid homomorphism. -/
def toAddMonoidHom (φ : AddChar A M) : A →+ Additive M 
goal: A →+ Additive M

full_name: AddChar.coe_toAddMonoidHom
code: @[simp] lemma coe_toAddMonoidHom (ψ : AddChar A M) : ⇑ψ.toAddMonoidHom = Additive.ofMul ∘ ψ 
goal: ⇑ψ.toAddMonoidHom = ⇑Additive.ofMul ∘ ⇑ψ

full_name: AddChar.toAddMonoidHom_apply
code: @[simp] lemma toAddMonoidHom_apply (ψ : AddChar A M) (a : A) :
    ψ.toAddMonoidHom a = Additive.ofMul (ψ a) 
goal: ψ.toAddMonoidHom a = Additive.ofMul (ψ a)

full_name: AddChar.toAddMonoidHomEquiv
code: /-- Additive characters `A → M` are the same thing as additive homomorphisms from `A` to
`Additive M`. -/
def toAddMonoidHomEquiv : AddChar A M ≃ (A →+ Additive M) 
goal: AddChar A M ≃ (A →+ Additive M)

full_name: AddChar.coe_toAddMonoidHomEquiv
code: @[simp, norm_cast]
lemma coe_toAddMonoidHomEquiv (ψ : AddChar A M) :
    ⇑(toAddMonoidHomEquiv ψ) = Additive.ofMul ∘ ψ 
goal: ⇑(AddChar.toAddMonoidHomEquiv ψ) = ⇑Additive.ofMul ∘ ⇑ψ

full_name: AddChar.coe_toAddMonoidHomEquiv_symm
code: @[simp, norm_cast] lemma coe_toAddMonoidHomEquiv_symm (ψ : A →+ Additive M) :
    ⇑(toAddMonoidHomEquiv.symm ψ) = Additive.toMul ∘ ψ 
goal: ⇑(AddChar.toAddMonoidHomEquiv.symm ψ) = ⇑Additive.toMul ∘ ⇑ψ

full_name: AddChar.toAddMonoidHomEquiv_apply
code: @[simp] lemma toAddMonoidHomEquiv_apply (ψ : AddChar A M) (a : A) :
    toAddMonoidHomEquiv ψ a = Additive.ofMul (ψ a) 
goal: (AddChar.toAddMonoidHomEquiv ψ) a = Additive.ofMul (ψ a)

full_name: AddChar.toAddMonoidHomEquiv_symm_apply
code: @[simp] lemma toAddMonoidHomEquiv_symm_apply (ψ : A →+ Additive M) (a : A) :
    toAddMonoidHomEquiv.symm ψ a = Additive.toMul (ψ a) 
goal: (AddChar.toAddMonoidHomEquiv.symm ψ) a = Additive.toMul (ψ a)

full_name: AddChar.instOne
code: /-- The trivial additive character (sending everything to `1`) is `(1 : AddChar A M).` -/
instance instOne : One (AddChar A M) 
goal: One (AddChar A M)

full_name: AddChar.coe_one
code: @[simp, norm_cast] lemma coe_one : ⇑(1 : AddChar A M) = 1 
goal: ⇑1 = 1

full_name: AddChar.one_apply
code: @[simp] lemma one_apply (a : A) : (1 : AddChar A M) a = 1 
goal: 1 a = 1

full_name: AddChar.instInhabited
code: instance instInhabited : Inhabited (AddChar A M) 
goal: Inhabited (AddChar A M)

full_name: MonoidHom.compAddChar
code: /-- Composing a `MonoidHom` with an `AddChar` yields another `AddChar`. -/
def _root_.MonoidHom.compAddChar {N : Type*} [Monoid N] (f : M →* N) (φ : AddChar A M) :
    AddChar A N 
goal: AddChar A N

full_name: MonoidHom.coe_compAddChar
code: @[simp, norm_cast]
lemma _root_.MonoidHom.coe_compAddChar {N : Type*} [Monoid N] (f : M →* N) (φ : AddChar A M) :
    f.compAddChar φ = f ∘ φ 
goal: ⇑(f.compAddChar φ) = ⇑f ∘ ⇑φ

full_name: MonoidHom.compAddChar_apply
code: @[simp, norm_cast]
lemma _root_.MonoidHom.compAddChar_apply (f : M →* N) (φ : AddChar A M) : f.compAddChar φ = f ∘ φ 
goal: ⇑(f.compAddChar φ) = ⇑f ∘ ⇑φ

full_name: MonoidHom.compAddChar_injective_left
code: lemma _root_.MonoidHom.compAddChar_injective_left (ψ : AddChar A M) (hψ : Surjective ψ) :
    Injective fun f : M →* N ↦ f.compAddChar ψ 
goal: Function.Injective fun f => f.compAddChar ψ

full_name: MonoidHom.compAddChar_injective_right
code: lemma _root_.MonoidHom.compAddChar_injective_right (f : M →* N) (hf : Injective f) :
    Injective fun ψ : AddChar B M ↦ f.compAddChar ψ 
goal: Function.Injective fun ψ => f.compAddChar ψ

full_name: AddChar.compAddMonoidHom
code: /-- Composing an `AddChar` with an `AddMonoidHom` yields another `AddChar`. -/
def compAddMonoidHom (φ : AddChar B M) (f : A →+ B) : AddChar A M 
goal: AddChar A M

full_name: AddChar.coe_compAddMonoidHom
code: @[simp, norm_cast]
lemma coe_compAddMonoidHom (φ : AddChar B M) (f : A →+ B) : φ.compAddMonoidHom f = φ ∘ f 
goal: ⇑(φ.compAddMonoidHom f) = ⇑φ ∘ ⇑f

full_name: AddChar.compAddMonoidHom_apply
code: @[simp] lemma compAddMonoidHom_apply (ψ : AddChar B M) (f : A →+ B)
    (a : A) : ψ.compAddMonoidHom f a = ψ (f a) 
goal: (ψ.compAddMonoidHom f) a = ψ (f a)

full_name: AddChar.compAddMonoidHom_injective_left
code: lemma compAddMonoidHom_injective_left (f : A →+ B) (hf : Surjective f) :
    Injective fun ψ : AddChar B M ↦ ψ.compAddMonoidHom f 
goal: Function.Injective fun ψ => ψ.compAddMonoidHom f

full_name: AddChar.compAddMonoidHom_injective_right
code: lemma compAddMonoidHom_injective_right (ψ : AddChar B M) (hψ : Injective ψ) :
    Injective fun f : A →+ B ↦ ψ.compAddMonoidHom f 
goal: Function.Injective fun f => ψ.compAddMonoidHom f

full_name: AddChar.eq_one_iff
code: lemma eq_one_iff : ψ = 1 ↔ ∀ x, ψ x = 1 
goal: ψ = 1 ↔ ∀ (x : A), ψ x = 1

full_name: AddChar.ne_one_iff
code: lemma ne_one_iff : ψ ≠ 1 ↔ ∃ x, ψ x ≠ 1 
goal: ψ ≠ 1 ↔ ∃ x, ψ x ≠ 1

full_name: AddChar.IsNontrivial
code: /-- An additive character is *nontrivial* if it takes a value `≠ 1`. -/
@[deprecated (since := "2024-06-06")]
def IsNontrivial (ψ : AddChar A M) : Prop 
goal: Prop

full_name: AddChar.isNontrivial_iff_ne_trivial
code: /-- An additive character is nontrivial iff it is not the trivial character. -/
@[deprecated ne_one_iff (since := "2024-06-06")]
lemma isNontrivial_iff_ne_trivial (ψ : AddChar A M) : IsNontrivial ψ ↔ ψ ≠ 1 
goal: ψ.IsNontrivial ↔ ψ ≠ 1

full_name: AddChar.instCommMonoid
code: /-- When `M` is commutative, `AddChar A M` is a commutative monoid. -/
instance instCommMonoid : CommMonoid (AddChar A M) 
goal: CommMonoid (AddChar A M)

full_name: AddChar.coe_mul
code: @[simp, norm_cast] lemma coe_mul (ψ χ : AddChar A M) : ⇑(ψ * χ) = ψ * χ 
goal: ⇑(ψ * χ) = ⇑ψ * ⇑χ

full_name: AddChar.coe_pow
code: @[simp, norm_cast] lemma coe_pow (ψ : AddChar A M) (n : ℕ) : ⇑(ψ ^ n) = ψ ^ n 
goal: ⇑(ψ ^ n) = ⇑ψ ^ n

full_name: AddChar.mul_apply
code: @[simp, norm_cast] lemma mul_apply (ψ φ : AddChar A M) (a : A) : (ψ * φ) a = ψ a * φ a 
goal: (ψ * φ) a = ψ a * φ a

full_name: AddChar.pow_apply
code: @[simp, norm_cast] lemma pow_apply (ψ : AddChar A M) (n : ℕ) (a : A) : (ψ ^ n) a = (ψ a) ^ n 
goal: (ψ ^ n) a = ψ a ^ n

full_name: AddChar.toMonoidHomMulEquiv
code: /-- The natural equivalence to `(Multiplicative A →* M)` is a monoid isomorphism. -/
def toMonoidHomMulEquiv : AddChar A M ≃* (Multiplicative A →* M) 
goal: AddChar A M ≃* (Multiplicative A →* M)

full_name: AddChar.toAddMonoidAddEquiv
code: /-- Additive characters `A → M` are the same thing as additive homomorphisms from `A` to
`Additive M`. -/
def toAddMonoidAddEquiv : Additive (AddChar A M) ≃+ (A →+ Additive M) 
goal: Additive (AddChar A M) ≃+ (A →+ Additive M)

full_name: AddChar.instCommGroup
code: /-- The additive characters on a commutative additive group form a commutative group.

Note that the inverse is defined using negation on the domain; we do not assume `M` has an
inversion operation for the definition (but see `AddChar.map_neg_eq_inv` below). -/
instance instCommGroup : CommGroup (AddChar A M) 
goal: CommGroup (AddChar A M)

full_name: AddChar.inv_apply
code: @[simp] lemma inv_apply (ψ : AddChar A M) (x : A) : ψ⁻¹ x = ψ (-x) 
goal: ψ⁻¹ x = ψ (-x)

full_name: AddChar.val_isUnit
code: /-- The values of an additive character on an additive group are units. -/
lemma val_isUnit {A M} [AddGroup A] [Monoid M] (φ : AddChar A M) (a : A) : IsUnit (φ a) 
goal: IsUnit (φ a)

full_name: AddChar.map_neg_eq_inv
code: /-- An additive character maps negatives to inverses (when defined) -/
lemma map_neg_eq_inv (ψ : AddChar A M) (a : A) : ψ (-a) = (ψ a)⁻¹ 
goal: ψ (-a) = (ψ a)⁻¹

full_name: AddChar.map_zsmul_eq_zpow
code: /-- An additive character maps integer scalar multiples to integer powers. -/
lemma map_zsmul_eq_zpow (ψ : AddChar A M) (n : ℤ) (a : A) : ψ (n • a) = (ψ a) ^ n 
goal: ψ (n • a) = ψ a ^ n

full_name: AddChar.inv_apply'
code: lemma inv_apply' (ψ : AddChar A M) (x : A) : ψ⁻¹ x = (ψ x)⁻¹ 
goal: ψ⁻¹ x = (ψ x)⁻¹

full_name: AddChar.map_sub_eq_div
code: lemma map_sub_eq_div (ψ : AddChar A M) (a b : A) : ψ (a - b) = ψ a / ψ b 
goal: ψ (a - b) = ψ a / ψ b

full_name: AddChar.injective_iff
code: lemma injective_iff {ψ : AddChar A M} : Injective ψ ↔ ∀ ⦃x⦄, ψ x = 1 → x = 0 
goal: Function.Injective ⇑ψ ↔ ∀ ⦃x : A⦄, ψ x = 1 → x = 0

full_name: AddChar.mulShift
code: /-- Define the multiplicative shift of an additive character.
This satisfies `mulShift ψ a x = ψ (a * x)`. -/
def mulShift (ψ : AddChar R M) (r : R) : AddChar R M 
goal: AddChar R M

full_name: AddChar.mulShift_apply
code: @[simp] lemma mulShift_apply {ψ : AddChar R M} {r : R} {x : R} : mulShift ψ r x = ψ (r * x) 
goal: (ψ.mulShift r) x = ψ (r * x)

full_name: AddChar.inv_mulShift
code: /-- `ψ⁻¹ = mulShift ψ (-1))`. -/
theorem inv_mulShift (ψ : AddChar R M) : ψ⁻¹ = mulShift ψ (-1) 
goal: ψ⁻¹ = ψ.mulShift (-1)

full_name: AddChar.mulShift_spec'
code: /-- If `n` is a natural number, then `mulShift ψ n x = (ψ x) ^ n`. -/
theorem mulShift_spec' (ψ : AddChar R M) (n : ℕ) (x : R) : mulShift ψ n x = ψ x ^ n 
goal: (ψ.mulShift ↑n) x = ψ x ^ n

full_name: AddChar.pow_mulShift
code: /-- If `n` is a natural number, then `ψ ^ n = mulShift ψ n`. -/
theorem pow_mulShift (ψ : AddChar R M) (n : ℕ) : ψ ^ n = mulShift ψ n 
goal: ψ ^ n = ψ.mulShift ↑n

full_name: AddChar.mulShift_mul
code: /-- The product of `mulShift ψ r` and `mulShift ψ s` is `mulShift ψ (r + s)`. -/
theorem mulShift_mul (ψ : AddChar R M) (r s : R) :
    mulShift ψ r * mulShift ψ s = mulShift ψ (r + s) 
goal: ψ.mulShift r * ψ.mulShift s = ψ.mulShift (r + s)

full_name: AddChar.mulShift_mulShift
code: lemma mulShift_mulShift (ψ : AddChar R M) (r s : R) :
    mulShift (mulShift ψ r) s = mulShift ψ (r * s) 
goal: (ψ.mulShift r).mulShift s = ψ.mulShift (r * s)

full_name: AddChar.mulShift_zero
code: /-- `mulShift ψ 0` is the trivial character. -/
@[simp]
theorem mulShift_zero (ψ : AddChar R M) : mulShift ψ 0 = 1 
goal: ψ.mulShift 0 = 1

full_name: AddChar.mulShift_one
code: @[simp]
lemma mulShift_one (ψ : AddChar R M) : mulShift ψ 1 = ψ 
goal: ψ.mulShift 1 = ψ

full_name: AddChar.mulShift_unit_eq_one_iff
code: lemma mulShift_unit_eq_one_iff (ψ : AddChar R M) {u : R} (hu : IsUnit u) :
    ψ.mulShift u = 1 ↔ ψ = 1 
goal: ψ.mulShift u = 1 ↔ ψ = 1