l3lab/ntp-mathlib huggingface dataset:
/--
An `EffectiveEpiFamily` consisting of a single `EffectiveEpi`
-/
noncomputable
def effectiveEpiFamilyStructSingletonOfEffectiveEpi {B X : C} (f : X ⟶ B) [EffectiveEpi f] :
    EffectiveEpiFamilyStruct (fun () ↦ X) (fun () ↦ f) where
  desc e h := EffectiveEpi.desc f (e ()) (fun g₁ g₂ hg ↦ h () () g₁ g₂ hg)
  fac e h := fun _ ↦ EffectiveEpi.fac f (e ()) (fun g₁ g₂ hg ↦ h () () g₁ g₂ hg)
  uniq e h m hm := by apply EffectiveEpi.uniq f (e ()) (h () ()); 

Proof state:
case hm
C : Type u_1
inst✝¹ : Category.{?u.130481, u_1} C
B X : C
f : X ⟶ B
inst✝ : EffectiveEpi f
W✝ : C
e : Unit → (X ⟶ W✝)
h :
  ∀ {Z : C} (a₁ a₂ : Unit) (g₁ g₂ : Z ⟶ X),
    ((g₁ ≫
          match a₁ with
          | PUnit.unit => f) =
        g₂ ≫
          match a₂ with
          | PUnit.unit => f) →
      g₁ ≫ e a₁ = g₂ ≫ e a₂
m : B ⟶ W✝
hm :
  ∀ (a : Unit),
    (match a with
        | PUnit.unit => f) ≫
        m =
      e a
⊢ f ≫ m = e ()

Next tactic:
exact hm ()
/--
A family of morphisms with the same target inducing an isomorphism from the coproduct to the target
is an `EffectiveEpiFamily`.
-/
noncomputable
def effectiveEpiFamilyStructOfIsIsoDesc {B : C} {α : Type*} (X : α → C)
    (π : (a : α) → (X a ⟶ B)) [HasCoproduct X] [IsIso (Sigma.desc π)] :
    EffectiveEpiFamilyStruct X π where
  desc e _ := (asIso (Sigma.desc π)).inv ≫ (Sigma.desc e)
  fac e h := by
    

Proof state:
C : Type u_1
inst✝² : Category.{?u.138907, u_1} C
B : C
α : Type u_2
X : α → C
π : (a : α) → X a ⟶ B
inst✝¹ : HasCoproduct X
inst✝ : IsIso (Sigma.desc π)
W✝ : C
e : (a : α) → X a ⟶ W✝
h : ∀ {Z : C} (a₁ a₂ : α) (g₁ : Z ⟶ X a₁) (g₂ : Z ⟶ X a₂), g₁ ≫ π a₁ = g₂ ≫ π a₂ → g₁ ≫ e a₁ = g₂ ≫ e a₂
⊢ ∀ (a : α),
    π a ≫
        (fun {W} e x => (asIso (Sigma.desc π)).inv ≫ Sigma.desc e) e
          (_ : ∀ {Z : C} (a₁ a₂ : α) (g₁ : Z ⟶ X a₁) (g₂ : Z ⟶ X a₂), g₁ ≫ π a₁ = g₂ ≫ π a₂ → g₁ ≫ e a₁ = g₂ ≫ e a₂) =
      e a

Next tactic:
intro a
/--
A family of morphisms with the same target inducing an isomorphism from the coproduct to the target
is an `EffectiveEpiFamily`.
-/
noncomputable
def effectiveEpiFamilyStructOfIsIsoDesc {B : C} {α : Type*} (X : α → C)
    (π : (a : α) → (X a ⟶ B)) [HasCoproduct X] [IsIso (Sigma.desc π)] :
    EffectiveEpiFamilyStruct X π where
  desc e _ := (asIso (Sigma.desc π)).inv ≫ (Sigma.desc e)
  fac e h := by
    intro a
    

Proof state:
C : Type u_1
inst✝² : Category.{?u.138907, u_1} C
B : C
α : Type u_2
X : α → C
π : (a : α) → X a ⟶ B
inst✝¹ : HasCoproduct X
inst✝ : IsIso (Sigma.desc π)
W✝ : C
e : (a : α) → X a ⟶ W✝
h : ∀ {Z : C} (a₁ a₂ : α) (g₁ : Z ⟶ X a₁) (g₂ : Z ⟶ X a₂), g₁ ≫ π a₁ = g₂ ≫ π a₂ → g₁ ≫ e a₁ = g₂ ≫ e a₂
a : α
⊢ π a ≫
      (fun {W} e x => (asIso (Sigma.desc π)).inv ≫ Sigma.desc e) e
        (_ : ∀ {Z : C} (a₁ a₂ : α) (g₁ : Z ⟶ X a₁) (g₂ : Z ⟶ X a₂), g₁ ≫ π a₁ = g₂ ≫ π a₂ → g₁ ≫ e a₁ = g₂ ≫ e a₂) =
    e a

Next tactic:
have : π a = Sigma.ι X a ≫ (asIso (Sigma.desc π)).hom := by simp only [asIso_hom,
      colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app]
