Timings for GroupCoeq.v
Require Import Basics Types.
Require Import WildCat.Core.
Require Import Truncations.Core.
Require Import Algebra.Groups.Group.
Require Import Colimits.Coeq.
Require Import Algebra.Groups.FreeProduct.
Local Open Scope mc_scope.
Local Open Scope mc_mult_scope.
(** Coequalizers of group homomorphisms *)
Definition GroupCoeq {A B : Group} (f g : A $-> B) : Group.
rapply (AmalgamatedFreeProduct (FreeProduct A A) A B).
1,2: apply FreeProduct_rec.
Definition equiv_groupcoeq_rec `{Funext} {A B C : Group} (f g : GroupHomomorphism A B)
: {h : B $-> C & h o f == h o g} <~> (GroupCoeq f g $-> C).
refine (equiv_amalgamatedfreeproduct_rec _ _ _ _ _ _ oE _).
refine (equiv_sigma_symm _ oE _).
apply equiv_functor_sigma_id.
snrapply equiv_adjointify.
exists (grp_homo_compose h f).
2: intros; apply path_ishprop.
1: apply ap, grp_homo_unit.
1,2: refine (ap _ (grp_homo_op _ _ _) @ _).
1,2: refine (grp_homo_op _ _ _ @ _ @ (grp_homo_op _ _ _)^); f_ap.
assert (q1 := p (freeproduct_inl x)).
assert (q2 := p (freeproduct_inr x)).
rewrite 2 right_identity in q1, q2.
apply equiv_path_grouphomomorphism.
pose (q1 := p (freeproduct_inl y)).
rewrite 2 right_identity in q1.
hnf; intros; apply path_ishprop.