File: Mathlib/CategoryTheory/Limits/Shapes/KernelPair.lean

full_name: CategoryTheory.IsKernelPair
code: /-- `IsKernelPair f a b` expresses that `(a, b)` is a kernel pair for `f`, i.e. `a ≫ f = b ≫ f`
and the square
  R → X
  ↓   ↓
  X → Y
is a pullback square.
This is just an abbreviation for `IsPullback a b f f`.
-/
abbrev IsKernelPair 
goal: Prop

full_name: CategoryTheory.IsKernelPair.instSubsingleton
code: /-- The data expressing that `(a, b)` is a kernel pair is subsingleton. -/
instance : Subsingleton (IsKernelPair f a b) 
goal: Subsingleton (CategoryTheory.IsKernelPair f a b)

full_name: CategoryTheory.IsKernelPair.id_of_mono
code: /-- If `f` is a monomorphism, then `(𝟙 _, 𝟙 _)` is a kernel pair for `f`. -/
theorem id_of_mono [Mono f] : IsKernelPair f (𝟙 _) (𝟙 _) 
goal: CategoryTheory.IsKernelPair f (CategoryTheory.CategoryStruct.id X) (CategoryTheory.CategoryStruct.id X)

full_name: CategoryTheory.IsKernelPair.instInhabitedIdOfMono
code: instance [Mono f] : Inhabited (IsKernelPair f (𝟙 _) (𝟙 _)) 
goal: Inhabited (CategoryTheory.IsKernelPair f (CategoryTheory.CategoryStruct.id X) (CategoryTheory.CategoryStruct.id X))

full_name: CategoryTheory.IsKernelPair.lift
code: /--
Given a pair of morphisms `p`, `q` to `X` which factor through `f`, they factor through any kernel
pair of `f`.
-/
noncomputable def lift {S : C} (k : IsKernelPair f a b) (p q : S ⟶ X) (w : p ≫ f = q ≫ f) :
    S ⟶ R 
goal: S ⟶ R

full_name: CategoryTheory.IsKernelPair.lift_fst
code: @[reassoc (attr := simp)]
lemma lift_fst {S : C} (k : IsKernelPair f a b) (p q : S ⟶ X) (w : p ≫ f = q ≫ f) :
    k.lift p q w ≫ a = p 
goal: CategoryTheory.CategoryStruct.comp (k.lift p q w) a = p

full_name: CategoryTheory.IsKernelPair.lift_snd
code: @[reassoc (attr := simp)]
lemma lift_snd {S : C} (k : IsKernelPair f a b) (p q : S ⟶ X) (w : p ≫ f = q ≫ f) :
    k.lift p q w ≫ b = q 
goal: CategoryTheory.CategoryStruct.comp (k.lift p q w) b = q