/--
A family of morphisms with the same target inducing an isomorphism from the coproduct to the target
is an `EffectiveEpiFamily`.
-/
noncomputable
def effectiveEpiFamilyStructOfIsIsoDesc {B : C} {α : Type*} (X : α → C)
    (π : (a : α) → (X a ⟶ B)) [HasCoproduct X] [IsIso (Sigma.desc π)] :
    EffectiveEpiFamilyStruct X π where
  desc e _ := (asIso (Sigma.desc π)).inv ≫ (Sigma.desc e)
  fac e h := by
    intro a
    have : π a = Sigma.ι X a ≫ (asIso (Sigma.desc π)).hom := by 

Proof state:
C : Type u_1
inst✝² : Category.{?u.138907, u_1} C
B : C
α : Type u_2
X : α → C
π : (a : α) → X a ⟶ B
inst✝¹ : HasCoproduct X
inst✝ : IsIso (Sigma.desc π)
W✝ : C
e : (a : α) → X a ⟶ W✝
h : ∀ {Z : C} (a₁ a₂ : α) (g₁ : Z ⟶ X a₁) (g₂ : Z ⟶ X a₂), g₁ ≫ π a₁ = g₂ ≫ π a₂ → g₁ ≫ e a₁ = g₂ ≫ e a₂
a : α
⊢ π a = Sigma.ι X a ≫ (asIso (Sigma.desc π)).hom

Next tactic:
simp only [asIso_hom,
      colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app]
/--
A family of morphisms with the same target inducing an isomorphism from the coproduct to the target
is an `EffectiveEpiFamily`.
-/
noncomputable
def effectiveEpiFamilyStructOfIsIsoDesc {B : C} {α : Type*} (X : α → C)
    (π : (a : α) → (X a ⟶ B)) [HasCoproduct X] [IsIso (Sigma.desc π)] :
    EffectiveEpiFamilyStruct X π where
  desc e _ := (asIso (Sigma.desc π)).inv ≫ (Sigma.desc e)
  fac e h := by
    intro a
    have : π a = Sigma.ι X a ≫ (asIso (Sigma.desc π)).hom := by simp only [asIso_hom,
      colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app]
    

Proof state:
C : Type u_1
inst✝² : Category.{?u.138907, u_1} C
B : C
α : Type u_2
X : α → C
π : (a : α) → X a ⟶ B
inst✝¹ : HasCoproduct X
inst✝ : IsIso (Sigma.desc π)
W✝ : C
e : (a : α) → X a ⟶ W✝
h : ∀ {Z : C} (a₁ a₂ : α) (g₁ : Z ⟶ X a₁) (g₂ : Z ⟶ X a₂), g₁ ≫ π a₁ = g₂ ≫ π a₂ → g₁ ≫ e a₁ = g₂ ≫ e a₂
a : α
this : π a = Sigma.ι X a ≫ (asIso (Sigma.desc π)).hom
⊢ π a ≫
      (fun {W} e x => (asIso (Sigma.desc π)).inv ≫ Sigma.desc e) e
        (_ : ∀ {Z : C} (a₁ a₂ : α) (g₁ : Z ⟶ X a₁) (g₂ : Z ⟶ X a₂), g₁ ≫ π a₁ = g₂ ≫ π a₂ → g₁ ≫ e a₁ = g₂ ≫ e a₂) =
    e a

Next tactic:
rw [this, Category.assoc]
/--
A family of morphisms with the same target inducing an isomorphism from the coproduct to the target
is an `EffectiveEpiFamily`.
-/
noncomputable
def effectiveEpiFamilyStructOfIsIsoDesc {B : C} {α : Type*} (X : α → C)
    (π : (a : α) → (X a ⟶ B)) [HasCoproduct X] [IsIso (Sigma.desc π)] :
    EffectiveEpiFamilyStruct X π where
  desc e _ := (asIso (Sigma.desc π)).inv ≫ (Sigma.desc e)
  fac e h := by
    intro a
    have : π a = Sigma.ι X a ≫ (asIso (Sigma.desc π)).hom := by simp only [asIso_hom,
      colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app]
    rw [this, Category.assoc]
    

Proof state:
C : Type u_1
inst✝² : Category.{?u.138907, u_1} C
B : C
α : Type u_2
X : α → C
π : (a : α) → X a ⟶ B
inst✝¹ : HasCoproduct X
inst✝ : IsIso (Sigma.desc π)
W✝ : C
e : (a : α) → X a ⟶ W✝
h : ∀ {Z : C} (a₁ a₂ : α) (g₁ : Z ⟶ X a₁) (g₂ : Z ⟶ X a₂), g₁ ≫ π a₁ = g₂ ≫ π a₂ → g₁ ≫ e a₁ = g₂ ≫ e a₂
a : α
this : π a = Sigma.ι X a ≫ (asIso (Sigma.desc π)).hom
⊢ Sigma.ι X a ≫
      (asIso (Sigma.desc π)).hom ≫
        (fun {W} e x => (asIso (Sigma.desc π)).inv ≫ Sigma.desc e) e
          (_ : ∀ {Z : C} (a₁ a₂ : α) (g₁ : Z ⟶ X a₁) (g₂ : Z ⟶ X a₂), g₁ ≫ π a₁ = g₂ ≫ π a₂ → g₁ ≫ e a₁ = g₂ ≫ e a₂) =
    e a

