File: Mathlib/Algebra/Ring/CompTypeclasses.lean

full_name: RingHomId
code: /-- Class that expresses that a ring homomorphism is in fact the identity. -/
-- This at first seems not very useful. However we need this when considering
-- modules over some diagram in the category of rings,
-- e.g. when defining presheaves over a presheaf of rings.
-- See `Mathlib.Algebra.Category.ModuleCat.Presheaf`.
class RingHomId {R : Type*} [Semiring R] (σ : R →+* R) : Prop where
  eq_id : σ = RingHom.id R
goal: Prop

full_name: RingHomId.eq_id
code: /-- Class that expresses that a ring homomorphism is in fact the identity. -/
-- This at first seems not very useful. However we need this when considering
-- modules over some diagram in the category of rings,
-- e.g. when defining presheaves over a presheaf of rings.
-- See `Mathlib.Algebra.Category.ModuleCat.Presheaf`.
class RingHomId {R : Type*} [Semiring R] (σ : R →+* R) : Prop where
  eq_id : σ = RingHom.id R
goal: σ = RingHom.id R

full_name: instRingHomIdId
code: instance {R : Type*} [Semiring R] : RingHomId (RingHom.id R) 
goal: RingHomId (RingHom.id R)

full_name: RingHomCompTriple
code: /-- Class that expresses the fact that three ring homomorphisms form a composition triple. This is
used to handle composition of semilinear maps. -/
class RingHomCompTriple (σ₁₂ : R₁ →+* R₂) (σ₂₃ : R₂ →+* R₃) (σ₁₃ : outParam (R₁ →+* R₃)) :
  Prop where
  /-- The morphisms form a commutative triangle -/
  comp_eq : σ₂₃.comp σ₁₂ = σ₁₃
goal: Prop

full_name: RingHomCompTriple.comp_eq
code: /-- Class that expresses the fact that three ring homomorphisms form a composition triple. This is
used to handle composition of semilinear maps. -/
class RingHomCompTriple (σ₁₂ : R₁ →+* R₂) (σ₂₃ : R₂ →+* R₃) (σ₁₃ : outParam (R₁ →+* R₃)) :
  Prop where
  /-- The morphisms form a commutative triangle -/
  comp_eq : σ₂₃.comp σ₁₂ = σ₁₃
goal: σ₂₃.comp σ₁₂ = σ₁₃

full_name: RingHomCompTriple.comp_apply
code: @[simp]
theorem comp_apply [RingHomCompTriple σ₁₂ σ₂₃ σ₁₃] {x : R₁} : σ₂₃ (σ₁₂ x) = σ₁₃ x 
goal: σ₂₃ (σ₁₂ x) = σ₁₃ x

