Library UniMath.Bicategories.DoubleCategories.Examples.HorizontalDual

1. The data of the horizontal dual

  Definition horizontal_dual_hor_bicat
    : bicat
    := op1_bicat (hor_bicat_of_verity_double_bicat B).

  Definition horizontal_dual_twosided_disp_cat_data
    : twosided_disp_cat_data horizontal_dual_hor_bicat horizontal_dual_hor_bicat.
  Proof.
    simple refine ((_ ,, _) ,, (_ ,, _)).
    - exact (Ξ» (x y : B), x -|-> y).
    - exact (Ξ» (x₁ xβ‚‚ y₁ yβ‚‚ : B)
               (v₁ : x₁ -|-> y₁) (vβ‚‚ : xβ‚‚ -|-> yβ‚‚)
               (h₁ : xβ‚‚ --> x₁) (hβ‚‚ : yβ‚‚ --> y₁),
             square_double_bicat h₁ hβ‚‚ vβ‚‚ v₁).
    - exact (Ξ» (x y : B) (v : x -|-> y), id_h_square_bicat _).
    - exact (Ξ» (x₁ xβ‚‚ x₃ y₁ yβ‚‚ y₃ : B)
               (v₁ : x₁ -|-> y₁) (vβ‚‚ : xβ‚‚ -|-> yβ‚‚) (v₃ : x₃ -|-> y₃)
               (h₁ : xβ‚‚ --> x₁) (hβ‚‚ : x₃ --> xβ‚‚)
               (k₁ : yβ‚‚ --> y₁) (kβ‚‚ : y₃ --> yβ‚‚)
               (s₁ : square_double_bicat h₁ k₁ vβ‚‚ v₁)
               (sβ‚‚ : square_double_bicat hβ‚‚ kβ‚‚ v₃ vβ‚‚),
             sβ‚‚ ⋆h s₁).
  Defined.

  Definition horizontal_dual_ver_sq_bicat
    : ver_sq_bicat.
  Proof.
    use make_ver_sq_bicat.
    - exact horizontal_dual_hor_bicat.
    - exact horizontal_dual_twosided_disp_cat_data.
  Defined.

  Definition horizontal_dual_ver_sq_bicat_ver_id_comp
    : ver_sq_bicat_ver_id_comp horizontal_dual_ver_sq_bicat.
  Proof.
    repeat split ; cbn.
    - exact (Ξ» (x : B), id_v x).
    - exact (Ξ» (x y z : B)
               (v₁ : x -|-> y) (vβ‚‚ : y -|-> z),
             v₁ Β· vβ‚‚).
    - exact (Ξ» (x y : B)
               (v₁ vβ‚‚ : x -|-> y),
             vβ‚‚ =|=> v₁).
  Defined.

  Definition horizontal_dual_ver_sq_bicat_id_comp_cells
    : ver_sq_bicat_id_comp_cells horizontal_dual_ver_sq_bicat_ver_id_comp.
  Proof.
    repeat split ; cbn.
    - exact (Ξ» (x y : B) (v : x -|-> y), id2 v).
    - exact (Ξ» (x y : B) (v : x -|-> y), lunitor (C := op2_bicat 𝕍) v).
    - exact (Ξ» (x y : B) (v : x -|-> y), runitor (C := op2_bicat 𝕍) v).
    - exact (Ξ» (x y : B) (v : x -|-> y), linvunitor (C := op2_bicat 𝕍) v).
    - exact (Ξ» (x y : B) (v : x -|-> y), rinvunitor (C := op2_bicat 𝕍) v).
    - exact (Ξ» (w x y z : B)
               (v₁ : w -|-> x) (vβ‚‚ : x -|-> y) (v₃ : y -|-> z),
             rassociator (C := op2_bicat 𝕍) v₁ vβ‚‚ v₃).
    - exact (Ξ» (w x y z : B)
               (v₁ : w -|-> x) (vβ‚‚ : x -|-> y) (v₃ : y -|-> z),
             lassociator (C := op2_bicat 𝕍) v₁ vβ‚‚ v₃).
    - exact (Ξ» (x y : B)
               (v₁ vβ‚‚ v₃ : x -|-> y)
               (Ο„ : vβ‚‚ =|=> v₁) (ΞΈ : v₃ =|=> vβ‚‚),
             ΞΈ β€’ Ο„).
    - exact (Ξ» (x y z : B)
               (v : x -|-> y)
               (w₁ wβ‚‚ : y -|-> z)
               (Ο„ : wβ‚‚ =|=> w₁),
             v β—ƒ Ο„).
    - exact (Ξ» (x y z : B)
               (v₁ vβ‚‚ : x -|-> y)
               (w : y -|-> z)
               (Ο„ : vβ‚‚ =|=> v₁),
             Ο„ β–Ή w).
  Defined.

  Proposition horizontal_dual_ver_sq_bicat_prebicat_laws
    : ver_sq_bicat_prebicat_laws horizontal_dual_ver_sq_bicat_id_comp_cells.
  Proof.
    exact (pr21 (op2_bicat 𝕍)).
  Qed.

  Definition horizontal_dual_ver_bicat_sq_bicat
    : ver_bicat_sq_bicat.
  Proof.
    use make_ver_bicat_sq_bicat.
    - exact horizontal_dual_ver_sq_bicat.
    - exact horizontal_dual_ver_sq_bicat_ver_id_comp.
    - exact horizontal_dual_ver_sq_bicat_id_comp_cells.
    - exact horizontal_dual_ver_sq_bicat_prebicat_laws.
    - abstract
        (intro ; intros ;
         apply cellset_property).
  Defined.

  Definition horizontal_dual_ver_bicat_sq_bicat_ver_id_comp_sq
    : ver_bicat_sq_bicat_ver_id_comp_sq horizontal_dual_ver_bicat_sq_bicat.
  Proof.
    split.
    - exact (Ξ» (x y : B) (h : y --> x), id_v_square_bicat h).
    - exact (Ξ» (x₁ xβ‚‚ x₃ y₁ yβ‚‚ y₃ : B)
               (h₁ : y₁ --> x₁)
               (hβ‚‚ : yβ‚‚ --> xβ‚‚)
               (h₃ : y₃ --> x₃)
               (v₁ : x₁ -|-> xβ‚‚) (vβ‚‚ : xβ‚‚ -|-> x₃)
               (w₁ : y₁ -|-> yβ‚‚) (wβ‚‚ : yβ‚‚ -|-> y₃)
               (s₁ : square_double_bicat h₁ hβ‚‚ w₁ v₁)
               (sβ‚‚ : square_double_bicat hβ‚‚ h₃ wβ‚‚ vβ‚‚),
             s₁ ⋆v sβ‚‚).
  Defined.

  Definition horizontal_dual_ver_bicat_sq_bicat_ver_id_comp
    : ver_bicat_sq_bicat_ver_id_comp.
  Proof.
    use make_ver_bicat_sq_bicat_ver_id_comp.
    - exact horizontal_dual_ver_bicat_sq_bicat.
    - exact horizontal_dual_ver_bicat_sq_bicat_ver_id_comp_sq.
  Defined.