Next tactic:
simp only [asIso_hom, asIso_inv, IsIso.hom_inv_id_assoc, colimit.ι_desc, Cofan.mk_pt,
      Cofan.mk_ι_app]
/--
A family of morphisms with the same target inducing an isomorphism from the coproduct to the target
is an `EffectiveEpiFamily`.
-/
noncomputable
def effectiveEpiFamilyStructOfIsIsoDesc {B : C} {α : Type*} (X : α → C)
    (π : (a : α) → (X a ⟶ B)) [HasCoproduct X] [IsIso (Sigma.desc π)] :
    EffectiveEpiFamilyStruct X π where
  desc e _ := (asIso (Sigma.desc π)).inv ≫ (Sigma.desc e)
  fac e h := by
    intro a
    have : π a = Sigma.ι X a ≫ (asIso (Sigma.desc π)).hom := by simp only [asIso_hom,
      colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app]
    rw [this, Category.assoc]
    simp only [asIso_hom, asIso_inv, IsIso.hom_inv_id_assoc, colimit.ι_desc, Cofan.mk_pt,
      Cofan.mk_ι_app]
  uniq e h m hm := by
    

Proof state:
C : Type u_1
inst✝² : Category.{?u.138907, u_1} C
B : C
α : Type u_2
X : α → C
π : (a : α) → X a ⟶ B
inst✝¹ : HasCoproduct X
inst✝ : IsIso (Sigma.desc π)
W✝ : C
e : (a : α) → X a ⟶ W✝
h : ∀ {Z : C} (a₁ a₂ : α) (g₁ : Z ⟶ X a₁) (g₂ : Z ⟶ X a₂), g₁ ≫ π a₁ = g₂ ≫ π a₂ → g₁ ≫ e a₁ = g₂ ≫ e a₂
m : B ⟶ W✝
hm : ∀ (a : α), π a ≫ m = e a
⊢ m =
    (fun {W} e x => (asIso (Sigma.desc π)).inv ≫ Sigma.desc e) e
      (_ : ∀ {Z : C} (a₁ a₂ : α) (g₁ : Z ⟶ X a₁) (g₂ : Z ⟶ X a₂), g₁ ≫ π a₁ = g₂ ≫ π a₂ → g₁ ≫ e a₁ = g₂ ≫ e a₂)

Next tactic:
simp only [asIso_inv, IsIso.eq_inv_comp]
/--
A family of morphisms with the same target inducing an isomorphism from the coproduct to the target
is an `EffectiveEpiFamily`.
-/
noncomputable
def effectiveEpiFamilyStructOfIsIsoDesc {B : C} {α : Type*} (X : α → C)
    (π : (a : α) → (X a ⟶ B)) [HasCoproduct X] [IsIso (Sigma.desc π)] :
    EffectiveEpiFamilyStruct X π where
  desc e _ := (asIso (Sigma.desc π)).inv ≫ (Sigma.desc e)
  fac e h := by
    intro a
    have : π a = Sigma.ι X a ≫ (asIso (Sigma.desc π)).hom := by simp only [asIso_hom,
      colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app]
    rw [this, Category.assoc]
    simp only [asIso_hom, asIso_inv, IsIso.hom_inv_id_assoc, colimit.ι_desc, Cofan.mk_pt,
      Cofan.mk_ι_app]
  uniq e h m hm := by
    simp only [asIso_inv, IsIso.eq_inv_comp]
    

Proof state:
C : Type u_1
inst✝² : Category.{?u.138907, u_1} C
B : C
α : Type u_2
X : α → C
π : (a : α) → X a ⟶ B
inst✝¹ : HasCoproduct X
inst✝ : IsIso (Sigma.desc π)
W✝ : C
e : (a : α) → X a ⟶ W✝
h : ∀ {Z : C} (a₁ a₂ : α) (g₁ : Z ⟶ X a₁) (g₂ : Z ⟶ X a₂), g₁ ≫ π a₁ = g₂ ≫ π a₂ → g₁ ≫ e a₁ = g₂ ≫ e a₂
m : B ⟶ W✝
hm : ∀ (a : α), π a ≫ m = e a
⊢ Sigma.desc π ≫ m = Sigma.desc e

