File: Mathlib/Algebra/Algebra/Defs.lean

full_name: Algebra.smul_def'
code: /-- An associative unital `R`-algebra is a semiring `A` equipped with a map into its center `R → A`.

See the implementation notes in this file for discussion of the details of this definition.
-/
-- Porting note(#5171): unsupported @[nolint has_nonempty_instance]
class Algebra (R : Type u) (A : Type v) [CommSemiring R] [Semiring A] extends SMul R A,
  R →+* A where
  commutes' : ∀ r x, toRingHom r * x = x * toRingHom r
  smul_def' : ∀ r x, r • x = toRingHom r * x
goal: r • x = Algebra.toRingHom r * x

full_name: Algebra.commutes'
code: /-- An associative unital `R`-algebra is a semiring `A` equipped with a map into its center `R → A`.

See the implementation notes in this file for discussion of the details of this definition.
-/
-- Porting note(#5171): unsupported @[nolint has_nonempty_instance]
class Algebra (R : Type u) (A : Type v) [CommSemiring R] [Semiring A] extends SMul R A,
  R →+* A where
  commutes' : ∀ r x, toRingHom r * x = x * toRingHom r
  smul_def' : ∀ r x, r • x = toRingHom r * x
goal: Algebra.toRingHom r * x = x * Algebra.toRingHom r

full_name: Algebra
code: /-- An associative unital `R`-algebra is a semiring `A` equipped with a map into its center `R → A`.

See the implementation notes in this file for discussion of the details of this definition.
-/
-- Porting note(#5171): unsupported @[nolint has_nonempty_instance]
class Algebra (R : Type u) (A : Type v) [CommSemiring R] [Semiring A] extends SMul R A,
  R →+* A where
  commutes' : ∀ r x, toRingHom r * x = x * toRingHom r
  smul_def' : ∀ r x, r • x = toRingHom r * x
goal: Type (max u v)

full_name: algebraMap
code: /-- Embedding `R →+* A` given by `Algebra` structure. -/
def algebraMap (R : Type u) (A : Type v) [CommSemiring R] [Semiring A] [Algebra R A] : R →+* A 
goal: R →+* A

full_name: Algebra.cast
code: /-- Coercion from a commutative semiring to an algebra over this semiring. -/
@[coe, reducible]
def Algebra.cast {R A : Type*} [CommSemiring R] [Semiring A] [Algebra R A] : R → A 
goal: R → A

full_name: algebraMap.coeHTCT
code: scoped instance coeHTCT (R A : Type*) [CommSemiring R] [Semiring A] [Algebra R A] :
    CoeHTCT R A 
goal: CoeHTCT R A

full_name: algebraMap.coe_zero
code: @[norm_cast]
theorem coe_zero : (↑(0 : R) : A) = 0 
goal: ↑0 = 0

full_name: algebraMap.coe_one
code: @[norm_cast]
theorem coe_one : (↑(1 : R) : A) = 1 
goal: ↑1 = 1

full_name: algebraMap.coe_natCast
code: @[norm_cast]
theorem coe_natCast (a : ℕ) : (↑(a : R) : A) = a 
goal: ↑↑a = ↑a

full_name: algebraMap.coe_add
code: @[norm_cast]
theorem coe_add (a b : R) : (↑(a + b : R) : A) = ↑a + ↑b 
goal: ↑(a + b) = ↑a + ↑b

full_name: algebraMap.coe_mul
code: @[norm_cast]
theorem coe_mul (a b : R) : (↑(a * b : R) : A) = ↑a * ↑b 
goal: ↑(a * b) = ↑a * ↑b

full_name: algebraMap.coe_pow
code: @[norm_cast]
theorem coe_pow (a : R) (n : ℕ) : (↑(a ^ n : R) : A) = (a : A) ^ n 
goal: ↑(a ^ n) = ↑a ^ n

full_name: algebraMap.coe_neg
code: @[norm_cast]
theorem coe_neg (x : R) : (↑(-x : R) : A) = -↑x 
goal: ↑(-x) = -↑x

full_name: algebraMap.coe_sub
code: @[norm_cast]
theorem coe_sub (a b : R) :
    (↑(a - b : R) : A) = ↑a - ↑b 
goal: ↑(a - b) = ↑a - ↑b

full_name: algebraMap.coe_prod
code: @[norm_cast]
theorem coe_prod {ι : Type*} {s : Finset ι} (a : ι → R) :
    (↑(∏ i ∈ s, a i : R) : A) = ∏ i ∈ s, (↑(a i) : A) 
goal: ↑(∏ i ∈ s, a i) = ∏ i ∈ s, ↑(a i)

full_name: algebraMap.coe_sum
code: @[norm_cast]
theorem coe_sum {ι : Type*} {s : Finset ι} (a : ι → R) :
    ↑(∑ i ∈ s, a i) = ∑ i ∈ s, (↑(a i) : A) 
goal: ↑(∑ i ∈ s, a i) = ∑ i ∈ s, ↑(a i)

full_name: RingHom.toAlgebra'
code: /-- Creating an algebra from a morphism to the center of a semiring. -/
def RingHom.toAlgebra' {R S} [CommSemiring R] [Semiring S] (i : R →+* S)
    (h : ∀ c x, i c * x = x * i c) : Algebra R S 
goal: Algebra R S

full_name: RingHom.toAlgebra
code: /-- Creating an algebra from a morphism to a commutative semiring. -/
def RingHom.toAlgebra {R S} [CommSemiring R] [CommSemiring S] (i : R →+* S) : Algebra R S 
goal: Algebra R S

full_name: RingHom.algebraMap_toAlgebra
code: theorem RingHom.algebraMap_toAlgebra {R S} [CommSemiring R] [CommSemiring S] (i : R →+* S) :
    @algebraMap R S _ _ i.toAlgebra = i 
goal: algebraMap R S = i

full_name: Algebra.ofModule'
code: /-- Let `R` be a commutative semiring, let `A` be a semiring with a `Module R` structure.
If `(r • 1) * x = x * (r • 1) = r • x` for all `r : R` and `x : A`, then `A` is an `Algebra`
over `R`.

See note [reducible non-instances]. -/
abbrev ofModule' [CommSemiring R] [Semiring A] [Module R A]
    (h₁ : ∀ (r : R) (x : A), r • (1 : A) * x = r • x)
    (h₂ : ∀ (r : R) (x : A), x * r • (1 : A) = r • x) : Algebra R A 
goal: Algebra R A

full_name: Algebra.ofModule
code: /-- Let `R` be a commutative semiring, let `A` be a semiring with a `Module R` structure.
If `(r • x) * y = x * (r • y) = r • (x * y)` for all `r : R` and `x y : A`, then `A`
is an `Algebra` over `R`.

See note [reducible non-instances]. -/
abbrev ofModule [CommSemiring R] [Semiring A] [Module R A]
    (h₁ : ∀ (r : R) (x y : A), r • x * y = r • (x * y))
    (h₂ : ∀ (r : R) (x y : A), x * r • y = r • (x * y)) : Algebra R A 
goal: Algebra R A

full_name: Algebra.algebra_ext
code: /-- To prove two algebra structures on a fixed `[CommSemiring R] [Semiring A]` agree,
it suffices to check the `algebraMap`s agree.
-/
@[ext]
theorem algebra_ext {R : Type*} [CommSemiring R] {A : Type*} [Semiring A] (P Q : Algebra R A)
    (h : ∀ r : R, (haveI := P; algebraMap R A r) = haveI := Q; algebraMap R A r) :
    P = Q 
goal: P = Q

full_name: Algebra.toModule
code: instance (priority := 200) toModule : Module R A 
goal: Module R A

full_name: Algebra.smul_def
code: theorem smul_def (r : R) (x : A) : r • x = algebraMap R A r * x 
goal: r • x = (algebraMap R A) r * x

full_name: Algebra.algebraMap_eq_smul_one
code: theorem algebraMap_eq_smul_one (r : R) : algebraMap R A r = r • (1 : A) 
goal: (algebraMap R A) r = r • 1

full_name: Algebra.algebraMap_eq_smul_one'
code: theorem algebraMap_eq_smul_one' : ⇑(algebraMap R A) = fun r => r • (1 : A) 
goal: ⇑(algebraMap R A) = fun r => r • 1

full_name: Algebra.commutes
code: /-- `mul_comm` for `Algebra`s when one element is from the base ring. -/
theorem commutes (r : R) (x : A) : algebraMap R A r * x = x * algebraMap R A r 
goal: (algebraMap R A) r * x = x * (algebraMap R A) r

full_name: Algebra.commute_algebraMap_left
code: lemma commute_algebraMap_left (r : R) (x : A) : Commute (algebraMap R A r) x 
goal: Commute ((algebraMap R A) r) x

full_name: Algebra.commute_algebraMap_right
code: lemma commute_algebraMap_right (r : R) (x : A) : Commute x (algebraMap R A r) 
goal: Commute x ((algebraMap R A) r)

full_name: Algebra.left_comm
code: /-- `mul_left_comm` for `Algebra`s when one element is from the base ring. -/
theorem left_comm (x : A) (r : R) (y : A) :
    x * (algebraMap R A r * y) = algebraMap R A r * (x * y) 
goal: x * ((algebraMap R A) r * y) = (algebraMap R A) r * (x * y)

full_name: Algebra.right_comm
code: /-- `mul_right_comm` for `Algebra`s when one element is from the base ring. -/
theorem right_comm (x : A) (r : R) (y : A) :
    x * algebraMap R A r * y = x * y * algebraMap R A r 
goal: x * (algebraMap R A) r * y = x * y * (algebraMap R A) r

full_name: IsScalarTower.right
code: instance _root_.IsScalarTower.right : IsScalarTower R A A 
goal: IsScalarTower R A A

full_name: RingHom.smulOneHom_eq_algebraMap
code: @[simp]
theorem _root_.RingHom.smulOneHom_eq_algebraMap : RingHom.smulOneHom = algebraMap R A 
goal: RingHom.smulOneHom = algebraMap R A

full_name: Algebra.mul_smul_comm
code: /-- This is just a special case of the global `mul_smul_comm` lemma that requires less typeclass
search (and was here first). -/
@[simp]
protected theorem mul_smul_comm (s : R) (x y : A) : x * s • y = s • (x * y) 
goal: x * s • y = s • (x * y)

full_name: Algebra.smul_mul_assoc
code: /-- This is just a special case of the global `smul_mul_assoc` lemma that requires less typeclass
search (and was here first). -/
@[simp]
protected theorem smul_mul_assoc (r : R) (x y : A) : r • x * y = r • (x * y) 
goal: r • x * y = r • (x * y)

full_name: smul_algebraMap
code: @[simp]
theorem _root_.smul_algebraMap {α : Type*} [Monoid α] [MulDistribMulAction α A]
    [SMulCommClass α R A] (a : α) (r : R) : a • algebraMap R A r = algebraMap R A r 
goal: a • (algebraMap R A) r = (algebraMap R A) r

full_name: Algebra.linearMap
code: /-- The canonical ring homomorphism `algebraMap R A : R →+* A` for any `R`-algebra `A`,
packaged as an `R`-linear map.
-/
protected def linearMap : R →ₗ[R] A 
goal: R →ₗ[R] A

full_name: Algebra.linearMap_apply
code: @[simp]
theorem linearMap_apply (r : R) : Algebra.linearMap R A r = algebraMap R A r 
goal: (Algebra.linearMap R A) r = (algebraMap R A) r

full_name: Algebra.coe_linearMap
code: theorem coe_linearMap : ⇑(Algebra.linearMap R A) = algebraMap R A 
goal: ⇑(Algebra.linearMap R A) = ⇑(algebraMap R A)

full_name: Algebra.id
code: /-- The identity map inducing an `Algebra` structure. -/
instance (priority := 1100) id : Algebra R R 
goal: Algebra R R

full_name: Algebra.id.map_eq_id
code: @[simp]
theorem map_eq_id : algebraMap R R = RingHom.id _ 
goal: algebraMap R R = RingHom.id R

full_name: Algebra.id.map_eq_self
code: theorem map_eq_self (x : R) : algebraMap R R x = x 
goal: (algebraMap R R) x = x

full_name: Algebra.id.smul_eq_mul
code: @[simp]
theorem smul_eq_mul (x y : R) : x • y = x * y 
goal: x • y = x * y

full_name: algebraMap.coe_smul
code: @[norm_cast]
theorem algebraMap.coe_smul (A B C : Type*) [SMul A B] [CommSemiring B] [Semiring C] [Algebra B C]
    [SMul A C] [IsScalarTower A B C] (a : A) (b : B) : (a • b : B) = a • (b : C) 
goal: ↑(a • b) = a • ↑b