The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V24. Category theory

Mathlib.CategoryTheory.Bicategory.Coherence

27 declarations. Mathlib docs · Source

The coherence theorem for bicategories

In this file, we prove the coherence theorem for bicategories, stated in the following form: the free bicategory over any quiver is locally thin.

The proof is almost the same as the proof of the coherence theorem for monoidal categories that has been previously formalized in mathlib, which is based on the proof described by Ilya Beylin and Peter Dybjer. The idea is to view a path on a quiver as a normal form of a 1-morphism in the free bicategory on the same quiver. A normalization procedure is then described by normalize : FreeBicategory B ⥤ᵖ (LocallyDiscrete (Paths B)), which is a pseudofunctor from the free bicategory to the locally discrete bicategory on the path category. It turns out that this pseudofunctor is locally an equivalence of categories, and the coherence theorem follows immediately from this fact.

Main statements

  • locally_thin : the free bicategory is locally thin, that is, there is at most one 2-morphism between two fixed 1-morphisms.

References

  • [Ilya Beylin and Peter Dybjer, Extracting a proof of coherence for monoidal categories from a proof of normalization for monoids][beylin1996]

theorem CategoryTheory.FreeBicategory.normalizeAux.match_1.congr_eq_1 E1 #

∀ {B : Type u_2} [inst : Quiver B] {a : B}
  (motive : (x x_1 : B) → Quiver.Path a x → CategoryTheory.FreeBicategory.Hom x x_1 → Sort u_3) (x x_1 : B)
  (x_2 : Quiver.Path a x) (x_3 : CategoryTheory.FreeBicategory.Hom x x_1)
  (h_1 : (x x_4 : B) → (p : Quiver.Path a x) → (f : x ⟶ x_4) → motive x x_4 p (CategoryTheory.FreeBicategory.Hom.of f))
  (h_2 : (x : B) → (p : Quiver.Path a x) → motive x x p (CategoryTheory.FreeBicategory.Hom.id x))
  (h_3 :
    (x x_4 : B) →
      (p : Quiver.Path a x) →
        (b : B) →
          (f : CategoryTheory.FreeBicategory.Hom x b) →
            (g : CategoryTheory.FreeBicategory.Hom b x_4) → motive x x_4 p (f.comp g))
  (x_4 x_5 : B) (p : Quiver.Path a x_4) (f : x_4 ⟶ x_5),
  x = x_4 →
    x_1 = x_5 →
      x_2 ≍ p →
        x_3 ≍ CategoryTheory.FreeBicategory.Hom.of f →
          (match x, x_1, x_2, x_3 with
            | x, x_6, p, CategoryTheory.FreeBicategory.Hom.of f => h_1 x x_6 p f
            | x, .(x), p, CategoryTheory.FreeBicategory.Hom.id .(x) => h_2 x p
            | x, x_6, p, f.comp g => h_3 x x_6 p b f g) ≍
            h_1 x_4 x_5 p f

theorem CategoryTheory.FreeBicategory.normalizeAux.match_1.congr_eq_3 E1 #

∀ {B : Type u_2} [inst : Quiver B] {a : B}
  (motive : (x x_1 : B) → Quiver.Path a x → CategoryTheory.FreeBicategory.Hom x x_1 → Sort u_3) (x x_1 : B)
  (x_2 : Quiver.Path a x) (x_3 : CategoryTheory.FreeBicategory.Hom x x_1)
  (h_1 : (x x_4 : B) → (p : Quiver.Path a x) → (f : x ⟶ x_4) → motive x x_4 p (CategoryTheory.FreeBicategory.Hom.of f))
  (h_2 : (x : B) → (p : Quiver.Path a x) → motive x x p (CategoryTheory.FreeBicategory.Hom.id x))
  (h_3 :
    (x x_4 : B) →
      (p : Quiver.Path a x) →
        (b : B) →
          (f : CategoryTheory.FreeBicategory.Hom x b) →
            (g : CategoryTheory.FreeBicategory.Hom b x_4) → motive x x_4 p (f.comp g))
  (x_4 x_5 : B) (p : Quiver.Path a x_4) (b : B) (f : CategoryTheory.FreeBicategory.Hom x_4 b)
  (g : CategoryTheory.FreeBicategory.Hom b x_5),
  x = x_4 →
    x_1 = x_5 →
      x_2 ≍ p →
        x_3 ≍ f.comp g →
          (match x, x_1, x_2, x_3 with
            | x, x_6, p, CategoryTheory.FreeBicategory.Hom.of f => h_1 x x_6 p f
            | x, .(x), p, CategoryTheory.FreeBicategory.Hom.id .(x) => h_2 x p
            | x, x_6, p, f.comp g => h_3 x x_6 p b f g) ≍
            h_3 x_4 x_5 p b f g

