File: Mathlib/CategoryTheory/Abelian/NonPreadditive.lean

full_name: CategoryTheory.NonPreadditiveAbelian
code: /-- We call a category `NonPreadditiveAbelian` if it has a zero object, kernels, cokernels, binary
    products and coproducts, and every monomorphism and every epimorphism is normal. -/
class NonPreadditiveAbelian extends HasZeroMorphisms C, NormalMonoCategory C,
    NormalEpiCategory C where
  [has_zero_object : HasZeroObject C]
  [has_kernels : HasKernels C]
  [has_cokernels : HasCokernels C]
  [has_finite_products : HasFiniteProducts C]
  [has_finite_coproducts : HasFiniteCoproducts C]
goal: Type (max u v)

full_name: CategoryTheory.NonPreadditiveAbelian.has_cokernels
code: /-- We call a category `NonPreadditiveAbelian` if it has a zero object, kernels, cokernels, binary
    products and coproducts, and every monomorphism and every epimorphism is normal. -/
class NonPreadditiveAbelian extends HasZeroMorphisms C, NormalMonoCategory C,
    NormalEpiCategory C where
  [has_zero_object : HasZeroObject C]
  [has_kernels : HasKernels C]
  [has_cokernels : HasCokernels C]
  [has_finite_products : HasFiniteProducts C]
  [has_finite_coproducts : HasFiniteCoproducts C]
goal: CategoryTheory.Limits.HasCokernels C

full_name: CategoryTheory.NonPreadditiveAbelian.has_finite_coproducts
code: /-- We call a category `NonPreadditiveAbelian` if it has a zero object, kernels, cokernels, binary
    products and coproducts, and every monomorphism and every epimorphism is normal. -/
class NonPreadditiveAbelian extends HasZeroMorphisms C, NormalMonoCategory C,
    NormalEpiCategory C where
  [has_zero_object : HasZeroObject C]
  [has_kernels : HasKernels C]
  [has_cokernels : HasCokernels C]
  [has_finite_products : HasFiniteProducts C]
  [has_finite_coproducts : HasFiniteCoproducts C]
goal: CategoryTheory.Limits.HasFiniteCoproducts C

full_name: CategoryTheory.NonPreadditiveAbelian.has_zero_object
code: /-- We call a category `NonPreadditiveAbelian` if it has a zero object, kernels, cokernels, binary
    products and coproducts, and every monomorphism and every epimorphism is normal. -/
class NonPreadditiveAbelian extends HasZeroMorphisms C, NormalMonoCategory C,
    NormalEpiCategory C where
  [has_zero_object : HasZeroObject C]
  [has_kernels : HasKernels C]
  [has_cokernels : HasCokernels C]
  [has_finite_products : HasFiniteProducts C]
  [has_finite_coproducts : HasFiniteCoproducts C]
goal: CategoryTheory.Limits.HasZeroObject C

full_name: CategoryTheory.NonPreadditiveAbelian.has_kernels
code: /-- We call a category `NonPreadditiveAbelian` if it has a zero object, kernels, cokernels, binary
    products and coproducts, and every monomorphism and every epimorphism is normal. -/
class NonPreadditiveAbelian extends HasZeroMorphisms C, NormalMonoCategory C,
    NormalEpiCategory C where
  [has_zero_object : HasZeroObject C]
  [has_kernels : HasKernels C]
  [has_cokernels : HasCokernels C]
  [has_finite_products : HasFiniteProducts C]
  [has_finite_coproducts : HasFiniteCoproducts C]
goal: CategoryTheory.Limits.HasKernels C

full_name: CategoryTheory.NonPreadditiveAbelian.has_finite_products
code: /-- We call a category `NonPreadditiveAbelian` if it has a zero object, kernels, cokernels, binary
    products and coproducts, and every monomorphism and every epimorphism is normal. -/
class NonPreadditiveAbelian extends HasZeroMorphisms C, NormalMonoCategory C,
    NormalEpiCategory C where
  [has_zero_object : HasZeroObject C]
  [has_kernels : HasKernels C]
  [has_cokernels : HasCokernels C]
  [has_finite_products : HasFiniteProducts C]
  [has_finite_coproducts : HasFiniteCoproducts C]
goal: CategoryTheory.Limits.HasFiniteProducts C