full_name: RingHomInvPair
code: /-- Class that expresses the fact that two ring homomorphisms are inverses of each other. This is
used to handle `symm` for semilinear equivalences. -/
class RingHomInvPair (σ : R₁ →+* R₂) (σ' : outParam (R₂ →+* R₁)) : Prop where
  /-- `σ'` is a left inverse of `σ` -/
  comp_eq : σ'.comp σ = RingHom.id R₁
  /-- `σ'` is a left inverse of `σ'` -/
  comp_eq₂ : σ.comp σ' = RingHom.id R₂
goal: Prop

full_name: RingHomInvPair.comp_eq₂
code: /-- Class that expresses the fact that two ring homomorphisms are inverses of each other. This is
used to handle `symm` for semilinear equivalences. -/
class RingHomInvPair (σ : R₁ →+* R₂) (σ' : outParam (R₂ →+* R₁)) : Prop where
  /-- `σ'` is a left inverse of `σ` -/
  comp_eq : σ'.comp σ = RingHom.id R₁
  /-- `σ'` is a left inverse of `σ'` -/
  comp_eq₂ : σ.comp σ' = RingHom.id R₂
goal: σ.comp σ' = RingHom.id R₂

full_name: RingHomInvPair.comp_eq
code: /-- Class that expresses the fact that two ring homomorphisms are inverses of each other. This is
used to handle `symm` for semilinear equivalences. -/
class RingHomInvPair (σ : R₁ →+* R₂) (σ' : outParam (R₂ →+* R₁)) : Prop where
  /-- `σ'` is a left inverse of `σ` -/
  comp_eq : σ'.comp σ = RingHom.id R₁
  /-- `σ'` is a left inverse of `σ'` -/
  comp_eq₂ : σ.comp σ' = RingHom.id R₂
goal: RingHom.comp σ' σ = RingHom.id R₁

full_name: RingHomInvPair.comp_apply_eq
code: theorem comp_apply_eq {x : R₁} : σ' (σ x) = x 
goal: σ' (σ x) = x

full_name: RingHomInvPair.comp_apply_eq₂
code: theorem comp_apply_eq₂ {x : R₂} : σ (σ' x) = x 
goal: σ (σ' x) = x

full_name: RingHomInvPair.ids
code: instance ids : RingHomInvPair (RingHom.id R₁) (RingHom.id R₁) 
goal: RingHomInvPair (RingHom.id R₁) (RingHom.id R₁)

full_name: RingHomInvPair.triples
code: instance triples {σ₂₁ : R₂ →+* R₁} [RingHomInvPair σ₁₂ σ₂₁] :
    RingHomCompTriple σ₁₂ σ₂₁ (RingHom.id R₁) 
goal: RingHomCompTriple σ₁₂ σ₂₁ (RingHom.id R₁)

full_name: RingHomInvPair.triples₂
code: instance triples₂ {σ₂₁ : R₂ →+* R₁} [RingHomInvPair σ₁₂ σ₂₁] :
    RingHomCompTriple σ₂₁ σ₁₂ (RingHom.id R₂) 
goal: RingHomCompTriple σ₂₁ σ₁₂ (RingHom.id R₂)

full_name: RingHomInvPair.of_ringEquiv
code: /-- Construct a `RingHomInvPair` from both directions of a ring equiv.

This is not an instance, as for equivalences that are involutions, a better instance
would be `RingHomInvPair e e`. Indeed, this declaration is not currently used in mathlib.
-/
theorem of_ringEquiv (e : R₁ ≃+* R₂) : RingHomInvPair (↑e : R₁ →+* R₂) ↑e.symm 
goal: RingHomInvPair ↑e ↑e.symm

full_name: RingHomInvPair.symm
code: /--
Swap the direction of a `RingHomInvPair`. This is not an instance as it would loop, and better
instances are often available and may often be preferrable to using this one. Indeed, this
declaration is not currently used in mathlib.
-/
theorem symm (σ₁₂ : R₁ →+* R₂) (σ₂₁ : R₂ →+* R₁) [RingHomInvPair σ₁₂ σ₂₁] :
    RingHomInvPair σ₂₁ σ₁₂ 
goal: RingHomInvPair σ₂₁ σ₁₂

full_name: RingHomCompTriple.ids
code: instance ids : RingHomCompTriple (RingHom.id R₁) σ₁₂ σ₁₂ 
goal: RingHomCompTriple (RingHom.id R₁) σ₁₂ σ₁₂

full_name: RingHomCompTriple.right_ids
code: instance right_ids : RingHomCompTriple σ₁₂ (RingHom.id R₂) σ₁₂ 
goal: RingHomCompTriple σ₁₂ (RingHom.id R₂) σ₁₂

full_name: RingHomSurjective
code: /-- Class expressing the fact that a `RingHom` is surjective. This is needed in the context
of semilinear maps, where some lemmas require this. -/
class RingHomSurjective (σ : R₁ →+* R₂) : Prop where
  /-- The ring homomorphism is surjective -/
  is_surjective : Function.Surjective σ
goal: Prop

full_name: RingHomSurjective.is_surjective
code: /-- Class expressing the fact that a `RingHom` is surjective. This is needed in the context
of semilinear maps, where some lemmas require this. -/
class RingHomSurjective (σ : R₁ →+* R₂) : Prop where
  /-- The ring homomorphism is surjective -/
  is_surjective : Function.Surjective σ
goal: Function.Surjective ⇑σ

full_name: RingHom.surjective
code: theorem RingHom.surjective (σ : R₁ →+* R₂) [t : RingHomSurjective σ] : Function.Surjective σ 
goal: Function.Surjective ⇑σ

full_name: RingHomSurjective.invPair
code: instance (priority := 100) invPair {σ₁ : R₁ →+* R₂} {σ₂ : R₂ →+* R₁} [RingHomInvPair σ₁ σ₂] :
    RingHomSurjective σ₁ 
goal: RingHomSurjective σ₁

full_name: RingHomSurjective.ids
code: instance ids : RingHomSurjective (RingHom.id R₁) 
goal: RingHomSurjective (RingHom.id R₁)

full_name: RingHomSurjective.comp
code: /-- This cannot be an instance as there is no way to infer `σ₁₂` and `σ₂₃`. -/
theorem comp [RingHomCompTriple σ₁₂ σ₂₃ σ₁₃] [RingHomSurjective σ₁₂] [RingHomSurjective σ₂₃] :
    RingHomSurjective σ₁₃ 
goal: RingHomSurjective σ₁₃

full_name: RingHomSurjective.instToRingHomRingEquiv
code: instance (σ : R₁ ≃+* R₂) : RingHomSurjective (σ : R₁ →+* R₂) 
goal: RingHomSurjective ↑σ