l3lab/ntp-mathlib huggingface dataset:
/-- 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
      simp only [Cofork.app_one_eq_π]
      

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₁ ≫ Cofork.π s = g₂ ≫ Cofork.π s

Next tactic:
rw [← pullback.lift_snd g₁ g₂ hg, Category.assoc, ← Cofork.app_zero_eq_comp_π_right]
/-- 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
      simp only [Cofork.app_one_eq_π]
      rw [← pullback.lift_snd g₁ g₂ hg, Category.assoc, ← Cofork.app_zero_eq_comp_π_right]
      

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₁ ≫ Cofork.π s = pullback.lift g₁ g₂ hg ≫ s.ι.app WalkingParallelPair.zero

Next tactic:
simp
/-- 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
      simp only [Cofork.app_one_eq_π]
      rw [← pullback.lift_snd g₁ g₂ hg, Category.assoc, ← Cofork.app_zero_eq_comp_π_right]
      simp)
    fac := 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)) (j : WalkingParallelPair),
    (Cofork.ofπ f (_ : pullback.fst ≫ f = pullback.snd ≫ f)).ι.app j ≫
        (fun s =>
            EffectiveEpi.desc f (s.ι.app WalkingParallelPair.one)
              (_ :
                ∀ {Z : C} (g₁ g₂ : Z ⟶ X),
                  g₁ ≫ f = g₂ ≫ f → g₁ ≫ s.ι.app WalkingParallelPair.one = g₂ ≫ s.ι.app WalkingParallelPair.one))
          s =
      s.ι.app j

Next tactic:
intro s j
/-- 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
      simp only [Cofork.app_one_eq_π]
      rw [← pullback.lift_snd g₁ g₂ hg, Category.assoc, ← Cofork.app_zero_eq_comp_π_right]
      simp)
    fac := by
      intro s j
      

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)
j : WalkingParallelPair
⊢ (Cofork.ofπ f (_ : pullback.fst ≫ f = pullback.snd ≫ f)).ι.app j ≫
      (fun s =>
          EffectiveEpi.desc f (s.ι.app WalkingParallelPair.one)
            (_ :
              ∀ {Z : C} (g₁ g₂ : Z ⟶ X),
                g₁ ≫ f = g₂ ≫ f → g₁ ≫ s.ι.app WalkingParallelPair.one = g₂ ≫ s.ι.app WalkingParallelPair.one))
        s =
    s.ι.app j

Next tactic:
have := EffectiveEpi.fac f (s.ι.app WalkingParallelPair.one) fun g₁ g₂ hg ↦ (by
          simp only [Cofork.app_one_eq_π]
          rw [← pullback.lift_snd g₁ g₂ hg, Category.assoc, ← Cofork.app_zero_eq_comp_π_right]
          simp)
/-- 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
      simp only [Cofork.app_one_eq_π]
      rw [← pullback.lift_snd g₁ g₂ hg, Category.assoc, ← Cofork.app_zero_eq_comp_π_right]
      simp)
    fac := by
      intro s j
      have := EffectiveEpi.fac 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)
j : WalkingParallelPair
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_π]
/-- 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
      simp only [Cofork.app_one_eq_π]
      rw [← pullback.lift_snd g₁ g₂ hg, Category.assoc, ← Cofork.app_zero_eq_comp_π_right]
      simp)
    fac := by
      intro s j
      have := EffectiveEpi.fac f (s.ι.app WalkingParallelPair.one) fun g₁ g₂ hg ↦ (by
          simp only [Cofork.app_one_eq_π]
          

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)
j : WalkingParallelPair
Z✝ : C
g₁ g₂ : Z✝ ⟶ X
hg : g₁ ≫ f = g₂ ≫ f
⊢ g₁ ≫ Cofork.π s = g₂ ≫ Cofork.π s