full_name: CategoryTheory.NonPreadditiveAbelian.instEpiFactorThruImage
code: /-- The map `p : P ⟶ image f` is an epimorphism -/
instance : Epi (Abelian.factorThruImage f) 
goal: CategoryTheory.Epi (CategoryTheory.Abelian.factorThruImage f)

full_name: CategoryTheory.NonPreadditiveAbelian.isIso_factorThruImage
code: instance isIso_factorThruImage [Mono f] : IsIso (Abelian.factorThruImage f) 
goal: CategoryTheory.IsIso (CategoryTheory.Abelian.factorThruImage f)

full_name: CategoryTheory.NonPreadditiveAbelian.instMonoFactorThruCoimage
code: /-- The canonical morphism `i : coimage f ⟶ Q` is a monomorphism -/
instance : Mono (Abelian.factorThruCoimage f) 
goal: CategoryTheory.Mono (CategoryTheory.Abelian.factorThruCoimage f)

full_name: CategoryTheory.NonPreadditiveAbelian.isIso_factorThruCoimage
code: instance isIso_factorThruCoimage [Epi f] : IsIso (Abelian.factorThruCoimage f) 
goal: CategoryTheory.IsIso (CategoryTheory.Abelian.factorThruCoimage f)

full_name: CategoryTheory.NonPreadditiveAbelian.epiIsCokernelOfKernel
code: /-- In a `NonPreadditiveAbelian` category, an epi is the cokernel of its kernel. More precisely:
    If `f` is an epimorphism and `s` is some limit kernel cone on `f`, then `f` is a cokernel
    of `Fork.ι s`. -/
def epiIsCokernelOfKernel [Epi f] (s : Fork f 0) (h : IsLimit s) :
    IsColimit (CokernelCofork.ofπ f (KernelFork.condition s)) 
goal: CategoryTheory.Limits.IsColimit (CategoryTheory.Limits.CokernelCofork.ofπ f ⋯)

full_name: CategoryTheory.NonPreadditiveAbelian.monoIsKernelOfCokernel
code: /-- In a `NonPreadditiveAbelian` category, a mono is the kernel of its cokernel. More precisely:
    If `f` is a monomorphism and `s` is some colimit cokernel cocone on `f`, then `f` is a kernel
    of `Cofork.π s`. -/
def monoIsKernelOfCokernel [Mono f] (s : Cofork f 0) (h : IsColimit s) :
    IsLimit (KernelFork.ofι f (CokernelCofork.condition s)) 
goal: CategoryTheory.Limits.IsLimit (CategoryTheory.Limits.KernelFork.ofι f ⋯)

full_name: CategoryTheory.NonPreadditiveAbelian.r
code: /-- The composite `A ⟶ A ⨯ A ⟶ cokernel (Δ A)`, where the first map is `(𝟙 A, 0)` and the second map
    is the canonical projection into the cokernel. -/
abbrev r (A : C) : A ⟶ cokernel (diag A) 
goal: A ⟶ CategoryTheory.Limits.cokernel (CategoryTheory.Limits.diag A)

full_name: CategoryTheory.NonPreadditiveAbelian.mono_Δ
code: instance mono_Δ {A : C} : Mono (diag A) 
goal: CategoryTheory.Mono (CategoryTheory.Limits.diag A)

full_name: CategoryTheory.NonPreadditiveAbelian.mono_r
code: instance mono_r {A : C} : Mono (r A) 
goal: CategoryTheory.Mono (CategoryTheory.NonPreadditiveAbelian.r A)

full_name: CategoryTheory.NonPreadditiveAbelian.epi_r
code: instance epi_r {A : C} : Epi (r A) 
goal: CategoryTheory.Epi (CategoryTheory.NonPreadditiveAbelian.r A)

full_name: CategoryTheory.NonPreadditiveAbelian.isIso_r
code: instance isIso_r {A : C} : IsIso (r A) 
goal: CategoryTheory.IsIso (CategoryTheory.NonPreadditiveAbelian.r A)

full_name: CategoryTheory.NonPreadditiveAbelian.σ
code: /-- The composite `A ⨯ A ⟶ cokernel (diag A) ⟶ A` given by the natural projection into the cokernel
    followed by the inverse of `r`. In the category of modules, using the normal kernels and
    cokernels, this map is equal to the map `(a, b) ↦ a - b`, hence the name `σ` for
    "subtraction". -/
abbrev σ {A : C} : A ⨯ A ⟶ A 
goal: A ⨯ A ⟶ A