theorem CategoryTheory.FreeBicategory.inclusionPathAux.match_1.congr_eq_1 E1 #

∀ {B : Type u_2} [inst : Quiver B] {a : B} (motive : (x : B) → Quiver.Path a x → Sort u_3) (x : B)
  (x_1 : Quiver.Path a x) (h_1 : Unit → motive a Quiver.Path.nil)
  (h_2 : (x b : B) → (p : Quiver.Path a b) → (f : b ⟶ x) → motive x (p.cons f)),
  x = a →
    x_1 ≍ Quiver.Path.nil →
      (match x, x_1 with
        | .(a), Quiver.Path.nil => h_1 ()
        | x, p.cons f => h_2 x b p f) ≍
        h_1 ()

theorem CategoryTheory.FreeBicategory.normalizeAux.match_1.congr_eq_2 E1 #

∀ {B : Type u_2} [inst : Quiver B] {a : B}
  (motive : (x x_1 : B) → Quiver.Path a x → CategoryTheory.FreeBicategory.Hom x x_1 → Sort u_3) (x x_1 : B)
  (x_2 : Quiver.Path a x) (x_3 : CategoryTheory.FreeBicategory.Hom x x_1)
  (h_1 : (x x_4 : B) → (p : Quiver.Path a x) → (f : x ⟶ x_4) → motive x x_4 p (CategoryTheory.FreeBicategory.Hom.of f))
  (h_2 : (x : B) → (p : Quiver.Path a x) → motive x x p (CategoryTheory.FreeBicategory.Hom.id x))
  (h_3 :
    (x x_4 : B) →
      (p : Quiver.Path a x) →
        (b : B) →
          (f : CategoryTheory.FreeBicategory.Hom x b) →
            (g : CategoryTheory.FreeBicategory.Hom b x_4) → motive x x_4 p (f.comp g))
  (x_4 : B) (p : Quiver.Path a x_4),
  x = x_4 →
    x_1 = x_4 →
      x_2 ≍ p →
        x_3 ≍ CategoryTheory.FreeBicategory.Hom.id x_4 →
          (match x, x_1, x_2, x_3 with
            | x, x_5, p, CategoryTheory.FreeBicategory.Hom.of f => h_1 x x_5 p f
            | x, .(x), p, CategoryTheory.FreeBicategory.Hom.id .(x) => h_2 x p
            | x, x_5, p, f.comp g => h_3 x x_5 p b f g) ≍
            h_2 x_4 p

theorem CategoryTheory.FreeBicategory.inclusionPathAux.match_1.congr_eq_2 E1 #

∀ {B : Type u_2} [inst : Quiver B] {a : B} (motive : (x : B) → Quiver.Path a x → Sort u_3) (x : B)
  (x_1 : Quiver.Path a x) (h_1 : Unit → motive a Quiver.Path.nil)
  (h_2 : (x b : B) → (p : Quiver.Path a b) → (f : b ⟶ x) → motive x (p.cons f)) (x_2 b : B) (p : Quiver.Path a b)
  (f : b ⟶ x_2),
  x = x_2 →
    x_1 ≍ p.cons f →
      (match x, x_1 with
        | .(a), Quiver.Path.nil => h_1 ()
        | x, p.cons f => h_2 x b p f) ≍
        h_2 x_2 b p f

def CategoryTheory.FreeBicategory.inclusionPathAux E0 #

{B : Type u} → [inst : Quiver B] → {a b : B} → Quiver.Path a b → CategoryTheory.FreeBicategory.Hom a b

Auxiliary definition for inclusionPath.

def CategoryTheory.FreeBicategory.homCategory' E1 #

{B : Type u} →
  [inst : Quiver B] → (a b : B) → CategoryTheory.Category.{max u v, max u v} (CategoryTheory.FreeBicategory.Hom a b)

Category structure on Hom a b. In this file, we will use Hom a b for a b : B (precisely, FreeBicategory.Hom a b) instead of the definitionally equal expression a ⟶ b for a b : FreeBicategory B. The main reason is that we have to annoyingly write @Quiver.Hom (FreeBicategory B) _ a b to get the latter expression when given a b : B.

def CategoryTheory.FreeBicategory.inclusionPath E1 #

{B : Type u} →
  [inst : Quiver B] →
    (a b : B) →
      CategoryTheory.Functor (CategoryTheory.Discrete (Quiver.Path a b)) (CategoryTheory.FreeBicategory.Hom a b)

The discrete category on the paths includes into the category of 1-morphisms in the free bicategory.

def CategoryTheory.FreeBicategory.preinclusion E1 #

