Skip to content

Commit 2f25984

Browse files
committed
automated fixes
Mathbin -> Mathlib fix certain import statements move "by" to end of line add import to Mathlib.lean
1 parent f1c2148 commit 2f25984

File tree

4 files changed

+88
-90
lines changed

4 files changed

+88
-90
lines changed

Mathlib.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ import Mathlib.CategoryTheory.Category.GaloisConnection
234234
import Mathlib.CategoryTheory.Category.KleisliCat
235235
import Mathlib.CategoryTheory.Category.Preorder
236236
import Mathlib.CategoryTheory.Category.RelCat
237-
import Mathlib.CategoryTheory.Category.Ulift
237+
import Mathlib.CategoryTheory.Category.ULift
238238
import Mathlib.CategoryTheory.Comma
239239
import Mathlib.CategoryTheory.ConcreteCategory.Bundled
240240
import Mathlib.CategoryTheory.Equivalence

ULift.lean renamed to Mathlib/CategoryTheory/Category/ULift.lean

Lines changed: 76 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -11,110 +11,110 @@ Authors: Adam Topaz
1111
import Mathlib.CategoryTheory.Category.Basic
1212
import Mathlib.CategoryTheory.Equivalence
1313
import Mathlib.CategoryTheory.EqToHom
14+
import Mathlib.Data.ULift
1415

1516
/-!
16-
# Basic API for ulift
17+
# Basic API for ULift
1718
1819
This 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
3738
This file also contains a construction which takes a type `C : Type u` with a
3839
category 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-
4646
universe w₁ v₁ v₂ u₁ u₂
4747

4848
namespace CategoryTheory
4949

5050
variable {C : Type u₁} [Category.{v₁} C]
5151

52-
/-- The functorial version of `ulift.up`. -/
52+
/-- The functorial version of `ULift.up`. -/
5353
@[simps]
5454
def 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

10098
section 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

109109
instance {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`. -/
113113
def 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`. -/
118118
def 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]
140139
def 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]
147146
def 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

161159
end 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]
186184
def 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]
193191
def 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]
200198
def 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

