Proposition comp_enriched_profunctor_rmap_eq (y₁ y₂ : C₂) : lmap_e P y₂ y₁ x₁ #⊗ identity _ · internal_transpose (comp_enriched_profunctor_rmap_mor y₁) = sym_mon_braiding _ _ _ #⊗ identity _ · mon_lassociator _ _ _ · identity _ #⊗ rmap_e Q z y₁ y₂ · internal_transpose (comp_enriched_profunctor_rmap_mor y₂). Proof. unfold comp_enriched_profunctor_rmap_mor, internal_transpose. use internal_funext. intros a h. rewrite !tensor_comp_r_id_r. rewrite !assoc'. rewrite !internal_beta. etrans. { apply maponpaths_2. apply tensor_split. } refine (!_). etrans. { apply maponpaths_2. apply tensor_split. } refine (!_). rewrite !assoc'. apply maponpaths. etrans. { rewrite !assoc. rewrite tensor_sym_mon_braiding. rewrite !assoc'. apply maponpaths. rewrite !assoc. rewrite tensor_rassociator. rewrite !assoc'. apply maponpaths. rewrite !assoc. rewrite <- tensor_comp_id_r. rewrite lmap_e_rmap_e'. rewrite !tensor_comp_id_r. rewrite !assoc'. rewrite comp_enriched_profunctor_comm. rewrite !tensor_comp_id_l. apply idpath. } rewrite !assoc. apply maponpaths_2. etrans. { rewrite !assoc'. do 5 apply maponpaths. rewrite !assoc. rewrite tensor_lassociator. 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 !assoc. rewrite tensor_id_id. rewrite <- tensor_split'. rewrite tensor_split. rewrite !assoc'. rewrite <- tensor_split'. apply idpath. } refine (!_). etrans. { rewrite !assoc'. do 2 apply maponpaths. rewrite !assoc. rewrite tensor_sym_mon_braiding. rewrite !assoc'. apply maponpaths. rewrite !assoc. rewrite tensor_rassociator. rewrite !assoc'. apply maponpaths. rewrite tensor_id_id. rewrite <- tensor_split. apply idpath. } rewrite !assoc. apply maponpaths_2. generalize (E₂ ⦃ y₁ , y₂ ⦄). generalize (P y₂ x₁). generalize (Q z y₁). generalize (E₁ ⦃ x₁ , x₂ ⦄). intros v₁ v₂ v₃ v₄. etrans. { apply maponpaths_2. rewrite !assoc'. rewrite tensor_sym_mon_braiding. rewrite !assoc. rewrite tensor_sym_mon_braiding. apply idpath. } rewrite !assoc'. apply maponpaths. refine (!_). etrans. { rewrite !assoc. do 6 apply maponpaths_2. pose (maponpaths (λ z, identity _ #⊗ mon_lassociator _ _ _ · z) (@mon_rassociator_rassociator 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_left in p. exact (!p). } rewrite !assoc'. etrans. { do 4 apply maponpaths. rewrite !assoc. do 3 apply maponpaths_2. 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). } etrans. { do 2 apply maponpaths. rewrite !assoc. rewrite <- tensor_rassociator. rewrite !assoc'. apply maponpaths. rewrite !assoc. rewrite mon_rassociator_lassociator. rewrite id_left. apply idpath. } rewrite !assoc. refine (!(id_right _) @ _). rewrite <- mon_lassociator_rassociator. rewrite !assoc. apply maponpaths_2. rewrite <- tensor_comp_id_l. etrans. { rewrite !assoc'. do 6 apply maponpaths. rewrite <- tensor_id_id. rewrite tensor_lassociator. apply idpath. } etrans. { apply maponpaths. rewrite !assoc. apply maponpaths_2. etrans. { do 2 apply maponpaths_2. rewrite !assoc'. rewrite tensor_sym_mon_braiding. apply idpath. } rewrite !assoc'. etrans. { do 4 apply maponpaths. rewrite mon_lassociator_lassociator. rewrite !assoc. rewrite <- tensor_comp_id_r. rewrite mon_rassociator_lassociator. rewrite tensor_id_id. rewrite id_left. apply idpath. } rewrite !assoc. apply maponpaths_2. rewrite !assoc'. etrans. { do 2 apply maponpaths. rewrite !assoc. apply sym_mon_hexagon_lassociator. } rewrite tensor_id_id. etrans. { apply maponpaths. rewrite !assoc. rewrite <- tensor_comp_id_r. rewrite sym_mon_braiding_inv. rewrite tensor_id_id. rewrite id_left. apply idpath. } rewrite !assoc. rewrite mon_rassociator_lassociator. apply id_left. } rewrite <- !tensor_comp_id_l. apply maponpaths. clear v₁. 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. 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.