full_name: CategoryTheory.NonPreadditiveAbelian.diag_σ
code: @[reassoc]
theorem diag_σ {X : C} : diag X ≫ σ = 0 
goal: CategoryTheory.Limits.diag X ≫ CategoryTheory.NonPreadditiveAbelian.σ = 0

full_name: CategoryTheory.NonPreadditiveAbelian.lift_σ
code: @[reassoc (attr := simp)]
theorem lift_σ {X : C} : prod.lift (𝟙 X) 0 ≫ σ = 𝟙 X 
goal: CategoryTheory.Limits.prod.lift (𝟙 X) 0 ≫ CategoryTheory.NonPreadditiveAbelian.σ = 𝟙 X

full_name: CategoryTheory.NonPreadditiveAbelian.lift_map
code: @[reassoc]
theorem lift_map {X Y : C} (f : X ⟶ Y) :
    prod.lift (𝟙 X) 0 ≫ Limits.prod.map f f = f ≫ prod.lift (𝟙 Y) 0 
goal: CategoryTheory.Limits.prod.lift (𝟙 X) 0 ≫ CategoryTheory.Limits.prod.map f f =
  f ≫ CategoryTheory.Limits.prod.lift (𝟙 Y) 0

full_name: CategoryTheory.NonPreadditiveAbelian.isColimitσ
code: /-- σ is a cokernel of Δ X. -/
def isColimitσ {X : C} : IsColimit (CokernelCofork.ofπ (σ : X ⨯ X ⟶ X) diag_σ) 
goal: CategoryTheory.Limits.IsColimit (CategoryTheory.Limits.CokernelCofork.ofπ CategoryTheory.NonPreadditiveAbelian.σ ⋯)

full_name: CategoryTheory.NonPreadditiveAbelian.σ_comp
code: /-- This is the key identity satisfied by `σ`. -/
theorem σ_comp {X Y : C} (f : X ⟶ Y) : σ ≫ f = Limits.prod.map f f ≫ σ 
goal: CategoryTheory.NonPreadditiveAbelian.σ ≫ f = CategoryTheory.Limits.prod.map f f ≫ CategoryTheory.NonPreadditiveAbelian.σ

full_name: CategoryTheory.NonPreadditiveAbelian.hasSub
code: /-- Subtraction of morphisms in a `NonPreadditiveAbelian` category. -/
def hasSub {X Y : C} : Sub (X ⟶ Y) 
goal: Sub (X ⟶ Y)

full_name: CategoryTheory.NonPreadditiveAbelian.hasNeg
code: /-- Negation of morphisms in a `NonPreadditiveAbelian` category. -/
def hasNeg {X Y : C} : Neg (X ⟶ Y) 
goal: Neg (X ⟶ Y)

full_name: CategoryTheory.NonPreadditiveAbelian.hasAdd
code: /-- Addition of morphisms in a `NonPreadditiveAbelian` category. -/
def hasAdd {X Y : C} : Add (X ⟶ Y) 
goal: Add (X ⟶ Y)

full_name: CategoryTheory.NonPreadditiveAbelian.sub_def
code: theorem sub_def {X Y : C} (a b : X ⟶ Y) : a - b = prod.lift a b ≫ σ 
goal: a - b = CategoryTheory.Limits.prod.lift a b ≫ CategoryTheory.NonPreadditiveAbelian.σ

full_name: CategoryTheory.NonPreadditiveAbelian.add_def
code: theorem add_def {X Y : C} (a b : X ⟶ Y) : a + b = a - -b 
goal: a + b = a - -b

full_name: CategoryTheory.NonPreadditiveAbelian.neg_def
code: theorem neg_def {X Y : C} (a : X ⟶ Y) : -a = 0 - a 
goal: -a = 0 - a

full_name: CategoryTheory.NonPreadditiveAbelian.sub_zero
code: theorem sub_zero {X Y : C} (a : X ⟶ Y) : a - 0 = a 
goal: a - 0 = a

full_name: CategoryTheory.NonPreadditiveAbelian.sub_self
code: theorem sub_self {X Y : C} (a : X ⟶ Y) : a - a = 0 
goal: a - a = 0

full_name: CategoryTheory.NonPreadditiveAbelian.lift_sub_lift
code: theorem lift_sub_lift {X Y : C} (a b c d : X ⟶ Y) :
    prod.lift a b - prod.lift c d = prod.lift (a - c) (b - d) 
