Proposition comp_enriched_profunctor_coend_laws : enriched_profunctor_laws comp_enriched_profunctor_coend_data. Proof. repeat split ; cbn. - intros y₁ y₂. rewrite !assoc. rewrite <- tensor_id_id. rewrite tensor_rassociator. rewrite !assoc'. rewrite <- tensor_comp_id_r. rewrite lmap_e_id. rewrite <- mon_lunitor_triangle. rewrite !assoc. rewrite mon_rassociator_lassociator. apply id_left. - intros y₁ y₂. etrans. { rewrite !assoc. rewrite <- tensor_id_id. rewrite tensor_sym_mon_braiding. rewrite !assoc'. apply maponpaths. rewrite !assoc. rewrite tensor_lassociator. rewrite !assoc'. apply maponpaths. rewrite <- tensor_comp_id_l. rewrite !assoc. rewrite tensor_sym_mon_braiding. rewrite !assoc'. rewrite rmap_e_id. apply idpath. } rewrite tensor_comp_id_l. rewrite sym_mon_tensor_lassociator. rewrite !assoc'. etrans. { do 4 apply maponpaths. rewrite !assoc. rewrite mon_rassociator_lassociator. rewrite id_left. apply idpath. } etrans. { do 3 apply maponpaths. rewrite !assoc. rewrite <- tensor_comp_id_l. rewrite sym_mon_braiding_inv. rewrite tensor_id_id. apply id_left. } rewrite <- mon_triangle. rewrite <- tensor_comp_id_r. rewrite sym_mon_braiding_runitor. rewrite <- mon_lunitor_triangle. rewrite !assoc. rewrite mon_rassociator_lassociator. apply id_left. - intros y₁ y₂ y₃ y₄ ; cbn. etrans. { rewrite <- tensor_id_id. rewrite !assoc. rewrite tensor_rassociator. rewrite !assoc'. rewrite <- tensor_comp_id_r. rewrite lmap_e_comp. rewrite !tensor_comp_id_r. apply idpath. } refine (!_). etrans. { rewrite tensor_comp_id_l. rewrite !assoc'. do 2 apply maponpaths. rewrite !assoc. rewrite tensor_rassociator. apply idpath. } rewrite !assoc. do 2 apply maponpaths_2. refine (!(id_left _) @ _). rewrite <- mon_rassociator_lassociator. rewrite !assoc'. apply maponpaths. rewrite !assoc. rewrite mon_lassociator_lassociator. etrans. { rewrite !assoc'. do 2 apply maponpaths. rewrite !assoc. rewrite <- tensor_comp_id_l. rewrite mon_lassociator_rassociator. rewrite tensor_id_id. apply id_left. } rewrite mon_lassociator_rassociator. apply id_right. - intros y₁ y₂ y₃ y₄ ; cbn. etrans. { rewrite !assoc. rewrite tensor_sym_mon_braiding. rewrite !assoc'. apply maponpaths. rewrite !assoc. rewrite <- tensor_id_id. rewrite tensor_lassociator. rewrite !assoc'. apply maponpaths. rewrite <- tensor_comp_id_l. rewrite !assoc. rewrite tensor_sym_mon_braiding. rewrite !assoc'. rewrite rmap_e_comp. rewrite !tensor_comp_id_l. apply idpath. } refine (!_). etrans. { rewrite !assoc'. apply maponpaths. rewrite !assoc. rewrite tensor_sym_mon_braiding. rewrite tensor_comp_id_r. rewrite !assoc'. do 2 apply maponpaths. rewrite !assoc. rewrite tensor_lassociator. rewrite !assoc'. apply maponpaths. rewrite <- tensor_comp_id_l. rewrite tensor_comp_id_r. rewrite !assoc'. etrans. { do 2 apply maponpaths. rewrite !assoc. rewrite tensor_sym_mon_braiding. apply idpath. } rewrite !tensor_comp_id_l. apply idpath. } rewrite tensor_comp_id_r. rewrite !assoc. do 2 apply maponpaths_2. generalize (E₂ ⦃ y₃ , y₄ ⦄). generalize (E₂ ⦃ y₂ , y₃ ⦄). generalize (P y₁ x). generalize (Q z y₂). intros v₁ v₂ v₃ v₄. rewrite !assoc'. etrans. { do 5 apply maponpaths. rewrite <- tensor_comp_id_l. rewrite tensor_sym_mon_braiding. rewrite tensor_comp_id_l. apply idpath. } refine (!_). etrans. { do 2 apply maponpaths. rewrite <- tensor_comp_id_l. rewrite sym_mon_tensor_lassociator. rewrite !assoc'. rewrite mon_rassociator_lassociator. rewrite id_right. rewrite !assoc. rewrite tensor_comp_id_l. apply idpath. } rewrite !assoc. apply maponpaths_2. refine (!_). etrans. { apply maponpaths_2. rewrite !assoc'. do 3 apply maponpaths. pose (maponpaths (λ z, z · identity _ #⊗ mon_rassociator _ _ _) (@mon_lassociator_lassociator V v₂ v₁ v₃ v₄)) as p. cbn in p. rewrite !assoc' in p. rewrite <- tensor_comp_id_l in p. rewrite mon_lassociator_rassociator in p. rewrite tensor_id_id in p. rewrite id_right in p. exact (!p). } rewrite !assoc'. rewrite <- tensor_comp_id_l. etrans. { do 6 apply maponpaths. rewrite sym_mon_tensor_rassociator. rewrite !assoc. rewrite mon_rassociator_lassociator. rewrite id_left. apply idpath. } rewrite !tensor_comp_id_l. rewrite !assoc. do 3 apply maponpaths_2. rewrite !assoc'. rewrite <- tensor_lassociator. rewrite !assoc. apply maponpaths_2. rewrite tensor_id_id. generalize (v₂ ⊗ v₁). clear v₁ v₂. intros v₂. rewrite !assoc'. rewrite sym_mon_tensor_rassociator. rewrite !assoc'. apply maponpaths. rewrite !assoc. rewrite <- tensor_sym_mon_braiding. rewrite !assoc'. apply maponpaths. refine (!(id_left _) @ _). rewrite <- mon_rassociator_lassociator. rewrite !assoc'. apply maponpaths. rewrite !assoc. rewrite sym_mon_hexagon_lassociator. rewrite !assoc'. rewrite <- tensor_comp_id_l. rewrite sym_mon_braiding_inv. rewrite tensor_id_id. rewrite id_right. apply idpath. - intros y₁ y₂ y₃ y₄ ; cbn. rewrite !assoc'. etrans. { do 2 apply maponpaths. rewrite tensor_comp_id_l. rewrite !assoc'. apply maponpaths. rewrite !assoc. rewrite tensor_sym_mon_braiding. rewrite !assoc'. apply maponpaths. rewrite !assoc. rewrite tensor_lassociator. rewrite !assoc'. apply maponpaths. rewrite tensor_id_id. rewrite <- tensor_split'. rewrite tensor_comp_l_id_l. apply idpath. } refine (!_). etrans. { apply maponpaths. rewrite !assoc. rewrite !tensor_comp_id_l. rewrite !assoc'. do 3 apply maponpaths. rewrite !assoc. rewrite tensor_rassociator. rewrite !assoc'. rewrite tensor_id_id. rewrite <- tensor_split. apply idpath. } rewrite !assoc. apply maponpaths_2. generalize (E₂ ⦃ y₂ , y₁ ⦄). generalize (E₂ ⦃ y₃ , y₄ ⦄). generalize (P y₁ x). generalize (Q z y₃). intros v₁ v₂ v₃ v₄. rewrite !assoc'. rewrite tensor_rassociator. rewrite tensor_id_id. rewrite !assoc. apply maponpaths_2. refine (!(id_right _) @ _). rewrite <- mon_rassociator_lassociator. rewrite !assoc. apply maponpaths_2. rewrite !assoc'. rewrite mon_rassociator_rassociator. rewrite tensor_sym_mon_braiding. rewrite !assoc. apply maponpaths_2. etrans. { apply maponpaths_2. rewrite !assoc'. rewrite <- tensor_comp_id_l. rewrite mon_lassociator_rassociator. rewrite tensor_id_id. rewrite id_right. apply idpath. } refine (_ @ id_right _). rewrite <- mon_lassociator_rassociator. rewrite !assoc. apply maponpaths_2. refine (!_). etrans. { rewrite !assoc'. apply maponpaths. rewrite assoc. apply sym_mon_hexagon_lassociator. } rewrite !assoc. rewrite <- tensor_comp_id_r. rewrite sym_mon_braiding_inv. rewrite tensor_id_id. rewrite id_left. apply idpath. Qed.
Require Import UniMath.Foundations.All. Require Import UniMath.MoreFoundations.All. Require Import UniMath.CategoryTheory.Core.Prelude. Require Import UniMath.CategoryTheory.Limits.Coends. Require Import UniMath.CategoryTheory.OppositeCategory.Core. Require Import UniMath.CategoryTheory.PrecategoryBinProduct. Require Import UniMath.CategoryTheory.EnrichedCats.BenabouCosmos. Require Import UniMath.CategoryTheory.EnrichedCats.Enrichment. Require Import UniMath.CategoryTheory.EnrichedCats.EnrichmentFunctor. Require Import UniMath.CategoryTheory.EnrichedCats.Profunctors.Profunctor. Require Import UniMath.CategoryTheory.EnrichedCats.Profunctors.Coend. Require Import UniMath.CategoryTheory.Monoidal.Categories. Require Import UniMath.CategoryTheory.Monoidal.Structure.Symmetric. Require Import UniMath.CategoryTheory.Monoidal.Structure.Closed. Import MonoidalNotations.