Next tactic:
rw [← pullback.lift_snd g₁ g₂ hg, Category.assoc, ← Cofork.app_zero_eq_comp_π_right]
/-- 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
      simp only [Cofork.app_one_eq_π]
      rw [← pullback.lift_snd g₁ g₂ hg, Category.assoc, ← Cofork.app_zero_eq_comp_π_right]
      simp)
    fac := by
      intro s j
      have := EffectiveEpi.fac f (s.ι.app WalkingParallelPair.one) fun g₁ g₂ hg ↦ (by
          simp only [Cofork.app_one_eq_π]
          rw [← pullback.lift_snd g₁ g₂ hg, Category.assoc, ← Cofork.app_zero_eq_comp_π_right]
          

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)
j : WalkingParallelPair
Z✝ : C
g₁ g₂ : Z✝ ⟶ X
hg : g₁ ≫ f = g₂ ≫ f
⊢ g₁ ≫ Cofork.π s = pullback.lift g₁ g₂ hg ≫ s.ι.app WalkingParallelPair.zero

Next tactic:
simp
/-- 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
      simp only [Cofork.app_one_eq_π]
      rw [← pullback.lift_snd g₁ g₂ hg, Category.assoc, ← Cofork.app_zero_eq_comp_π_right]
      simp)
    fac := by
      intro s j
      have := EffectiveEpi.fac f (s.ι.app WalkingParallelPair.one) fun g₁ g₂ hg ↦ (by
          simp only [Cofork.app_one_eq_π]
          rw [← pullback.lift_snd g₁ g₂ hg, Category.assoc, ← Cofork.app_zero_eq_comp_π_right]
          simp)
      

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)
j : WalkingParallelPair
this :
  f ≫
      EffectiveEpi.desc f (s.ι.app WalkingParallelPair.one)
        (_ :
          ∀ {Z : C} (g₁ g₂ : Z ⟶ X),
            g₁ ≫ f = g₂ ≫ f → g₁ ≫ s.ι.app WalkingParallelPair.one = g₂ ≫ s.ι.app WalkingParallelPair.one) =
    s.ι.app WalkingParallelPair.one
⊢ (Cofork.ofπ f (_ : pullback.fst ≫ f = pullback.snd ≫ f)).ι.app j ≫
      (fun s =>
          EffectiveEpi.desc f (s.ι.app WalkingParallelPair.one)
            (_ :
              ∀ {Z : C} (g₁ g₂ : Z ⟶ X),
                g₁ ≫ f = g₂ ≫ f → g₁ ≫ s.ι.app WalkingParallelPair.one = g₂ ≫ s.ι.app WalkingParallelPair.one))
        s =
    s.ι.app j

Next tactic:
simp only [Functor.const_obj_obj, Cofork.app_one_eq_π] at this
/-- 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
      simp only [Cofork.app_one_eq_π]
      rw [← pullback.lift_snd g₁ g₂ hg, Category.assoc, ← Cofork.app_zero_eq_comp_π_right]
      simp)
    fac := by
      intro s j
      have := EffectiveEpi.fac f (s.ι.app WalkingParallelPair.one) fun g₁ g₂ hg ↦ (by
          simp only [Cofork.app_one_eq_π]
          rw [← pullback.lift_snd g₁ g₂ hg, Category.assoc, ← Cofork.app_zero_eq_comp_π_right]
          simp)
      simp only [Functor.const_obj_obj, Cofork.app_one_eq_π] at this
      

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)
j : WalkingParallelPair
this :
  f ≫
      EffectiveEpi.desc f (Cofork.π s)
        (_ : ∀ {Z : C} (g₁ g₂ : Z ⟶ X), g₁ ≫ f = g₂ ≫ f → g₁ ≫ Cofork.π s = g₂ ≫ Cofork.π s) =
    Cofork.π s
⊢ (Cofork.ofπ f (_ : pullback.fst ≫ f = pullback.snd ≫ f)).ι.app j ≫
      (fun s =>
          EffectiveEpi.desc f (s.ι.app WalkingParallelPair.one)
            (_ :
              ∀ {Z : C} (g₁ g₂ : Z ⟶ X),
                g₁ ≫ f = g₂ ≫ f → g₁ ≫ s.ι.app WalkingParallelPair.one = g₂ ≫ s.ι.app WalkingParallelPair.one))
        s =
    s.ι.app j

