Skip to content

Commit 6ea6e60

Browse files
chrisflavpfaffelh
authored andcommitted
chore(CategoryTheory/Action): generalize universes (#24547)
Since #21652 the universe restrictions are no longer necessary. This also allows to remove some universe restrictions in the Galois category API.
1 parent 59f2186 commit 6ea6e60

8 files changed

Lines changed: 57 additions & 67 deletions

File tree

Mathlib/CategoryTheory/Action/Basic.lean

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ universe u v
2727

2828
open CategoryTheory Limits
2929

30-
variable (V : Type (u + 1)) [LargeCategory V]
30+
variable (V : Type*) [Category V]
3131

3232
-- Note: this is _not_ a categorical action of `G` on `V`.
3333
/-- An `Action V G` represents a bundled action of
@@ -36,7 +36,7 @@ the monoid `G` on an object of some category `V`.
3636
As an example, when `V = ModuleCat R`, this is an `R`-linear representation of `G`,
3737
while when `V = Type` this is a `G`-action.
3838
-/
39-
structure Action (G : Type u) [Monoid G] where
39+
structure Action (G : Type*) [Monoid G] where
4040
/-- The object this action acts on -/
4141
V : V
4242
/-- The underlying monoid homomorphism of this action -/
@@ -46,11 +46,11 @@ namespace Action
4646

4747
variable {V}
4848

49-
theorem ρ_one {G : Type u} [Monoid G] (A : Action V G) : A.ρ 1 = 𝟙 A.V := by simp
49+
theorem ρ_one {G : Type*} [Monoid G] (A : Action V G) : A.ρ 1 = 𝟙 A.V := by simp
5050

5151
/-- When a group acts, we can lift the action to the group of automorphisms. -/
5252
@[simps]
53-
def ρAut {G : Type u} [Group G] (A : Action V G) : G →* Aut A.V where
53+
def ρAut {G : Type*} [Group G] (A : Action V G) : G →* Aut A.V where
5454
toFun g :=
5555
{ hom := A.ρ g
5656
inv := A.ρ (g⁻¹ : G)
@@ -59,11 +59,11 @@ def ρAut {G : Type u} [Group G] (A : Action V G) : G →* Aut A.V where
5959
map_one' := Aut.ext A.ρ.map_one
6060
map_mul' x y := Aut.ext (A.ρ.map_mul x y)
6161

62-
variable (G : Type u) [Monoid G]
62+
variable (G : Type*) [Monoid G]
6363

6464
section
6565

66-
instance inhabited' : Inhabited (Action (Type u) G) :=
66+
instance inhabited' : Inhabited (Action (Type*) G) :=
6767
⟨⟨PUnit, 1⟩⟩
6868

6969
/-- The trivial representation of a group. -/
@@ -311,7 +311,7 @@ taking actions of `H` to actions of `G`.
311311
(This makes sense for any homomorphism, but the name is natural when `f` is a monomorphism.)
312312
-/
313313
@[simps]
314-
def res {G H : Type u} [Monoid G] [Monoid H] (f : G →* H) : Action V H ⥤ Action V G where
314+
def res {G H : Type*} [Monoid G] [Monoid H] (f : G →* H) : Action V H ⥤ Action V G where
315315
obj M :=
316316
{ V := M.V
317317
ρ := M.ρ.comp f }
@@ -323,21 +323,21 @@ def res {G H : Type u} [Monoid G] [Monoid H] (f : G →* H) : Action V H ⥤ Act
323323
the identity functor on `Action V G`.
324324
-/
325325
@[simps!]
326-
def resId {G : Type u} [Monoid G] : res V (MonoidHom.id G) ≅ 𝟭 (Action V G) :=
326+
def resId {G : Type*} [Monoid G] : res V (MonoidHom.id G) ≅ 𝟭 (Action V G) :=
327327
NatIso.ofComponents fun M => mkIso (Iso.refl _)
328328

329329
/-- The natural isomorphism from the composition of restrictions along homomorphisms
330330
to the restriction along the composition of homomorphism.
331331
-/
332332
@[simps!]
333-
def resComp {G H K : Type u} [Monoid G] [Monoid H] [Monoid K]
333+
def resComp {G H K : Type*} [Monoid G] [Monoid H] [Monoid K]
334334
(f : G →* H) (g : H →* K) : res V g ⋙ res V f ≅ res V (g.comp f) :=
335335
NatIso.ofComponents fun M => mkIso (Iso.refl _)
336336

337337
-- TODO promote `res` to a pseudofunctor from
338338
-- the locally discrete bicategory constructed from `Monᵒᵖ` to `Cat`, sending `G` to `Action V G`.
339339

340-
variable {G H : Type u} [Monoid G] [Monoid H] (f : G →* H)
340+
variable {G H : Type*} [Monoid G] [Monoid H] (f : G →* H)
341341

342342
/-- The functor from `Action V H` to `Action V G` induced by a morphism `f : G → H` is faithful. -/
343343
instance : (res V f).Faithful where
@@ -361,12 +361,12 @@ end Action
361361

362362
namespace CategoryTheory.Functor
363363

364-
variable {V} {W : Type (u + 1)} [LargeCategory W]
364+
variable {V} {W : Type*} [Category W]
365365

366366
/-- A functor between categories induces a functor between
367367
the categories of `G`-actions within those categories. -/
368368
@[simps]
369-
def mapAction (F : V ⥤ W) (G : Type u) [Monoid G] : Action V G ⥤ Action W G where
369+
def mapAction (F : V ⥤ W) (G : Type*) [Monoid G] : Action V G ⥤ Action W G where
370370
obj M :=
371371
{ V := F.obj M.V
372372
ρ :=

Mathlib/CategoryTheory/Action/Concrete.lean

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import Mathlib.GroupTheory.QuotientGroup.Defs
1313
/-!
1414
# Constructors for `Action V G` for some concrete categories
1515
16-
We construct `Action (Type u) G` from a `[MulAction G X]` instance and give some applications.
16+
We construct `Action (Type*) G` from a `[MulAction G X]` instance and give some applications.
1717
-/
1818

1919
assert_not_exists Field
@@ -25,12 +25,12 @@ open CategoryTheory Limits
2525
namespace Action
2626

2727
/-- Bundles a type `H` with a multiplicative action of `G` as an `Action`. -/
28-
def ofMulAction (G H : Type u) [Monoid G] [MulAction G H] : Action (Type u) G where
28+
def ofMulAction (G : Type*) (H : Type u) [Monoid G] [MulAction G H] : Action (Type u) G where
2929
V := H
3030
ρ := @MulAction.toEndHom _ _ _ (by assumption)
3131

3232
@[simp]
33-
theorem ofMulAction_apply {G H : Type u} [Monoid G] [MulAction G H] (g : G) (x : H) :
33+
theorem ofMulAction_apply {G H : Type*} [Monoid G] [MulAction G H] (g : G) (x : H) :
3434
(ofMulAction G H).ρ g x = (g • x : H) :=
3535
rfl
3636

@@ -68,7 +68,7 @@ def diagonal (G : Type u) [Monoid G] (n : ℕ) : Action (Type u) G :=
6868
Action.ofMulAction G (Fin n → G)
6969

7070
/-- We have `Fin 1 → G ≅ G` as `G`-sets, with `G` acting by left multiplication. -/
71-
def diagonalOneIsoLeftRegular (G : Type u) [Monoid G] : diagonal G 1 ≅ leftRegular G :=
71+
def diagonalOneIsoLeftRegular (G : Type*) [Monoid G] : diagonal G 1 ≅ leftRegular G :=
7272
Action.mkIso (Equiv.funUnique _ _).toIso fun _ => rfl
7373

7474
namespace FintypeCat
@@ -80,13 +80,13 @@ instance (G : Type*) (X : Type*) [Monoid G] [MulAction G X] [Fintype X] :
8080
inferInstanceAs <| MulAction G X
8181

8282
/-- Bundles a finite type `H` with a multiplicative action of `G` as an `Action`. -/
83-
def ofMulAction (G : Type u) (H : FintypeCat.{u}) [Monoid G] [MulAction G H] :
83+
def ofMulAction (G : Type*) (H : FintypeCat.{u}) [Monoid G] [MulAction G H] :
8484
Action FintypeCat G where
8585
V := H
8686
ρ := @MulAction.toEndHom _ _ _ (by assumption)
8787

8888
@[simp]
89-
theorem ofMulAction_apply {G : Type u} {H : FintypeCat.{u}} [Monoid G] [MulAction G H]
89+
theorem ofMulAction_apply {G : Type*} {H : FintypeCat.{u}} [Monoid G] [MulAction G H]
9090
(g : G) (x : H) : (FintypeCat.ofMulAction G H).ρ g x = (g • x : H) :=
9191
rfl
9292

@@ -172,7 +172,7 @@ section ToMulAction
172172
variable {V : Type (u + 1)} [LargeCategory V] {FV : V → V → Type*} {CV : V → Type*}
173173
variable [∀ X Y, FunLike (FV X Y) (CV X) (CV Y)] [ConcreteCategory V FV]
174174

175-
instance instMulAction {G : Type u} [Monoid G] (X : Action V G) :
175+
instance instMulAction {G : Type*} [Monoid G] (X : Action V G) :
176176
MulAction G (ToType X) where
177177
smul g x := ConcreteCategory.hom (X.ρ g) x
178178
one_smul x := by
@@ -184,7 +184,7 @@ instance instMulAction {G : Type u} [Monoid G] (X : Action V G) :
184184
simp
185185

186186
/- Specialize `instMulAction` to assist typeclass inference. -/
187-
instance {G : Type u} [Monoid G] (X : Action FintypeCat G) : MulAction G X.V :=
187+
instance {G : Type*} [Monoid G] (X : Action FintypeCat G) : MulAction G X.V :=
188188
Action.instMulAction X
189189

190190
end ToMulAction

Mathlib/CategoryTheory/Action/Continuous.lean

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,10 @@ of `HasForget₂` instances.
2424
2525
-/
2626

27-
universe u v
28-
2927
open CategoryTheory Limits
3028

31-
variable (V : Type (u + 1)) [LargeCategory V] [HasForget V] [HasForget₂ V TopCat]
32-
variable (G : Type u) [Monoid G] [TopologicalSpace G]
29+
variable (V : Type*) [Category V] [HasForget V] [HasForget₂ V TopCat]
30+
variable (G : Type*) [Monoid G] [TopologicalSpace G]
3331

3432
namespace Action
3533

Mathlib/CategoryTheory/Action/Limits.lean

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ universe u v w₁ w₂ t₁ t₂
2323

2424
open CategoryTheory Limits
2525

26-
variable {V : Type (u + 1)} [LargeCategory V] {G : Type u} [Monoid G]
26+
variable {V : Type*} [Category V] {G : Type*} [Monoid G]
2727

2828
namespace Action
2929

@@ -41,7 +41,7 @@ instance [HasLimits V] : HasLimits (Action V G) :=
4141
Adjunction.has_limits_of_equivalence (Action.functorCategoryEquivalence _ _).functor
4242

4343
/-- If `V` has limits of shape `J`, so does `Action V G`. -/
44-
instance hasLimitsOfShape {J : Type w₁} [Category.{w₂} J] [HasLimitsOfShape J V] :
44+
instance hasLimitsOfShape {J : Type*} [Category J] [HasLimitsOfShape J V] :
4545
HasLimitsOfShape J (Action V G) :=
4646
Adjunction.hasLimitsOfShape_of_equivalence (Action.functorCategoryEquivalence _ _).functor
4747

@@ -57,20 +57,20 @@ instance [HasColimits V] : HasColimits (Action V G) :=
5757
Adjunction.has_colimits_of_equivalence (Action.functorCategoryEquivalence _ _).functor
5858

5959
/-- If `V` has colimits of shape `J`, so does `Action V G`. -/
60-
instance hasColimitsOfShape {J : Type w₁} [Category.{w₂} J]
60+
instance hasColimitsOfShape {J : Type*} [Category J]
6161
[HasColimitsOfShape J V] : HasColimitsOfShape J (Action V G) :=
6262
Adjunction.hasColimitsOfShape_of_equivalence (Action.functorCategoryEquivalence _ _).functor
6363

6464
end Limits
6565

6666
section Preservation
6767

68-
variable {C : Type t₁} [Category.{t₂} C]
68+
variable {C : Type*} [Category C]
6969

7070
/-- `F : C ⥤ SingleObj G ⥤ V` preserves the limit of some `K : J ⥤ C` if it does
7171
evaluated at `SingleObj.star G`. -/
7272
private lemma SingleObj.preservesLimit (F : C ⥤ SingleObj G ⥤ V)
73-
{J : Type w₁} [Category.{w₂} J] (K : J ⥤ C)
73+
{J : Type*} [Category J] (K : J ⥤ C)
7474
(h : PreservesLimit K (F ⋙ (evaluation (SingleObj G) V).obj (SingleObj.star G))) :
7575
PreservesLimit K F := by
7676
apply preservesLimit_of_evaluation
@@ -79,17 +79,17 @@ private lemma SingleObj.preservesLimit (F : C ⥤ SingleObj G ⥤ V)
7979

8080
/-- `F : C ⥤ Action V G` preserves the limit of some `K : J ⥤ C` if
8181
if it does after postcomposing with the forgetful functor `Action V G ⥤ V`. -/
82-
lemma preservesLimit_of_preserves (F : C ⥤ Action V G) {J : Type w₁}
83-
[Category.{w₂} J] (K : J ⥤ C)
82+
lemma preservesLimit_of_preserves (F : C ⥤ Action V G) {J : Type*}
83+
[Category J] (K : J ⥤ C)
8484
(h : PreservesLimit K (F ⋙ Action.forget V G)) : PreservesLimit K F := by
8585
let F' : C ⥤ SingleObj G ⥤ V := F ⋙ (Action.functorCategoryEquivalence V G).functor
8686
have : PreservesLimit K F' := SingleObj.preservesLimit _ _ h
8787
apply preservesLimit_of_reflects_of_preserves F (Action.functorCategoryEquivalence V G).functor
8888

8989
/-- `F : C ⥤ Action V G` preserves limits of some shape `J`
9090
if it does after postcomposing with the forgetful functor `Action V G ⥤ V`. -/
91-
lemma preservesLimitsOfShape_of_preserves (F : C ⥤ Action V G) {J : Type w₁}
92-
[Category.{w₂} J] (h : PreservesLimitsOfShape J (F ⋙ Action.forget V G)) :
91+
lemma preservesLimitsOfShape_of_preserves (F : C ⥤ Action V G) {J : Type*}
92+
[Category J] (h : PreservesLimitsOfShape J (F ⋙ Action.forget V G)) :
9393
PreservesLimitsOfShape J F := by
9494
constructor
9595
intro K
@@ -109,7 +109,7 @@ lemma preservesLimitsOfSize_of_preserves (F : C ⥤ Action V G)
109109
/-- `F : C ⥤ SingleObj G ⥤ V` preserves the colimit of some `K : J ⥤ C` if it does
110110
evaluated at `SingleObj.star G`. -/
111111
private lemma SingleObj.preservesColimit (F : C ⥤ SingleObj G ⥤ V)
112-
{J : Type w₁} [Category.{w₂} J] (K : J ⥤ C)
112+
{J : Type*} [Category J] (K : J ⥤ C)
113113
(h : PreservesColimit K (F ⋙ (evaluation (SingleObj G) V).obj (SingleObj.star G))) :
114114
PreservesColimit K F := by
115115
apply preservesColimit_of_evaluation
@@ -118,17 +118,17 @@ private lemma SingleObj.preservesColimit (F : C ⥤ SingleObj G ⥤ V)
118118

119119
/-- `F : C ⥤ Action V G` preserves the colimit of some `K : J ⥤ C` if
120120
if it does after postcomposing with the forgetful functor `Action V G ⥤ V`. -/
121-
lemma preservesColimit_of_preserves (F : C ⥤ Action V G) {J : Type w₁}
122-
[Category.{w₂} J] (K : J ⥤ C)
121+
lemma preservesColimit_of_preserves (F : C ⥤ Action V G) {J : Type*}
122+
[Category J] (K : J ⥤ C)
123123
(h : PreservesColimit K (F ⋙ Action.forget V G)) : PreservesColimit K F := by
124124
let F' : C ⥤ SingleObj G ⥤ V := F ⋙ (Action.functorCategoryEquivalence V G).functor
125125
have : PreservesColimit K F' := SingleObj.preservesColimit _ _ h
126126
apply preservesColimit_of_reflects_of_preserves F (Action.functorCategoryEquivalence V G).functor
127127

128128
/-- `F : C ⥤ Action V G` preserves colimits of some shape `J`
129129
if it does after postcomposing with the forgetful functor `Action V G ⥤ V`. -/
130-
lemma preservesColimitsOfShape_of_preserves (F : C ⥤ Action V G) {J : Type w₁}
131-
[Category.{w₂} J] (h : PreservesColimitsOfShape J (F ⋙ Action.forget V G)) :
130+
lemma preservesColimitsOfShape_of_preserves (F : C ⥤ Action V G) {J : Type*}
131+
[Category J] (h : PreservesColimitsOfShape J (F ⋙ Action.forget V G)) :
132132
PreservesColimitsOfShape J F := by
133133
constructor
134134
intro K
@@ -149,13 +149,13 @@ end Preservation
149149

150150
section Forget
151151

152-
noncomputable instance {J : Type w₁} [Category.{w₂} J] [HasLimitsOfShape J V] :
152+
noncomputable instance {J : Type*} [Category J] [HasLimitsOfShape J V] :
153153
PreservesLimitsOfShape J (Action.forget V G) := by
154154
show PreservesLimitsOfShape J ((Action.functorCategoryEquivalence V G).functor ⋙
155155
(evaluation (SingleObj G) V).obj (SingleObj.star G))
156156
infer_instance
157157

158-
noncomputable instance {J : Type w₁} [Category.{w₂} J] [HasColimitsOfShape J V] :
158+
noncomputable instance {J : Type*} [Category J] [HasColimitsOfShape J V] :
159159
PreservesColimitsOfShape J (Action.forget V G) := by
160160
show PreservesColimitsOfShape J ((Action.functorCategoryEquivalence V G).functor ⋙
161161
(evaluation (SingleObj G) V).obj (SingleObj.star G))
@@ -179,24 +179,24 @@ noncomputable instance [HasFiniteColimits V] : PreservesFiniteColimits (Action.f
179179
infer_instance
180180
apply comp_preservesFiniteColimits
181181

182-
instance {J : Type w₁} [Category.{w₂} J] (F : J ⥤ Action V G) :
182+
instance {J : Type*} [Category J] (F : J ⥤ Action V G) :
183183
ReflectsLimit F (Action.forget V G) where
184184
reflects h := ⟨by
185185
apply isLimitOfReflects ((Action.functorCategoryEquivalence V G).functor)
186186
exact evaluationJointlyReflectsLimits _ (fun _ => h)⟩
187187

188-
instance {J : Type w₁} [Category.{w₂} J] :
188+
instance {J : Type*} [Category J] :
189189
ReflectsLimitsOfShape J (Action.forget V G) where
190190

191191
instance : ReflectsLimits (Action.forget V G) where
192192

193-
instance {J : Type w₁} [Category.{w₂} J] (F : J ⥤ Action V G) :
193+
instance {J : Type*} [Category J] (F : J ⥤ Action V G) :
194194
ReflectsColimit F (Action.forget V G) where
195195
reflects h := ⟨by
196196
apply isColimitOfReflects ((Action.functorCategoryEquivalence V G).functor)
197197
exact evaluationJointlyReflectsColimits _ (fun _ => h)⟩
198198

199-
noncomputable instance {J : Type w₁} [Category.{w₂} J] :
199+
noncomputable instance {J : Type*} [Category J] :
200200
ReflectsColimitsOfShape J (Action.forget V G) where
201201

202202
noncomputable instance : ReflectsColimits (Action.forget V G) where
@@ -296,7 +296,7 @@ instance functorCategoryEquivalence_linear :
296296
theorem smul_hom {X Y : Action V G} (r : R) (f : X ⟶ Y) : (r • f).hom = r • f.hom :=
297297
rfl
298298

299-
variable {H : Type u} [Monoid H] (f : G →* H)
299+
variable {H : Type*} [Monoid H] (f : G →* H)
300300

301301
instance res_additive : (res V f).Additive where
302302

@@ -307,8 +307,8 @@ end Linear
307307
section Abelian
308308

309309
/-- Auxiliary construction for the `Abelian (Action V G)` instance. -/
310-
def abelianAux : Action V G ≌ ULift.{u} (SingleObj G) ⥤ V :=
311-
(functorCategoryEquivalence V G).trans (Equivalence.congrLeft ULift.equivalence)
310+
def abelianAux : Action V G ≌ (SingleObj G) ⥤ V :=
311+
functorCategoryEquivalence V G
312312

313313
noncomputable instance [Abelian V] : Abelian (Action V G) :=
314314
abelianOfEquivalence abelianAux.functor
@@ -319,7 +319,7 @@ end Action
319319

320320
namespace CategoryTheory.Functor
321321

322-
variable {W : Type (u + 1)} [LargeCategory W] (F : V ⥤ W) (G : Type u) [Monoid G] [Preadditive V]
322+
variable {W : Type*} [Category W] (F : V ⥤ W) (G : Type*) [Monoid G] [Preadditive V]
323323
[Preadditive W]
324324

325325
instance mapAction_preadditive [F.Additive] : (F.mapAction G).Additive where

Mathlib/CategoryTheory/Action/Monoidal.lean

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ We show:
1919
* When `V` is monoidal, braided, or symmetric, so is `Action V G`.
2020
-/
2121

22-
universe u v
22+
universe u
2323

2424
open CategoryTheory Limits MonoidalCategory
2525

26-
variable {V : Type (u + 1)} [LargeCategory V] {G : Type u} [Monoid G]
26+
variable {V : Type*} [Category V] {G : Type*} [Monoid G]
2727

2828
namespace Action
2929

@@ -144,7 +144,7 @@ lemma FunctorCategoryEquivalence.functor_δ (A B : Action V G) :
144144
δ FunctorCategoryEquivalence.functor A B = 𝟙 _ := rfl
145145

146146

147-
variable (H : Type u) [Group H]
147+
variable (H : Type*) [Group H]
148148

149149
instance [RightRigidCategory V] : RightRigidCategory (SingleObj H ⥤ V) := by
150150
infer_instance
@@ -227,7 +227,7 @@ noncomputable def leftRegularTensorIso (G : Type u) [Group G] (X : Action (Type
227227
/-- The natural isomorphism of `G`-sets `Gⁿ⁺¹ ≅ G × Gⁿ`, where `G` acts by left multiplication on
228228
each factor. -/
229229
@[simps!]
230-
noncomputable def diagonalSucc (G : Type u) [Monoid G] (n : ℕ) :
230+
noncomputable def diagonalSucc (G : Type*) [Monoid G] (n : ℕ) :
231231
diagonal G (n + 1) ≅ leftRegular G ⊗ diagonal G n :=
232232
mkIso (Fin.consEquiv _).symm.toIso fun _ => rfl
233233

@@ -237,7 +237,7 @@ namespace CategoryTheory.Functor
237237

238238
open Action
239239

240-
variable {W : Type (u + 1)} [LargeCategory W] [MonoidalCategory V] [MonoidalCategory W]
240+
variable {W : Type*} [Category W] [MonoidalCategory V] [MonoidalCategory W]
241241
(F : V ⥤ W)
242242

243243
open Functor.LaxMonoidal Functor.OplaxMonoidal Functor.Monoidal

0 commit comments

Comments
 (0)