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

Commit 19a246c

Browse files
kim-emmergify[bot]
authored andcommitted
fix(category_theory): require morphisms are in Type, again (#1412)
* chore(category_theory): require morphisms live in Type * move back to Type * fixes
1 parent ab2c546 commit 19a246c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+138
-151
lines changed

src/algebraic_geometry/presheafed_space.lean

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ open topological_space
2323
open opposite
2424
open category_theory.category category_theory.functor
2525

26-
variables (C : Type u) [𝒞 : category.{v+1} C]
26+
variables (C : Type u) [𝒞 : category.{v} C]
2727
include 𝒞
2828

2929
local attribute [tidy] tactic.op_induction'
@@ -67,7 +67,7 @@ end
6767

6868
def id (X : PresheafedSpace.{v} C) : hom X X :=
6969
{ f := 𝟙 (X : Top.{v}),
70-
c := ((functor.left_unitor _).inv) ≫ (whisker_right (nat_trans.op (opens.map_id _).hom) _) }
70+
c := ((functor.left_unitor _).inv) ≫ (whisker_right (nat_trans.op (opens.map_id (X.to_Top)).hom) _) }
7171

7272
def comp (X Y Z : PresheafedSpace.{v} C) (α : hom X Y) (β : hom Y Z) : hom X Z :=
7373
{ f := α.f ≫ β.f,
@@ -131,7 +131,7 @@ instance {X Y : PresheafedSpace.{v} C} : has_coe (X ⟶ Y) (X.to_Top ⟶ Y.to_To
131131

132132
lemma id_c (X : PresheafedSpace.{v} C) :
133133
((𝟙 X) : X ⟶ X).c =
134-
(((functor.left_unitor _).inv) ≫ (whisker_right (nat_trans.op (opens.map_id _).hom) _)) := rfl
134+
(((functor.left_unitor _).inv) ≫ (whisker_right (nat_trans.op (opens.map_id (X.to_Top)).hom) _)) := rfl
135135

136136
-- Implementation note: this harmless looking lemma causes deterministic timeouts,
137137
-- but happily we can survive without it.
@@ -160,7 +160,7 @@ variables {C}
160160

161161
namespace category_theory
162162

163-
variables {D : Type u} [𝒟 : category.{v+1} D]
163+
variables {D : Type u} [𝒟 : category.{v} D]
164164
include 𝒟
165165

166166
local attribute [simp] presheaf.pushforward
@@ -209,7 +209,7 @@ def on_presheaf {F G : C ⥤ D} (α : F ⟶ G) : G.map_presheaf ⟶ F.map_preshe
209209
{ app := λ X,
210210
{ f := 𝟙 _,
211211
c := whisker_left X.𝒪 α ≫ ((functor.left_unitor _).inv) ≫
212-
(whisker_right (nat_trans.op (opens.map_id _).hom) _) },
212+
(whisker_right (nat_trans.op (opens.map_id X.to_Top).hom) _) },
213213
naturality' := λ X Y f,
214214
begin
215215
ext1, swap,

src/algebraic_geometry/stalks.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ open category_theory.limits category_theory.category category_theory.functor
2020
open algebraic_geometry
2121
open topological_space
2222

23-
variables {C : Type u} [𝒞 : category.{v+1} C] [has_colimits.{v} C]
23+
variables {C : Type u} [𝒞 : category.{v} C] [has_colimits.{v} C]
2424
include 𝒞
2525

2626
local attribute [tidy] tactic.op_induction'

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 : Type u₁} [𝒞 : category.{v+1} C] {D : Type u₂} [𝒟 : category.{v+1} D]
18+
variables {C : Type u₁} [𝒞 : category.{v} C] {D : Type u₂} [𝒟 : category.{v} D]
1919
include 𝒞 𝒟
2020

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

src/category_theory/category/Cat.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ instance str (C : Cat.{v u}) : category.{v u} C.α := C.str
3333
def of (C : Type u) [category.{v} C] : Cat.{v u} := mk_ob C
3434

3535
/-- Category structure on `Cat` -/
36-
instance category : category.{(max u v)+1 (max v (u+1))} Cat.{v u} :=
36+
instance category : large_category.{max v u} Cat.{v u} :=
3737
{ hom := λ C D, C.α ⥤ D.α,
3838
id := λ C, 𝟭 C.α,
3939
comp := λ C D E F G, F ⋙ G,

src/category_theory/category/Groupoid.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ instance str (C : Groupoid.{v u}) : groupoid.{v u} C.α := C.str
3636
def of (C : Type u) [groupoid.{v} C] : Groupoid.{v u} := mk_ob C
3737

3838
/-- Category structure on `Groupoid` -/
39-
instance category : category.{(max u v)+1 (max v (u+1))} Groupoid.{v u} :=
39+
instance category : large_category.{max v u} Groupoid.{v u} :=
4040
{ hom := λ C D, C.α ⥤ D.α,
4141
id := λ C, 𝟭 C.α,
4242
comp := λ C D E F G, F ⋙ G,

src/category_theory/category/default.lean

Lines changed: 6 additions & 6 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 : Type u) : Type (max u v) :=
35-
(hom : obj → obj → Sort v)
34+
class has_hom (obj : Type u) : Type (max u (v+1)) :=
35+
(hom : obj → obj → Type v)
3636

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

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

@@ -50,7 +50,7 @@ The universe levels of the objects and morphisms are unconstrained, and will oft
5050
specified explicitly, as `category.{v} C`. (See also `large_category` and `small_category`.)
5151
-/
5252
class category (obj : Type u)
53-
extends category_struct.{v} obj : Type (max u v) :=
53+
extends category_struct.{v} obj : Type (max u (v+1)) :=
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),
@@ -74,11 +74,11 @@ 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 : Type u) : Type u := category.{u} C
77+
abbreviation large_category (C : Type (u+1)) : Type (u+1) := category.{u} C
7878
/--
7979
A `small_category` has objects and morphisms in the same universe level.
8080
-/
81-
abbreviation small_category (C : Type u) : Type (u+1) := category.{u+1} C
81+
abbreviation small_category (C : Type u) : Type (u+1) := category.{u} C
8282

