@@ -11,110 +11,110 @@ Authors: Adam Topaz
1111import Mathlib.CategoryTheory.Category.Basic
1212import Mathlib.CategoryTheory.Equivalence
1313import Mathlib.CategoryTheory.EqToHom
14+ import Mathlib.Data.ULift
1415
1516/-!
16- # Basic API for ulift
17+ # Basic API for ULift
1718
1819This file contains a very basic API for working with the categorical
19- instance on `ulift C` where `C` is a type with a category instance.
20+ instance on `ULift C` where `C` is a type with a category instance.
2021
21- 1. `category_theory.ulift .up` is the functorial version of the usual `ulift .up`.
22- 2. `category_theory.ulift .down` is the functorial version of the usual `ulift .down`.
23- 3. `category_theory.ulift .equivalence` is the categorical equivalence between
24- `C` and `ulift C`.
22+ 1. `category_theory.ULift .up` is the functorial version of the usual `ULift .up`.
23+ 2. `category_theory.ULift .down` is the functorial version of the usual `ULift .down`.
24+ 3. `category_theory.ULift .equivalence` is the categorical equivalence between
25+ `C` and `ULift C`.
2526
26- # ulift_hom
27+ # ULiftHom
2728
28- Given a type `C : Type u`, `ulift_hom .{w} C` is just an alias for `C`.
29- If we have `category.{v} C`, then `ulift_hom .{w} C` is endowed with a category instance
30- whose morphisms are obtained by applying `ulift .{w}` to the morphisms from `C`.
29+ Given a type `C : Type u`, `ULiftHom .{w} C` is just an alias for `C`.
30+ If we have `category.{v} C`, then `ULiftHom .{w} C` is endowed with a category instance
31+ whose morphisms are obtained by applying `ULift .{w}` to the morphisms from `C`.
3132
32- This is a category equivalent to `C`. The forward direction of the equivalence is `ulift_hom .up`,
33- the backward direction is `ulift_hom .donw` and the equivalence is `ulift_hom .equiv`.
33+ This is a category equivalent to `C`. The forward direction of the equivalence is `ULiftHom .up`,
34+ the backward direction is `ULiftHom .donw` and the equivalence is `ULiftHom .equiv`.
3435
35- # as_small
36+ # AsSmall
3637
3738This file also contains a construction which takes a type `C : Type u` with a
3839category instance `category.{v} C` and makes a small category
39- `as_small .{w} C : Type (max w v u)` equivalent to `C`.
40+ `AsSmall .{w} C : Type (max w v u)` equivalent to `C`.
4041
41- The forward direction of the equivalence, `C ⥤ as_small C`, is denoted `as_small .up`
42- and the backward direction is `as_small .down`. The equivalence itself is `as_small .equiv`.
42+ The forward direction of the equivalence, `C ⥤ AsSmall C`, is denoted `AsSmall .up`
43+ and the backward direction is `AsSmall .down`. The equivalence itself is `AsSmall .equiv`.
4344-/
4445
45-
4646universe w₁ v₁ v₂ u₁ u₂
4747
4848namespace CategoryTheory
4949
5050variable {C : Type u₁} [Category.{v₁} C]
5151
52- /-- The functorial version of `ulift .up`. -/
52+ /-- The functorial version of `ULift .up`. -/
5353@[simps]
5454def Ulift.upFunctor : C ⥤ ULift.{u₂} C where
5555 obj := ULift.up
56- map X Y f := f
56+ map f := f
5757#align category_theory.ulift.up_functor CategoryTheory.Ulift.upFunctor
5858
59- /-- The functorial version of `ulift .down`. -/
59+ /-- The functorial version of `ULift .down`. -/
6060@[simps]
61- def Ulift.downFunctor : ULift.{u₂} C ⥤ C
62- where
61+ def Ulift.downFunctor : ULift.{u₂} C ⥤ C where
6362 obj := ULift.down
64- map X Y f := f
63+ map f := f
6564#align category_theory.ulift.down_functor CategoryTheory.Ulift.downFunctor
6665
67- /-- The categorical equivalence between `C` and `ulift C`. -/
66+ /-- The categorical equivalence between `C` and `ULift C`. -/
6867@[simps]
69- def Ulift.equivalence : C ≌ ULift.{u₂} C
70- where
71- Functor := Ulift.upFunctor
68+ def Ulift.equivalence : C ≌ ULift.{u₂} C where
69+ functor := Ulift.upFunctor
7270 inverse := Ulift.downFunctor
7371 unitIso :=
74- { Hom := 𝟙 _
72+ { hom := 𝟙 _
7573 inv := 𝟙 _ }
7674 counitIso :=
77- { Hom :=
75+ { hom :=
7876 { app := fun X => 𝟙 _
79- naturality' := fun X Y f => by
77+ naturality := fun X Y f => by
8078 change f ≫ 𝟙 _ = 𝟙 _ ≫ f
8179 simp }
8280 inv :=
8381 { app := fun X => 𝟙 _
84- naturality' := fun X Y f => by
82+ naturality := fun X Y f => by
8583 change f ≫ 𝟙 _ = 𝟙 _ ≫ f
8684 simp }
87- hom_inv_id' := by
85+ hom_inv_id := by
8886 ext
8987 change 𝟙 _ ≫ 𝟙 _ = 𝟙 _
9088 simp
91- inv_hom_id' := by
89+ inv_hom_id := by
9290 ext
9391 change 𝟙 _ ≫ 𝟙 _ = 𝟙 _
9492 simp }
95- functor_unitIso_comp' X := by
93+ functor_unitIso_comp X := by
9694 change 𝟙 X ≫ 𝟙 X = 𝟙 X
9795 simp
9896#align category_theory.ulift.equivalence CategoryTheory.Ulift.equivalence
9997
10098section UliftHom
101-
102- /-- `ulift_hom.{w} C` is an alias for `C`, which is endowed with a category instance
103- whose morphisms are obtained by applying `ulift.{w}` to the morphisms from `C`.
99+ /- Porting note: obviously we don't want code that looks like this long term
100+ the ability to turn off unused universe parameter error is desirable -/
101+ /-- `ULiftHom.{w} C` is an alias for `C`, which is endowed with a category instance
102+ whose morphisms are obtained by applying `ULift.{w}` to the morphisms from `C`.
104103-/
105- def UliftHom. {w, u} (C : Type u) :=
104+ def UliftHom. {w,u} (C : Type u) : Type u :=
105+ let _ := ULift.{w} C
106106 C
107107#align category_theory.ulift_hom CategoryTheory.UliftHom
108108
109109instance {C} [Inhabited C] : Inhabited (UliftHom C) :=
110- ⟨(Inhabited. default C : C)⟩
110+ ⟨(default : C)⟩
111111
112- /-- The obvious function `ulift_hom C → C`. -/
112+ /-- The obvious function `ULiftHom C → C`. -/
113113def UliftHom.objDown {C} (A : UliftHom C) : C :=
114114 A
115115#align category_theory.ulift_hom.obj_down CategoryTheory.UliftHom.objDown
116116
117- /-- The obvious function `C → ulift_hom C`. -/
117+ /-- The obvious function `C → ULiftHom C`. -/
118118def UliftHom.objUp {C} (A : C) : UliftHom C :=
119119 A
120120#align category_theory.ulift_hom.obj_up CategoryTheory.UliftHom.objUp
@@ -129,91 +129,89 @@ theorem objUp_objDown {C} (A : UliftHom C) : UliftHom.objUp A.objDown = A :=
129129 rfl
130130#align category_theory.obj_up_obj_down CategoryTheory.objUp_objDown
131131
132- instance : Category.{max v₂ v₁} (UliftHom.{v₂} C)
133- where
132+ instance : Category.{max v₂ v₁} (UliftHom.{v₂} C) where
134133 Hom A B := ULift.{v₂} <| A.objDown ⟶ B.objDown
135134 id A := ⟨𝟙 _⟩
136- comp A B C f g := ⟨f.down ≫ g.down⟩
135+ comp f g := ⟨f.down ≫ g.down⟩
137136
138- /-- One half of the quivalence between `C` and `ulift_hom C`. -/
137+ /-- One half of the quivalence between `C` and `ULiftHom C`. -/
139138@[simps]
140139def UliftHom.up : C ⥤ UliftHom C where
141140 obj := UliftHom.objUp
142- map X Y f := ⟨f⟩
141+ map f := ⟨f⟩
143142#align category_theory.ulift_hom.up CategoryTheory.UliftHom.up
144143
145- /-- One half of the quivalence between `C` and `ulift_hom C`. -/
144+ /-- One half of the quivalence between `C` and `ULiftHom C`. -/
146145@[simps]
147146def UliftHom.down : UliftHom C ⥤ C where
148147 obj := UliftHom.objDown
149- map X Y f := f.down
148+ map f := f.down
150149#align category_theory.ulift_hom.down CategoryTheory.UliftHom.down
151150
152- /-- The equivalence between `C` and `ulift_hom C`. -/
153- def UliftHom.equiv : C ≌ UliftHom C
154- where
155- Functor := UliftHom.up
151+ /-- The equivalence between `C` and `ULiftHom C`. -/
152+ def UliftHom.equiv : C ≌ UliftHom C where
153+ functor := UliftHom.up
156154 inverse := UliftHom.down
157- unitIso := NatIso.ofComponents (fun A => eqToIso rfl) (by tidy )
158- counitIso := NatIso.ofComponents (fun A => eqToIso rfl) (by tidy )
155+ unitIso := NatIso.ofComponents (fun A => eqToIso rfl) (by aesop_cat )
156+ counitIso := NatIso.ofComponents (fun A => eqToIso rfl) (by aesop_cat )
159157#align category_theory.ulift_hom.equiv CategoryTheory.UliftHom.equiv
160158
161159end UliftHom
162-
163- /-- `as_small C` is a small category equivalent to `C`.
164- More specifically, if `C : Type u` is endowed with `category.{v} C`, then
165- `as_small.{w} C : Type (max w v u)` is endowed with an instance of a small category.
166-
167- The objects and morphisms of `as_small C` are defined by applying `ulift` to the
160+ /- Porting note: we want to keep around the category instance on `D`
161+ so Lean can figure out things further down. So `AsSmall` has been
162+ nolinted. -/
163+ /-- `AsSmall C` is a small category equivalent to `C`.
164+ More specifically, if `C : Type u` is endowed with `Category.{v} C`, then
165+ `AsSmall.{w} C : Type (max w v u)` is endowed with an instance of a small category.
166+
167+ The objects and morphisms of `AsSmall C` are defined by applying `ULift` to the
168168 objects and morphisms of `C`.
169169
170170 Note: We require a category instance for this definition in order to have direct
171171 access to the universe level `v`.
172172-/
173- @ [nolint unused_arguments]
174- def AsSmall. {w, v, u} (C : Type u) [Category.{v} C] :=
175- ULift.{max w v} C
173+ @ [nolint unusedArguments]
174+ def AsSmall. {w, v, u} (D : Type u) [Category.{v} D] := ULift.{max w v} D
176175#align category_theory.as_small CategoryTheory.AsSmall
177176
178- instance : SmallCategory (AsSmall.{w₁} C)
179- where
177+ instance : SmallCategory (AsSmall.{w₁} C) where
180178 Hom X Y := ULift.{max w₁ u₁} <| X.down ⟶ Y.down
181179 id X := ⟨𝟙 _⟩
182- comp X Y Z f g := ⟨f.down ≫ g.down⟩
180+ comp f g := ⟨f.down ≫ g.down⟩
183181
184- /-- One half of the equivalence between `C` and `as_small C`. -/
182+ /-- One half of the equivalence between `C` and `AsSmall C`. -/
185183@[simps]
186184def AsSmall.up : C ⥤ AsSmall C where
187185 obj X := ⟨X⟩
188- map X Y f := ⟨f⟩
186+ map f := ⟨f⟩
189187#align category_theory.as_small.up CategoryTheory.AsSmall.up
190188
191- /-- One half of the equivalence between `C` and `as_small C`. -/
189+ /-- One half of the equivalence between `C` and `AsSmall C`. -/
192190@[simps]
193191def AsSmall.down : AsSmall C ⥤ C where
194- obj X := X .down
195- map X Y f := f.down
192+ obj X := ULift .down X
193+ map f := f.down
196194#align category_theory.as_small.down CategoryTheory.AsSmall.down
197195
198- /-- The equivalence between `C` and `as_small C`. -/
196+ /-- The equivalence between `C` and `AsSmall C`. -/
199197@[simps]
200198def AsSmall.equiv : C ≌ AsSmall C where
201- Functor := AsSmall.up
199+ functor := AsSmall.up
202200 inverse := AsSmall.down
203- unitIso := NatIso.ofComponents (fun X => eqToIso rfl) (by tidy )
201+ unitIso := NatIso.ofComponents (fun X => eqToIso rfl) (by aesop_cat )
204202 counitIso :=
205203 NatIso.ofComponents
206204 (fun X =>
207205 eqToIso <| by
208- ext
206+ apply ULift. ext
209207 rfl)
210- (by tidy )
208+ (by aesop_cat )
211209#align category_theory.as_small.equiv CategoryTheory.AsSmall.equiv
212210
213211instance [Inhabited C] : Inhabited (AsSmall C) :=
214- ⟨⟨Inhabited. default _ ⟩⟩
212+ ⟨⟨default⟩⟩
215213
216- /-- The equivalence between `C` and `ulift_hom (ulift C)`. -/
214+ /-- The equivalence between `C` and `ULiftHom (Ulift C)`. -/
217215def UliftHomUliftCategory.equiv. {v', u', v, u} (C : Type u) [Category.{v} C] :
218216 C ≌ UliftHom.{v'} (ULift.{u'} C) :=
219217 Ulift.equivalence.trans UliftHom.equiv
0 commit comments