Next tactic:
cases j with
      | zero => simp [this]
      | one => simp [this]
/-- 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
      simp only [Cofork.app_one_eq_π]
      rw [← pullback.lift_snd g₁ g₂ hg, Category.assoc, ← Cofork.app_zero_eq_comp_π_right]
      simp)
    fac := by
      intro s j
      have := EffectiveEpi.fac f (s.ι.app WalkingParallelPair.one) fun g₁ g₂ hg ↦ (by
          simp only [Cofork.app_one_eq_π]
          rw [← pullback.lift_snd g₁ g₂ hg, Category.assoc, ← Cofork.app_zero_eq_comp_π_right]
          simp)
      simp only [Functor.const_obj_obj, Cofork.app_one_eq_π] at this
      cases j with
      

Proof state:
case zero
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)
this :
  f ≫
      EffectiveEpi.desc f (Cofork.π s)
        (_ : ∀ {Z : C} (g₁ g₂ : Z ⟶ X), g₁ ≫ f = g₂ ≫ f → g₁ ≫ Cofork.π s = g₂ ≫ Cofork.π s) =
    Cofork.π s
⊢ (Cofork.ofπ f (_ : pullback.fst ≫ f = pullback.snd ≫ f)).ι.app WalkingParallelPair.zero ≫
      (fun s =>
          EffectiveEpi.desc f (s.ι.app WalkingParallelPair.one)
            (_ :
              ∀ {Z : C} (g₁ g₂ : Z ⟶ X),
                g₁ ≫ f = g₂ ≫ f → g₁ ≫ s.ι.app WalkingParallelPair.one = g₂ ≫ s.ι.app WalkingParallelPair.one))
        s =
    s.ι.app WalkingParallelPair.zero

Next tactic:
| zero => simp [this]
/-- 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
      simp only [Cofork.app_one_eq_π]
      rw [← pullback.lift_snd g₁ g₂ hg, Category.assoc, ← Cofork.app_zero_eq_comp_π_right]
      simp)
    fac := by
      intro s j
      have := EffectiveEpi.fac f (s.ι.app WalkingParallelPair.one) fun g₁ g₂ hg ↦ (by
          simp only [Cofork.app_one_eq_π]
          rw [← pullback.lift_snd g₁ g₂ hg, Category.assoc, ← Cofork.app_zero_eq_comp_π_right]
          simp)
      simp only [Functor.const_obj_obj, Cofork.app_one_eq_π] at this
      cases j with
      | zero => 

Proof state:
case zero
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)
this :
  f ≫
      EffectiveEpi.desc f (Cofork.π s)
        (_ : ∀ {Z : C} (g₁ g₂ : Z ⟶ X), g₁ ≫ f = g₂ ≫ f → g₁ ≫ Cofork.π s = g₂ ≫ Cofork.π s) =
    Cofork.π s
⊢ (Cofork.ofπ f (_ : pullback.fst ≫ f = pullback.snd ≫ f)).ι.app WalkingParallelPair.zero ≫
      (fun s =>
          EffectiveEpi.desc f (s.ι.app WalkingParallelPair.one)
            (_ :
              ∀ {Z : C} (g₁ g₂ : Z ⟶ X),
                g₁ ≫ f = g₂ ≫ f → g₁ ≫ s.ι.app WalkingParallelPair.one = g₂ ≫ s.ι.app WalkingParallelPair.one))
        s =
    s.ι.app WalkingParallelPair.zero

Next tactic:
simp [this]
/-- 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
      simp only [Cofork.app_one_eq_π]
      rw [← pullback.lift_snd g₁ g₂ hg, Category.assoc, ← Cofork.app_zero_eq_comp_π_right]
      simp)
    fac := by
      intro s j
      have := EffectiveEpi.fac f (s.ι.app WalkingParallelPair.one) fun g₁ g₂ hg ↦ (by
          simp only [Cofork.app_one_eq_π]
          rw [← pullback.lift_snd g₁ g₂ hg, Category.assoc, ← Cofork.app_zero_eq_comp_π_right]
          simp)
      simp only [Functor.const_obj_obj, Cofork.app_one_eq_π] at this
      cases j with
      | zero => simp [this]
      

