Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit ff9b757

Browse files
committed
feat(category_theory/bicategory/locally_discrete): define locally discrete bicategory (#11402)
This PR defines the locally discrete bicategory on a category.
1 parent 6dd6525 commit ff9b757

File tree

2 files changed

+94
-0
lines changed

2 files changed

+94
-0
lines changed
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
/-
2+
Copyright (c) 2022 Yuma Mizuno. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Yuma Mizuno
5+
-/
6+
import category_theory.discrete_category
7+
import category_theory.bicategory.functor
8+
import category_theory.bicategory.strict
9+
10+
/-!
11+
# Locally discrete bicategories
12+
13+
A category `C` can be promoted to a strict bicategory `locally_discrete C`. The objects and the
14+
1-morphisms in `locally_discrete C` are the same as the objects and the morphisms, respectively,
15+
in `C`, and the 2-morphisms in `locally_discrete C` are the equalities between 1-morphisms. In
16+
other words, the category consisting of the 1-morphisms between each pair of objects `X` and `Y`
17+
in `locally_discrete C` is defined as the discrete category associated with the type `X ⟶ Y`.
18+
-/
19+
20+
namespace category_theory
21+
22+
open bicategory discrete
23+
open_locale bicategory
24+
25+
universes w₂ v v₁ v₂ u u₁ u₂
26+
27+
variables (C : Type u)
28+
29+
/--
30+
A type alias for promoting any category to a bicategory,
31+
with the only 2-morphisms being equalities.
32+
-/
33+
def locally_discrete := C
34+
35+
namespace locally_discrete
36+
37+
instance : Π [inhabited C], inhabited (locally_discrete C) := id
38+
39+
instance : Π [category_struct.{v} C], category_struct (locally_discrete C) := id
40+
41+
variables {C} [category_struct.{v} C]
42+
43+
instance (X Y : locally_discrete C) : small_category (X ⟶ Y) :=
44+
category_theory.discrete_category (X ⟶ Y)
45+
46+
end locally_discrete
47+
48+
variables (C) [category.{v} C]
49+
50+
/--
51+
The locally discrete bicategory on a category is a bicategory in which the objects and the
52+
1-morphisms are the same as those in the underlying category, and the 2-morphisms are the
53+
equalities between 1-morphisms.
54+
-/
55+
instance locally_discrete_bicategory : bicategory (locally_discrete C) :=
56+
{ whisker_left := λ X Y Z f g h η, eq_to_hom (congr_arg2 (≫) rfl (eq_of_hom η)),
57+
whisker_right := λ X Y Z f g η h, eq_to_hom (congr_arg2 (≫) (eq_of_hom η) rfl),
58+
associator := λ W X Y Z f g h, eq_to_iso (category.assoc f g h),
59+
left_unitor := λ X Y f, eq_to_iso (category.id_comp f),
60+
right_unitor := λ X Y f, eq_to_iso (category.comp_id f) }
61+
62+
/-- A locally discrete bicategory is strict. -/
63+
instance locally_discrete_bicategory.strict : strict (locally_discrete C) := { }
64+
65+
variables {I : Type u₁} [category.{v₁} I] {B : Type u₂} [bicategory.{w₂ v₂} B] [strict B]
66+
67+
/--
68+
If `B` is a strict bicategory and `I` is a (1-)category, any functor (of 1-categories) `I ⥤ B` can
69+
be promoted to an oplax functor from `locally_discrete I` to `B`.
70+
-/
71+
@[simps]
72+
def functor.to_oplax_functor (F : I ⥤ B) : oplax_functor (locally_discrete I) B :=
73+
{ map₂ := λ i j f g η, eq_to_hom (congr_arg _ (eq_of_hom η)),
74+
map_id := λ i, eq_to_hom (F.map_id i),
75+
map_comp := λ i j k f g, eq_to_hom (F.map_comp f g),
76+
.. F }
77+
78+
end category_theory

src/category_theory/bicategory/strict.lean

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,20 @@ instance strict_bicategory.category [bicategory.strict B] : category B :=
6363
comp_id' := λ a b, bicategory.strict.comp_id,
6464
assoc' := λ a b c d, bicategory.strict.assoc }
6565

66+
namespace bicategory
67+
68+
variables {B}
69+
70+
@[simp]
71+
lemma whisker_left_eq_to_hom {a b c : B} (f : a ⟶ b) {g h : b ⟶ c} (η : g = h) :
72+
f ◁ eq_to_hom η = eq_to_hom (congr_arg2 (≫) rfl η) :=
73+
by { cases η, simp only [whisker_left_id, eq_to_hom_refl] }
74+
75+
@[simp]
76+
lemma eq_to_hom_whisker_right {a b c : B} {f g : a ⟶ b} (η : f = g) (h : b ⟶ c) :
77+
eq_to_hom η ▷ h = eq_to_hom (congr_arg2 (≫) η rfl) :=
78+
by { cases η, simp only [whisker_right_id, eq_to_hom_refl] }
79+
80+
end bicategory
81+
6682
end category_theory

0 commit comments

Comments
 (0)