(B : Type u) →
  [inst : Quiver B] →
    CategoryTheory.PrelaxFunctor (CategoryTheory.LocallyDiscrete (CategoryTheory.Paths B))
      (CategoryTheory.FreeBicategory B)

The inclusion from the locally discrete bicategory on the path category into the free bicategory as a prelax functor. This will be promoted to a pseudofunctor after proving the coherence theorem. See inclusion.

theorem CategoryTheory.FreeBicategory.preinclusion_obj E0 #

∀ {B : Type u} [inst : Quiver B] (a : B), (CategoryTheory.FreeBicategory.preinclusion B).obj { as := a } = a

theorem CategoryTheory.FreeBicategory.preinclusion_map₂ E0 #

∀ {B : Type u} [inst : Quiver B] {a b : B} (f g : CategoryTheory.Discrete (Quiver.Path a b)) (η : f ⟶ g),
  (CategoryTheory.FreeBicategory.preinclusion B).map₂ η = CategoryTheory.eqToHom ⋯

def CategoryTheory.FreeBicategory.normalizeAux E0 #

{B : Type u} →
  [inst : Quiver B] → {a b c : B} → Quiver.Path a b → CategoryTheory.FreeBicategory.Hom b c → Quiver.Path a c

The normalization of the composition of p : Path a b and f : Hom b c. p will eventually be taken to be nil and we then get the normalization of f alone, but the auxiliary p is necessary for Lean to accept the definition of normalizeIso and the whisker_left case of normalizeAux_congr and normalize_naturality.

def CategoryTheory.FreeBicategory.normalizeIso E1 #

{B : Type u} →
  [inst : Quiver B] →
    {a b c : B} →
      (p : Quiver.Path a b) →
        (f : CategoryTheory.FreeBicategory.Hom b c) →
          CategoryTheory.CategoryStruct.comp ((CategoryTheory.FreeBicategory.preinclusion B).map { as := p }) f ≅
            (CategoryTheory.FreeBicategory.preinclusion B).map { as := CategoryTheory.FreeBicategory.normalizeAux p f }

A 2-isomorphism between a partially-normalized 1-morphism in the free bicategory to the fully-normalized 1-morphism.

theorem CategoryTheory.FreeBicategory.normalizeAux_comp E0 #

∀ {B : Type u} [inst : Quiver B] {a : B} {b c d : CategoryTheory.FreeBicategory B} (p : Quiver.Path a b) (f : b ⟶ c)
  (g : c ⟶ d),
  CategoryTheory.FreeBicategory.normalizeAux p (CategoryTheory.CategoryStruct.comp f g) =
    CategoryTheory.FreeBicategory.normalizeAux (CategoryTheory.FreeBicategory.normalizeAux p f) g

theorem CategoryTheory.FreeBicategory.normalizeAux_id E0 #

∀ {B : Type u} [inst : Quiver B] {a : B} {b : CategoryTheory.FreeBicategory B} (p : Quiver.Path a b),
  CategoryTheory.FreeBicategory.normalizeAux p (CategoryTheory.CategoryStruct.id b) = p

theorem CategoryTheory.FreeBicategory.normalizeIso_comp E0 #

∀ {B : Type u} [inst : Quiver B] {a : B} {b c d : CategoryTheory.FreeBicategory B} (p : Quiver.Path a b) (f : b ⟶ c)
  (g : c ⟶ d),
  CategoryTheory.FreeBicategory.normalizeIso p (CategoryTheory.CategoryStruct.comp f g) =
    (CategoryTheory.Bicategory.associator ((CategoryTheory.FreeBicategory.preinclusion B).map { as := p }) f g).symm ≪≫
      CategoryTheory.Bicategory.whiskerRightIso (CategoryTheory.FreeBicategory.normalizeIso p f) g ≪≫
        CategoryTheory.FreeBicategory.normalizeIso (CategoryTheory.FreeBicategory.normalizeAux p f) g

theorem CategoryTheory.FreeBicategory.normalizeIso_id E0 #

∀ {B : Type u} [inst : Quiver B] {a : B} {b : CategoryTheory.FreeBicategory B} (p : Quiver.Path a b),
  CategoryTheory.FreeBicategory.normalizeIso p (CategoryTheory.CategoryStruct.id b) =
    CategoryTheory.Bicategory.rightUnitor ((CategoryTheory.FreeBicategory.preinclusion B).map { as := p })

theorem CategoryTheory.FreeBicategory.quot_whisker_left E0 #

