Local Obligation Tactic := idtac.
Section Equalizer.
Context (C : Category) {A B : PreSheaf C} (f g : (A –≻ B)%nattrans).
(** The pointwise equalizer presheaf. *)
Program Definition PSh_ptw_eq_Func : PreSheaf C :=
{|
FO := fun c => Type_Cat_Has_Equalizers _ _ (Trans f c) (Trans g c);
FA := fun c c' h x => exist _ (A _a h (proj1_sig x))%morphism _
|}.
Next Obligation.
Next Obligation.
Next Obligation.
Local Obligation Tactic := basic_simpl; auto.
(** The equalizer morph. *)
Program Definition PSh_ptw_eq_morph_NatTrans : NatTrans PSh_ptw_eq_Func A :=
{|
Trans :=
fun c =>
equalizer_morph
(Type_Cat_Has_Equalizers _ _ (Trans f c) (Trans g c))
|}.
Local Hint Extern 1 => apply NatTrans_eq_simplify; FunExt; basic_simpl.
Program Definition PSh_Eq : Equalizer (PShCat C) f g :=
{|
equalizer := PSh_ptw_eq_Func;
equalizer_morph := PSh_ptw_eq_morph_NatTrans;
equalizer_morph_ex :=
fun u v H =>
{|
Trans := fun c x => exist _ (Trans v c x) _
|}
|}.
Next Obligation.
Next Obligation.
Next Obligation.
Local Obligation Tactic := idtac.
Next Obligation.
intros e' eqm H1 u u' H4 H5.
rewrite <- H5 in H4; clear H5.
assert (H4' := f_equal Trans H4); clear H4.
apply NatTrans_eq_simplify.
extensionality x; extensionality y.
apply sig_proof_irrelevance.
apply (f_equal (fun w => w x y) H4').
Qed.
End Equalizer.
Instance PSh_Has_Equalizers (C : Category) : Has_Equalizers (PShCat C)
:= fun _ _ => PSh_Eq C.
Section CoEqualizer.
Context (C : Category) {A B : PreSheaf C} (f g : (A –≻ B)%nattrans).

Lemma equalizer_morph_com_simplified
(a : C)
(x y : (B _o)%object a)
(H : CoEq_rel (Trans f a) (Trans g a) x y)
:
Equalizer.Type_Cat_CoEq_obligation_1 (Trans f a) (Trans g a) y =
Equalizer.Type_Cat_CoEq_obligation_1 (Trans f a) (Trans g a) x
.