-- Mathlib/CategoryTheory/Sites/Coherent/RegularSheaves.lean
theorem EqualizerCondition.mk (P : Cᵒᵖ ⥤ Type*)
    (hP : ∀ (X B : C) (π : X ⟶ B) [EffectiveEpi π] [HasPullback π π], Function.Bijective
    (MapToEqualizer P π (pullback.fst π π) (pullback.snd π π)
    pullback.condition)) : EqualizerCondition P

Proof state:
C : Type u_1
inst✝¹ : Category.{u_5, u_1} C
P : Cᵒᵖ ⥤ Type u_4
X B : C
π : X ⟶ B
inst✝ : EffectiveEpi π
c : PullbackCone π π
hc : IsLimit c
this : HasPullback π π
hP :
  ∀ (b : ↑{x | P.map (pullback.fst π π).op x = P.map (pullback.snd π π).op x}),
    ∃! a, MapToEqualizer P π (pullback.fst π π) (pullback.snd π π) ⋯ a = b
b : P.obj (op X)
hb : P.map c.fst.op b = P.map c.snd.op b
h₁ : ((pullbackIsPullback π π).conePointUniqueUpToIso hc).hom ≫ c.fst = pullback.fst π π
⊢ P.map ((pullbackIsPullback π π).conePointUniqueUpToIso hc).hom.op (P.map c.snd.op b) = P.map (pullback.snd π π).op b

Tactic:
simp [← FunctorToTypes.map_comp_apply, ← op_comp]

Result:
no goals

Proof state:
C : Type u_1
inst✝¹ : Category.{u_5, u_1} C
P : Cᵒᵖ ⥤ Type u_4
hP :
  ∀ (X B : C) (π : X ⟶ B) [inst : EffectiveEpi π] [inst : HasPullback π π],
    Function.Bijective (MapToEqualizer P π (pullback.fst π π) (pullback.snd π π) ⋯)
X B : C
π : X ⟶ B
inst✝ : EffectiveEpi π
c : PullbackCone π π
hc : IsLimit c
this : HasPullback π π
⊢ Nonempty (IsLimit (Fork.ofι (P.map π.op) ⋯))

Tactic:
specialize hP X B π

Result:
C : Type u_1
inst✝¹ : Category.{u_5, u_1} C
P : Cᵒᵖ ⥤ Type u_4
X B : C
π : X ⟶ B
inst✝ : EffectiveEpi π
c : PullbackCone π π
hc : IsLimit c
this : HasPullback π π
hP : Function.Bijective (MapToEqualizer P π (pullback.fst π π) (pullback.snd π π) ⋯)
⊢ Nonempty (IsLimit (Fork.ofι (P.map π.op) ⋯))

Proof state:
C : Type u_1
inst✝¹ : Category.{u_5, u_1} C
P : Cᵒᵖ ⥤ Type u_4
X B : C
π : X ⟶ B
inst✝ : EffectiveEpi π
c : PullbackCone π π
hc : IsLimit c
this : HasPullback π π
hP : Function.Bijective (MapToEqualizer P π (pullback.fst π π) (pullback.snd π π) ⋯)
⊢ ∀ (y : P.obj (op X)), P.map c.fst.op y = P.map c.snd.op y → ∃! x, P.map π.op x = y

Tactic:
rw [Function.bijective_iff_existsUnique] at hP

Result:
C : Type u_1
inst✝¹ : Category.{u_5, u_1} C
P : Cᵒᵖ ⥤ Type u_4
X B : C
π : X ⟶ B
inst✝ : EffectiveEpi π
c : PullbackCone π π
hc : IsLimit c
this : HasPullback π π
hP :
  ∀ (b : ↑{x | P.map (pullback.fst π π).op x = P.map (pullback.snd π π).op x}),
    ∃! a, MapToEqualizer P π (pullback.fst π π) (pullback.snd π π) ⋯ a = b
⊢ ∀ (y : P.obj (op X)), P.map c.fst.op y = P.map c.snd.op y → ∃! x, P.map π.op x = y

Proof state:
C : Type u_1
inst✝¹ : Category.{u_5, u_1} C
P : Cᵒᵖ ⥤ Type u_4
X B : C
π : X ⟶ B
inst✝ : EffectiveEpi π
c : PullbackCone π π
hc : IsLimit c
this : HasPullback π π
hP :
  ∀ (b : ↑{x | P.map (pullback.fst π π).op x = P.map (pullback.snd π π).op x}),
    ∃! a, MapToEqualizer P π (pullback.fst π π) (pullback.snd π π) ⋯ a = b
⊢ ∀ (y : P.obj (op X)), P.map c.fst.op y = P.map c.snd.op y → ∃! x, P.map π.op x = y

Tactic:
intro b hb

Result:
C : Type u_1
inst✝¹ : Category.{u_5, u_1} C
P : Cᵒᵖ ⥤ Type u_4
X B : C
π : X ⟶ B
inst✝ : EffectiveEpi π
c : PullbackCone π π
hc : IsLimit c
this : HasPullback π π
hP :
  ∀ (b : ↑{x | P.map (pullback.fst π π).op x = P.map (pullback.snd π π).op x}),
    ∃! a, MapToEqualizer P π (pullback.fst π π) (pullback.snd π π) ⋯ a = b
b : P.obj (op X)
hb : P.map c.fst.op b = P.map c.snd.op b
⊢ ∃! x, P.map π.op x = b