213211
instance [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)`. -/
217215
def 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

Mathlib/CategoryTheory/Equivalence.lean

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ structure Equivalence (C : Type u₁) (D : Type u₂) [Category.{v₁} C] [Categ
8989
/-- The composition `inverse ⋙ functor` is also isomorphic to the identity -/
9090
counitIso : inverse ⋙ functor ≅ 𝟭 D
9191
/-- The natural isomorphism compose to the identity -/
92-
functor_unit_iso_comp :
93-
∀ X : C, functor.map (unitIso.hom.app X) ≫ counitIso.hom.app (functor.obj X) =
92+
functor_unitIso_comp :
93+
∀ X : C, functor.map (unitIso.hom.app X) ≫ counitIso.hom.app (functor.obj X) =
9494
𝟙 (functor.obj X) := by aesop_cat
9595
#align category_theory.equivalence CategoryTheory.Equivalence
9696

@@ -124,7 +124,7 @@ abbrev counitInv (e : C ≌ D) : 𝟭 D ⟶ e.inverse ⋙ e.functor :=
124124
/- While these abbreviations are convenient, they also cause some trouble,
125125
preventing structure projections from unfolding. -/
126126
@[simp]
127-
theorem equivalence_mk'_unit (functor inverse unit_iso counit_iso f) :
127+
theorem Equivalence_mk'_unit (functor inverse unit_iso counit_iso f) :
128128
(⟨functor, inverse, unit_iso, counit_iso, f⟩ : C ≌ D).unit = unit_iso.hom :=
129129
rfl
130130
#align
@@ -154,7 +154,7 @@ theorem equivalence_mk'_counitInv (functor inverse unit_iso counit_iso f) :
154154
@[simp]
155155
theorem functor_unit_comp (e : C ≌ D) (X : C) :
156156
e.functor.map (e.unit.app X) ≫ e.counit.app (e.functor.obj X) = 𝟙 (e.functor.obj X) :=
157-
e.functor_unit_iso_comp X
157+
e.functor_unitIso_comp X
158158
#align category_theory.equivalence.functor_unit_comp CategoryTheory.Equivalence.functor_unit_comp
159159

160160
@[simp]
@@ -321,7 +321,7 @@ def trans (e : C ≌ D) (f : D ≌ E) : C ≌ E
321321
-- We wouldn't have needed to give this proof if we'd used `equivalence.mk`,
322322
-- but we choose to avoid using that here, for the sake of good structure projection `simp`
323323
-- lemmas.
324-
functor_unit_iso_comp X := by
324+
functor_unitIso_comp X := by
325325
dsimp
326326
rw [← f.functor.map_comp_assoc, e.functor.map_comp, ← counit_inv_app_functor, fun_inv_map,
327327
Iso.inv_hom_id_app_assoc, assoc, Iso.inv_hom_id_app, counit_app_functor, ← Functor.map_comp]
@@ -511,14 +511,14 @@ class IsEquivalence (F : C ⥤ D) where mk' ::
511511
/-- Composition `inverse ⋙ F` is isomorphic to the identity. =-/
512512
counitIso : inverse ⋙ F ≅ 𝟭 D
513513
/-- We natural isomorphisms are inverse -/
514-
functor_unit_iso_comp :
514+
functor_unitIso_comp :
515515
∀ X : C,
516516
F.map ((unitIso.hom : 𝟭 C ⟶ F ⋙ inverse).app X) ≫ counitIso.hom.app (F.obj X) =
517517
𝟙 (F.obj X) := by
518518
aesop_cat
519519
#align category_theory.is_equivalence CategoryTheory.IsEquivalence
520520

521-
attribute [reassoc (attr := simp)] IsEquivalence.functor_unit_iso_comp
521+
attribute [reassoc (attr := simp)] IsEquivalence.functor_unitIso_comp
522522

523523
namespace IsEquivalence
524524

@@ -546,7 +546,7 @@ namespace Functor
546546
/-- Interpret a functor that is an equivalence as an equivalence. -/
547547
def asEquivalence (F : C ⥤ D) [IsEquivalence F] : C ≌ D :=
548548
⟨F, IsEquivalence.inverse F, IsEquivalence.unitIso, IsEquivalence.counitIso,
549-
IsEquivalence.functor_unit_iso_comp
549+
IsEquivalence.functor_unitIso_comp
550550
#align category_theory.functor.as_equivalence CategoryTheory.Functor.asEquivalence
551551

552552
instance isEquivalenceRefl : IsEquivalence (𝟭 C) :=
@@ -654,15 +654,15 @@ def ofIso {F G : C ⥤ D} (e : F ≅ G) (hF : IsEquivalence F) : IsEquivalence G
654654
inverse := hF.inverse
655655
unitIso := hF.unitIso ≪≫ NatIso.hcomp e (Iso.refl hF.inverse)
656656
counitIso := NatIso.hcomp (Iso.refl hF.inverse) e.symm ≪≫ hF.counitIso
657-
functor_unit_iso_comp X := by
657+
functor_unitIso_comp X := by
658658
dsimp [NatIso.hcomp]
659659
erw [id_comp, F.map_id, comp_id]
660660
apply (cancel_epi (e.hom.app X)).mp
661661
slice_lhs 1 2 => rw [← e.hom.naturality]
662662
slice_lhs 2 3 => rw [← NatTrans.vcomp_app', e.hom_inv_id]
663663
simp only [NatTrans.id_app, id_comp, comp_id, F.map_comp, assoc]
664664
erw [hF.counitIso.hom.naturality]
665-
slice_lhs 1 2 => rw [functor_unit_iso_comp]
665+
slice_lhs 1 2 => rw [functor_unitIso_comp]
666666
simp only [Functor.id_map, id_comp]
667667
#align category_theory.is_equivalence.of_iso CategoryTheory.IsEquivalence.ofIso
668668

Mathlib/CategoryTheory/Products/Basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ def functorProdFunctorEquivCounitIso :
353353
(by aesop_cat)
354354
#align category_theory.functor_prod_functor_equiv_counit_iso CategoryTheory.functorProdFunctorEquivCounitIso
355355

356-
/- Porting note: unlike with Lean 3, we needed to provide `functor_unitIso_comp` because
356+
/- Porting note: unlike with Lean 3, we needed to provide `functor_unitIso_comp` because
357357
Lean 4 could not see through `functorProdFunctorEquivUnitIso` (or the co-unit version)
358358
to run the auto tactic `by aesop_cat` -/
359359

0 commit comments

Comments
 (0)