Next tactic:
ext a
/--
A family of morphisms with the same target inducing an isomorphism from the coproduct to the target
is an `EffectiveEpiFamily`.
-/
noncomputable
def effectiveEpiFamilyStructOfIsIsoDesc {B : C} {α : Type*} (X : α → C)
    (π : (a : α) → (X a ⟶ B)) [HasCoproduct X] [IsIso (Sigma.desc π)] :
    EffectiveEpiFamilyStruct X π where
  desc e _ := (asIso (Sigma.desc π)).inv ≫ (Sigma.desc e)
  fac e h := by
    intro a
    have : π a = Sigma.ι X a ≫ (asIso (Sigma.desc π)).hom := by simp only [asIso_hom,
      colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app]
    rw [this, Category.assoc]
    simp only [asIso_hom, asIso_inv, IsIso.hom_inv_id_assoc, colimit.ι_desc, Cofan.mk_pt,
      Cofan.mk_ι_app]
  uniq e h m hm := by
    simp only [asIso_inv, IsIso.eq_inv_comp]
    ext a
    

Proof state:
case h
C : Type u_1
inst✝² : Category.{?u.138907, u_1} C
B : C
α : Type u_2
X : α → C
π : (a : α) → X a ⟶ B
inst✝¹ : HasCoproduct X
inst✝ : IsIso (Sigma.desc π)
W✝ : C
e : (a : α) → X a ⟶ W✝
h : ∀ {Z : C} (a₁ a₂ : α) (g₁ : Z ⟶ X a₁) (g₂ : Z ⟶ X a₂), g₁ ≫ π a₁ = g₂ ≫ π a₂ → g₁ ≫ e a₁ = g₂ ≫ e a₂
m : B ⟶ W✝
hm : ∀ (a : α), π a ≫ m = e a
a : α
⊢ Sigma.ι (fun b => X b) a ≫ Sigma.desc π ≫ m = Sigma.ι (fun b => X b) a ≫ Sigma.desc e

Next tactic:
simp only [colimit.ι_desc_assoc, Discrete.functor_obj, Cofan.mk_pt, Cofan.mk_ι_app,
      colimit.ι_desc]
/--
A family of morphisms with the same target inducing an isomorphism from the coproduct to the target
is an `EffectiveEpiFamily`.
-/
noncomputable
def effectiveEpiFamilyStructOfIsIsoDesc {B : C} {α : Type*} (X : α → C)
    (π : (a : α) → (X a ⟶ B)) [HasCoproduct X] [IsIso (Sigma.desc π)] :
    EffectiveEpiFamilyStruct X π where
  desc e _ := (asIso (Sigma.desc π)).inv ≫ (Sigma.desc e)
  fac e h := by
    intro a
    have : π a = Sigma.ι X a ≫ (asIso (Sigma.desc π)).hom := by simp only [asIso_hom,
      colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app]
    rw [this, Category.assoc]
    simp only [asIso_hom, asIso_inv, IsIso.hom_inv_id_assoc, colimit.ι_desc, Cofan.mk_pt,
      Cofan.mk_ι_app]
  uniq e h m hm := by
    simp only [asIso_inv, IsIso.eq_inv_comp]
    ext a
    simp only [colimit.ι_desc_assoc, Discrete.functor_obj, Cofan.mk_pt, Cofan.mk_ι_app,
      colimit.ι_desc]
    

Proof state:
case h
C : Type u_1
inst✝² : Category.{?u.138907, u_1} C
B : C
α : Type u_2
X : α → C
π : (a : α) → X a ⟶ B
inst✝¹ : HasCoproduct X
inst✝ : IsIso (Sigma.desc π)
W✝ : C
e : (a : α) → X a ⟶ W✝
h : ∀ {Z : C} (a₁ a₂ : α) (g₁ : Z ⟶ X a₁) (g₂ : Z ⟶ X a₂), g₁ ≫ π a₁ = g₂ ≫ π a₂ → g₁ ≫ e a₁ = g₂ ≫ e a₂
m : B ⟶ W✝
hm : ∀ (a : α), π a ≫ m = e a
a : α
⊢ π a ≫ m = e a

Next tactic:
exact hm a
/-- The identity is an effective epi. -/
noncomputable
def effectiveEpiStructOfIsIso {X Y : C} (f : X ⟶ Y) [IsIso f] : EffectiveEpiStruct f where
  desc e _ := inv f ≫ e
  fac _ _ := by 

Proof state:
C : Type u_1
inst✝¹ : Category.{?u.145354, u_1} C
X Y : C
f : X ⟶ Y
inst✝ : IsIso f
W✝ : C
x✝¹ : X ⟶ W✝
x✝ : ∀ {Z : C} (g₁ g₂ : Z ⟶ X), g₁ ≫ f = g₂ ≫ f → g₁ ≫ x✝¹ = g₂ ≫ x✝¹
⊢ f ≫ (fun {W} e x => inv f ≫ e) x✝¹ (_ : ∀ {Z : C} (g₁ g₂ : Z ⟶ X), g₁ ≫ f = g₂ ≫ f → g₁ ≫ x✝¹ = g₂ ≫ x✝¹) = x✝¹

Next tactic:
simp
/-- The identity is an effective epi. -/
noncomputable
def effectiveEpiStructOfIsIso {X Y : C} (f : X ⟶ Y) [IsIso f] : EffectiveEpiStruct f where
  desc e _ := inv f ≫ e
  fac _ _ := by simp
  uniq _ _ _ h := by 