8383
section
8484
variables {C : Type u} [𝒞 : category.{v} C] {X Y Z : C}

src/category_theory/comma.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ end comma
190190

191191
omit 𝒜 ℬ
192192

193-
def over (X : T) := comma.{v₃ 1 v₃} (𝟭 T) (functor.of.obj X)
193+
def over (X : T) := comma.{v₃ 0 v₃} (𝟭 T) (functor.of.obj X)
194194

195195
namespace over
196196

@@ -254,7 +254,7 @@ end
254254

255255
end over
256256

257-
def under (X : T) := comma.{1 v₃ v₃} (functor.of.obj X) (𝟭 T)
257+
def under (X : T) := comma.{0 v₃ v₃} (functor.of.obj X) (𝟭 T)
258258

259259
namespace under
260260

src/category_theory/conj.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ namespace category_theory
2222

2323
namespace iso
2424

25-
variables {C : Type u} [𝒞 : category.{v+1} C]
25+
variables {C : Type u} [𝒞 : category.{v} C]
2626
include 𝒞
2727

2828
/- If `X` is isomorphic to `X₁` and `Y` is isomorphic to `Y₁`, then
@@ -122,7 +122,7 @@ namespace functor
122122

123123
universes v₁ u₁
124124

125-
variables {C : Type u} [𝒞 : category.{v+1} C] {D : Type u₁} [𝒟 : category.{v₁+1} D] (F : C ⥤ D)
125+
variables {C : Type u} [𝒞 : category.{v} C] {D : Type u₁} [𝒟 : category.{v₁} D] (F : C ⥤ D)
126126
include 𝒞 𝒟
127127

128128
lemma map_hom_congr {X Y X₁ Y₁ : C} (α : X ≅ X₁) (β : Y ≅ Y₁) (f : X ⟶ Y) :

src/category_theory/core.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def core (C : Type u₁) := C
1919
variables {C : Type u₁} [𝒞 : category.{v₁} C]
2020
include 𝒞
2121

22-
instance core_category : groupoid.{(max v₁ 1)} (core C) :=
22+
instance core_category : groupoid.{v₁} (core C) :=
2323
{ hom := λ X Y : C, X ≅ Y,
2424
inv := λ X Y f, iso.symm f,
2525
id := λ X, iso.refl X,

src/category_theory/currying.lean

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

1313
universes v₁ v₂ v₃ u₁ u₂ u₃
1414

15-
variables {C : Type u₁} [𝒞 : category.{v₁+1} C]
16-
{D : Type u₂} [𝒟 : category.{v₂+1} D]
17-
{E : Type u₃} [ℰ : category.{v₃+1} E]
15+
variables {C : Type u₁} [𝒞 : category.{v₁} C]
16+
{D : Type u₂} [𝒟 : category.{v₂} D]
17+
{E : Type u₃} [ℰ : category.{v₃} E]
1818
include 𝒞 𝒟 ℰ
1919

2020
def uncurry : (C ⥤ (D ⥤ E)) ⥤ ((C × D) ⥤ E) :=

0 commit comments

Comments
 (0)