2. Whiskering operations

  Definition horizontal_dual_double_bicat_whiskering
    : double_bicat_whiskering horizontal_dual_ver_bicat_sq_bicat_ver_id_comp.
  Proof.
    repeat split.
    - exact (Ξ» (w x y z : B)
               (h₁ : x --> w)
               (hβ‚‚ : z --> y)
               (v₁ v₁' : w -|-> y)
               (vβ‚‚ : x -|-> z)
               (Ο„ : v₁' =|=> v₁)
               (s : square_double_bicat h₁ hβ‚‚ vβ‚‚ v₁'),
             Ο„ β–Ήs s).
    - exact (Ξ» (w x y z : B)
               (h₁ : x --> w)
               (hβ‚‚ : z --> y)
               (v₁ : w -|-> y)
               (vβ‚‚ vβ‚‚' : x -|-> z)
               (Ο„ : vβ‚‚' =|=> vβ‚‚)
               (s : square_double_bicat h₁ hβ‚‚ vβ‚‚ v₁),
             Ο„ β—ƒs s).
    - exact (Ξ» (w x y z : B)
               (h₁ h₁' : x --> w)
               (hβ‚‚ : z --> y)
               (v₁ : w -|-> y)
               (vβ‚‚ : x -|-> z)
               (Ο„ : h₁ ==> h₁')
               (s : square_double_bicat h₁' hβ‚‚ vβ‚‚ v₁),
             Ο„ β–΅s s).
    - exact (Ξ» (w x y z : B)
               (h₁ : x --> w)
               (hβ‚‚ hβ‚‚' : z --> y)
               (v₁ : w -|-> y)
               (vβ‚‚ : x -|-> z)
               (Ο„ : hβ‚‚ ==> hβ‚‚')
               (s : square_double_bicat h₁ hβ‚‚ vβ‚‚ v₁),
             Ο„ β–Ώs s).
  Defined.

  Definition horizontal_dual_ver_bicat_sq_id_comp_whisker
    : ver_bicat_sq_id_comp_whisker.
  Proof.
    use make_ver_bicat_sq_id_comp_whisker.
    - exact horizontal_dual_ver_bicat_sq_bicat_ver_id_comp.
    - exact horizontal_dual_double_bicat_whiskering.
  Defined.

3. Laws of the horizontal dual

  Proposition horizontal_dual_whisker_square_bicat_law
    : whisker_square_bicat_law horizontal_dual_ver_bicat_sq_id_comp_whisker.
  Proof.
    repeat split ; intro ; intros ; cbn.
    - apply rwhisker_square_id.
    - apply rwhisker_square_comp.
    - apply lwhisker_square_id.
    - apply lwhisker_square_comp.
    - apply uwhisker_square_id.
    - apply uwhisker_square_comp.
    - apply dwhisker_square_id.
    - apply dwhisker_square_comp.
    - apply dwhisker_uwhisker_square.
    - apply rwhisker_uwhisker_square.
    - apply lwhisker_uwhisker_square.
    - apply rwhisker_dwhisker_square.
    - apply lwhisker_dwhisker_square.
    - refine (!_).
      apply rwhisker_lwhisker_square.
    - refine (!_).
      apply lwhisker_id_h_square.
    - apply uwhisker_id_v_square.
    - apply uwhisker_vcomp_square.
    - apply dwhisker_vcomp_square.
    - apply ud_whisker_vcomp_square.
    - apply rwhisker_hcomp_square.
    - apply lwhisker_hcomp_square.
    - refine (!_).
      apply lrwhisker_hcomp_square.
  Qed.

  Proposition horizontal_dual_double_bicat_id_comp_square_laws
    : double_bicat_id_comp_square_laws horizontal_dual_ver_bicat_sq_id_comp_whisker.
  Proof.
    repeat split ; intro ; intros ; cbn.
    - apply double_bicat_interchange.
    - apply id_h_square_bicat_id.
    - apply id_h_square_bicat_comp.
    - apply id_v_square_bicat_comp.
  Qed.

  Proposition horizontal_dual_double_bicat_cylinder_laws
    : double_bicat_cylinder_laws horizontal_dual_ver_bicat_sq_id_comp_whisker.
  Proof.
    repeat split.
    - intro ; intros ; cbn.
      etrans.
      {
        apply maponpaths.
        apply lassociator_h_comp_square''.
      }
      rewrite <- dwhisker_square_comp.
      rewrite lassociator_rassociator.
      apply dwhisker_square_id.
    - intro ; intros ; cbn.
      etrans.
      {
        apply maponpaths.
        apply lassociator_v_comp_square'.
      }
      rewrite <- rwhisker_lwhisker_square.
      rewrite <- rwhisker_square_comp.
      rewrite (lassociator_rassociator (C := 𝕍)).
      apply rwhisker_square_id.
    - intro ; intros ; cbn.
      apply runitor_h_comp_square.
    - intro ; intros ; cbn.
      refine (!_).
      etrans.
      {
        apply maponpaths.
        apply lunitor_v_comp_square'.
      }
      rewrite rwhisker_lwhisker_square.
      rewrite <- lwhisker_square_comp.
      rewrite (linvunitor_lunitor (C := 𝕍)).
      apply lwhisker_square_id.
    - intro ; intros ; cbn.
      apply lunitor_h_comp_square.
    - intro ; intros ; cbn.
      refine (!_).
      etrans.
      {
        apply maponpaths.
        apply runitor_v_comp_square'.
      }
      rewrite rwhisker_lwhisker_square.
      rewrite <- lwhisker_square_comp.
      rewrite (rinvunitor_runitor (C := 𝕍)).
      apply lwhisker_square_id.
    - intros x₁ xβ‚‚ y₁ yβ‚‚ z₁ zβ‚‚ h₁ hβ‚‚ h₃ v₁ v₁' vβ‚‚ vβ‚‚'.
      intros w₁ w₁' wβ‚‚ wβ‚‚' τ₁ Ο„β‚‚ θ₁ ΞΈβ‚‚ s₁ s₁' sβ‚‚ sβ‚‚' p q ; cbn.
      rewrite <- !(vcomp_whisker (C := 𝕍)).
      exact (!(ver_bicat_hcomp_v_comp_square B _ _ _ _ _ _ _ _ (!p) (!q))).
    - intros x₁ xβ‚‚ y₁ yβ‚‚ z₁ zβ‚‚ h₁ hβ‚‚ h₃ v₁ v₁' vβ‚‚ vβ‚‚'.
      intros w₁ w₁' wβ‚‚ wβ‚‚' τ₁ Ο„β‚‚ θ₁ ΞΈβ‚‚ s₁ s₁' sβ‚‚ sβ‚‚' p q ; cbn.
      rewrite <- !vcomp_whisker.
      exact (hor_bicat_hcomp_h_comp_square B _ _ _ _ _ _ _ _ q p).
  Qed.

  Proposition horizontal_dual_double_bicat_laws
    : double_bicat_laws horizontal_dual_ver_bicat_sq_id_comp_whisker.
  Proof.
    use make_double_bicat_laws.
    - exact horizontal_dual_whisker_square_bicat_law.
    - exact horizontal_dual_double_bicat_id_comp_square_laws.
    - exact horizontal_dual_double_bicat_cylinder_laws.
    - intro ; intros.
      apply isaset_square_double_bicat.
  Qed.

4. The horizontal dual

5. Vertical cells and squares

  Definition horizontal_dual_vertically_saturated
             (H : vertically_saturated B)
    : vertically_saturated horizontal_dual_verity_double_bicat.
  Proof.
    refine (Ξ» (x y : B) (v₁ vβ‚‚ : x -|-> y), _).
    use isweq_iso.
    - exact (Ξ» s, square_to_vertical_cell H s).
    - abstract
        (intro Ο„ ; cbn ;
         refine (_ @ vertical_cell_to_square_to_vertical_cell H Ο„) ;
         apply maponpaths ; unfold vertical_cell_to_square ;
         rewrite lwhisker_id_h_square ;
         apply idpath).
    - abstract
        (intro s ; cbn ;
         refine (_ @ square_to_vertical_cell_to_square H s) ;
         unfold vertical_cell_to_square ;
         rewrite lwhisker_id_h_square ;
         apply idpath).
  Defined.

6. The local univalence of the dual

  Proposition hor_locally_univalent_horizontal_dual
              (H : hor_locally_univalent B)
    : hor_locally_univalent horizontal_dual_verity_double_bicat.
  Proof.
    use op1_bicat_is_univalent_2_1.
    exact H.
  Qed.

  Definition horizontal_dual_inv2cell_weq
             {x y : B}
             (v₁ vβ‚‚ : x -|-> y)
    : invertible_2cell (C := 𝕍) v₁ vβ‚‚
      β‰ƒ
      invertible_2cell
        (C := ver_bicat_of_verity_double_bicat horizontal_dual_verity_double_bicat)
        v₁ vβ‚‚.
  Proof.
    use weq_iso.
    - use (Ξ» Ο„, make_invertible_2cell _).
      + exact Ο„^-1.
      + use make_is_invertible_2cell.
        * exact Ο„.
        * exact (vcomp_rinv Ο„).
        * exact (vcomp_linv Ο„).
    - use (Ξ» Ο„, make_invertible_2cell _).
      + exact Ο„^-1.
      + use make_is_invertible_2cell.
        * exact Ο„.
        * exact (vcomp_rinv Ο„).
        * exact (vcomp_linv Ο„).
    - abstract
        (intro ;
         apply idpath).
    - abstract
        (intro ;
         apply idpath).
  Defined.

  Proposition ver_locally_univalent_horizontal_dual
              (H : ver_locally_univalent B)
    : ver_locally_univalent horizontal_dual_verity_double_bicat.
  Proof.
    intros x y v₁ vβ‚‚.
    use weqhomot.
    - exact (horizontal_dual_inv2cell_weq v₁ vβ‚‚
             βˆ˜ make_weq _ (H x y v₁ vβ‚‚))%weq.
    - intro p.
      induction p.
      use cell_from_invertible_2cell_eq ; cbn.
      apply idpath.
  Qed.

  Proposition locally_univalent_horizontal_dual
              (H : locally_univalent_verity_double_bicat B)
    : locally_univalent_verity_double_bicat horizontal_dual_verity_double_bicat.
  Proof.
    split.
    - use hor_locally_univalent_horizontal_dual.
      apply H.
    - use ver_locally_univalent_horizontal_dual.
      apply H.
  Qed.
End HorizontalDual.