Proof state:
C : Type u_1
inst✝¹ : Category.{?u.145354, u_1} C
X Y : C
f : X ⟶ Y
inst✝ : IsIso f
W✝ : C
x✝² : X ⟶ W✝
x✝¹ : ∀ {Z : C} (g₁ g₂ : Z ⟶ X), g₁ ≫ f = g₂ ≫ f → g₁ ≫ x✝² = g₂ ≫ x✝²
x✝ : Y ⟶ W✝
h : f ≫ x✝ = x✝²
⊢ x✝ = (fun {W} e x => inv f ≫ e) x✝² (_ : ∀ {Z : C} (g₁ g₂ : Z ⟶ X), g₁ ≫ f = g₂ ≫ f → g₁ ≫ x✝² = g₂ ≫ x✝²)

Next tactic:
simpa using h
/--
A split epi followed by an effective epi is an effective epi. This version takes an explicit section
to the split epi, and is mainly used to define `effectiveEpiStructCompOfEffectiveEpiSplitEpi`,
which takes a `IsSplitEpi` instance instead.
-/
noncomputable
def effectiveEpiStructCompOfEffectiveEpiSplitEpi' {B X Y : C} (f : X ⟶ B) (g : Y ⟶ X) (i : X ⟶ Y)
    (hi : i ≫ g = 𝟙 _) [EffectiveEpi f] : EffectiveEpiStruct (g ≫ f) where
  desc e w := EffectiveEpi.desc f (i ≫ e) fun g₁ g₂ _ ↦ (by
    

Proof state:
C : Type u_1
inst✝¹ : Category.{?u.147785, u_1} C
B X Y : C
f : X ⟶ B
g : Y ⟶ X
i : X ⟶ Y
hi : i ≫ g = 𝟙 X
inst✝ : EffectiveEpi f
W✝ : C
e : Y ⟶ W✝
w : ∀ {Z : C} (g₁ g₂ : Z ⟶ Y), g₁ ≫ g ≫ f = g₂ ≫ g ≫ f → g₁ ≫ e = g₂ ≫ e
Z✝ : C
g₁ g₂ : Z✝ ⟶ X
x✝ : g₁ ≫ f = g₂ ≫ f
⊢ g₁ ≫ i ≫ e = g₂ ≫ i ≫ e

Next tactic:
simp only [← Category.assoc]
/--
A split epi followed by an effective epi is an effective epi. This version takes an explicit section
to the split epi, and is mainly used to define `effectiveEpiStructCompOfEffectiveEpiSplitEpi`,
which takes a `IsSplitEpi` instance instead.
-/
noncomputable
def effectiveEpiStructCompOfEffectiveEpiSplitEpi' {B X Y : C} (f : X ⟶ B) (g : Y ⟶ X) (i : X ⟶ Y)
    (hi : i ≫ g = 𝟙 _) [EffectiveEpi f] : EffectiveEpiStruct (g ≫ f) where
  desc e w := EffectiveEpi.desc f (i ≫ e) fun g₁ g₂ _ ↦ (by
    simp only [← Category.assoc]
    

Proof state:
C : Type u_1
inst✝¹ : Category.{?u.147785, u_1} C
B X Y : C
f : X ⟶ B
g : Y ⟶ X
i : X ⟶ Y
hi : i ≫ g = 𝟙 X
inst✝ : EffectiveEpi f
W✝ : C
e : Y ⟶ W✝
w : ∀ {Z : C} (g₁ g₂ : Z ⟶ Y), g₁ ≫ g ≫ f = g₂ ≫ g ≫ f → g₁ ≫ e = g₂ ≫ e
Z✝ : C
g₁ g₂ : Z✝ ⟶ X
x✝ : g₁ ≫ f = g₂ ≫ f
⊢ (g₁ ≫ i) ≫ e = (g₂ ≫ i) ≫ e

Next tactic:
apply w (g₁ ≫ i) (g₂ ≫ i)
/--
A split epi followed by an effective epi is an effective epi. This version takes an explicit section
to the split epi, and is mainly used to define `effectiveEpiStructCompOfEffectiveEpiSplitEpi`,
which takes a `IsSplitEpi` instance instead.
-/
noncomputable
def effectiveEpiStructCompOfEffectiveEpiSplitEpi' {B X Y : C} (f : X ⟶ B) (g : Y ⟶ X) (i : X ⟶ Y)
    (hi : i ≫ g = 𝟙 _) [EffectiveEpi f] : EffectiveEpiStruct (g ≫ f) where
  desc e w := EffectiveEpi.desc f (i ≫ e) fun g₁ g₂ _ ↦ (by
    simp only [← Category.assoc]
    apply w (g₁ ≫ i) (g₂ ≫ i)
    

Proof state:
C : Type u_1
inst✝¹ : Category.{?u.147785, u_1} C
B X Y : C
f : X ⟶ B
g : Y ⟶ X
i : X ⟶ Y
hi : i ≫ g = 𝟙 X
inst✝ : EffectiveEpi f
W✝ : C
e : Y ⟶ W✝
w : ∀ {Z : C} (g₁ g₂ : Z ⟶ Y), g₁ ≫ g ≫ f = g₂ ≫ g ≫ f → g₁ ≫ e = g₂ ≫ e
Z✝ : C
g₁ g₂ : Z✝ ⟶ X
x✝ : g₁ ≫ f = g₂ ≫ f
⊢ (g₁ ≫ i) ≫ g ≫ f = (g₂ ≫ i) ≫ g ≫ f

Next tactic:
simpa [← Category.assoc, hi]
/--
A split epi followed by an effective epi is an effective epi. This version takes an explicit section
to the split epi, and is mainly used to define `effectiveEpiStructCompOfEffectiveEpiSplitEpi`,
which takes a `IsSplitEpi` instance instead.
-/
noncomputable
def effectiveEpiStructCompOfEffectiveEpiSplitEpi' {B X Y : C} (f : X ⟶ B) (g : Y ⟶ X) (i : X ⟶ Y)
    (hi : i ≫ g = 𝟙 _) [EffectiveEpi f] : EffectiveEpiStruct (g ≫ f) where
  desc e w := EffectiveEpi.desc f (i ≫ e) fun g₁ g₂ _ ↦ (by
    simp only [← Category.assoc]
    apply w (g₁ ≫ i) (g₂ ≫ i)
    simpa [← Category.assoc, hi])
  fac e w := by
    

Proof state:
C : Type u_1
inst✝¹ : Category.{?u.147785, u_1} C
B X Y : C
f : X ⟶ B
g : Y ⟶ X
i : X ⟶ Y
hi : i ≫ g = 𝟙 X
inst✝ : EffectiveEpi f
W✝ : C
e : Y ⟶ W✝
w : ∀ {Z : C} (g₁ g₂ : Z ⟶ Y), g₁ ≫ g ≫ f = g₂ ≫ g ≫ f → g₁ ≫ e = g₂ ≫ e
⊢ (g ≫ f) ≫
      (fun {W} e w =>
          EffectiveEpi.desc f (i ≫ e) (_ : ∀ {Z : C} (g₁ g₂ : Z ⟶ X), g₁ ≫ f = g₂ ≫ f → g₁ ≫ i ≫ e = g₂ ≫ i ≫ e))
        e (_ : ∀ {Z : C} (g₁ g₂ : Z ⟶ Y), g₁ ≫ g ≫ f = g₂ ≫ g ≫ f → g₁ ≫ e = g₂ ≫ e) =
    e

Next tactic:
simp only [Category.assoc, EffectiveEpi.fac]
/--
A split epi followed by an effective epi is an effective epi. This version takes an explicit section
to the split epi, and is mainly used to define `effectiveEpiStructCompOfEffectiveEpiSplitEpi`,
which takes a `IsSplitEpi` instance instead.
-/
noncomputable
def effectiveEpiStructCompOfEffectiveEpiSplitEpi' {B X Y : C} (f : X ⟶ B) (g : Y ⟶ X) (i : X ⟶ Y)
    (hi : i ≫ g = 𝟙 _) [EffectiveEpi f] : EffectiveEpiStruct (g ≫ f) where
  desc e w := EffectiveEpi.desc f (i ≫ e) fun g₁ g₂ _ ↦ (by
    simp only [← Category.assoc]
    apply w (g₁ ≫ i) (g₂ ≫ i)
    simpa [← Category.assoc, hi])
  fac e w := by
    simp only [Category.assoc, EffectiveEpi.fac]
    

Proof state:
C : Type u_1
inst✝¹ : Category.{?u.147785, u_1} C
B X Y : C
f : X ⟶ B
g : Y ⟶ X
i : X ⟶ Y
hi : i ≫ g = 𝟙 X
inst✝ : EffectiveEpi f
W✝ : C
e : Y ⟶ W✝
w : ∀ {Z : C} (g₁ g₂ : Z ⟶ Y), g₁ ≫ g ≫ f = g₂ ≫ g ≫ f → g₁ ≫ e = g₂ ≫ e
⊢ g ≫ i ≫ e = e

Next tactic:
rw [← Category.id_comp e, ← Category.assoc, ← Category.assoc]
/--
A split epi followed by an effective epi is an effective epi. This version takes an explicit section
to the split epi, and is mainly used to define `effectiveEpiStructCompOfEffectiveEpiSplitEpi`,
which takes a `IsSplitEpi` instance instead.
-/
noncomputable
def effectiveEpiStructCompOfEffectiveEpiSplitEpi' {B X Y : C} (f : X ⟶ B) (g : Y ⟶ X) (i : X ⟶ Y)
    (hi : i ≫ g = 𝟙 _) [EffectiveEpi f] : EffectiveEpiStruct (g ≫ f) where
  desc e w := EffectiveEpi.desc f (i ≫ e) fun g₁ g₂ _ ↦ (by
    simp only [← Category.assoc]
    apply w (g₁ ≫ i) (g₂ ≫ i)
    simpa [← Category.assoc, hi])
  fac e w := by
    simp only [Category.assoc, EffectiveEpi.fac]
    rw [← Category.id_comp e, ← Category.assoc, ← Category.assoc]
    

Proof state:
C : Type u_1
inst✝¹ : Category.{?u.147785, u_1} C
B X Y : C
f : X ⟶ B
g : Y ⟶ X
i : X ⟶ Y
hi : i ≫ g = 𝟙 X
inst✝ : EffectiveEpi f
W✝ : C
e : Y ⟶ W✝
w : ∀ {Z : C} (g₁ g₂ : Z ⟶ Y), g₁ ≫ g ≫ f = g₂ ≫ g ≫ f → g₁ ≫ e = g₂ ≫ e
⊢ ((g ≫ i) ≫ 𝟙 Y) ≫ e = 𝟙 Y ≫ e

Next tactic:
apply w
/--
A split epi followed by an effective epi is an effective epi. This version takes an explicit section
to the split epi, and is mainly used to define `effectiveEpiStructCompOfEffectiveEpiSplitEpi`,
which takes a `IsSplitEpi` instance instead.
-/
noncomputable
def effectiveEpiStructCompOfEffectiveEpiSplitEpi' {B X Y : C} (f : X ⟶ B) (g : Y ⟶ X) (i : X ⟶ Y)
    (hi : i ≫ g = 𝟙 _) [EffectiveEpi f] : EffectiveEpiStruct (g ≫ f) where
  desc e w := EffectiveEpi.desc f (i ≫ e) fun g₁ g₂ _ ↦ (by
    simp only [← Category.assoc]
    apply w (g₁ ≫ i) (g₂ ≫ i)
    simpa [← Category.assoc, hi])
  fac e w := by
    simp only [Category.assoc, EffectiveEpi.fac]
    rw [← Category.id_comp e, ← Category.assoc, ← Category.assoc]
    apply w
    

Proof state:
case a
C : Type u_1
inst✝¹ : Category.{?u.147785, u_1} C
B X Y : C
f : X ⟶ B
g : Y ⟶ X
i : X ⟶ Y
hi : i ≫ g = 𝟙 X
inst✝ : EffectiveEpi f
W✝ : C
e : Y ⟶ W✝
w : ∀ {Z : C} (g₁ g₂ : Z ⟶ Y), g₁ ≫ g ≫ f = g₂ ≫ g ≫ f → g₁ ≫ e = g₂ ≫ e
⊢ ((g ≫ i) ≫ 𝟙 Y) ≫ g ≫ f = 𝟙 Y ≫ g ≫ f

Next tactic:
simp only [Category.comp_id, Category.id_comp, ← Category.assoc]
/--
A split epi followed by an effective epi is an effective epi. This version takes an explicit section
to the split epi, and is mainly used to define `effectiveEpiStructCompOfEffectiveEpiSplitEpi`,
which takes a `IsSplitEpi` instance instead.
-/
noncomputable
def effectiveEpiStructCompOfEffectiveEpiSplitEpi' {B X Y : C} (f : X ⟶ B) (g : Y ⟶ X) (i : X ⟶ Y)
    (hi : i ≫ g = 𝟙 _) [EffectiveEpi f] : EffectiveEpiStruct (g ≫ f) where
  desc e w := EffectiveEpi.desc f (i ≫ e) fun g₁ g₂ _ ↦ (by
    simp only [← Category.assoc]
    apply w (g₁ ≫ i) (g₂ ≫ i)
    simpa [← Category.assoc, hi])
  fac e w := by
    simp only [Category.assoc, EffectiveEpi.fac]
    rw [← Category.id_comp e, ← Category.assoc, ← Category.assoc]
    apply w
    simp only [Category.comp_id, Category.id_comp, ← Category.assoc]
    

Proof state:
case a
C : Type u_1
inst✝¹ : Category.{?u.147785, u_1} C
B X Y : C
f : X ⟶ B
g : Y ⟶ X
i : X ⟶ Y
hi : i ≫ g = 𝟙 X
inst✝ : EffectiveEpi f
W✝ : C
e : Y ⟶ W✝
w : ∀ {Z : C} (g₁ g₂ : Z ⟶ Y), g₁ ≫ g ≫ f = g₂ ≫ g ≫ f → g₁ ≫ e = g₂ ≫ e
⊢ ((g ≫ i) ≫ g) ≫ f = g ≫ f

Next tactic:
aesop
/--
A split epi followed by an effective epi is an effective epi. This version takes an explicit section
to the split epi, and is mainly used to define `effectiveEpiStructCompOfEffectiveEpiSplitEpi`,
which takes a `IsSplitEpi` instance instead.
-/
noncomputable
def effectiveEpiStructCompOfEffectiveEpiSplitEpi' {B X Y : C} (f : X ⟶ B) (g : Y ⟶ X) (i : X ⟶ Y)
    (hi : i ≫ g = 𝟙 _) [EffectiveEpi f] : EffectiveEpiStruct (g ≫ f) where
  desc e w := EffectiveEpi.desc f (i ≫ e) fun g₁ g₂ _ ↦ (by
    simp only [← Category.assoc]
    apply w (g₁ ≫ i) (g₂ ≫ i)
    simpa [← Category.assoc, hi])
  fac e w := by
    simp only [Category.assoc, EffectiveEpi.fac]
    rw [← Category.id_comp e, ← Category.assoc, ← Category.assoc]
    apply w
    simp only [Category.comp_id, Category.id_comp, ← Category.assoc]
    aesop
  uniq _ _ _ hm := by
    

Proof state:
C : Type u_1
inst✝¹ : Category.{?u.147785, u_1} C
B X Y : C
f : X ⟶ B
g : Y ⟶ X
i : X ⟶ Y
hi : i ≫ g = 𝟙 X
inst✝ : EffectiveEpi f
W✝ : C
x✝² : Y ⟶ W✝
x✝¹ : ∀ {Z : C} (g₁ g₂ : Z ⟶ Y), g₁ ≫ g ≫ f = g₂ ≫ g ≫ f → g₁ ≫ x✝² = g₂ ≫ x✝²
x✝ : B ⟶ W✝
hm : (g ≫ f) ≫ x✝ = x✝²
⊢ x✝ =
    (fun {W} e w =>
        EffectiveEpi.desc f (i ≫ e) (_ : ∀ {Z : C} (g₁ g₂ : Z ⟶ X), g₁ ≫ f = g₂ ≫ f → g₁ ≫ i ≫ e = g₂ ≫ i ≫ e))
      x✝² (_ : ∀ {Z : C} (g₁ g₂ : Z ⟶ Y), g₁ ≫ g ≫ f = g₂ ≫ g ≫ f → g₁ ≫ x✝² = g₂ ≫ x✝²)

Next tactic:
apply EffectiveEpi.uniq f
/--
A split epi followed by an effective epi is an effective epi. This version takes an explicit section
to the split epi, and is mainly used to define `effectiveEpiStructCompOfEffectiveEpiSplitEpi`,
which takes a `IsSplitEpi` instance instead.
-/
noncomputable
def effectiveEpiStructCompOfEffectiveEpiSplitEpi' {B X Y : C} (f : X ⟶ B) (g : Y ⟶ X) (i : X ⟶ Y)
    (hi : i ≫ g = 𝟙 _) [EffectiveEpi f] : EffectiveEpiStruct (g ≫ f) where
  desc e w := EffectiveEpi.desc f (i ≫ e) fun g₁ g₂ _ ↦ (by
    simp only [← Category.assoc]
    apply w (g₁ ≫ i) (g₂ ≫ i)
    simpa [← Category.assoc, hi])
  fac e w := by
    simp only [Category.assoc, EffectiveEpi.fac]
    rw [← Category.id_comp e, ← Category.assoc, ← Category.assoc]
    apply w
    simp only [Category.comp_id, Category.id_comp, ← Category.assoc]
    aesop
  uniq _ _ _ hm := by
    apply EffectiveEpi.uniq f
    

Proof state:
case hm
C : Type u_1
inst✝¹ : Category.{?u.147785, u_1} C
B X Y : C
f : X ⟶ B
g : Y ⟶ X
i : X ⟶ Y
hi : i ≫ g = 𝟙 X
inst✝ : EffectiveEpi f
W✝ : C
x✝² : Y ⟶ W✝
x✝¹ : ∀ {Z : C} (g₁ g₂ : Z ⟶ Y), g₁ ≫ g ≫ f = g₂ ≫ g ≫ f → g₁ ≫ x✝² = g₂ ≫ x✝²
x✝ : B ⟶ W✝
hm : (g ≫ f) ≫ x✝ = x✝²
⊢ f ≫ x✝ = i ≫ x✝²

Next tactic:
rw [← hm, ← Category.assoc, ← Category.assoc, hi, Category.id_comp]
/-- An effective epi which has a kernel pair is a regular epi. -/
noncomputable instance regularEpiOfEffectiveEpi {B X : C} (f : X ⟶ B) [HasPullback f f]
    [EffectiveEpi f] : RegularEpi f where
  W := pullback f f
  left := pullback.fst
  right := pullback.snd
  w := pullback.condition
  isColimit := {
    desc := fun s ↦ EffectiveEpi.desc f (s.ι.app WalkingParallelPair.one) fun g₁ g₂ hg ↦ (by
      

Proof state:
C : Type u_1
inst✝² : Category.{?u.160059, u_1} C
B X : C
f : X ⟶ B
inst✝¹ : HasPullback f f
inst✝ : EffectiveEpi f
s : Cocone (parallelPair pullback.fst pullback.snd)
Z✝ : C
g₁ g₂ : Z✝ ⟶ X
hg : g₁ ≫ f = g₂ ≫ f
⊢ g₁ ≫ s.ι.app WalkingParallelPair.one = g₂ ≫ s.ι.app WalkingParallelPair.one

Next tactic:
simp only [Cofork.app_one_eq_π]