Proof state:
case one
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)
this :
  f ≫
      EffectiveEpi.desc f (Cofork.π s)
        (_ : ∀ {Z : C} (g₁ g₂ : Z ⟶ X), g₁ ≫ f = g₂ ≫ f → g₁ ≫ Cofork.π s = g₂ ≫ Cofork.π s) =
    Cofork.π s
⊢ (Cofork.ofπ f (_ : pullback.fst ≫ f = pullback.snd ≫ f)).ι.app WalkingParallelPair.one ≫
      (fun s =>
          EffectiveEpi.desc f (s.ι.app WalkingParallelPair.one)
            (_ :
              ∀ {Z : C} (g₁ g₂ : Z ⟶ X),
                g₁ ≫ f = g₂ ≫ f → g₁ ≫ s.ι.app WalkingParallelPair.one = g₂ ≫ s.ι.app WalkingParallelPair.one))
        s =
    s.ι.app WalkingParallelPair.one

Next tactic:
| one => simp [this]
/-- 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
      simp only [Cofork.app_one_eq_π]
      rw [← pullback.lift_snd g₁ g₂ hg, Category.assoc, ← Cofork.app_zero_eq_comp_π_right]
      simp)
    fac := by
      intro s j
      have := EffectiveEpi.fac f (s.ι.app WalkingParallelPair.one) fun g₁ g₂ hg ↦ (by
          simp only [Cofork.app_one_eq_π]
          rw [← pullback.lift_snd g₁ g₂ hg, Category.assoc, ← Cofork.app_zero_eq_comp_π_right]
          simp)
      simp only [Functor.const_obj_obj, Cofork.app_one_eq_π] at this
      cases j with
      | zero => simp [this]
      | one => 

Proof state:
case one
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)
this :
  f ≫
      EffectiveEpi.desc f (Cofork.π s)
        (_ : ∀ {Z : C} (g₁ g₂ : Z ⟶ X), g₁ ≫ f = g₂ ≫ f → g₁ ≫ Cofork.π s = g₂ ≫ Cofork.π s) =
    Cofork.π s
⊢ (Cofork.ofπ f (_ : pullback.fst ≫ f = pullback.snd ≫ f)).ι.app WalkingParallelPair.one ≫
      (fun s =>
          EffectiveEpi.desc f (s.ι.app WalkingParallelPair.one)
            (_ :
              ∀ {Z : C} (g₁ g₂ : Z ⟶ X),
                g₁ ≫ f = g₂ ≫ f → g₁ ≫ s.ι.app WalkingParallelPair.one = g₂ ≫ s.ι.app WalkingParallelPair.one))
        s =
    s.ι.app WalkingParallelPair.one

Next tactic:
simp [this]
lemma effectiveEpi_iff_epi {X Y : C} (f : X ⟶ Y) : EffectiveEpi f ↔ Epi f := by
  

Proof state:
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : HasFiniteCoproducts C
h :
  ∀ {α : Type} [inst : Fintype α] {B : C} (X : α → C) (π : (a : α) → X a ⟶ B),
    EffectiveEpiFamily X π ↔ Epi (Sigma.desc π)
X Y : C
f : X ⟶ Y
⊢ EffectiveEpi f ↔ Epi f

Next tactic:
rw [effectiveEpi_iff_effectiveEpiFamily, h]
lemma effectiveEpi_iff_epi {X Y : C} (f : X ⟶ Y) : EffectiveEpi f ↔ Epi f := by
  rw [effectiveEpi_iff_effectiveEpiFamily, h]
  

Proof state:
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : HasFiniteCoproducts C
h :
  ∀ {α : Type} [inst : Fintype α] {B : C} (X : α → C) (π : (a : α) → X a ⟶ B),
    EffectiveEpiFamily X π ↔ Epi (Sigma.desc π)