full_name: CategoryTheory.IsKernelPair.lift'
code: /--
Given a pair of morphisms `p`, `q` to `X` which factor through `f`, they factor through any kernel
pair of `f`.
-/
noncomputable def lift' {S : C} (k : IsKernelPair f a b) (p q : S ⟶ X) (w : p ≫ f = q ≫ f) :
    { t : S ⟶ R // t ≫ a = p ∧ t ≫ b = q } 
goal: { t // CategoryTheory.CategoryStruct.comp t a = p ∧ CategoryTheory.CategoryStruct.comp t b = q }

full_name: CategoryTheory.IsKernelPair.cancel_right
code: /--
If `(a,b)` is a kernel pair for `f₁ ≫ f₂` and `a ≫ f₁ = b ≫ f₁`, then `(a,b)` is a kernel pair for
just `f₁`.
That is, to show that `(a,b)` is a kernel pair for `f₁` it suffices to only show the square
commutes, rather than to additionally show it's a pullback.
-/
theorem cancel_right {f₁ : X ⟶ Y} {f₂ : Y ⟶ Z} (comm : a ≫ f₁ = b ≫ f₁)
    (big_k : IsKernelPair (f₁ ≫ f₂) a b) : IsKernelPair f₁ a b 
goal: CategoryTheory.IsKernelPair f₁ a b

full_name: CategoryTheory.IsKernelPair.cancel_right_of_mono
code: /-- If `(a,b)` is a kernel pair for `f₁ ≫ f₂` and `f₂` is mono, then `(a,b)` is a kernel pair for
just `f₁`.
The converse of `comp_of_mono`.
-/
theorem cancel_right_of_mono {f₁ : X ⟶ Y} {f₂ : Y ⟶ Z} [Mono f₂]
    (big_k : IsKernelPair (f₁ ≫ f₂) a b) : IsKernelPair f₁ a b 
goal: CategoryTheory.IsKernelPair f₁ a b

full_name: CategoryTheory.IsKernelPair.comp_of_mono
code: /--
If `(a,b)` is a kernel pair for `f₁` and `f₂` is mono, then `(a,b)` is a kernel pair for `f₁ ≫ f₂`.
The converse of `cancel_right_of_mono`.
-/
theorem comp_of_mono {f₁ : X ⟶ Y} {f₂ : Y ⟶ Z} [Mono f₂] (small_k : IsKernelPair f₁ a b) :
    IsKernelPair (f₁ ≫ f₂) a b 
goal: CategoryTheory.IsKernelPair (CategoryTheory.CategoryStruct.comp f₁ f₂) a b

full_name: CategoryTheory.IsKernelPair.toCoequalizer
code: /--
If `(a,b)` is the kernel pair of `f`, and `f` is a coequalizer morphism for some parallel pair, then
`f` is a coequalizer morphism of `a` and `b`.
-/
def toCoequalizer (k : IsKernelPair f a b) [r : RegularEpi f] : IsColimit (Cofork.ofπ f k.w) 
goal: CategoryTheory.Limits.IsColimit (CategoryTheory.Limits.Cofork.ofπ f ⋯)

full_name: CategoryTheory.IsKernelPair.pullback
code: /-- If `a₁ a₂ : A ⟶ Y` is a kernel pair for `g : Y ⟶ Z`, then `a₁ ×[Z] X` and `a₂ ×[Z] X`
(`A ×[Z] X ⟶ Y ×[Z] X`) is a kernel pair for `Y ×[Z] X ⟶ X`. -/
protected theorem pullback {X Y Z A : C} {g : Y ⟶ Z} {a₁ a₂ : A ⟶ Y} (h : IsKernelPair g a₁ a₂)
    (f : X ⟶ Z) [HasPullback f g] [HasPullback f (a₁ ≫ g)] :
    IsKernelPair (pullback.fst f g)
      (pullback.map f _ f _ (𝟙 X) a₁ (𝟙 Z) (by simp) <| Category.comp_id _)
      (pullback.map _ _ _ _ (𝟙 X) a₂ (𝟙 Z) (by simp) <| (Category.comp_id _).trans h.1.1) 
goal: CategoryTheory.IsKernelPair (CategoryTheory.Limits.pullback.fst f g)
  (CategoryTheory.Limits.pullback.map f (CategoryTheory.CategoryStruct.comp a₁ g) f g
    (CategoryTheory.CategoryStruct.id X) a₁ (CategoryTheory.CategoryStruct.id Z) ⋯ ⋯)
  (CategoryTheory.Limits.pullback.map f (CategoryTheory.CategoryStruct.comp a₁ g) f g
    (CategoryTheory.CategoryStruct.id X) a₂ (CategoryTheory.CategoryStruct.id Z) ⋯ ⋯)

full_name: CategoryTheory.IsKernelPair.mono_of_isIso_fst
code: theorem mono_of_isIso_fst (h : IsKernelPair f a b) [IsIso a] : Mono f 
goal: CategoryTheory.Mono f

full_name: CategoryTheory.IsKernelPair.isIso_of_mono
code: theorem isIso_of_mono (h : IsKernelPair f a b) [Mono f] : IsIso a 
goal: CategoryTheory.IsIso a

full_name: CategoryTheory.IsKernelPair.of_isIso_of_mono
code: theorem of_isIso_of_mono [IsIso a] [Mono f] : IsKernelPair f a a 
goal: CategoryTheory.IsKernelPair f a a