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

Commit 953c612

Browse files
kim-emmergify[bot]
authored andcommitted
fix(category_theory): simplifying universes (#1122)
1 parent 98ece77 commit 953c612

40 files changed

+146
-153
lines changed

src/category_theory/adjunction/basic.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ universes v₁ v₂ v₃ u₁ u₂ u₃ -- declare the `v`'s first; see `categor
1313

1414
local attribute [elab_simple] whisker_left whisker_right
1515

16-
variables {C : Sort u₁} [𝒞 : category.{v₁} C] {D : Sort u₂} [𝒟 : category.{v₂} D]
16+
variables {C : Type u₁} [𝒞 : category.{v₁} C] {D : Type u₂} [𝒟 : category.{v₂} D]
1717
include 𝒞 𝒟
1818

1919
/--
@@ -172,7 +172,7 @@ def id : functor.id C ⊣ functor.id C :=
172172
end
173173

174174
section
175-
variables {E : Sort u₃} [ℰ : category.{v₃} E] (H : D ⥤ E) (I : E ⥤ D)
175+
variables {E : Type u₃} [ℰ : category.{v₃} E] (H : D ⥤ E) (I : E ⥤ D)
176176

177177
def comp (adj₁ : F ⊣ G) (adj₂ : H ⊣ I) : F ⋙ H ⊣ I ⋙ G :=
178178
{ hom_equiv := λ X Z, equiv.trans (adj₂.hom_equiv _ _) (adj₁.hom_equiv _ _),

src/category_theory/adjunction/limits.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ open category_theory.limits
1515

1616
universes u₁ u₂ v
1717

18-
variables {C : Sort u₁} [𝒞 : category.{v+1} C] {D : Sort u₂} [𝒟 : category.{v+1} D]
18+
variables {C : Type u₁} [𝒞 : category.{v+1} C] {D : Type u₂} [𝒟 : category.{v+1} D]
1919
include 𝒞 𝒟
2020

2121
variables {F : C ⥤ D} {G : D ⥤ C} (adj : F ⊣ G)

src/category_theory/category.lean

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ powerful tactics.
3131
def_replacer obviously
3232
@[obviously] meta def obviously' := tactic.tidy
3333

34-
class has_hom (obj : Sort u) : Sort (max u (v+1)) :=
34+
class has_hom (obj : Type u) : Type (max u v) :=
3535
(hom : obj → obj → Sort v)
3636

3737
infixr ` ⟶ `:10 := has_hom.hom -- type as \h
3838

39-
class category_struct (obj : Sort u)
40-
extends has_hom.{v} obj : Sort (max u (v+1)) :=
39+
class category_struct (obj : Type u)
40+
extends has_hom.{v} obj : Type (max u v) :=
4141
(id : Π X : obj, hom X X)
4242
(comp : Π {X Y Z : obj}, (X ⟶ Y) → (Y ⟶ Z) → (X ⟶ Z))
4343

@@ -49,8 +49,8 @@ The typeclass `category C` describes morphisms associated to objects of type `C`
4949
The universe levels of the objects and morphisms are unconstrained, and will often need to be
5050
specified explicitly, as `category.{v} C`. (See also `large_category` and `small_category`.)
5151
-/
52-
class category (obj : Sort u)
53-
extends category_struct.{v} obj : Sort (max u (v+1)) :=
52+
class category (obj : Type u)
53+
extends category_struct.{v} obj : Type (max u v) :=
5454
(id_comp' : ∀ {X Y : obj} (f : hom X Y), 𝟙 X ≫ f = f . obviously)
5555
(comp_id' : ∀ {X Y : obj} (f : hom X Y), f ≫ 𝟙 Y = f . obviously)
5656
(assoc' : ∀ {W X Y Z : obj} (f : hom W X) (g : hom X Y) (h : hom Y Z),
@@ -65,7 +65,7 @@ restate_axiom category.assoc'
6565
attribute [simp] category.id_comp category.comp_id category.assoc
6666
attribute [trans] category_struct.comp
6767

68-
lemma category.assoc_symm {C : Sort u} [category.{v} C] {W X Y Z : C} (f : W ⟶ X) (g : X ⟶ Y) (h : Y ⟶ Z) :
68+
lemma category.assoc_symm {C : Type u} [category.{v} C] {W X Y Z : C} (f : W ⟶ X) (g : X ⟶ Y) (h : Y ⟶ Z) :
6969
f ≫ (g ≫ h) = (f ≫ g) ≫ h :=
7070
by rw ←category.assoc
7171

@@ -74,14 +74,14 @@ A `large_category` has objects in one universe level higher than the universe le
7474
the morphisms. It is useful for examples such as the category of types, or the category
7575
of groups, etc.
7676
-/
77-
abbreviation large_category (C : Sort (u+1)) : Sort (u+1) := category.{u} C
77+
abbreviation large_category (C : Type u) : Type u := category.{u} C
7878
/--
7979
A `small_category` has objects and morphisms in the same universe level.
8080
-/
81-
abbreviation small_category (C : Sort u) : Sort (u+1) := category.{u} C
81+
abbreviation small_category (C : Type u) : Type (u+1) := category.{u+1} C
8282

8383
section
84-
variables {C : Sort u} [𝒞 : category.{v} C] {X Y Z : C}
84+
variables {C : Type u} [𝒞 : category.{v} C] {X Y Z : C}
8585
include 𝒞
8686

8787
lemma eq_of_comp_left_eq {f g : X ⟶ Y} (w : ∀ {Z : C} (h : Y ⟶ Z), f ≫ h = g ≫ h) : f = g :=

src/category_theory/comma.lean

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ import category_theory.punit
88
namespace category_theory
99

1010
universes v₁ v₂ v₃ u₁ u₂ u₃ -- declare the `v`'s first; see `category_theory.category` for an explanation
11-
variables {A : Sort u₁} [𝒜 : category.{v₁} A]
12-
variables {B : Sort u₂} [ℬ : category.{v₂} B]
13-
variables {T : Sort u₃} [𝒯 : category.{v₃} T]
11+
variables {A : Type u₁} [𝒜 : category.{v₁} A]
12+
variables {B : Type u₂} [ℬ : category.{v₂} B]
13+
variables {T : Type u₃} [𝒯 : category.{v₃} T]
1414
include 𝒜 ℬ 𝒯
1515

16-
structure comma (L : A ⥤ T) (R : B ⥤ T) :=
16+
structure comma (L : A ⥤ T) (R : B ⥤ T) : Type (max u₁ u₂ v₃) :=
1717
(left : A . obviously)
1818
(right : B . obviously)
1919
(hom : L.obj left ⟶ R.obj right)
@@ -240,7 +240,7 @@ variables {Y : T} {f : X ⟶ Y} {U V : over X} {g : U ⟶ V}
240240
end
241241

242242
section
243-
variables {D : Sort u₃} [𝒟 : category.{v₃} D]
243+
variables {D : Type u₃} [𝒟 : category.{v₃} D]
244244
include 𝒟
245245

246246
def post (F : T ⥤ D) : over X ⥤ over (F.obj X) :=
@@ -304,7 +304,7 @@ variables {Y : T} {f : X ⟶ Y} {U V : under Y} {g : U ⟶ V}
304304
end
305305

306306
section
307-
variables {D : Sort u₃} [𝒟 : category.{v₃} D]
307+
variables {D : Type u₃} [𝒟 : category.{v₃} D]
308308
include 𝒟
309309

310310
def post {X : T} (F : T ⥤ D) : under X ⥤ under (F.obj X) :=

src/category_theory/concrete_category.lean

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import category_theory.types
1111
universes u v
1212

1313
namespace category_theory
14-
variables {c d : Sort u → Sort v} {α : Sort u}
14+
variables {c d : Type u → Type v} {α : Type u}
1515

1616
/--
1717
`concrete_category @hom` collects the evidence that a type constructor `c` and a
@@ -28,23 +28,23 @@ attribute [class] concrete_category
2828

2929
/-- `bundled` is a type bundled with a type class instance for that type. Only
3030
the type class is exposed as a parameter. -/
31-
structure bundled (c : Sort u → Sort v) : Sort (max (u+1) v) :=
32-
(α : Sort u)
31+
structure bundled (c : Type u → Type v) : Type (max (u+1) v) :=
32+
(α : Type u)
3333
(str : c α . tactic.apply_instance)
3434

35-
def mk_ob {c : Sort u → Sort v} (α : Sort u) [str : c α] : bundled c := ⟨α, str⟩
35+
def mk_ob {c : Type u → Type v} (α : Type u) [str : c α] : bundled c := ⟨α, str⟩
3636

3737
namespace bundled
3838

3939
instance : has_coe_to_sort (bundled c) :=
40-
{ S := Sort u, coe := bundled.α }
40+
{ S := Type u, coe := bundled.α }
4141

4242
/-- Map over the bundled structure -/
4343
def map (f : ∀ {α}, c α → d α) (b : bundled c) : bundled d :=
4444
⟨b.α, f b.str⟩
4545

4646
section concrete_category
47-
variables (hom : ∀ {α β : Sort u}, c α → c β → (α → β) → Prop)
47+
variables (hom : ∀ {α β : Type u}, c α → c β → (α → β) → Prop)
4848
variables [h : concrete_category @hom]
4949
include h
5050

@@ -77,21 +77,21 @@ end concrete_category
7777
end bundled
7878

7979
def concrete_functor
80-
{C : Sort u → Sort v} {hC : ∀{α β}, C α → C β → (α → β) → Prop} [concrete_category @hC]
81-
{D : Sort u → Sort v} {hD : ∀{α β}, D α → D β → (α → β) → Prop} [concrete_category @hD]
80+
{C : Type u → Type v} {hC : ∀{α β}, C α → C β → (α → β) → Prop} [concrete_category @hC]
81+
{D : Type u → Type v} {hD : ∀{α β}, D α → D β → (α → β) → Prop} [concrete_category @hD]
8282
(m : ∀{α}, C α → D α) (h : ∀{α β} {ia : C α} {ib : C β} {f}, hC ia ib f → hD (m ia) (m ib) f) :
8383
bundled C ⥤ bundled D :=
8484
{ obj := bundled.map @m,
8585
map := λ X Y f, ⟨ f, h f.2 ⟩ }
8686

8787
section forget
88-
variables {C : Sort u → Sort v} {hom : ∀α β, C α → C β → (α → β) → Prop} [i : concrete_category hom]
88+
variables {C : Type u → Type v} {hom : ∀α β, C α → C β → (α → β) → Prop} [i : concrete_category hom]
8989
include i
9090

9191
/-- The forgetful functor from a bundled category to `Sort`. -/
92-
def forget : bundled C ⥤ Sort u := { obj := bundled.α, map := λ a b h, h.1 }
92+
def forget : bundled C ⥤ Type u := { obj := bundled.α, map := λ a b h, h.1 }
9393

94-
instance forget.faithful : faithful (forget : bundled C ⥤ Sort u) :=
94+
instance forget.faithful : faithful (forget : bundled C ⥤ Type u) :=
9595
{ injectivity' :=
9696
begin
9797
rintros X Y ⟨f,_⟩ ⟨g,_⟩ p,

src/category_theory/const.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ open category_theory
1111

1212
namespace category_theory.functor
1313

14-
variables (J : Sort u₁) [𝒥 : category.{v₁} J]
15-
variables {C : Sort u₂} [𝒞 : category.{v₂} C]
14+
variables (J : Type u₁) [𝒥 : category.{v₁} J]
15+
variables {C : Type u₂} [𝒞 : category.{v₂} C]
1616
include 𝒥 𝒞
1717

1818
def const : C ⥤ (J ⥤ C) :=
@@ -52,7 +52,7 @@ end const
5252

5353

5454
section
55-
variables {D : Sort u₃} [𝒟 : category.{v₃} D]
55+
variables {D : Type u₃} [𝒟 : category.{v₃} D]
5656
include 𝒟
5757

5858
/-- These are actually equal, of course, but not definitionally equal

src/category_theory/core.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ namespace category_theory
1414

1515
universes v₁ v₂ u₁ u₂ -- declare the `v`'s first; see `category_theory.category` for an explanation
1616

17-
def core (C : Sort u₁) := C
17+
def core (C : Type u₁) := C
1818

19-
variables {C : Sort u₁} [𝒞 : category.{v₁} C]
19+
variables {C : Type u₁} [𝒞 : category.{v₁} C]
2020
include 𝒞
2121

2222
instance core_category : groupoid.{(max v₁ 1)} (core C) :=
@@ -34,7 +34,7 @@ def inclusion : core C ⥤ C :=
3434
{ obj := id,
3535
map := λ X Y f, f.hom }
3636

37-
variables {G : Sort u₂} [𝒢 : groupoid.{v₂} G]
37+
variables {G : Type u₂} [𝒢 : groupoid.{v₂} G]
3838
include 𝒢
3939

4040
/-- A functor from a groupoid to a category C factors through the core of C. -/

src/category_theory/discrete_category.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ variables {α : Type u₁}
2424

2525
end discrete
2626

27-
variables {C : Sort u₂} [𝒞 : category.{v₂} C]
27+
variables {C : Type u₂} [𝒞 : category.{v₂} C]
2828
include 𝒞
2929

3030
namespace functor

src/category_theory/epi_mono.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ universes v₁ v₂ u₁ u₂
1616

1717
namespace category_theory
1818

19-
variables {C : Sort u₁} [𝒞 : category.{v₁} C] {D : Sort u₂} [𝒟 : category.{v₂} D]
19+
variables {C : Type u₁} [𝒞 : category.{v₁} C] {D : Type u₂} [𝒟 : category.{v₂} D]
2020
include 𝒞 𝒟
2121

2222
lemma left_adjoint_preserves_epi {F : C ⥤ D} {G : D ⥤ C} (adj : F ⊣ G)

src/category_theory/eq_to_hom.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ universes v v' u u' -- declare the `v`'s first; see `category_theory.category` f
1111
namespace category_theory
1212
open opposite
1313

14-
variables {C : Sort u} [𝒞 : category.{v} C]
14+
variables {C : Type u} [𝒞 : category.{v} C]
1515
include 𝒞
1616

1717
def eq_to_hom {X Y : C} (p : X = Y) : X ⟶ Y := by rw p; exact 𝟙 _
@@ -41,7 +41,7 @@ begin
4141
refl
4242
end
4343

44-
variables {D : Sort u'} [𝒟 : category.{v'} D]
44+
variables {D : Type u'} [𝒟 : category.{v'} D]
4545
include 𝒟
4646

4747
namespace functor

0 commit comments

Comments
 (0)