Proof state:
C : Type u_1
inst✝¹ : Category.{u_5, u_1} C
P : Cᵒᵖ ⥤ Type u_4
X B : C
π : X ⟶ B
inst✝ : EffectiveEpi π
c : PullbackCone π π
hc : IsLimit c
this : HasPullback π π
hP :
  ∀ (b : ↑{x | P.map (pullback.fst π π).op x = P.map (pullback.snd π π).op x}),
    ∃! a, MapToEqualizer P π (pullback.fst π π) (pullback.snd π π) ⋯ a = b
b : P.obj (op X)
hb : P.map c.fst.op b = P.map c.snd.op b
h₁ : ((pullbackIsPullback π π).conePointUniqueUpToIso hc).hom ≫ c.fst = pullback.fst π π
hb' : P.map (pullback.fst π π).op b = P.map (pullback.snd π π).op b
⊢ ∃! x, P.map π.op x = b

Tactic:
obtain ⟨a, ha₁, ha₂⟩ := hP ⟨b, hb'⟩

Result:
case intro.intro
C : Type u_1
inst✝¹ : Category.{u_5, u_1} C
P : Cᵒᵖ ⥤ Type u_4
X B : C
π : X ⟶ B
inst✝ : EffectiveEpi π
c : PullbackCone π π
hc : IsLimit c
this : HasPullback π π
hP :
  ∀ (b : ↑{x | P.map (pullback.fst π π).op x = P.map (pullback.snd π π).op x}),
    ∃! a, MapToEqualizer P π (pullback.fst π π) (pullback.snd π π) ⋯ a = b
b : P.obj (op X)
hb : P.map c.fst.op b = P.map c.snd.op b
h₁ : ((pullbackIsPullback π π).conePointUniqueUpToIso hc).hom ≫ c.fst = pullback.fst π π
hb' : P.map (pullback.fst π π).op b = P.map (pullback.snd π π).op b
a : P.obj (op B)
ha₁ : MapToEqualizer P π (pullback.fst π π) (pullback.snd π π) ⋯ a = ⟨b, hb'⟩
ha₂ : ∀ (y : P.obj (op B)), (fun a => MapToEqualizer P π (pullback.fst π π) (pullback.snd π π) ⋯ a = ⟨b, hb'⟩) y → y = a
⊢ ∃! x, P.map π.op x = b

Proof state:
C : Type u_1
inst✝¹ : Category.{u_5, u_1} C
P : Cᵒᵖ ⥤ Type u_4
X B : C
π : X ⟶ B
inst✝ : EffectiveEpi π
c : PullbackCone π π
hc : IsLimit c
this : HasPullback π π
hP :
  ∀ (b : ↑{x | P.map (pullback.fst π π).op x = P.map (pullback.snd π π).op x}),
    ∃! a, MapToEqualizer P π (pullback.fst π π) (pullback.snd π π) ⋯ a = b
b : P.obj (op X)
hb : P.map c.fst.op b = P.map c.snd.op b
h₁ : ((pullbackIsPullback π π).conePointUniqueUpToIso hc).hom ≫ c.fst = pullback.fst π π
⊢ P.map (pullback.fst π π).op b = P.map (pullback.snd π π).op b

Tactic:
rw [← h₁, op_comp, FunctorToTypes.map_comp_apply, hb]

Result:
C : Type u_1
inst✝¹ : Category.{u_5, u_1} C
P : Cᵒᵖ ⥤ Type u_4
X B : C
π : X ⟶ B
inst✝ : EffectiveEpi π
c : PullbackCone π π
hc : IsLimit c
this : HasPullback π π
hP :
  ∀ (b : ↑{x | P.map (pullback.fst π π).op x = P.map (pullback.snd π π).op x}),
    ∃! a, MapToEqualizer P π (pullback.fst π π) (pullback.snd π π) ⋯ a = b
b : P.obj (op X)
hb : P.map c.fst.op b = P.map c.snd.op b
h₁ : ((pullbackIsPullback π π).conePointUniqueUpToIso hc).hom ≫ c.fst = pullback.fst π π
⊢ P.map ((pullbackIsPullback π π).conePointUniqueUpToIso hc).hom.op (P.map c.snd.op b) = P.map (pullback.snd π π).op b

Proof state:
C : Type u_1
inst✝¹ : Category.{u_5, u_1} C
P : Cᵒᵖ ⥤ Type u_4
X B : C
π : X ⟶ B
inst✝ : EffectiveEpi π
c : PullbackCone π π
hc : IsLimit c
this : HasPullback π π
hP :
  ∀ (b : ↑{x | P.map (pullback.fst π π).op x = P.map (pullback.snd π π).op x}),
    ∃! a, MapToEqualizer P π (pullback.fst π π) (pullback.snd π π) ⋯ a = b
b : P.obj (op X)
hb : P.map c.fst.op b = P.map c.snd.op b
⊢ ∃! x, P.map π.op x = b

Tactic:
have h₁ : ((pullbackIsPullback π π).conePointUniqueUpToIso hc).hom ≫ c.fst =
  pullback.fst π π := by simp

Result:
C : Type u_1
inst✝¹ : Category.{u_5, u_1} C
P : Cᵒᵖ ⥤ Type u_4
X B : C
π : X ⟶ B
inst✝ : EffectiveEpi π
c : PullbackCone π π
hc : IsLimit c
this : HasPullback π π
hP :
  ∀ (b : ↑{x | P.map (pullback.fst π π).op x = P.map (pullback.snd π π).op x}),
    ∃! a, MapToEqualizer P π (pullback.fst π π) (pullback.snd π π) ⋯ a = b
b : P.obj (op X)
hb : P.map c.fst.op b = P.map c.snd.op b
h₁ : ((pullbackIsPullback π π).conePointUniqueUpToIso hc).hom ≫ c.fst = pullback.fst π π
⊢ ∃! x, P.map π.op x = b