|
| 1 | +/- |
| 2 | +Copyright (c) 2025 Joël Riou. All rights reserved. |
| 3 | +Released under Apache 2.0 license as described in the file LICENSE. |
| 4 | +Authors: Joël Riou, Christian Merten |
| 5 | +-/ |
| 6 | +import Mathlib.CategoryTheory.Bicategory.Functor.Pseudofunctor |
| 7 | +import Mathlib.CategoryTheory.CommSq |
| 8 | + |
| 9 | +/-! |
| 10 | +# Pseudofunctors from strict bicategory |
| 11 | +
|
| 12 | +This file provides an API for pseudofunctors `F` from a strict bicategory `B`. In |
| 13 | +particular, this shall apply to pseudofunctors from locally discrete bicategories. |
| 14 | +
|
| 15 | +Firstly, we study the compatibilities of the flexible variants `mapId'` and `mapComp'` |
| 16 | +of `mapId` and `mapComp` with respect to the composition with identities and the |
| 17 | +associativity. |
| 18 | +
|
| 19 | +Secondly, given a commutative square `t ≫ r = l ≫ b` in `B`, we construct an |
| 20 | +isomorphism `F.map t ≫ F.map r ≅ F.map l ≫ F.map b` |
| 21 | +(see `Pseudofunctor.isoMapOfCommSq`). |
| 22 | +
|
| 23 | +-/ |
| 24 | + |
| 25 | +namespace CategoryTheory |
| 26 | + |
| 27 | +open Bicategory |
| 28 | + |
| 29 | +namespace Pseudofunctor |
| 30 | + |
| 31 | +variable {B C : Type*} [Bicategory B] [Strict B] [Bicategory C] (F : Pseudofunctor B C) |
| 32 | + |
| 33 | +lemma mapComp'_comp_id {b₀ b₁ : B} (f : b₀ ⟶ b₁) : |
| 34 | + F.mapComp' f (𝟙 b₁) f = (ρ_ _).symm ≪≫ whiskerLeftIso _ (F.mapId b₁).symm := by |
| 35 | + ext |
| 36 | + rw [mapComp'] |
| 37 | + dsimp |
| 38 | + rw [F.mapComp_id_right_hom f, Strict.rightUnitor_eqToIso, eqToIso.hom, |
| 39 | + ← F.map₂_comp_assoc, eqToHom_trans, eqToHom_refl, PrelaxFunctor.map₂_id, |
| 40 | + Category.id_comp] |
| 41 | + |
| 42 | +lemma mapComp'_id_comp {b₀ b₁ : B} (f : b₀ ⟶ b₁) : |
| 43 | + F.mapComp' (𝟙 b₀) f f = (λ_ _).symm ≪≫ whiskerRightIso (F.mapId b₀).symm _ := by |
| 44 | + ext |
| 45 | + rw [mapComp'] |
| 46 | + dsimp |
| 47 | + rw [F.mapComp_id_left_hom f, Strict.leftUnitor_eqToIso, eqToIso.hom, |
| 48 | + ← F.map₂_comp_assoc, eqToHom_trans, eqToHom_refl, PrelaxFunctor.map₂_id, |
| 49 | + Category.id_comp] |
| 50 | + |
| 51 | +section associativity |
| 52 | + |
| 53 | +variable {b₀ b₁ b₂ b₃ : B} (f₀₁ : b₀ ⟶ b₁) |
| 54 | + (f₁₂ : b₁ ⟶ b₂) (f₂₃ : b₂ ⟶ b₃) (f₀₂ : b₀ ⟶ b₂) (f₁₃ : b₁ ⟶ b₃) (f : b₀ ⟶ b₃) |
| 55 | + (h₀₂ : f₀₁ ≫ f₁₂ = f₀₂) (h₁₃ : f₁₂ ≫ f₂₃ = f₁₃) |
| 56 | + |
| 57 | +@[reassoc] |
| 58 | +lemma mapComp'_hom_comp_whiskerLeft_mapComp'_hom (hf : f₀₁ ≫ f₁₃ = f) : |
| 59 | + (F.mapComp' f₀₁ f₁₃ f).hom ≫ F.map f₀₁ ◁ (F.mapComp' f₁₂ f₂₃ f₁₃ h₁₃).hom = |
| 60 | + (F.mapComp' f₀₂ f₂₃ f).hom ≫ |
| 61 | + (F.mapComp' f₀₁ f₁₂ f₀₂ h₀₂).hom ▷ F.map f₂₃ ≫ (α_ _ _ _).hom := by |
| 62 | + subst h₀₂ h₁₃ hf |
| 63 | + simp [mapComp_assoc_right_hom, Strict.associator_eqToIso, mapComp'] |
| 64 | + |
| 65 | +@[reassoc] |
| 66 | +lemma mapComp'_inv_comp_mapComp'_hom (hf : f₀₁ ≫ f₁₃ = f) : |
| 67 | + (F.mapComp' f₀₁ f₁₃ f).inv ≫ (F.mapComp' f₀₂ f₂₃ f).hom = |
| 68 | + F.map f₀₁ ◁ (F.mapComp' f₁₂ f₂₃ f₁₃ h₁₃).hom ≫ |
| 69 | + (α_ _ _ _).inv ≫ (F.mapComp' f₀₁ f₁₂ f₀₂ h₀₂).inv ▷ F.map f₂₃ := by |
| 70 | + rw [← cancel_epi (F.mapComp' f₀₁ f₁₃ f hf).hom, Iso.hom_inv_id_assoc, |
| 71 | + F.mapComp'_hom_comp_whiskerLeft_mapComp'_hom_assoc _ _ _ _ _ _ h₀₂ h₁₃ hf] |
| 72 | + simp |
| 73 | + |
| 74 | +@[reassoc] |
| 75 | +lemma whiskerLeft_mapComp'_inv_comp_mapComp'_inv (hf : f₀₁ ≫ f₁₃ = f) : |
| 76 | + F.map f₀₁ ◁ (F.mapComp' f₁₂ f₂₃ f₁₃ h₁₃).inv ≫ (F.mapComp' f₀₁ f₁₃ f hf).inv = |
| 77 | + (α_ _ _ _).inv ≫ (F.mapComp' f₀₁ f₁₂ f₀₂ h₀₂).inv ▷ F.map f₂₃ ≫ |
| 78 | + (F.mapComp' f₀₂ f₂₃ f).inv := by |
| 79 | + simp [← cancel_mono (F.mapComp' f₀₂ f₂₃ f).hom, |
| 80 | + F.mapComp'_inv_comp_mapComp'_hom _ _ _ _ _ _ h₀₂ h₁₃ hf] |
| 81 | + |
| 82 | +@[reassoc] |
| 83 | +lemma mapComp'_hom_comp_mapComp'_hom_whiskerRight (hf : f₀₂ ≫ f₂₃ = f) : |
| 84 | + (F.mapComp' f₀₂ f₂₃ f).hom ≫ (F.mapComp' f₀₁ f₁₂ f₀₂ h₀₂).hom ▷ F.map f₂₃ = |
| 85 | + (F.mapComp' f₀₁ f₁₃ f).hom ≫ F.map f₀₁ ◁ (F.mapComp' f₁₂ f₂₃ f₁₃ h₁₃).hom ≫ |
| 86 | + (α_ _ _ _).inv := by |
| 87 | + rw [F.mapComp'_hom_comp_whiskerLeft_mapComp'_hom_assoc _ _ _ _ _ f h₀₂ h₁₃ (by aesop_cat)] |
| 88 | + simp |
| 89 | + |
| 90 | +@[reassoc] |
| 91 | +lemma mapComp'_inv_whiskerRight_comp_mapComp'_inv (hf : f₀₂ ≫ f₂₃ = f) : |
| 92 | + (F.mapComp' f₀₁ f₁₂ f₀₂ h₀₂).inv ▷ F.map f₂₃ ≫ (F.mapComp' f₀₂ f₂₃ f).inv = |
| 93 | + (α_ _ _ _).hom ≫ F.map f₀₁ ◁ (F.mapComp' f₁₂ f₂₃ f₁₃ h₁₃).inv ≫ |
| 94 | + (F.mapComp' f₀₁ f₁₃ f).inv := by |
| 95 | + rw [whiskerLeft_mapComp'_inv_comp_mapComp'_inv _ _ _ _ _ _ f h₀₂ h₁₃, |
| 96 | + Iso.hom_inv_id_assoc] |
| 97 | + |
| 98 | +end associativity |
| 99 | + |
| 100 | +section CommSq |
| 101 | + |
| 102 | +variable {X₁ X₂ Y₁ Y₂ Z₁ Z₂ : B} |
| 103 | + |
| 104 | +section |
| 105 | + |
| 106 | +variable {t : X₁ ⟶ Y₁} {l : X₁ ⟶ X₂} {r : Y₁ ⟶ Y₂} {b : X₂ ⟶ Y₂} (sq : CommSq t l r b) |
| 107 | + |
| 108 | +/-- Given a commutative square `CommSq t l r b` in a strict bicategory `B` and |
| 109 | +a pseudofunctor from `B`, this is the natural isomorphism |
| 110 | +`F.map t ≫ F.map r ≅ F.map l ≫ F.map b`. -/ |
| 111 | +def isoMapOfCommSq : F.map t ≫ F.map r ≅ F.map l ≫ F.map b := |
| 112 | + (F.mapComp t r).symm ≪≫ F.mapComp' _ _ _ (by rw [sq.w]) |
| 113 | + |
| 114 | +lemma isoMapOfCommSq_eq (φ : X₁ ⟶ Y₂) (hφ : t ≫ r = φ) : |
| 115 | + F.isoMapOfCommSq sq = (F.mapComp' t r φ (by rw [hφ])).symm ≪≫ |
| 116 | + F.mapComp' l b φ (by rw [← hφ, sq.w]) := by |
| 117 | + subst hφ |
| 118 | + simp [isoMapOfCommSq, mapComp'_eq_mapComp] |
| 119 | + |
| 120 | +end |
| 121 | + |
| 122 | +/-- Equational lemma for `Pseudofunctor.isoMapOfCommSq` when |
| 123 | +both vertical maps of the square are the same and horizontal maps are identities. -/ |
| 124 | +lemma isoMapOfCommSq_horiz_id (f : X₁ ⟶ X₂) : |
| 125 | + F.isoMapOfCommSq (t := 𝟙 _) (l := f) (r := f) (b := 𝟙 _) ⟨by simp⟩ = |
| 126 | + whiskerRightIso (F.mapId X₁) (F.map f) ≪≫ λ_ _ ≪≫ (ρ_ _).symm ≪≫ |
| 127 | + (whiskerLeftIso (F.map f) (F.mapId X₂)).symm := by |
| 128 | + ext |
| 129 | + rw [isoMapOfCommSq_eq _ _ f (by simp), mapComp'_comp_id, mapComp'_id_comp] |
| 130 | + simp |
| 131 | + |
| 132 | +/-- Equational lemma for `Pseudofunctor.isoMapOfCommSq` when |
| 133 | +both horizontal maps of the square are the same and vertical maps are identities. -/ |
| 134 | +lemma isoMapOfCommSq_vert_id (f : X₁ ⟶ X₂) : |
| 135 | + F.isoMapOfCommSq (t := f) (l := 𝟙 _) (r := 𝟙 _) (b := f) ⟨by simp⟩ = |
| 136 | + whiskerLeftIso (F.map f) (F.mapId X₂) ≪≫ ρ_ _ ≪≫ (λ_ _).symm ≪≫ |
| 137 | + (whiskerRightIso (F.mapId X₁) (F.map f)).symm := by |
| 138 | + ext |
| 139 | + rw [isoMapOfCommSq_eq _ _ f (by simp), mapComp'_comp_id, mapComp'_id_comp] |
| 140 | + simp |
| 141 | + |
| 142 | +end CommSq |
| 143 | + |
| 144 | +end Pseudofunctor |
| 145 | + |
| 146 | +end CategoryTheory |
0 commit comments