X Y : C
f : X ⟶ Y
⊢ Epi
      (Sigma.desc fun x =>
        match x with
        | PUnit.unit => f) ↔
    Epi f

Next tactic:
have w : f = (Limits.Sigma.ι (fun () ↦ X) ()) ≫ (Limits.Sigma.desc (fun () ↦ f))
lemma effectiveEpi_iff_epi {X Y : C} (f : X ⟶ Y) : EffectiveEpi f ↔ Epi f := by
  rw [effectiveEpi_iff_effectiveEpiFamily, h]
  have w : f = (Limits.Sigma.ι (fun () ↦ X) ()) ≫ (Limits.Sigma.desc (fun () ↦ f))
  · 

Proof state:
case w
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : HasFiniteCoproducts C
h :
  ∀ {α : Type} [inst : Fintype α] {B : C} (X : α → C) (π : (a : α) → X a ⟶ B),
    EffectiveEpiFamily X π ↔ Epi (Sigma.desc π)
X Y : C
f : X ⟶ Y
⊢ f =
    Sigma.ι (fun x => X) () ≫
      Sigma.desc fun x =>
        match x with
        | PUnit.unit => f

Next tactic:
simp only [Limits.colimit.ι_desc, Limits.Cofan.mk_pt, Limits.Cofan.mk_ι_app]
lemma effectiveEpi_iff_epi {X Y : C} (f : X ⟶ Y) : EffectiveEpi f ↔ Epi f := by
  rw [effectiveEpi_iff_effectiveEpiFamily, h]
  have w : f = (Limits.Sigma.ι (fun () ↦ X) ()) ≫ (Limits.Sigma.desc (fun () ↦ f))
  · simp only [Limits.colimit.ι_desc, Limits.Cofan.mk_pt, Limits.Cofan.mk_ι_app]
  

Proof state:
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : HasFiniteCoproducts C
h :
  ∀ {α : Type} [inst : Fintype α] {B : C} (X : α → C) (π : (a : α) → X a ⟶ B),
    EffectiveEpiFamily X π ↔ Epi (Sigma.desc π)
X Y : C
f : X ⟶ Y
w :
  f =
    Sigma.ι (fun x => X) () ≫
      Sigma.desc fun x =>
        match x with
        | PUnit.unit => f
⊢ Epi
      (Sigma.desc fun x =>
        match x with
        | PUnit.unit => f) ↔
    Epi f

Next tactic:
refine ⟨?_, fun _ ↦ epi_of_epi_fac w.symm⟩
lemma effectiveEpi_iff_epi {X Y : C} (f : X ⟶ Y) : EffectiveEpi f ↔ Epi f := by
  rw [effectiveEpi_iff_effectiveEpiFamily, h]
  have w : f = (Limits.Sigma.ι (fun () ↦ X) ()) ≫ (Limits.Sigma.desc (fun () ↦ f))
  · simp only [Limits.colimit.ι_desc, Limits.Cofan.mk_pt, Limits.Cofan.mk_ι_app]
  refine ⟨?_, fun _ ↦ epi_of_epi_fac w.symm⟩
  

Proof state:
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : HasFiniteCoproducts C
h :
  ∀ {α : Type} [inst : Fintype α] {B : C} (X : α → C) (π : (a : α) → X a ⟶ B),
    EffectiveEpiFamily X π ↔ Epi (Sigma.desc π)
X Y : C
f : X ⟶ Y
w :
  f =
    Sigma.ι (fun x => X) () ≫
      Sigma.desc fun x =>
        match x with
        | PUnit.unit => f
⊢ Epi
      (Sigma.desc fun x =>
        match x with
        | PUnit.unit => f) →
    Epi f

Next tactic:
intro
lemma effectiveEpi_iff_epi {X Y : C} (f : X ⟶ Y) : EffectiveEpi f ↔ Epi f := by
  rw [effectiveEpi_iff_effectiveEpiFamily, h]
  have w : f = (Limits.Sigma.ι (fun () ↦ X) ()) ≫ (Limits.Sigma.desc (fun () ↦ f))
  · simp only [Limits.colimit.ι_desc, Limits.Cofan.mk_pt, Limits.Cofan.mk_ι_app]
  refine ⟨?_, fun _ ↦ epi_of_epi_fac w.symm⟩
  intro
  