goal: CategoryTheory.Limits.prod.lift a b - CategoryTheory.Limits.prod.lift c d =
  CategoryTheory.Limits.prod.lift (a - c) (b - d)

full_name: CategoryTheory.NonPreadditiveAbelian.sub_sub_sub
code: theorem sub_sub_sub {X Y : C} (a b c d : X ⟶ Y) : a - c - (b - d) = a - b - (c - d) 
goal: a - c - (b - d) = a - b - (c - d)

full_name: CategoryTheory.NonPreadditiveAbelian.neg_sub
code: theorem neg_sub {X Y : C} (a b : X ⟶ Y) : -a - b = -b - a 
goal: -a - b = -b - a

full_name: CategoryTheory.NonPreadditiveAbelian.neg_neg
code: theorem neg_neg {X Y : C} (a : X ⟶ Y) : - -a = a 
goal: - -a = a

full_name: CategoryTheory.NonPreadditiveAbelian.add_comm
code: theorem add_comm {X Y : C} (a b : X ⟶ Y) : a + b = b + a 
goal: a + b = b + a

full_name: CategoryTheory.NonPreadditiveAbelian.add_neg
code: theorem add_neg {X Y : C} (a b : X ⟶ Y) : a + -b = a - b 
goal: a + -b = a - b

full_name: CategoryTheory.NonPreadditiveAbelian.add_neg_self
code: theorem add_neg_self {X Y : C} (a : X ⟶ Y) : a + -a = 0 
goal: a + -a = 0

full_name: CategoryTheory.NonPreadditiveAbelian.neg_add_self
code: theorem neg_add_self {X Y : C} (a : X ⟶ Y) : -a + a = 0 
goal: -a + a = 0

full_name: CategoryTheory.NonPreadditiveAbelian.neg_sub'
code: theorem neg_sub' {X Y : C} (a b : X ⟶ Y) : -(a - b) = -a + b 
goal: -(a - b) = -a + b

full_name: CategoryTheory.NonPreadditiveAbelian.neg_add
code: theorem neg_add {X Y : C} (a b : X ⟶ Y) : -(a + b) = -a - b 
goal: -(a + b) = -a - b

full_name: CategoryTheory.NonPreadditiveAbelian.sub_add
code: theorem sub_add {X Y : C} (a b c : X ⟶ Y) : a - b + c = a - (b - c) 
goal: a - b + c = a - (b - c)

full_name: CategoryTheory.NonPreadditiveAbelian.add_assoc
code: theorem add_assoc {X Y : C} (a b c : X ⟶ Y) : a + b + c = a + (b + c) 
goal: a + b + c = a + (b + c)

full_name: CategoryTheory.NonPreadditiveAbelian.add_zero
code: theorem add_zero {X Y : C} (a : X ⟶ Y) : a + 0 = a 
goal: a + 0 = a

full_name: CategoryTheory.NonPreadditiveAbelian.comp_sub
code: theorem comp_sub {X Y Z : C} (f : X ⟶ Y) (g h : Y ⟶ Z) : f ≫ (g - h) = f ≫ g - f ≫ h 
goal: f ≫ (g - h) = f ≫ g - f ≫ h

full_name: CategoryTheory.NonPreadditiveAbelian.sub_comp
code: theorem sub_comp {X Y Z : C} (f g : X ⟶ Y) (h : Y ⟶ Z) : (f - g) ≫ h = f ≫ h - g ≫ h 
goal: (f - g) ≫ h = f ≫ h - g ≫ h

full_name: CategoryTheory.NonPreadditiveAbelian.comp_add
code: theorem comp_add (X Y Z : C) (f : X ⟶ Y) (g h : Y ⟶ Z) : f ≫ (g + h) = f ≫ g + f ≫ h 
goal: f ≫ (g + h) = f ≫ g + f ≫ h

full_name: CategoryTheory.NonPreadditiveAbelian.add_comp
code: theorem add_comp (X Y Z : C) (f g : X ⟶ Y) (h : Y ⟶ Z) : (f + g) ≫ h = f ≫ h + g ≫ h 
goal: (f + g) ≫ h = f ≫ h + g ≫ h

full_name: CategoryTheory.NonPreadditiveAbelian.preadditive
code: /-- Every `NonPreadditiveAbelian` category is preadditive. -/
def preadditive : Preadditive C 
goal: CategoryTheory.Preadditive C