Timings for Colimit_Coequalizer.v
Require Import Diagrams.ParallelPair.
Require Import Diagrams.Cocone.
Require Import Colimits.Colimit.
Require Import Colimits.Coeq.
Generalizable All Variables.
(** * Coequalizer as a colimit *)
(** In this file, we define [Coequalizer] the coequalizer of two maps as the colimit of a particular diagram, and then show that it is equivalent to [Coeq] the primitive coequalizer defined as an HIT. *)
(** ** [Coequalizer] *)
Definition IsCoequalizer (f g : B -> A)
:= IsColimit (parallel_pair f g).
Definition Coequalizer (f g : B -> A)
:= Colimit (parallel_pair f g).
(** ** Equivalence with [Coeq] *)
Definition cocone_Coeq : Cocone (parallel_pair f g) (Coeq f g).
intros []; [exact (coeq o g)| exact coeq].
intros i j phi x; destruct i, j, phi; simpl;
[ exact (cglue x) | reflexivity ].
Lemma iscoequalizer_Coeq `{Funext}
: IsColimit (parallel_pair f g) (Coeq f g).
srapply (Build_IsColimit cocone_Coeq).
srapply Build_UniversalCocone.
srapply isequiv_adjointify.
exact (legs_comm C true false true b).
exact (legs_comm C true false false b)^.
intros i x; destruct i; simpl.
exact (legs_comm C true false false x).
intros i j phi x; destruct i, j, phi; simpl.
match goal with
| [|- ap (Coeq_rec ?a ?b ?c) _ @ _ = _ ]
=> rewrite (Coeq_rec_beta_cglue a b c)
end.
match goal with
| [|- ?G == _ ] => simple refine (Coeq_ind (fun w => G w = F w) _ _)
end.
transport_paths FlFr; simpl.
refine (Coeq_rec_beta_cglue _ _ _ _ @ _).
Definition equiv_Coeq_Coequalizer `{Funext}
: Coeq f g <~> Coequalizer f g.
3: eapply iscoequalizer_Coeq.
eapply iscolimit_colimit.