∀ {B : Type u} [inst : Quiver B] {a b c : CategoryTheory.FreeBicategory B} (f : a ⟶ b) {g h : b ⟶ c}
  (η : CategoryTheory.FreeBicategory.Hom₂ g h),
  Quot.mk CategoryTheory.FreeBicategory.Rel (CategoryTheory.FreeBicategory.Hom₂.whisker_left f η) =
    CategoryTheory.Bicategory.whiskerLeft f (Quot.mk CategoryTheory.FreeBicategory.Rel η)

theorem CategoryTheory.FreeBicategory.normalizeAux_congr E1 #

∀ {B : Type u} [inst : Quiver B] {a b c : B} (p : Quiver.Path a b) {f g : CategoryTheory.FreeBicategory.Hom b c}
  (η : f ⟶ g), CategoryTheory.FreeBicategory.normalizeAux p f = CategoryTheory.FreeBicategory.normalizeAux p g

Given a 2-morphism between f and g in the free bicategory, we have the equality normalizeAux p f = normalizeAux p g.

theorem CategoryTheory.FreeBicategory.normalize_naturality E1 #

∀ {B : Type u} [inst : Quiver B] {a b c : B} (p : Quiver.Path a b) {f g : CategoryTheory.FreeBicategory.Hom b c}
  (η : f ⟶ g),
  CategoryTheory.CategoryStruct.comp
      (CategoryTheory.Bicategory.whiskerLeft ((CategoryTheory.FreeBicategory.preinclusion B).map { as := p }) η)
      (CategoryTheory.FreeBicategory.normalizeIso p g).hom =
    CategoryTheory.CategoryStruct.comp (CategoryTheory.FreeBicategory.normalizeIso p f).hom
      ((CategoryTheory.FreeBicategory.preinclusion B).map₂ (CategoryTheory.eqToHom ⋯))

The 2-isomorphism normalizeIso p f is natural in f.

theorem CategoryTheory.FreeBicategory.normalizeAux_nil_comp E1 #

∀ {B : Type u} [inst : Quiver B] {a b c : B} (f : CategoryTheory.FreeBicategory.Hom a b)
  (g : CategoryTheory.FreeBicategory.Hom b c),
  CategoryTheory.FreeBicategory.normalizeAux Quiver.Path.nil (f.comp g) =
    (CategoryTheory.FreeBicategory.normalizeAux Quiver.Path.nil f).comp
      (CategoryTheory.FreeBicategory.normalizeAux Quiver.Path.nil g)

def CategoryTheory.FreeBicategory.normalize E1 #

(B : Type u) →
  [inst : Quiver B] →
    CategoryTheory.Pseudofunctor (CategoryTheory.FreeBicategory B)
      (CategoryTheory.LocallyDiscrete (CategoryTheory.Paths B))

The normalization pseudofunctor for the free bicategory on a quiver B.

def CategoryTheory.FreeBicategory.normalizeUnitIso E1 #

{B : Type u} →
  [inst : Quiver B] →
    (a b : CategoryTheory.FreeBicategory B) →
      CategoryTheory.Functor.id (a ⟶ b) ≅
        ((CategoryTheory.FreeBicategory.normalize B).mapFunctor a b).comp
          (CategoryTheory.FreeBicategory.inclusionPath a b)

Auxiliary definition for normalizeEquiv.

def CategoryTheory.FreeBicategory.normalizeEquiv E1 #

{B : Type u} →
  [inst : Quiver B] → (a b : B) → CategoryTheory.FreeBicategory.Hom a b ≌ CategoryTheory.Discrete (Quiver.Path a b)

Normalization as an equivalence of categories.

instance CategoryTheory.FreeBicategory.locally_thin E3 #

∀ {B : Type u} [inst : Quiver B] {a b : CategoryTheory.FreeBicategory B}, Quiver.IsThin (a ⟶ b)

The coherence theorem for bicategories.

def CategoryTheory.FreeBicategory.inclusionMapCompAux E0 #

{B : Type u} →
  [inst : Quiver B] →
    {a b c : B} →
      (f : Quiver.Path a b) →
        (g : Quiver.Path b c) →
          (CategoryTheory.FreeBicategory.preinclusion B).map
              (CategoryTheory.CategoryStruct.comp { as := f } { as := g }) ≅
            CategoryTheory.CategoryStruct.comp ((CategoryTheory.FreeBicategory.preinclusion B).map { as := f })
              ((CategoryTheory.FreeBicategory.preinclusion B).map { as := g })

Auxiliary definition for inclusion.

def CategoryTheory.FreeBicategory.inclusion E1 #

(B : Type u) →
  [inst : Quiver B] →
    CategoryTheory.Pseudofunctor (CategoryTheory.LocallyDiscrete (CategoryTheory.Paths B))
      (CategoryTheory.FreeBicategory B)

The inclusion pseudofunctor from the locally discrete bicategory on the path category into the free bicategory.