l3lab/ntp-mathlib huggingface dataset:
/--
Implementation: This is a construction which will be used in the proof that
the sieve generated by a single arrow is effective epimorphic if and only if
the arrow is an effective epi.
-/
def isColimitOfEffectiveEpiStruct {X Y : C} (f : Y ⟶ X) (Hf : EffectiveEpiStruct f) :
    IsColimit (Sieve.generateSingleton f : Presieve X).cocone :=
  letI D := FullSubcategory fun T : Over X => Sieve.generateSingleton f T.hom
  letI F : D ⥤ _ := (Sieve.generateSingleton f).arrows.diagram
  { desc := fun S => Hf.desc (S.ι.app ⟨Over.mk f, ⟨𝟙 _, by simp⟩⟩) <| by
      intro Z g₁ g₂ h
      let Y' : D := ⟨Over.mk f, 𝟙 _, by simp⟩
      let Z' : D := ⟨Over.mk (g₁ ≫ f), g₁, rfl⟩
      let g₁' : Z' ⟶ Y' := Over.homMk g₁
      let g₂' : Z' ⟶ Y' := Over.homMk g₂ (by simp [h])
      change F.map g₁' ≫ _ = F.map g₂' ≫ _
      simp only [S.w]
    fac := by
      rintro S ⟨T,g,hT⟩
      dsimp
      nth_rewrite 1 [← hT, Category.assoc, Hf.fac]
      let y : D := ⟨Over.mk f, 𝟙 _, by simp⟩
      let x : D := ⟨Over.mk T.hom, g, hT⟩
      let g' : x ⟶ y := Over.homMk g
      change F.map g' ≫ _ = _
      

Proof state:
case mk.intro
C : Type u_1
inst✝ : Category.{?u.8651, u_1} C
X Y : C
f : Y ⟶ X
Hf : EffectiveEpiStruct f
D : Type (max u_1 ?u.8651) := FullSubcategory fun T => (Sieve.generateSingleton f).arrows T.hom
F : D ⥤ C := Presieve.diagram (Sieve.generateSingleton f).arrows
S : Cocone (Presieve.diagram (Sieve.generateSingleton f).arrows)
T : Over X
g : (𝟭 C).obj T.left ⟶ Y
hT : g ≫ f = T.hom
y : D := { obj := Over.mk f, property := (_ : ∃ e, e ≫ f = (Over.mk f).hom) }
x : D := { obj := Over.mk T.hom, property := (_ : ∃ e, e ≫ f = (Over.mk T.hom).hom) }
g' : x ⟶ y := Over.homMk g
⊢ F.map g' ≫ S.ι.app { obj := Over.mk f, property := (_ : ∃ e, e ≫ f = f) } =
    S.ι.app { obj := T, property := (_ : ∃ e, e ≫ f = T.hom) }

Next tactic:
rw [S.w]
/--
Implementation: This is a construction which will be used in the proof that
the sieve generated by a single arrow is effective epimorphic if and only if
the arrow is an effective epi.
-/
def isColimitOfEffectiveEpiStruct {X Y : C} (f : Y ⟶ X) (Hf : EffectiveEpiStruct f) :
    IsColimit (Sieve.generateSingleton f : Presieve X).cocone :=
  letI D := FullSubcategory fun T : Over X => Sieve.generateSingleton f T.hom
  letI F : D ⥤ _ := (Sieve.generateSingleton f).arrows.diagram
  { desc := fun S => Hf.desc (S.ι.app ⟨Over.mk f, ⟨𝟙 _, by simp⟩⟩) <| by
      intro Z g₁ g₂ h
      let Y' : D := ⟨Over.mk f, 𝟙 _, by simp⟩
      let Z' : D := ⟨Over.mk (g₁ ≫ f), g₁, rfl⟩
      let g₁' : Z' ⟶ Y' := Over.homMk g₁
      let g₂' : Z' ⟶ Y' := Over.homMk g₂ (by simp [h])
      change F.map g₁' ≫ _ = F.map g₂' ≫ _
      simp only [S.w]
    fac := by
      rintro S ⟨T,g,hT⟩
      dsimp
      nth_rewrite 1 [← hT, Category.assoc, Hf.fac]
      let y : D := ⟨Over.mk f, 𝟙 _, by simp⟩
      let x : D := ⟨Over.mk T.hom, g, hT⟩
      let g' : x ⟶ y := Over.homMk g
      change F.map g' ≫ _ = _
      rw [S.w]
      

Proof state:
case mk.intro
C : Type u_1
inst✝ : Category.{?u.8651, u_1} C
X Y : C
f : Y ⟶ X
Hf : EffectiveEpiStruct f
D : Type (max u_1 ?u.8651) := FullSubcategory fun T => (Sieve.generateSingleton f).arrows T.hom
F : D ⥤ C := Presieve.diagram (Sieve.generateSingleton f).arrows
S : Cocone (Presieve.diagram (Sieve.generateSingleton f).arrows)
T : Over X
g : (𝟭 C).obj T.left ⟶ Y
hT : g ≫ f = T.hom
y : D := { obj := Over.mk f, property := (_ : ∃ e, e ≫ f = (Over.mk f).hom) }
x : D := { obj := Over.mk T.hom, property := (_ : ∃ e, e ≫ f = (Over.mk T.hom).hom) }
g' : x ⟶ y := Over.homMk g
⊢ S.ι.app x = S.ι.app { obj := T, property := (_ : ∃ e, e ≫ f = T.hom) }

Next tactic:
rfl
/--
Implementation: This is a construction which will be used in the proof that
the sieve generated by a single arrow is effective epimorphic if and only if
the arrow is an effective epi.
-/
def isColimitOfEffectiveEpiStruct {X Y : C} (f : Y ⟶ X) (Hf : EffectiveEpiStruct f) :
    IsColimit (Sieve.generateSingleton f : Presieve X).cocone :=
  letI D := FullSubcategory fun T : Over X => Sieve.generateSingleton f T.hom
  letI F : D ⥤ _ := (Sieve.generateSingleton f).arrows.diagram
  { desc := fun S => Hf.desc (S.ι.app ⟨Over.mk f, ⟨𝟙 _, by simp⟩⟩) <| by
      intro Z g₁ g₂ h
      let Y' : D := ⟨Over.mk f, 𝟙 _, by simp⟩
      let Z' : D := ⟨Over.mk (g₁ ≫ f), g₁, rfl⟩
      let g₁' : Z' ⟶ Y' := Over.homMk g₁
      let g₂' : Z' ⟶ Y' := Over.homMk g₂ (by simp [h])
      change F.map g₁' ≫ _ = F.map g₂' ≫ _
      simp only [S.w]
    fac := by
      rintro S ⟨T,g,hT⟩
      dsimp
      nth_rewrite 1 [← hT, Category.assoc, Hf.fac]
      let y : D := ⟨Over.mk f, 𝟙 _, by simp⟩
      let x : D := ⟨Over.mk T.hom, g, hT⟩
      let g' : x ⟶ y := Over.homMk g
      change F.map g' ≫ _ = _
      rw [S.w]
      rfl
    uniq := by
      

Proof state:
C : Type u_1
inst✝ : Category.{?u.8651, u_1} C
X Y : C
f : Y ⟶ X
Hf : EffectiveEpiStruct f
D : Type (max u_1 ?u.8651) := FullSubcategory fun T => (Sieve.generateSingleton f).arrows T.hom
F : D ⥤ C := Presieve.diagram (Sieve.generateSingleton f).arrows
⊢ ∀ (s : Cocone (Presieve.diagram (Sieve.generateSingleton f).arrows))
    (m : (Presieve.cocone (Sieve.generateSingleton f).arrows).pt ⟶ s.pt),
    (∀ (j : FullSubcategory fun f_1 => (Sieve.generateSingleton f).arrows f_1.hom),
        (Presieve.cocone (Sieve.generateSingleton f).arrows).ι.app j ≫ m = s.ι.app j) →
      m =
        (fun S =>
            EffectiveEpiStruct.desc Hf (S.ι.app { obj := Over.mk f, property := (_ : ∃ e, e ≫ f = (Over.mk f).hom) })
              (_ :
                ∀ {Z : C} (g₁ g₂ : Z ⟶ Y) (h : g₁ ≫ f = g₂ ≫ f),
                  let Y' := { obj := Over.mk f, property := (_ : ∃ e, e ≫ f = (Over.mk f).hom) };
                  let Z' := { obj := Over.mk (g₁ ≫ f), property := (_ : ∃ e, e ≫ f = (Over.mk (g₁ ≫ f)).hom) };
                  let g₁' := Over.homMk g₁;
                  let g₂' := Over.homMk g₂;
                  F.map g₁' ≫ S.ι.app { obj := Over.mk f, property := (_ : ∃ e, e ≫ f = (Over.mk f).hom) } =
                    F.map g₂' ≫ S.ι.app { obj := Over.mk f, property := (_ : ∃ e, e ≫ f = (Over.mk f).hom) }))
          s

Next tactic:
intro S m hm
/--
Implementation: This is a construction which will be used in the proof that
the sieve generated by a single arrow is effective epimorphic if and only if
the arrow is an effective epi.
-/
def isColimitOfEffectiveEpiStruct {X Y : C} (f : Y ⟶ X) (Hf : EffectiveEpiStruct f) :
    IsColimit (Sieve.generateSingleton f : Presieve X).cocone :=
  letI D := FullSubcategory fun T : Over X => Sieve.generateSingleton f T.hom
  letI F : D ⥤ _ := (Sieve.generateSingleton f).arrows.diagram
  { desc := fun S => Hf.desc (S.ι.app ⟨Over.mk f, ⟨𝟙 _, by simp⟩⟩) <| by
      intro Z g₁ g₂ h
      let Y' : D := ⟨Over.mk f, 𝟙 _, by simp⟩
      let Z' : D := ⟨Over.mk (g₁ ≫ f), g₁, rfl⟩
      let g₁' : Z' ⟶ Y' := Over.homMk g₁
      let g₂' : Z' ⟶ Y' := Over.homMk g₂ (by simp [h])
      change F.map g₁' ≫ _ = F.map g₂' ≫ _
      simp only [S.w]
    fac := by
      rintro S ⟨T,g,hT⟩
      dsimp
      nth_rewrite 1 [← hT, Category.assoc, Hf.fac]
      let y : D := ⟨Over.mk f, 𝟙 _, by simp⟩
      let x : D := ⟨Over.mk T.hom, g, hT⟩
      let g' : x ⟶ y := Over.homMk g
      change F.map g' ≫ _ = _
      rw [S.w]
      rfl
    uniq := by
      intro S m hm
      

Proof state:
C : Type u_1
inst✝ : Category.{?u.8651, u_1} C
X Y : C
f : Y ⟶ X
Hf : EffectiveEpiStruct f
D : Type (max u_1 ?u.8651) := FullSubcategory fun T => (Sieve.generateSingleton f).arrows T.hom
F : D ⥤ C := Presieve.diagram (Sieve.generateSingleton f).arrows
S : Cocone (Presieve.diagram (Sieve.generateSingleton f).arrows)
m : (Presieve.cocone (Sieve.generateSingleton f).arrows).pt ⟶ S.pt
hm :
  ∀ (j : FullSubcategory fun f_1 => (Sieve.generateSingleton f).arrows f_1.hom),
    (Presieve.cocone (Sieve.generateSingleton f).arrows).ι.app j ≫ m = S.ι.app j
⊢ m =
    (fun S =>
        EffectiveEpiStruct.desc Hf (S.ι.app { obj := Over.mk f, property := (_ : ∃ e, e ≫ f = (Over.mk f).hom) })
          (_ :
            ∀ {Z : C} (g₁ g₂ : Z ⟶ Y) (h : g₁ ≫ f = g₂ ≫ f),
              let Y' := { obj := Over.mk f, property := (_ : ∃ e, e ≫ f = (Over.mk f).hom) };
              let Z' := { obj := Over.mk (g₁ ≫ f), property := (_ : ∃ e, e ≫ f = (Over.mk (g₁ ≫ f)).hom) };
              let g₁' := Over.homMk g₁;
              let g₂' := Over.homMk g₂;
              F.map g₁' ≫ S.ι.app { obj := Over.mk f, property := (_ : ∃ e, e ≫ f = (Over.mk f).hom) } =
                F.map g₂' ≫ S.ι.app { obj := Over.mk f, property := (_ : ∃ e, e ≫ f = (Over.mk f).hom) }))
      S

Next tactic:
dsimp
/--
Implementation: This is a construction which will be used in the proof that
the sieve generated by a single arrow is effective epimorphic if and only if
the arrow is an effective epi.
-/
def isColimitOfEffectiveEpiStruct {X Y : C} (f : Y ⟶ X) (Hf : EffectiveEpiStruct f) :
    IsColimit (Sieve.generateSingleton f : Presieve X).cocone :=
  letI D := FullSubcategory fun T : Over X => Sieve.generateSingleton f T.hom
  letI F : D ⥤ _ := (Sieve.generateSingleton f).arrows.diagram
  { desc := fun S => Hf.desc (S.ι.app ⟨Over.mk f, ⟨𝟙 _, by simp⟩⟩) <| by
      intro Z g₁ g₂ h
      let Y' : D := ⟨Over.mk f, 𝟙 _, by simp⟩
      let Z' : D := ⟨Over.mk (g₁ ≫ f), g₁, rfl⟩
      let g₁' : Z' ⟶ Y' := Over.homMk g₁
      let g₂' : Z' ⟶ Y' := Over.homMk g₂ (by simp [h])
      change F.map g₁' ≫ _ = F.map g₂' ≫ _
      simp only [S.w]
    fac := by
      rintro S ⟨T,g,hT⟩
      dsimp
      nth_rewrite 1 [← hT, Category.assoc, Hf.fac]
      let y : D := ⟨Over.mk f, 𝟙 _, by simp⟩
      let x : D := ⟨Over.mk T.hom, g, hT⟩
      let g' : x ⟶ y := Over.homMk g
      change F.map g' ≫ _ = _
      rw [S.w]
      rfl
    uniq := by
      intro S m hm
      dsimp
      

Proof state:
C : Type u_1
inst✝ : Category.{?u.8651, u_1} C
X Y : C
f : Y ⟶ X
Hf : EffectiveEpiStruct f
D : Type (max u_1 ?u.8651) := FullSubcategory fun T => (Sieve.generateSingleton f).arrows T.hom
F : D ⥤ C := Presieve.diagram (Sieve.generateSingleton f).arrows
S : Cocone (Presieve.diagram (Sieve.generateSingleton f).arrows)
m : (Presieve.cocone (Sieve.generateSingleton f).arrows).pt ⟶ S.pt
hm :
  ∀ (j : FullSubcategory fun f_1 => (Sieve.generateSingleton f).arrows f_1.hom),
    (Presieve.cocone (Sieve.generateSingleton f).arrows).ι.app j ≫ m = S.ι.app j
⊢ m =
    EffectiveEpiStruct.desc Hf (S.ι.app { obj := Over.mk f, property := (_ : ∃ e, e ≫ f = f) })
      (_ :
        ∀ {Z : C} (g₁ g₂ : Z ⟶ Y),
          g₁ ≫ f = g₂ ≫ f →
            g₁ ≫ S.ι.app { obj := Over.mk f, property := (_ : ∃ e, e ≫ f = f) } =
              g₂ ≫ S.ι.app { obj := Over.mk f, property := (_ : ∃ e, e ≫ f = f) })

Next tactic:
generalize_proofs h1 h2
/--
Implementation: This is a construction which will be used in the proof that
the sieve generated by a single arrow is effective epimorphic if and only if
the arrow is an effective epi.
-/
def isColimitOfEffectiveEpiStruct {X Y : C} (f : Y ⟶ X) (Hf : EffectiveEpiStruct f) :
    IsColimit (Sieve.generateSingleton f : Presieve X).cocone :=
  letI D := FullSubcategory fun T : Over X => Sieve.generateSingleton f T.hom
  letI F : D ⥤ _ := (Sieve.generateSingleton f).arrows.diagram
  { desc := fun S => Hf.desc (S.ι.app ⟨Over.mk f, ⟨𝟙 _, by simp⟩⟩) <| by
      intro Z g₁ g₂ h
      let Y' : D := ⟨Over.mk f, 𝟙 _, by simp⟩
      let Z' : D := ⟨Over.mk (g₁ ≫ f), g₁, rfl⟩
      let g₁' : Z' ⟶ Y' := Over.homMk g₁
      let g₂' : Z' ⟶ Y' := Over.homMk g₂ (by simp [h])
      change F.map g₁' ≫ _ = F.map g₂' ≫ _
      simp only [S.w]
    fac := by
      rintro S ⟨T,g,hT⟩
      dsimp
      nth_rewrite 1 [← hT, Category.assoc, Hf.fac]
      let y : D := ⟨Over.mk f, 𝟙 _, by simp⟩
      let x : D := ⟨Over.mk T.hom, g, hT⟩
      let g' : x ⟶ y := Over.homMk g
      change F.map g' ≫ _ = _
      rw [S.w]
      rfl
    uniq := by
      intro S m hm
      dsimp
      generalize_proofs h1 h2
      

Proof state:
C : Type u_1
inst✝ : Category.{?u.8651, u_1} C
X Y : C
f : Y ⟶ X
Hf : EffectiveEpiStruct f
D : Type (max u_1 ?u.8651) := FullSubcategory fun T => (Sieve.generateSingleton f).arrows T.hom
F : D ⥤ C := Presieve.diagram (Sieve.generateSingleton f).arrows
S : Cocone (Presieve.diagram (Sieve.generateSingleton f).arrows)
m : (Presieve.cocone (Sieve.generateSingleton f).arrows).pt ⟶ S.pt
hm :
  ∀ (j : FullSubcategory fun f_1 => (Sieve.generateSingleton f).arrows f_1.hom),
    (Presieve.cocone (Sieve.generateSingleton f).arrows).ι.app j ≫ m = S.ι.app j
h1 : ∃ e, e ≫ f = f
h2 :
  ∀ {Z : C} (g₁ g₂ : Z ⟶ Y),
    g₁ ≫ f = g₂ ≫ f →
      g₁ ≫ S.ι.app { obj := Over.mk f, property := h1 } = g₂ ≫ S.ι.app { obj := Over.mk f, property := h1 }
⊢ m = EffectiveEpiStruct.desc Hf (S.ι.app { obj := Over.mk f, property := h1 }) h2

Next tactic:
apply Hf.uniq _ h2
/--
Implementation: This is a construction which will be used in the proof that
the sieve generated by a single arrow is effective epimorphic if and only if
the arrow is an effective epi.
-/
def isColimitOfEffectiveEpiStruct {X Y : C} (f : Y ⟶ X) (Hf : EffectiveEpiStruct f) :
    IsColimit (Sieve.generateSingleton f : Presieve X).cocone :=
  letI D := FullSubcategory fun T : Over X => Sieve.generateSingleton f T.hom
  letI F : D ⥤ _ := (Sieve.generateSingleton f).arrows.diagram
  { desc := fun S => Hf.desc (S.ι.app ⟨Over.mk f, ⟨𝟙 _, by simp⟩⟩) <| by
      intro Z g₁ g₂ h
      let Y' : D := ⟨Over.mk f, 𝟙 _, by simp⟩
      let Z' : D := ⟨Over.mk (g₁ ≫ f), g₁, rfl⟩
      let g₁' : Z' ⟶ Y' := Over.homMk g₁
      let g₂' : Z' ⟶ Y' := Over.homMk g₂ (by simp [h])
      change F.map g₁' ≫ _ = F.map g₂' ≫ _
      simp only [S.w]
    fac := by
      rintro S ⟨T,g,hT⟩
      dsimp
      nth_rewrite 1 [← hT, Category.assoc, Hf.fac]
      let y : D := ⟨Over.mk f, 𝟙 _, by simp⟩
      let x : D := ⟨Over.mk T.hom, g, hT⟩
      let g' : x ⟶ y := Over.homMk g
      change F.map g' ≫ _ = _
      rw [S.w]
      rfl
    uniq := by
      intro S m hm
      dsimp
      generalize_proofs h1 h2
      apply Hf.uniq _ h2
      

Proof state:
case a
C : Type u_1
inst✝ : Category.{?u.8651, u_1} C
X Y : C
f : Y ⟶ X
Hf : EffectiveEpiStruct f
D : Type (max u_1 ?u.8651) := FullSubcategory fun T => (Sieve.generateSingleton f).arrows T.hom
F : D ⥤ C := Presieve.diagram (Sieve.generateSingleton f).arrows
S : Cocone (Presieve.diagram (Sieve.generateSingleton f).arrows)
m : (Presieve.cocone (Sieve.generateSingleton f).arrows).pt ⟶ S.pt
hm :
  ∀ (j : FullSubcategory fun f_1 => (Sieve.generateSingleton f).arrows f_1.hom),
    (Presieve.cocone (Sieve.generateSingleton f).arrows).ι.app j ≫ m = S.ι.app j
h1 : ∃ e, e ≫ f = f
h2 :
  ∀ {Z : C} (g₁ g₂ : Z ⟶ Y),
    g₁ ≫ f = g₂ ≫ f →
      g₁ ≫ S.ι.app { obj := Over.mk f, property := h1 } = g₂ ≫ S.ι.app { obj := Over.mk f, property := h1 }
⊢ f ≫ m = S.ι.app { obj := Over.mk f, property := h1 }

Next tactic:
exact hm ⟨Over.mk f, 𝟙 _, by simp⟩
/--
Implementation: This is a construction which will be used in the proof that
the sieve generated by a single arrow is effective epimorphic if and only if
the arrow is an effective epi.
-/
def isColimitOfEffectiveEpiStruct {X Y : C} (f : Y ⟶ X) (Hf : EffectiveEpiStruct f) :
    IsColimit (Sieve.generateSingleton f : Presieve X).cocone :=
  letI D := FullSubcategory fun T : Over X => Sieve.generateSingleton f T.hom
  letI F : D ⥤ _ := (Sieve.generateSingleton f).arrows.diagram
  { desc := fun S => Hf.desc (S.ι.app ⟨Over.mk f, ⟨𝟙 _, by simp⟩⟩) <| by
      intro Z g₁ g₂ h
      let Y' : D := ⟨Over.mk f, 𝟙 _, by simp⟩
      let Z' : D := ⟨Over.mk (g₁ ≫ f), g₁, rfl⟩
      let g₁' : Z' ⟶ Y' := Over.homMk g₁
      let g₂' : Z' ⟶ Y' := Over.homMk g₂ (by simp [h])
      change F.map g₁' ≫ _ = F.map g₂' ≫ _
      simp only [S.w]
    fac := by
      rintro S ⟨T,g,hT⟩
      dsimp
      nth_rewrite 1 [← hT, Category.assoc, Hf.fac]
      let y : D := ⟨Over.mk f, 𝟙 _, by simp⟩
      let x : D := ⟨Over.mk T.hom, g, hT⟩
      let g' : x ⟶ y := Over.homMk g
      change F.map g' ≫ _ = _
      rw [S.w]
      rfl
    uniq := by
      intro S m hm
      dsimp
      generalize_proofs h1 h2
      apply Hf.uniq _ h2
      exact hm ⟨Over.mk f, 𝟙 _, by 

Proof state:
C : Type u_1
inst✝ : Category.{?u.8651, u_1} C
X Y : C
f : Y ⟶ X
Hf : EffectiveEpiStruct f
D : Type (max u_1 ?u.8651) := FullSubcategory fun T => (Sieve.generateSingleton f).arrows T.hom
F : D ⥤ C := Presieve.diagram (Sieve.generateSingleton f).arrows
S : Cocone (Presieve.diagram (Sieve.generateSingleton f).arrows)
m : (Presieve.cocone (Sieve.generateSingleton f).arrows).pt ⟶ S.pt
hm :
  ∀ (j : FullSubcategory fun f_1 => (Sieve.generateSingleton f).arrows f_1.hom),
    (Presieve.cocone (Sieve.generateSingleton f).arrows).ι.app j ≫ m = S.ι.app j
h1 : ∃ e, e ≫ f = f
h2 :
  ∀ {Z : C} (g₁ g₂ : Z ⟶ Y),
    g₁ ≫ f = g₂ ≫ f →
      g₁ ≫ S.ι.app { obj := Over.mk f, property := h1 } = g₂ ≫ S.ι.app { obj := Over.mk f, property := h1 }
⊢ 𝟙 ((𝟭 C).obj (Over.mk f).left) ≫ f = (Over.mk f).hom

Next tactic:
simp
/--
Implementation: This is a construction which will be used in the proof that
the sieve generated by a single arrow is effective epimorphic if and only if
the arrow is an effective epi.
-/
noncomputable
def effectiveEpiStructOfIsColimit {X Y : C} (f : Y ⟶ X)
    (Hf : IsColimit (Sieve.generateSingleton f : Presieve X).cocone) :
    EffectiveEpiStruct f :=
  let aux {W : C} (e : Y ⟶ W)
    (h : ∀ {Z : C} (g₁ g₂ : Z ⟶ Y), g₁ ≫ f = g₂ ≫ f → g₁ ≫ e = g₂ ≫ e) :
    Cocone (Sieve.generateSingleton f).arrows.diagram :=
    { pt := W
      ι := {
        app := fun ⟨T,hT⟩ => hT.choose ≫ e
        naturality := by
          

Proof state:
C : Type u_1
inst✝ : Category.{?u.21354, u_1} C
X Y : C
f : Y ⟶ X
Hf : IsColimit (Presieve.cocone (Sieve.generateSingleton f).arrows)
W : C
e : Y ⟶ W
h : ∀ {Z : C} (g₁ g₂ : Z ⟶ Y), g₁ ≫ f = g₂ ≫ f → g₁ ≫ e = g₂ ≫ e
⊢ ∀ ⦃X_1 Y_1 : FullSubcategory fun f_1 => (Sieve.generateSingleton f).arrows f_1.hom⦄ (f_1 : X_1 ⟶ Y_1),
    (Presieve.diagram (Sieve.generateSingleton f).arrows).map f_1 ≫
        (fun x =>
            match x with
            | { obj := T, property := hT } => Exists.choose hT ≫ e)
          Y_1 =
      (fun x =>
            match x with
            | { obj := T, property := hT } => Exists.choose hT ≫ e)
          X_1 ≫
        ((Functor.const (FullSubcategory fun f_2 => (Sieve.generateSingleton f).arrows f_2.hom)).obj W).map f_1

Next tactic:
rintro ⟨A,hA⟩ ⟨B,hB⟩ (q : A ⟶ B)
/--
Implementation: This is a construction which will be used in the proof that
the sieve generated by a single arrow is effective epimorphic if and only if
the arrow is an effective epi.
-/
noncomputable
def effectiveEpiStructOfIsColimit {X Y : C} (f : Y ⟶ X)
    (Hf : IsColimit (Sieve.generateSingleton f : Presieve X).cocone) :
    EffectiveEpiStruct f :=
  let aux {W : C} (e : Y ⟶ W)
    (h : ∀ {Z : C} (g₁ g₂ : Z ⟶ Y), g₁ ≫ f = g₂ ≫ f → g₁ ≫ e = g₂ ≫ e) :
    Cocone (Sieve.generateSingleton f).arrows.diagram :=
    { pt := W
      ι := {
        app := fun ⟨T,hT⟩ => hT.choose ≫ e
        naturality := by
          rintro ⟨A,hA⟩ ⟨B,hB⟩ (q : A ⟶ B)
          

Proof state:
case mk.mk
C : Type u_1
inst✝ : Category.{?u.21354, u_1} C
X Y : C
f : Y ⟶ X
Hf : IsColimit (Presieve.cocone (Sieve.generateSingleton f).arrows)
W : C
e : Y ⟶ W
h : ∀ {Z : C} (g₁ g₂ : Z ⟶ Y), g₁ ≫ f = g₂ ≫ f → g₁ ≫ e = g₂ ≫ e
A : Over X
hA : (Sieve.generateSingleton f).arrows A.hom
B : Over X
hB : (Sieve.generateSingleton f).arrows B.hom
q : A ⟶ B
⊢ (Presieve.diagram (Sieve.generateSingleton f).arrows).map q ≫
      (fun x =>
          match x with
          | { obj := T, property := hT } => Exists.choose hT ≫ e)
        { obj := B, property := hB } =
    (fun x =>
          match x with
          | { obj := T, property := hT } => Exists.choose hT ≫ e)
        { obj := A, property := hA } ≫
      ((Functor.const (FullSubcategory fun f_1 => (Sieve.generateSingleton f).arrows f_1.hom)).obj W).map q

Next tactic:
dsimp
/--
Implementation: This is a construction which will be used in the proof that
the sieve generated by a single arrow is effective epimorphic if and only if
the arrow is an effective epi.
-/
noncomputable
def effectiveEpiStructOfIsColimit {X Y : C} (f : Y ⟶ X)
    (Hf : IsColimit (Sieve.generateSingleton f : Presieve X).cocone) :
    EffectiveEpiStruct f :=
  let aux {W : C} (e : Y ⟶ W)
    (h : ∀ {Z : C} (g₁ g₂ : Z ⟶ Y), g₁ ≫ f = g₂ ≫ f → g₁ ≫ e = g₂ ≫ e) :
    Cocone (Sieve.generateSingleton f).arrows.diagram :=
    { pt := W
      ι := {
        app := fun ⟨T,hT⟩ => hT.choose ≫ e
        naturality := by
          rintro ⟨A,hA⟩ ⟨B,hB⟩ (q : A ⟶ B)
          dsimp; 

Proof state:
case mk.mk
C : Type u_1
inst✝ : Category.{?u.21354, u_1} C
X Y : C
f : Y ⟶ X
Hf : IsColimit (Presieve.cocone (Sieve.generateSingleton f).arrows)
W : C
e : Y ⟶ W
h : ∀ {Z : C} (g₁ g₂ : Z ⟶ Y), g₁ ≫ f = g₂ ≫ f → g₁ ≫ e = g₂ ≫ e
A : Over X
hA : (Sieve.generateSingleton f).arrows A.hom
B : Over X
hB : (Sieve.generateSingleton f).arrows B.hom
q : A ⟶ B
⊢ q.left ≫ Exists.choose hB ≫ e = (Exists.choose hA ≫ e) ≫ 𝟙 W

Next tactic:
simp only [← Category.assoc, Category.comp_id]
/--
Implementation: This is a construction which will be used in the proof that
the sieve generated by a single arrow is effective epimorphic if and only if
the arrow is an effective epi.
-/
noncomputable
def effectiveEpiStructOfIsColimit {X Y : C} (f : Y ⟶ X)
    (Hf : IsColimit (Sieve.generateSingleton f : Presieve X).cocone) :
    EffectiveEpiStruct f :=
  let aux {W : C} (e : Y ⟶ W)
    (h : ∀ {Z : C} (g₁ g₂ : Z ⟶ Y), g₁ ≫ f = g₂ ≫ f → g₁ ≫ e = g₂ ≫ e) :
    Cocone (Sieve.generateSingleton f).arrows.diagram :=
    { pt := W
      ι := {
        app := fun ⟨T,hT⟩ => hT.choose ≫ e
        naturality := by
          rintro ⟨A,hA⟩ ⟨B,hB⟩ (q : A ⟶ B)
          dsimp; simp only [← Category.assoc, Category.comp_id]
          

Proof state:
case mk.mk
C : Type u_1
inst✝ : Category.{?u.21354, u_1} C
X Y : C
f : Y ⟶ X
Hf : IsColimit (Presieve.cocone (Sieve.generateSingleton f).arrows)
W : C
e : Y ⟶ W
h : ∀ {Z : C} (g₁ g₂ : Z ⟶ Y), g₁ ≫ f = g₂ ≫ f → g₁ ≫ e = g₂ ≫ e
A : Over X
hA : (Sieve.generateSingleton f).arrows A.hom
B : Over X
hB : (Sieve.generateSingleton f).arrows B.hom
q : A ⟶ B
⊢ (q.left ≫ Exists.choose hB) ≫ e = Exists.choose hA ≫ e

Next tactic:
apply h
/--
Implementation: This is a construction which will be used in the proof that
the sieve generated by a single arrow is effective epimorphic if and only if
the arrow is an effective epi.
-/
noncomputable
def effectiveEpiStructOfIsColimit {X Y : C} (f : Y ⟶ X)
    (Hf : IsColimit (Sieve.generateSingleton f : Presieve X).cocone) :
    EffectiveEpiStruct f :=
  let aux {W : C} (e : Y ⟶ W)
    (h : ∀ {Z : C} (g₁ g₂ : Z ⟶ Y), g₁ ≫ f = g₂ ≫ f → g₁ ≫ e = g₂ ≫ e) :
    Cocone (Sieve.generateSingleton f).arrows.diagram :=
    { pt := W
      ι := {
        app := fun ⟨T,hT⟩ => hT.choose ≫ e
        naturality := by
          rintro ⟨A,hA⟩ ⟨B,hB⟩ (q : A ⟶ B)
          dsimp; simp only [← Category.assoc, Category.comp_id]
          apply h
          

Proof state:
case mk.mk.a
C : Type u_1
inst✝ : Category.{?u.21354, u_1} C
X Y : C
f : Y ⟶ X
Hf : IsColimit (Presieve.cocone (Sieve.generateSingleton f).arrows)
W : C
e : Y ⟶ W
h : ∀ {Z : C} (g₁ g₂ : Z ⟶ Y), g₁ ≫ f = g₂ ≫ f → g₁ ≫ e = g₂ ≫ e
A : Over X
hA : (Sieve.generateSingleton f).arrows A.hom
B : Over X
hB : (Sieve.generateSingleton f).arrows B.hom
q : A ⟶ B
⊢ (q.left ≫ Exists.choose hB) ≫ f = Exists.choose hA ≫ f

Next tactic:
rw [Category.assoc, hB.choose_spec, hA.choose_spec, Over.w]