Timings for Colimit_Pushout_Flattening.v
Require Import Diagrams.Diagram.
Require Import Diagrams.DDiagram.
Require Import Diagrams.Span.
Require Import Diagrams.Cocone.
Require Import Colimits.Colimit.
Require Import Colimits.Colimit_Pushout.
Require Import Colimits.Colimit_Flattening.
(** * Pushout case *)
(** We deduce the flattening lemma for pushouts from the flattening lemma for general colimits. This pushout is defined as the colimit of a span and is not the pushout that appears elsewhere in the library. The flattening lemma for the pushout that appears elsewhere in the library is in Colimits/Pushout.v. *)
Context `{Univalence} {A B C} {f: A -> B} {g: A -> C}.
Context (A0 : A -> Type) (B0 : B -> Type) (C0 : C -> Type)
(f0 : forall x, A0 x <~> B0 (f x)) (g0 : forall x, A0 x <~> C0 (g x)).
Definition POCase_P : PO f g -> Type.
simple refine (PO_rec Type B0 C0 _).
eapply path_universe_uncurried.
Definition POCase_E : DDiagram (span f g).
simple refine (Build_Diagram _ _ _); cbn.
intros [[[]|[]] x] [[[]|[]] y]; cbn; intros [[] p].
exact (fun y => p # (f0 x y)).
exact (fun y => p # (g0 x y)).
#[export] Instance POCase_HE : Equifibered POCase_E.
intros [[]|[]] [[]|[]] [] x; compute.
exact (equiv_isequiv (f0 x)).
exact (equiv_isequiv (g0 x)).
Definition PO_flattening
: PO (functor_sigma f f0) (functor_sigma g g0) <~> exists x, POCase_P x.
transitivity (Colimit (diagram_sigma POCase_E)).
srapply path_diagram; cbn.
intros [[]|[]] [[]|[]] [] x; cbn in *.
transitivity (exists x, E' (span f g) POCase_E POCase_HE x).
apply equiv_functor_sigma_id.
unfold E', POCase_P, PO_rec.
1: apply path_universe_uncurried; apply g0.
intros [[]|[]] [[]|[]] []; cbn.
lhs napply (ap (fun x => x @ _) _^).
1: napply path_universe_V_uncurried.
exact (path_universe_compose (f0 y)^-1 (g0 y))^.