Proof state:
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : HasFiniteCoproducts C
h :
  ∀ {α : Type} [inst : Fintype α] {B : C} (X : α → C) (π : (a : α) → X a ⟶ B),
    EffectiveEpiFamily X π ↔ Epi (Sigma.desc π)
X Y : C
f : X ⟶ Y
w :
  f =
    Sigma.ι (fun x => X) () ≫
      Sigma.desc fun x =>
        match x with
        | PUnit.unit => f
a✝ :
  Epi
    (Sigma.desc fun x =>
      match x with
      | PUnit.unit => f)
⊢ Epi f

Next tactic:
rw [w]
lemma effectiveEpi_iff_epi {X Y : C} (f : X ⟶ Y) : EffectiveEpi f ↔ Epi f := by
  rw [effectiveEpi_iff_effectiveEpiFamily, h]
  have w : f = (Limits.Sigma.ι (fun () ↦ X) ()) ≫ (Limits.Sigma.desc (fun () ↦ f))
  · simp only [Limits.colimit.ι_desc, Limits.Cofan.mk_pt, Limits.Cofan.mk_ι_app]
  refine ⟨?_, fun _ ↦ epi_of_epi_fac w.symm⟩
  intro
  rw [w]
  

Proof state:
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : HasFiniteCoproducts C
h :
  ∀ {α : Type} [inst : Fintype α] {B : C} (X : α → C) (π : (a : α) → X a ⟶ B),
    EffectiveEpiFamily X π ↔ Epi (Sigma.desc π)
X Y : C
f : X ⟶ Y
w :
  f =
    Sigma.ι (fun x => X) () ≫
      Sigma.desc fun x =>
        match x with
        | PUnit.unit => f
a✝ :
  Epi
    (Sigma.desc fun x =>
      match x with
      | PUnit.unit => f)
⊢ Epi
    (Sigma.ι (fun x => X) () ≫
      Sigma.desc fun x =>
        match x with
        | PUnit.unit => f)

Next tactic:
have : Epi (Limits.Sigma.ι (fun () ↦ X) ()) := ⟨fun _ _ h ↦ by ext; exact h⟩
lemma effectiveEpi_iff_epi {X Y : C} (f : X ⟶ Y) : EffectiveEpi f ↔ Epi f := by
  rw [effectiveEpi_iff_effectiveEpiFamily, h]
  have w : f = (Limits.Sigma.ι (fun () ↦ X) ()) ≫ (Limits.Sigma.desc (fun () ↦ f))
  · simp only [Limits.colimit.ι_desc, Limits.Cofan.mk_pt, Limits.Cofan.mk_ι_app]
  refine ⟨?_, fun _ ↦ epi_of_epi_fac w.symm⟩
  intro
  rw [w]
  have : Epi (Limits.Sigma.ι (fun () ↦ X) ()) := ⟨fun _ _ h ↦ by 

Proof state:
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : HasFiniteCoproducts C
h✝ :
  ∀ {α : Type} [inst : Fintype α] {B : C} (X : α → C) (π : (a : α) → X a ⟶ B),
    EffectiveEpiFamily X π ↔ Epi (Sigma.desc π)
X Y : C
f : X ⟶ Y
w :
  f =
    Sigma.ι (fun x => X) () ≫
      Sigma.desc fun x =>
        match x with
        | PUnit.unit => f
a✝ :
  Epi
    (Sigma.desc fun x =>
      match x with
      | PUnit.unit => f)
Z✝ : C
x✝¹ x✝ : (∐ fun x => X) ⟶ Z✝
h : Sigma.ι (fun x => X) () ≫ x✝¹ = Sigma.ι (fun x => X) () ≫ x✝
⊢ x✝¹ = x✝

Next tactic:
ext