File: Mathlib/Algebra/Ring/Hom/Defs.lean

full_name: NonUnitalRingHom
code: /-- Bundled non-unital semiring homomorphisms `α →ₙ+* β`; use this for bundled non-unital ring
homomorphisms too.

When possible, instead of parametrizing results over `(f : α →ₙ+* β)`,
you should parametrize over `(F : Type*) [NonUnitalRingHomClass F α β] (f : F)`.

When you extend this structure, make sure to extend `NonUnitalRingHomClass`. -/
structure NonUnitalRingHom (α β : Type*) [NonUnitalNonAssocSemiring α]
  [NonUnitalNonAssocSemiring β] extends α →ₙ* β, α →+ β
goal: Type (max u_5 u_6)

full_name: «_aux_Mathlib_Algebra_Ring_Hom_Defs___macroRules_term_→ₙ+*__1»
code: /-- `α →ₙ+* β` denotes the type of non-unital ring homomorphisms from `α` to `β`. -/
infixr:25 " →ₙ+* " => NonUnitalRingHom
goal: Lean.Macro

full_name: _aux_Mathlib_Algebra_Ring_Hom_Defs___unexpand_NonUnitalRingHom_1
code: /-- `α →ₙ+* β` denotes the type of non-unital ring homomorphisms from `α` to `β`. -/
infixr:25 " →ₙ+* " => NonUnitalRingHom
goal: Lean.PrettyPrinter.Unexpander

full_name: NonUnitalRingHomClass
code: /-- `NonUnitalRingHomClass F α β` states that `F` is a type of non-unital (semi)ring
homomorphisms. You should extend this class when you extend `NonUnitalRingHom`. -/
class NonUnitalRingHomClass (F : Type*) (α β : outParam Type*) [NonUnitalNonAssocSemiring α]
  [NonUnitalNonAssocSemiring β] [FunLike F α β]
  extends MulHomClass F α β, AddMonoidHomClass F α β : Prop
goal: Prop

full_name: NonUnitalRingHomClass.toNonUnitalRingHom
code: /-- Turn an element of a type `F` satisfying `NonUnitalRingHomClass F α β` into an actual
`NonUnitalRingHom`. This is declared as the default coercion from `F` to `α →ₙ+* β`. -/
@[coe]
def NonUnitalRingHomClass.toNonUnitalRingHom (f : F) : α →ₙ+* β 
goal: α →ₙ+* β

full_name: instCoeTCNonUnitalRingHom
code: /-- Any type satisfying `NonUnitalRingHomClass` can be cast into `NonUnitalRingHom` via
`NonUnitalRingHomClass.toNonUnitalRingHom`. -/
instance : CoeTC F (α →ₙ+* β) 
goal: CoeTC F (α →ₙ+* β)

full_name: NonUnitalRingHom.instFunLike
code: instance : FunLike (α →ₙ+* β) α β 
goal: FunLike (α →ₙ+* β) α β

full_name: NonUnitalRingHom.instNonUnitalRingHomClass
code: instance : NonUnitalRingHomClass (α →ₙ+* β) α β 
goal: NonUnitalRingHomClass (α →ₙ+* β) α β

full_name: NonUnitalRingHom.coe_toMulHom
code: @[simp]
theorem coe_toMulHom (f : α →ₙ+* β) : ⇑f.toMulHom = f 
goal: ⇑f.toMulHom = ⇑f

full_name: NonUnitalRingHom.coe_mulHom_mk
code: @[simp]
theorem coe_mulHom_mk (f : α → β) (h₁ h₂ h₃) :
    ((⟨⟨f, h₁⟩, h₂, h₃⟩ : α →ₙ+* β) : α →ₙ* β) = ⟨f, h₁⟩ 
goal: ↑{ toFun := f, map_mul' := h₁, map_zero' := h₂, map_add' := h₃ } = { toFun := f, map_mul' := h₁ }

full_name: NonUnitalRingHom.coe_toAddMonoidHom
code: theorem coe_toAddMonoidHom (f : α →ₙ+* β) : ⇑f.toAddMonoidHom = f 
goal: ⇑f.toAddMonoidHom = ⇑f

full_name: NonUnitalRingHom.coe_addMonoidHom_mk
code: @[simp]
theorem coe_addMonoidHom_mk (f : α → β) (h₁ h₂ h₃) :
    ((⟨⟨f, h₁⟩, h₂, h₃⟩ : α →ₙ+* β) : α →+ β) = ⟨⟨f, h₂⟩, h₃⟩ 
