Proposition comp_enriched_profunctor_laws : enriched_profunctor_laws comp_enriched_profunctor_data. Proof. repeat split. - intros z x ; cbn. use is_inj_internal_transpose. unfold internal_transpose. use from_comp_enriched_profunctor_eq. intros y. use internal_funext. intros a h. rewrite !tensor_comp_r_id_r. rewrite !assoc'. rewrite !internal_beta. rewrite !assoc. rewrite !tensor_sym_mon_braiding. rewrite !assoc'. apply maponpaths. rewrite (tensor_split' h). rewrite !assoc'. apply maponpaths. etrans. { rewrite !assoc. do 3 apply maponpaths_2. rewrite <- tensor_split. rewrite tensor_split'. apply idpath. } rewrite !assoc'. etrans. { apply maponpaths. rewrite !assoc. rewrite <- tensor_comp_id_l. rewrite tensor_sym_mon_braiding. rewrite !assoc'. apply maponpaths. rewrite comp_enriched_profunctor_lmap_comm. apply idpath. } unfold comp_enriched_profunctor_lmap_mor. rewrite tensor_lunitor. rewrite !assoc. apply maponpaths_2. rewrite !assoc'. etrans. { apply maponpaths. rewrite !assoc. rewrite sym_mon_braiding_inv. rewrite id_left. apply idpath. } 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. apply maponpaths. rewrite !assoc. rewrite tensor_sym_mon_braiding. rewrite !assoc'. rewrite lmap_e_id. apply sym_mon_braiding_lunitor. } rewrite <- mon_runitor_triangle. etrans. { apply maponpaths. rewrite !assoc. rewrite mon_lassociator_rassociator. apply id_left. } apply sym_mon_braiding_runitor. - intros z x ; cbn. use is_inj_internal_transpose. unfold internal_transpose. use from_comp_enriched_profunctor_eq. intros y. use internal_funext. intros a h. rewrite !tensor_comp_r_id_r. rewrite !assoc'. rewrite !internal_beta. rewrite !assoc. rewrite !tensor_sym_mon_braiding. rewrite !assoc'. apply maponpaths. rewrite (tensor_split' h). rewrite !assoc'. apply maponpaths. etrans. { rewrite !assoc. do 3 apply maponpaths_2. rewrite <- tensor_split. rewrite tensor_split'. apply idpath. } rewrite !assoc'. etrans. { apply maponpaths. rewrite !assoc. rewrite <- tensor_comp_id_l. rewrite tensor_sym_mon_braiding. rewrite !assoc'. apply maponpaths. rewrite comp_enriched_profunctor_rmap_comm. apply idpath. } unfold comp_enriched_profunctor_rmap_mor. rewrite tensor_lunitor. rewrite !assoc. apply maponpaths_2. rewrite !assoc'. etrans. { apply maponpaths. rewrite !assoc. rewrite sym_mon_braiding_inv. rewrite id_left. apply idpath. } etrans. { rewrite !assoc. rewrite <- tensor_id_id. rewrite tensor_rassociator. rewrite !assoc'. apply maponpaths. rewrite <- tensor_comp_id_r. rewrite rmap_e_id. apply idpath. } rewrite <- mon_lunitor_triangle. rewrite !assoc. rewrite mon_rassociator_lassociator. apply id_left. - intros z₁ z₂ z₃ x ; cbn. use is_inj_internal_transpose. use from_comp_enriched_profunctor_eq. intros y. use internal_funext. intros a h. rewrite !tensor_comp_r_id_r. rewrite !assoc'. unfold internal_transpose. rewrite !internal_beta. rewrite !(tensor_split (comp_enriched_profunctor_in _ _ _) h). rewrite !assoc'. apply maponpaths. etrans. { rewrite !assoc. rewrite tensor_sym_mon_braiding. rewrite !assoc'. apply maponpaths. rewrite !assoc. rewrite <- tensor_split. rewrite tensor_split'. rewrite !assoc'. apply maponpaths. rewrite !assoc. rewrite <- tensor_split. rewrite tensor_split'. rewrite !assoc'. apply maponpaths. rewrite !assoc. rewrite <- tensor_comp_id_l. rewrite tensor_sym_mon_braiding. rewrite !assoc'. rewrite comp_enriched_profunctor_lmap_comm. rewrite !assoc. rewrite sym_mon_braiding_inv. apply id_left. } etrans. { etrans. { apply maponpaths. rewrite !assoc. rewrite <- tensor_comp_id_r. unfold comp_enriched_profunctor_lmap_mor. rewrite !assoc. rewrite tensor_sym_mon_braiding. apply idpath. } rewrite !assoc. rewrite sym_mon_braiding_inv. rewrite id_left. rewrite <- tensor_id_id. rewrite tensor_lassociator. rewrite !assoc'. apply maponpaths. rewrite !assoc. rewrite <- tensor_comp_id_l. rewrite !assoc. rewrite tensor_sym_mon_braiding. rewrite !assoc'. rewrite tensor_comp_id_l. rewrite !assoc'. apply maponpaths. rewrite lmap_e_comp. rewrite !assoc'. rewrite tensor_comp_id_l. apply idpath. } refine (!_). 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 !assoc. rewrite <- tensor_comp_id_l. etrans. { do 3 apply maponpaths_2. apply maponpaths. rewrite !assoc. rewrite <- tensor_comp_id_l. rewrite tensor_sym_mon_braiding. rewrite !assoc'. rewrite comp_enriched_profunctor_lmap_comm. rewrite !assoc. rewrite sym_mon_braiding_inv. apply id_left. } rewrite <- tensor_comp_id_l. rewrite tensor_sym_mon_braiding. rewrite !assoc'. apply maponpaths. unfold comp_enriched_profunctor_lmap_mor. do 2 rewrite tensor_comp_id_r. rewrite !assoc'. apply maponpaths. rewrite !assoc. rewrite <- tensor_comp_id_r. rewrite comp_enriched_profunctor_lmap_comm. apply idpath. } unfold comp_enriched_profunctor_lmap_mor. etrans. { do 4 apply maponpaths. rewrite !assoc. rewrite sym_mon_braiding_inv. rewrite id_left. apply idpath. } etrans. { do 3 apply maponpaths. rewrite !assoc. rewrite tensor_comp_id_r. rewrite !assoc'. apply maponpaths. rewrite !assoc. rewrite tensor_lassociator. rewrite !assoc'. apply maponpaths. rewrite !assoc. rewrite <- tensor_comp_id_l. apply maponpaths_2. apply maponpaths. rewrite !assoc. apply maponpaths_2. rewrite tensor_comp_id_r. rewrite !assoc'. rewrite tensor_sym_mon_braiding. apply idpath. } etrans. { do 5 apply maponpaths. rewrite !assoc. do 2 rewrite tensor_comp_id_l. rewrite !assoc'. apply maponpaths. rewrite !assoc. rewrite <- tensor_comp_id_l. apply idpath. } rewrite !assoc. do 2 apply maponpaths_2. rewrite tensor_comp_id_r. rewrite tensor_comp_id_l. rewrite !assoc. etrans. { rewrite !assoc'. rewrite <- tensor_comp_id_l. rewrite tensor_sym_mon_braiding. rewrite tensor_comp_id_l. rewrite !assoc. apply idpath. } refine (!_). etrans. { rewrite !assoc'. rewrite <- tensor_comp_id_l. apply maponpaths. 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 (!(id_right _) @ _). rewrite <- tensor_id_id. rewrite <- sym_mon_braiding_inv. etrans. { apply maponpaths. rewrite tensor_comp_id_l. apply idpath. } rewrite !assoc. apply maponpaths_2. rewrite !assoc'. etrans. { apply maponpaths. rewrite <- tensor_comp_id_l. apply maponpaths. rewrite !assoc. rewrite sym_mon_tensor_lassociator. rewrite !assoc'. etrans. { do 2 apply maponpaths. rewrite !assoc. rewrite mon_lassociator_rassociator. rewrite id_left. apply idpath. } 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. rewrite id_left. apply idpath. } rewrite tensor_comp_id_l. rewrite !assoc. refine (_ @ id_right _). rewrite <- tensor_id_id. rewrite <- mon_lassociator_rassociator. rewrite tensor_comp_id_l. rewrite !assoc. apply maponpaths_2. refine (!_). etrans. { rewrite !assoc'. do 4 apply maponpaths. rewrite !assoc. rewrite <- mon_lassociator_lassociator. apply idpath. } rewrite <- tensor_lassociator. rewrite !assoc. apply maponpaths_2. rewrite tensor_id_id. generalize (P y x ⊗ Q z₁ y) (E₃ ⦃ z₃, z₂ ⦄) (E₃ ⦃ z₂, z₁ ⦄). intros v₁ v₂ v₃. rewrite (sym_mon_tensor_lassociator V v₁ v₂ v₃). refine (_ @ id_left _). rewrite <- mon_rassociator_lassociator. rewrite !assoc'. apply maponpaths. etrans. { do 3 apply maponpaths. rewrite !assoc. rewrite mon_rassociator_lassociator. rewrite id_left. apply idpath. } refine (_ @ id_left _). rewrite <- tensor_id_id. rewrite <- sym_mon_braiding_inv. rewrite tensor_comp_id_r. rewrite !assoc'. apply maponpaths. etrans. { apply maponpaths. rewrite !assoc. rewrite tensor_sym_mon_braiding. rewrite !assoc'. apply maponpaths. rewrite !assoc. rewrite <- tensor_comp_id_r. rewrite sym_mon_braiding_inv. rewrite tensor_id_id. apply id_left. } rewrite !assoc. exact (sym_mon_hexagon_lassociator V v₂ v₁ v₃). - intros z x₁ x₂ x₃ ; cbn. use is_inj_internal_transpose. use from_comp_enriched_profunctor_eq. intros y. use internal_funext. intros a h. rewrite !tensor_comp_r_id_r. rewrite !(tensor_split (comp_enriched_profunctor_in _ _ _) h). rewrite !assoc'. apply maponpaths. unfold internal_transpose. rewrite !internal_beta. etrans. { rewrite !assoc. rewrite tensor_sym_mon_braiding. rewrite !assoc'. apply maponpaths. rewrite !assoc. rewrite <- tensor_split. rewrite tensor_split'. rewrite !assoc'. apply maponpaths. rewrite !assoc. rewrite <- tensor_comp_id_l. rewrite tensor_sym_mon_braiding. rewrite !assoc'. rewrite comp_enriched_profunctor_rmap_comm. rewrite !assoc. rewrite sym_mon_braiding_inv. apply id_left. } unfold comp_enriched_profunctor_rmap_mor. etrans. { apply maponpaths. rewrite <- tensor_id_id. rewrite !assoc. rewrite tensor_rassociator. rewrite !assoc'. apply maponpaths. rewrite !assoc. rewrite <- tensor_comp_id_r. rewrite rmap_e_comp. apply idpath. } etrans. { rewrite !assoc'. do 2 apply maponpaths. rewrite tensor_comp_id_r. rewrite !assoc'. apply maponpaths. apply idpath. } refine (!_). etrans. { rewrite !assoc. rewrite tensor_sym_mon_braiding. rewrite !assoc'. apply maponpaths. rewrite <- tensor_id_id. rewrite !assoc. rewrite tensor_lassociator. rewrite !assoc'. apply maponpaths. rewrite !assoc. rewrite <- tensor_comp_id_l. etrans. { do 3 apply maponpaths_2. rewrite !assoc. rewrite <- tensor_comp_id_l. rewrite tensor_sym_mon_braiding. rewrite !assoc'. rewrite comp_enriched_profunctor_rmap_comm. rewrite !assoc. rewrite sym_mon_braiding_inv. rewrite id_left. apply idpath. } rewrite <- tensor_comp_id_l. rewrite tensor_sym_mon_braiding. rewrite !assoc'. apply maponpaths. unfold comp_enriched_profunctor_rmap_mor. do 2 rewrite tensor_comp_id_r. rewrite !assoc'. apply maponpaths. rewrite !assoc. rewrite <- tensor_comp_id_r. rewrite comp_enriched_profunctor_rmap_comm. unfold comp_enriched_profunctor_rmap_mor. apply idpath. } rewrite !assoc. apply maponpaths_2. etrans. { apply maponpaths_2. rewrite tensor_comp_id_r. rewrite !assoc'. do 4 apply maponpaths. rewrite !assoc. rewrite tensor_sym_mon_braiding. rewrite !assoc'. rewrite tensor_rassociator. apply idpath. } rewrite !assoc'. rewrite <- tensor_comp_id_r. rewrite !assoc. apply maponpaths_2. rewrite !assoc'. etrans. { do 3 apply maponpaths. rewrite !assoc. rewrite tensor_sym_mon_braiding. rewrite !assoc'. apply maponpaths. refine (!(id_right _) @ _). rewrite <- tensor_id_id. rewrite <- mon_rassociator_lassociator. rewrite tensor_comp_id_r. rewrite !assoc. rewrite <- mon_rassociator_rassociator. apply idpath. } rewrite !assoc. do 2 apply maponpaths_2. etrans. { apply maponpaths_2. rewrite !assoc'. rewrite sym_mon_braiding_inv. rewrite id_right. apply idpath. } rewrite !assoc'. rewrite mon_lassociator_rassociator. apply id_right. - intros z₁ z₂ x₁ x₂ ; cbn. use is_inj_internal_transpose. use from_comp_enriched_profunctor_eq. intros y. use internal_funext. intros a h. rewrite !tensor_comp_r_id_r. rewrite !assoc'. unfold internal_transpose. rewrite !internal_beta. rewrite !(tensor_split (comp_enriched_profunctor_in z₁ x₁ y) h). rewrite !assoc'. apply maponpaths. etrans. { rewrite !assoc. rewrite tensor_sym_mon_braiding. rewrite !assoc'. apply maponpaths. rewrite !assoc. rewrite <- tensor_split. rewrite tensor_split'. rewrite !assoc'. apply maponpaths. rewrite <- tensor_id_id. rewrite !assoc. rewrite tensor_lassociator. rewrite !assoc'. apply maponpaths. rewrite !assoc. rewrite <- !tensor_comp_id_l. rewrite tensor_sym_mon_braiding. rewrite !assoc'. apply maponpaths. apply maponpaths_2. rewrite !assoc. rewrite <- tensor_comp_id_l. rewrite tensor_sym_mon_braiding. rewrite !assoc'. apply maponpaths_2. apply maponpaths. rewrite !assoc. rewrite comp_enriched_profunctor_lmap_comm. apply idpath. } etrans. { do 4 apply maponpaths. rewrite !assoc. rewrite sym_mon_braiding_inv. rewrite id_left. unfold comp_enriched_profunctor_lmap_mor. do 2 rewrite tensor_comp_id_r. rewrite !assoc'. apply maponpaths. rewrite !assoc. rewrite <- tensor_comp_id_r. rewrite comp_enriched_profunctor_rmap_comm. apply idpath. } etrans. { do 4 apply maponpaths. rewrite !assoc. rewrite tensor_comp_id_r. rewrite !assoc'. apply maponpaths. rewrite tensor_comp_id_l. rewrite tensor_comp_id_r. rewrite !assoc'. apply maponpaths. rewrite !assoc. rewrite tensor_sym_mon_braiding. rewrite !assoc'. apply maponpaths. unfold comp_enriched_profunctor_rmap_mor. rewrite !assoc. rewrite tensor_rassociator. rewrite !assoc'. apply maponpaths. rewrite !assoc. rewrite tensor_id_id. rewrite <- tensor_split. apply idpath. } refine (!_). 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 !assoc. rewrite <- tensor_comp_id_l. etrans. { do 3 apply maponpaths_2. rewrite !assoc. rewrite <- tensor_comp_id_l. rewrite tensor_sym_mon_braiding. rewrite !assoc'. rewrite comp_enriched_profunctor_rmap_comm. rewrite !assoc. rewrite sym_mon_braiding_inv. rewrite id_left. apply idpath. } rewrite <- tensor_comp_id_l. rewrite tensor_sym_mon_braiding. rewrite !assoc'. apply maponpaths. unfold comp_enriched_profunctor_rmap_mor. rewrite !assoc'. do 2 rewrite tensor_comp_id_r. rewrite !assoc'. do 2 apply maponpaths. rewrite comp_enriched_profunctor_lmap_comm. unfold comp_enriched_profunctor_lmap_mor. rewrite !assoc. rewrite sym_mon_braiding_inv. rewrite id_left. apply idpath. } etrans. { do 4 apply maponpaths. rewrite !assoc. rewrite tensor_lassociator. rewrite !assoc'. apply maponpaths. rewrite !assoc. rewrite tensor_id_id. rewrite <- tensor_split'. rewrite tensor_comp_l_id_l. apply idpath. } rewrite !assoc. do 2 apply maponpaths_2. rewrite !assoc'. apply maponpaths. rewrite sym_mon_tensor_lassociator'. rewrite !assoc'. do 2 apply maponpaths. refine (!_). etrans. { do 2 apply maponpaths. rewrite !assoc. rewrite mon_rassociator_lassociator. rewrite id_left. apply idpath. } rewrite !assoc'. etrans. { do 4 apply maponpaths. rewrite !assoc. rewrite tensor_sym_mon_braiding. rewrite !assoc'. rewrite tensor_rassociator. apply idpath. } rewrite tensor_id_id. rewrite !assoc. apply maponpaths_2. refine (_ @ id_right _). rewrite <- mon_lassociator_rassociator. rewrite !assoc. apply maponpaths_2. rewrite !assoc'. rewrite mon_lassociator_lassociator. rewrite !assoc. rewrite <- tensor_comp_id_r. rewrite mon_rassociator_lassociator. rewrite tensor_id_id. rewrite id_left. rewrite !assoc'. apply maponpaths. rewrite tensor_comp_id_r. rewrite !assoc'. rewrite tensor_sym_mon_braiding. refine (_ @ id_left _). rewrite !assoc. apply maponpaths_2. etrans. { rewrite !assoc'. rewrite tensor_sym_mon_braiding. apply maponpaths. rewrite !assoc. rewrite sym_mon_braiding_inv. rewrite id_left. apply idpath. } rewrite <- tensor_comp_id_l. rewrite sym_mon_braiding_inv. apply tensor_id_id. 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.