goal: ↑{ toFun := f, map_mul' := h₁, map_zero' := h₂, map_add' := h₃ } = { toFun := f, map_zero' := h₂, map_add' := h₃ }

full_name: NonUnitalRingHom.copy
code: /-- Copy of a `RingHom` with a new `toFun` equal to the old one. Useful to fix definitional
equalities. -/
protected def copy (f : α →ₙ+* β) (f' : α → β) (h : f' = f) : α →ₙ+* β 
goal: α →ₙ+* β

full_name: NonUnitalRingHom.coe_copy
code: @[simp]
theorem coe_copy (f : α →ₙ+* β) (f' : α → β) (h : f' = f) : ⇑(f.copy f' h) = f' 
goal: ⇑(f.copy f' h) = f'

full_name: NonUnitalRingHom.copy_eq
code: theorem copy_eq (f : α →ₙ+* β) (f' : α → β) (h : f' = f) : f.copy f' h = f 
goal: f.copy f' h = f

full_name: NonUnitalRingHom.ext
code: @[ext]
theorem ext ⦃f g : α →ₙ+* β⦄ : (∀ x, f x = g x) → f = g 
goal: (∀ (x : α), f x = g x) → f = g

full_name: NonUnitalRingHom.ext_iff
code: protected theorem ext_iff {f g : α →ₙ+* β} : f = g ↔ ∀ x, f x = g x 
goal: f = g ↔ ∀ (x : α), f x = g x

full_name: NonUnitalRingHom.mk_coe
code: @[simp]
theorem mk_coe (f : α →ₙ+* β) (h₁ h₂ h₃) : NonUnitalRingHom.mk (MulHom.mk f h₁) h₂ h₃ = f 
goal: { toFun := ⇑f, map_mul' := h₁, map_zero' := h₂, map_add' := h₃ } = f

full_name: NonUnitalRingHom.coe_addMonoidHom_injective
code: theorem coe_addMonoidHom_injective : Injective fun f : α →ₙ+* β => (f : α →+ β) 
goal: Function.Injective fun f => ↑f

full_name: NonUnitalRingHom.coe_mulHom_injective
code: theorem coe_mulHom_injective : Injective fun f : α →ₙ+* β => (f : α →ₙ* β) 
goal: Function.Injective fun f => ↑f

full_name: NonUnitalRingHom.id
code: /-- The identity non-unital ring homomorphism from a non-unital semiring to itself. -/
protected def id (α : Type*) [NonUnitalNonAssocSemiring α] : α →ₙ+* α 
goal: α →ₙ+* α

full_name: NonUnitalRingHom.instZero
code: instance : Zero (α →ₙ+* β) 
goal: Zero (α →ₙ+* β)

full_name: NonUnitalRingHom.instInhabited
code: instance : Inhabited (α →ₙ+* β) 
goal: Inhabited (α →ₙ+* β)

full_name: NonUnitalRingHom.coe_zero
code: @[simp]
theorem coe_zero : ⇑(0 : α →ₙ+* β) = 0 
goal: ⇑0 = 0

full_name: NonUnitalRingHom.zero_apply
code: @[simp]
theorem zero_apply (x : α) : (0 : α →ₙ+* β) x = 0 
goal: 0 x = 0

full_name: NonUnitalRingHom.id_apply
code: @[simp]
theorem id_apply (x : α) : NonUnitalRingHom.id α x = x 
goal: (NonUnitalRingHom.id α) x = x

full_name: NonUnitalRingHom.coe_addMonoidHom_id
code: @[simp]
theorem coe_addMonoidHom_id : (NonUnitalRingHom.id α : α →+ α) = AddMonoidHom.id α 
goal: ↑(NonUnitalRingHom.id α) = AddMonoidHom.id α

full_name: NonUnitalRingHom.coe_mulHom_id
code: @[simp]
theorem coe_mulHom_id : (NonUnitalRingHom.id α : α →ₙ* α) = MulHom.id α 
goal: ↑(NonUnitalRingHom.id α) = MulHom.id α

full_name: NonUnitalRingHom.comp
code: /-- Composition of non-unital ring homomorphisms is a non-unital ring homomorphism. -/
def comp (g : β →ₙ+* γ) (f : α →ₙ+* β) : α →ₙ+* γ 
goal: α →ₙ+* γ

full_name: NonUnitalRingHom.comp_assoc
code: /-- Composition of non-unital ring homomorphisms is associative. -/
theorem comp_assoc {δ} {_ : NonUnitalNonAssocSemiring δ} (f : α →ₙ+* β) (g : β →ₙ+* γ)
    (h : γ →ₙ+* δ) : (h.comp g).comp f = h.comp (g.comp f) 
goal: ∀ {x : NonUnitalNonAssocSemiring δ} (f : α →ₙ+* β) (g : β →ₙ+* γ) (h : γ →ₙ+* δ), (h.comp g).comp f = h.comp (g.comp f)

full_name: NonUnitalRingHom.coe_comp
code: @[simp]
theorem coe_comp (g : β →ₙ+* γ) (f : α →ₙ+* β) : ⇑(g.comp f) = g ∘ f 
goal: ⇑(g.comp f) = ⇑g ∘ ⇑f

full_name: NonUnitalRingHom.comp_apply
code: @[simp]
theorem comp_apply (g : β →ₙ+* γ) (f : α →ₙ+* β) (x : α) : g.comp f x = g (f x) 
goal: (g.comp f) x = g (f x)

full_name: NonUnitalRingHom.coe_comp_addMonoidHom
code: @[simp]
theorem coe_comp_addMonoidHom (g : β →ₙ+* γ) (f : α →ₙ+* β) :
    AddMonoidHom.mk ⟨g ∘ f, (g.comp f).map_zero'⟩ (g.comp f).map_add' = (g : β →+ γ).comp f 
goal: { toFun := ⇑g ∘ ⇑f, map_zero' := ⋯, map_add' := ⋯ } = (↑g).comp ↑f

full_name: NonUnitalRingHom.coe_comp_mulHom
code: @[simp]
theorem coe_comp_mulHom (g : β →ₙ+* γ) (f : α →ₙ+* β) :
    MulHom.mk (g ∘ f) (g.comp f).map_mul' = (g : β →ₙ* γ).comp f 
goal: { toFun := ⇑g ∘ ⇑f, map_mul' := ⋯ } = (↑g).comp ↑f

full_name: NonUnitalRingHom.comp_zero
code: @[simp]
theorem comp_zero (g : β →ₙ+* γ) : g.comp (0 : α →ₙ+* β) = 0 
goal: g.comp 0 = 0

full_name: NonUnitalRingHom.zero_comp
code: @[simp]
theorem zero_comp (f : α →ₙ+* β) : (0 : β →ₙ+* γ).comp f = 0 
goal: NonUnitalRingHom.comp 0 f = 0

full_name: NonUnitalRingHom.comp_id
code: @[simp]
theorem comp_id (f : α →ₙ+* β) : f.comp (NonUnitalRingHom.id α) = f 
goal: f.comp (NonUnitalRingHom.id α) = f

full_name: NonUnitalRingHom.id_comp
code: @[simp]
theorem id_comp (f : α →ₙ+* β) : (NonUnitalRingHom.id β).comp f = f 
goal: (NonUnitalRingHom.id β).comp f = f

full_name: NonUnitalRingHom.instMonoidWithZero
code: instance : MonoidWithZero (α →ₙ+* α) 
goal: MonoidWithZero (α →ₙ+* α)

full_name: NonUnitalRingHom.one_def
code: theorem one_def : (1 : α →ₙ+* α) = NonUnitalRingHom.id α 
goal: 1 = NonUnitalRingHom.id α

full_name: NonUnitalRingHom.coe_one
code: @[simp]
theorem coe_one : ⇑(1 : α →ₙ+* α) = id 
goal: ⇑1 = id

full_name: NonUnitalRingHom.mul_def
code: theorem mul_def (f g : α →ₙ+* α) : f * g = f.comp g 
goal: f * g = f.comp g

full_name: NonUnitalRingHom.coe_mul
code: @[simp]
theorem coe_mul (f g : α →ₙ+* α) : ⇑(f * g) = f ∘ g 
goal: ⇑(f * g) = ⇑f ∘ ⇑g

full_name: NonUnitalRingHom.cancel_right
code: @[simp]
theorem cancel_right {g₁ g₂ : β →ₙ+* γ} {f : α →ₙ+* β} (hf : Surjective f) :
    g₁.comp f = g₂.comp f ↔ g₁ = g₂ 
goal: g₁.comp f = g₂.comp f ↔ g₁ = g₂

full_name: NonUnitalRingHom.cancel_left
code: @[simp]
theorem cancel_left {g : β →ₙ+* γ} {f₁ f₂ : α →ₙ+* β} (hg : Injective g) :
    g.comp f₁ = g.comp f₂ ↔ f₁ = f₂ 
goal: g.comp f₁ = g.comp f₂ ↔ f₁ = f₂

full_name: RingHom
code: /-- Bundled semiring homomorphisms; use this for bundled ring homomorphisms too.

This extends from both `MonoidHom` and `MonoidWithZeroHom` in order to put the fields in a
sensible order, even though `MonoidWithZeroHom` already extends `MonoidHom`. -/
structure RingHom (α : Type*) (β : Type*) [NonAssocSemiring α] [NonAssocSemiring β] extends
  α →* β, α →+ β, α →ₙ+* β, α →*₀ β
goal: Type (max u_5 u_6)

full_name: _aux_Mathlib_Algebra_Ring_Hom_Defs___unexpand_RingHom_1
code: /-- `α →+* β` denotes the type of ring homomorphisms from `α` to `β`. -/
infixr:25 " →+* " => RingHom
goal: Lean.PrettyPrinter.Unexpander

full_name: «_aux_Mathlib_Algebra_Ring_Hom_Defs___macroRules_term_→+*__1»
code: /-- `α →+* β` denotes the type of ring homomorphisms from `α` to `β`. -/
infixr:25 " →+* " => RingHom
goal: Lean.Macro

full_name: RingHomClass
code: /-- `RingHomClass F α β` states that `F` is a type of (semi)ring homomorphisms.
You should extend this class when you extend `RingHom`.

This extends from both `MonoidHomClass` and `MonoidWithZeroHomClass` in
order to put the fields in a sensible order, even though
`MonoidWithZeroHomClass` already extends `MonoidHomClass`. -/
class RingHomClass (F : Type*) (α β : outParam Type*)
    [NonAssocSemiring α] [NonAssocSemiring β] [FunLike F α β]
  extends MonoidHomClass F α β, AddMonoidHomClass F α β, MonoidWithZeroHomClass F α β : Prop
goal: Prop

full_name: RingHomClass.toRingHom
code: /-- Turn an element of a type `F` satisfying `RingHomClass F α β` into an actual
`RingHom`. This is declared as the default coercion from `F` to `α →+* β`. -/
@[coe]
def RingHomClass.toRingHom (f : F) : α →+* β 
goal: {x : NonAssocSemiring α} → {x_1 : NonAssocSemiring β} → [inst : RingHomClass F α β] → F → α →+* β

full_name: instCoeTCRingHom
code: /-- Any type satisfying `RingHomClass` can be cast into `RingHom` via `RingHomClass.toRingHom`. -/
instance : CoeTC F (α →+* β) 
goal: {x : NonAssocSemiring α} → {x_1 : NonAssocSemiring β} → [inst : RingHomClass F α β] → CoeTC F (α →+* β)

full_name: RingHomClass.toNonUnitalRingHomClass
code: instance (priority := 100) RingHomClass.toNonUnitalRingHomClass : NonUnitalRingHomClass F α β 
goal: ∀ {x : NonAssocSemiring α} {x_1 : NonAssocSemiring β} [inst : RingHomClass F α β], NonUnitalRingHomClass F α β

full_name: RingHom.instFunLike
code: instance instFunLike : FunLike (α →+* β) α β 
goal: {x : NonAssocSemiring α} → {x_1 : NonAssocSemiring β} → FunLike (α →+* β) α β

full_name: RingHom.instRingHomClass
code: instance instRingHomClass : RingHomClass (α →+* β) α β 
goal: ∀ {x : NonAssocSemiring α} {x_1 : NonAssocSemiring β}, RingHomClass (α →+* β) α β

full_name: RingHom.toFun_eq_coe
code: theorem toFun_eq_coe (f : α →+* β) : f.toFun = f 
goal: ∀ {x : NonAssocSemiring α} {x_1 : NonAssocSemiring β} (f : α →+* β), (↑↑f).toFun = ⇑f

full_name: RingHom.coe_mk
code: @[simp]
theorem coe_mk (f : α →* β) (h₁ h₂) : ((⟨f, h₁, h₂⟩ : α →+* β) : α → β) = f 
goal: ∀ {x : NonAssocSemiring α} {x_1 : NonAssocSemiring β} (f : α →* β) (h₁ : (↑f).toFun 0 = 0)
  (h₂ : ∀ (x_2 y : α), (↑f).toFun (x_2 + y) = (↑f).toFun x_2 + (↑f).toFun y),
  ⇑{ toMonoidHom := f, map_zero' := h₁, map_add' := h₂ } = ⇑f

full_name: RingHom.coe_coe
code: @[simp]
theorem coe_coe {F : Type*} [FunLike F α β] [RingHomClass F α β] (f : F) :
    ((f : α →+* β) : α → β) = f 
goal: ∀ {x : NonAssocSemiring α} {x_1 : NonAssocSemiring β} {F : Type u_5} [inst : FunLike F α β]
  [inst_1 : RingHomClass F α β] (f : F), ⇑↑f = ⇑f

full_name: RingHom.coeToMonoidHom
code: instance coeToMonoidHom : Coe (α →+* β) (α →* β) 
goal: {x : NonAssocSemiring α} → {x_1 : NonAssocSemiring β} → Coe (α →+* β) (α →* β)

full_name: RingHom.toMonoidHom_eq_coe
code: @[simp]
theorem toMonoidHom_eq_coe (f : α →+* β) : f.toMonoidHom = f 
goal: ∀ {x : NonAssocSemiring α} {x_1 : NonAssocSemiring β} (f : α →+* β), ↑f = ↑f

full_name: RingHom.toMonoidWithZeroHom_eq_coe
code: theorem toMonoidWithZeroHom_eq_coe (f : α →+* β) : (f.toMonoidWithZeroHom : α → β) = f 
goal: ∀ {x : NonAssocSemiring α} {x_1 : NonAssocSemiring β} (f : α →+* β), ⇑f.toMonoidWithZeroHom = ⇑f

full_name: RingHom.coe_monoidHom_mk
code: @[simp]
theorem coe_monoidHom_mk (f : α →* β) (h₁ h₂) : ((⟨f, h₁, h₂⟩ : α →+* β) : α →* β) = f 
goal: ∀ {x : NonAssocSemiring α} {x_1 : NonAssocSemiring β} (f : α →* β) (h₁ : (↑f).toFun 0 = 0)
  (h₂ : ∀ (x_2 y : α), (↑f).toFun (x_2 + y) = (↑f).toFun x_2 + (↑f).toFun y),
  ↑{ toMonoidHom := f, map_zero' := h₁, map_add' := h₂ } = f

full_name: RingHom.toAddMonoidHom_eq_coe
code: @[simp]
theorem toAddMonoidHom_eq_coe (f : α →+* β) : f.toAddMonoidHom = f 
goal: ∀ {x : NonAssocSemiring α} {x_1 : NonAssocSemiring β} (f : α →+* β), f.toAddMonoidHom = ↑f

full_name: RingHom.coe_addMonoidHom_mk
code: @[simp]
theorem coe_addMonoidHom_mk (f : α → β) (h₁ h₂ h₃ h₄) :
    ((⟨⟨⟨f, h₁⟩, h₂⟩, h₃, h₄⟩ : α →+* β) : α →+ β) = ⟨⟨f, h₃⟩, h₄⟩ 
goal: ∀ {x : NonAssocSemiring α} {x_1 : NonAssocSemiring β} (f : α → β) (h₁ : f 1 = 1)
  (h₂ :
    ∀ (x_2 y : α),
      { toFun := f, map_one' := h₁ }.toFun (x_2 * y) =
        { toFun := f, map_one' := h₁ }.toFun x_2 * { toFun := f, map_one' := h₁ }.toFun y)
  (h₃ : (↑{ toFun := f, map_one' := h₁, map_mul' := h₂ }).toFun 0 = 0)
  (h₄ :
    ∀ (x_2 y : α),
      (↑{ toFun := f, map_one' := h₁, map_mul' := h₂ }).toFun (x_2 + y) =
        (↑{ toFun := f, map_one' := h₁, map_mul' := h₂ }).toFun x_2 +
          (↑{ toFun := f, map_one' := h₁, map_mul' := h₂ }).toFun y),
  ↑{ toFun := f, map_one' := h₁, map_mul' := h₂, map_zero' := h₃, map_add' := h₄ } =
    { toFun := f, map_zero' := h₃, map_add' := h₄ }

full_name: RingHom.copy
code: /-- Copy of a `RingHom` with a new `toFun` equal to the old one. Useful to fix definitional
equalities. -/
def copy (f : α →+* β) (f' : α → β) (h : f' = f) : α →+* β 
goal: {x : NonAssocSemiring α} → {x_1 : NonAssocSemiring β} → (f : α →+* β) → (f' : α → β) → f' = ⇑f → α →+* β

full_name: RingHom.coe_copy
code: @[simp]
theorem coe_copy (f : α →+* β) (f' : α → β) (h : f' = f) : ⇑(f.copy f' h) = f' 
goal: ∀ {x : NonAssocSemiring α} {x_1 : NonAssocSemiring β} (f : α →+* β) (f' : α → β) (h : f' = ⇑f), ⇑(f.copy f' h) = f'

full_name: RingHom.copy_eq
code: theorem copy_eq (f : α →+* β) (f' : α → β) (h : f' = f) : f.copy f' h = f 
goal: ∀ {x : NonAssocSemiring α} {x_1 : NonAssocSemiring β} (f : α →+* β) (f' : α → β) (h : f' = ⇑f), f.copy f' h = f

full_name: RingHom.congr_fun
code: protected theorem congr_fun {f g : α →+* β} (h : f = g) (x : α) : f x = g x 
goal: ∀ {x : NonAssocSemiring α} {x_1 : NonAssocSemiring β} {f g : α →+* β}, f = g → ∀ (x_2 : α), f x_2 = g x_2

full_name: RingHom.congr_arg
code: protected theorem congr_arg (f : α →+* β) {x y : α} (h : x = y) : f x = f y 
goal: ∀ {x : NonAssocSemiring α} {x_1 : NonAssocSemiring β} (f : α →+* β) {x_2 y : α}, x_2 = y → f x_2 = f y

full_name: RingHom.coe_inj
code: theorem coe_inj ⦃f g : α →+* β⦄ (h : (f : α → β) = g) : f = g 
goal: ∀ {x : NonAssocSemiring α} {x_1 : NonAssocSemiring β} ⦃f g : α →+* β⦄, ⇑f = ⇑g → f = g

full_name: RingHom.ext
code: @[ext]
theorem ext ⦃f g : α →+* β⦄ : (∀ x, f x = g x) → f = g 
goal: ∀ {x : NonAssocSemiring α} {x_1 : NonAssocSemiring β} ⦃f g : α →+* β⦄, (∀ (x_2 : α), f x_2 = g x_2) → f = g

full_name: RingHom.ext_iff
code: protected theorem ext_iff {f g : α →+* β} : f = g ↔ ∀ x, f x = g x 
goal: ∀ {x : NonAssocSemiring α} {x_1 : NonAssocSemiring β} {f g : α →+* β}, f = g ↔ ∀ (x_2 : α), f x_2 = g x_2

full_name: RingHom.mk_coe
code: @[simp]
theorem mk_coe (f : α →+* β) (h₁ h₂ h₃ h₄) : RingHom.mk ⟨⟨f, h₁⟩, h₂⟩ h₃ h₄ = f 
goal: ∀ {x : NonAssocSemiring α} {x_1 : NonAssocSemiring β} (f : α →+* β) (h₁ : f 1 = 1)
  (h₂ :
    ∀ (x_2 y : α),
      { toFun := ⇑f, map_one' := h₁ }.toFun (x_2 * y) =
        { toFun := ⇑f, map_one' := h₁ }.toFun x_2 * { toFun := ⇑f, map_one' := h₁ }.toFun y)
  (h₃ : (↑{ toFun := ⇑f, map_one' := h₁, map_mul' := h₂ }).toFun 0 = 0)
  (h₄ :
    ∀ (x_2 y : α),
      (↑{ toFun := ⇑f, map_one' := h₁, map_mul' := h₂ }).toFun (x_2 + y) =
        (↑{ toFun := ⇑f, map_one' := h₁, map_mul' := h₂ }).toFun x_2 +
          (↑{ toFun := ⇑f, map_one' := h₁, map_mul' := h₂ }).toFun y),
  { toFun := ⇑f, map_one' := h₁, map_mul' := h₂, map_zero' := h₃, map_add' := h₄ } = f

full_name: RingHom.coe_addMonoidHom_injective
code: theorem coe_addMonoidHom_injective : Injective (fun f : α →+* β => (f : α →+ β)) 
goal: ∀ {x : NonAssocSemiring α} {x_1 : NonAssocSemiring β}, Function.Injective fun f => ↑f

full_name: RingHom.coe_monoidHom_injective
code: theorem coe_monoidHom_injective : Injective (fun f : α →+* β => (f : α →* β)) 
goal: ∀ {x : NonAssocSemiring α} {x_1 : NonAssocSemiring β}, Function.Injective fun f => ↑f

full_name: RingHom.map_zero
code: /-- Ring homomorphisms map zero to zero. -/
protected theorem map_zero (f : α →+* β) : f 0 = 0 
goal: ∀ {x : NonAssocSemiring α} {x_1 : NonAssocSemiring β} (f : α →+* β), f 0 = 0

full_name: RingHom.map_one
code: /-- Ring homomorphisms map one to one. -/
protected theorem map_one (f : α →+* β) : f 1 = 1 
goal: ∀ {x : NonAssocSemiring α} {x_1 : NonAssocSemiring β} (f : α →+* β), f 1 = 1

full_name: RingHom.map_add
code: /-- Ring homomorphisms preserve addition. -/
protected theorem map_add (f : α →+* β) : ∀ a b, f (a + b) = f a + f b 
goal: ∀ {x : NonAssocSemiring α} {x_1 : NonAssocSemiring β} (f : α →+* β) (a b : α), f (a + b) = f a + f b

full_name: RingHom.map_mul
code: /-- Ring homomorphisms preserve multiplication. -/
protected theorem map_mul (f : α →+* β) : ∀ a b, f (a * b) = f a * f b 
goal: ∀ {x : NonAssocSemiring α} {x_1 : NonAssocSemiring β} (f : α →+* β) (a b : α), f (a * b) = f a * f b

full_name: RingHom.map_ite_zero_one
code: @[simp]
theorem map_ite_zero_one {F : Type*} [FunLike F α β] [RingHomClass F α β] (f : F)
    (p : Prop) [Decidable p] :
    f (ite p 0 1) = ite p 0 1 
goal: ∀ {x : NonAssocSemiring α} {x_1 : NonAssocSemiring β} {F : Type u_5} [inst : FunLike F α β]
  [inst_1 : RingHomClass F α β] (f : F) (p : Prop) [inst_2 : Decidable p], f (if p then 0 else 1) = if p then 0 else 1

full_name: RingHom.map_ite_one_zero
code: @[simp]
theorem map_ite_one_zero {F : Type*} [FunLike F α β] [RingHomClass F α β] (f : F)
    (p : Prop) [Decidable p] :
    f (ite p 1 0) = ite p 1 0 
goal: ∀ {x : NonAssocSemiring α} {x_1 : NonAssocSemiring β} {F : Type u_5} [inst : FunLike F α β]
  [inst_1 : RingHomClass F α β] (f : F) (p : Prop) [inst_2 : Decidable p], f (if p then 1 else 0) = if p then 1 else 0

full_name: RingHom.codomain_trivial_iff_map_one_eq_zero
code: /-- `f : α →+* β` has a trivial codomain iff `f 1 = 0`. -/
theorem codomain_trivial_iff_map_one_eq_zero : (0 : β) = 1 ↔ f 1 = 0 
goal: ∀ {x : NonAssocSemiring α} {x_1 : NonAssocSemiring β} (f : α →+* β), 0 = 1 ↔ f 1 = 0

full_name: RingHom.codomain_trivial_iff_range_trivial
code: /-- `f : α →+* β` has a trivial codomain iff it has a trivial range. -/
theorem codomain_trivial_iff_range_trivial : (0 : β) = 1 ↔ ∀ x, f x = 0 
goal: ∀ {x : NonAssocSemiring α} {x_1 : NonAssocSemiring β} (f : α →+* β), 0 = 1 ↔ ∀ (x_2 : α), f x_2 = 0

full_name: RingHom.map_one_ne_zero
code: /-- `f : α →+* β` doesn't map `1` to `0` if `β` is nontrivial -/
theorem map_one_ne_zero [Nontrivial β] : f 1 ≠ 0 
goal: ∀ {x : NonAssocSemiring α} {x_1 : NonAssocSemiring β} (f : α →+* β) [inst : Nontrivial β], f 1 ≠ 0

full_name: RingHom.domain_nontrivial
code: /-- If there is a homomorphism `f : α →+* β` and `β` is nontrivial, then `α` is nontrivial. -/
theorem domain_nontrivial [Nontrivial β] : Nontrivial α 
goal: ∀ {x : NonAssocSemiring α} {x_1 : NonAssocSemiring β}, (α →+* β) → ∀ [inst : Nontrivial β], Nontrivial α

full_name: RingHom.codomain_trivial
code: theorem codomain_trivial (f : α →+* β) [h : Subsingleton α] : Subsingleton β 
goal: ∀ {x : NonAssocSemiring α} {x_1 : NonAssocSemiring β}, (α →+* β) → ∀ [h : Subsingleton α], Subsingleton β

full_name: RingHom.map_neg
code: /-- Ring homomorphisms preserve additive inverse. -/
protected theorem map_neg [NonAssocRing α] [NonAssocRing β] (f : α →+* β) (x : α) : f (-x) = -f x 
goal: f (-x) = -f x

full_name: RingHom.map_sub
code: /-- Ring homomorphisms preserve subtraction. -/
protected theorem map_sub [NonAssocRing α] [NonAssocRing β] (f : α →+* β) (x y : α) :
    f (x - y) = f x - f y 
goal: f (x - y) = f x - f y

full_name: RingHom.mk'
code: /-- Makes a ring homomorphism from a monoid homomorphism of rings which preserves addition. -/
def mk' [NonAssocSemiring α] [NonAssocRing β] (f : α →* β)
    (map_add : ∀ a b, f (a + b) = f a + f b) : α →+* β 
goal: α →+* β

full_name: RingHom.id
code: /-- The identity ring homomorphism from a semiring to itself. -/
def id (α : Type*) [NonAssocSemiring α] : α →+* α 
goal: α →+* α

full_name: RingHom.instInhabited
code: instance : Inhabited (α →+* α) 
goal: {x : NonAssocSemiring α} → Inhabited (α →+* α)

full_name: RingHom.id_apply
code: @[simp]
theorem id_apply (x : α) : RingHom.id α x = x 
goal: ∀ {x : NonAssocSemiring α} (x_1 : α), (RingHom.id α) x_1 = x_1

full_name: RingHom.coe_addMonoidHom_id
code: @[simp]
theorem coe_addMonoidHom_id : (id α : α →+ α) = AddMonoidHom.id α 
goal: ∀ {x : NonAssocSemiring α}, ↑(RingHom.id α) = AddMonoidHom.id α

full_name: RingHom.coe_monoidHom_id
code: @[simp]
theorem coe_monoidHom_id : (id α : α →* α) = MonoidHom.id α 
goal: ∀ {x : NonAssocSemiring α}, ↑(RingHom.id α) = MonoidHom.id α

full_name: RingHom.comp
code: /-- Composition of ring homomorphisms is a ring homomorphism. -/
def comp (g : β →+* γ) (f : α →+* β) : α →+* γ 
goal: {x : NonAssocSemiring α} → {x_1 : NonAssocSemiring β} → {x_2 : NonAssocSemiring γ} → (β →+* γ) → (α →+* β) → α →+* γ

full_name: RingHom.comp_assoc
code: /-- Composition of semiring homomorphisms is associative. -/
theorem comp_assoc {δ} {_ : NonAssocSemiring δ} (f : α →+* β) (g : β →+* γ) (h : γ →+* δ) :
    (h.comp g).comp f = h.comp (g.comp f) 
goal: ∀ {x : NonAssocSemiring α} {x_1 : NonAssocSemiring β} {x_2 : NonAssocSemiring γ} {δ : Type u_5}
  {x_3 : NonAssocSemiring δ} (f : α →+* β) (g : β →+* γ) (h : γ →+* δ), (h.comp g).comp f = h.comp (g.comp f)

full_name: RingHom.coe_comp
code: @[simp]
theorem coe_comp (hnp : β →+* γ) (hmn : α →+* β) : (hnp.comp hmn : α → γ) = hnp ∘ hmn 
goal: ∀ {x : NonAssocSemiring α} {x_1 : NonAssocSemiring β} {x_2 : NonAssocSemiring γ} (hnp : β →+* γ) (hmn : α →+* β),
  ⇑(hnp.comp hmn) = ⇑hnp ∘ ⇑hmn

full_name: RingHom.comp_apply
code: theorem comp_apply (hnp : β →+* γ) (hmn : α →+* β) (x : α) :
    (hnp.comp hmn : α → γ) x = hnp (hmn x) 
goal: ∀ {x : NonAssocSemiring α} {x_1 : NonAssocSemiring β} {x_2 : NonAssocSemiring γ} (hnp : β →+* γ) (hmn : α →+* β)
  (x_3 : α), (hnp.comp hmn) x_3 = hnp (hmn x_3)

full_name: RingHom.comp_id
code: @[simp]
theorem comp_id (f : α →+* β) : f.comp (id α) = f 
goal: ∀ {x : NonAssocSemiring α} {x_1 : NonAssocSemiring β} (f : α →+* β), f.comp (RingHom.id α) = f

full_name: RingHom.id_comp
code: @[simp]
theorem id_comp (f : α →+* β) : (id β).comp f = f 
goal: ∀ {x : NonAssocSemiring α} {x_1 : NonAssocSemiring β} (f : α →+* β), (RingHom.id β).comp f = f

full_name: RingHom.instOne
code: instance instOne : One (α →+* α) 
goal: {x : NonAssocSemiring α} → One (α →+* α)

full_name: RingHom.instMul
code: instance instMul : Mul (α →+* α) 
goal: {x : NonAssocSemiring α} → Mul (α →+* α)

full_name: RingHom.one_def
code: lemma one_def : (1 : α →+* α) = id α 
goal: ∀ {x : NonAssocSemiring α}, 1 = RingHom.id α

full_name: RingHom.mul_def
code: lemma mul_def (f g : α →+* α) : f * g = f.comp g 
goal: ∀ {x : NonAssocSemiring α} (f g : α →+* α), f * g = f.comp g

full_name: RingHom.coe_one
code: @[simp, norm_cast] lemma coe_one : ⇑(1 : α →+* α) = _root_.id 
goal: ∀ {x : NonAssocSemiring α}, ⇑1 = id

full_name: RingHom.coe_mul
code: @[simp, norm_cast] lemma coe_mul (f g : α →+* α) : ⇑(f * g) = f ∘ g 
goal: ∀ {x : NonAssocSemiring α} (f g : α →+* α), ⇑(f * g) = ⇑f ∘ ⇑g

full_name: RingHom.instMonoid
code: instance instMonoid : Monoid (α →+* α) 
goal: {x : NonAssocSemiring α} → Monoid (α →+* α)

full_name: RingHom.coe_pow
code: @[simp, norm_cast] lemma coe_pow (f : α →+* α) (n : ℕ) : ⇑(f ^ n) = f^[n] 
goal: ∀ {x : NonAssocSemiring α} (f : α →+* α) (n : ℕ), ⇑(f ^ n) = (⇑f)^[n]

full_name: RingHom.cancel_right
code: @[simp]
theorem cancel_right {g₁ g₂ : β →+* γ} {f : α →+* β} (hf : Surjective f) :
    g₁.comp f = g₂.comp f ↔ g₁ = g₂ 
goal: ∀ {x : NonAssocSemiring α} {x_1 : NonAssocSemiring β} {x_2 : NonAssocSemiring γ} {g₁ g₂ : β →+* γ} {f : α →+* β},
  Function.Surjective ⇑f → (g₁.comp f = g₂.comp f ↔ g₁ = g₂)

full_name: RingHom.cancel_left
code: @[simp]
theorem cancel_left {g : β →+* γ} {f₁ f₂ : α →+* β} (hg : Injective g) :
    g.comp f₁ = g.comp f₂ ↔ f₁ = f₂ 
goal: ∀ {x : NonAssocSemiring α} {x_1 : NonAssocSemiring β} {x_2 : NonAssocSemiring γ} {g : β →+* γ} {f₁ f₂ : α →+* β},
  Function.Injective ⇑g → (g.comp f₁ = g.comp f₂ ↔ f₁ = f₂)

full_name: RingHom.map_pow
code: protected lemma RingHom.map_pow (f : α →+* β) (a) : ∀ n : ℕ, f (a ^ n) = f a ^ n 
goal: f (a ^ n) = f a ^ n

full_name: AddMonoidHom.mkRingHomOfMulSelfOfTwoNeZero
code: /-- Make a ring homomorphism from an additive group homomorphism from a commutative ring to an
integral domain that commutes with self multiplication, assumes that two is nonzero and `1` is sent
to `1`. -/
def mkRingHomOfMulSelfOfTwoNeZero (h : ∀ x, f (x * x) = f x * f x) (h_two : (2 : α) ≠ 0)
    (h_one : f 1 = 1) : β →+* α 
goal: β →+* α

full_name: AddMonoidHom.coe_fn_mkRingHomOfMulSelfOfTwoNeZero
code: @[simp]
theorem coe_fn_mkRingHomOfMulSelfOfTwoNeZero (h h_two h_one) :
    (f.mkRingHomOfMulSelfOfTwoNeZero h h_two h_one : β → α) = f 
goal: ⇑(f.mkRingHomOfMulSelfOfTwoNeZero h h_two h_one) = ⇑f

full_name: AddMonoidHom.coe_addMonoidHom_mkRingHomOfMulSelfOfTwoNeZero
code: theorem coe_addMonoidHom_mkRingHomOfMulSelfOfTwoNeZero (h h_two h_one) :
    (f.mkRingHomOfMulSelfOfTwoNeZero h h_two h_one : β →+ α) = f 
goal: ↑(f.mkRingHomOfMulSelfOfTwoNeZero h h_two h_one) = f