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

Commit 3152982

Browse files
committed
feat(representation/Rep): linear structures (#13782)
Make `Rep k G` a `k`-linear (and `k`-linear monoidal) category. Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
1 parent 0009ffb commit 3152982

File tree

8 files changed

+228
-9
lines changed

8 files changed

+228
-9
lines changed

src/algebra/category/Module/monoidal.lean

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import category_theory.closed.monoidal
88
import algebra.category.Module.basic
99
import linear_algebra.tensor_product
1010
import category_theory.linear.yoneda
11-
import category_theory.monoidal.preadditive
11+
import category_theory.monoidal.linear
1212

1313
/-!
1414
# The symmetric monoidal category structure on R-modules
@@ -273,6 +273,10 @@ instance : monoidal_preadditive (Module.{u} R) :=
273273
tensor_add' := by { intros, ext, simp [tensor_product.tmul_add], },
274274
add_tensor' := by { intros, ext, simp [tensor_product.add_tmul], }, }
275275

276+
instance : monoidal_linear R (Module.{u} R) :=
277+
{ tensor_smul' := by { intros, ext, simp, },
278+
smul_tensor' := by { intros, ext, simp [tensor_product.smul_tmul], }, }
279+
276280
/--
277281
Auxiliary definition for the `monoidal_closed` instance on `Module R`.
278282
(This is only a separate definition in order to speed up typechecking. )

src/category_theory/linear/default.lean

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ import algebra.algebra.basic
1515
An `R`-linear category is a category in which `X ⟶ Y` is an `R`-module in such a way that
1616
composition of morphisms is `R`-linear in both variables.
1717
18+
Note that sometimes in the literature a "linear category" is further required to be abelian.
19+
1820
## Implementation
1921
2022
Corresponding to the fact that we need to have an `add_comm_group X` structure in place
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/-
2+
Copyright (c) 2022 Scott Morrison. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Scott Morrison
5+
-/
6+
import category_theory.preadditive.functor_category
7+
import category_theory.linear.default
8+
9+
/-!
10+
# Linear structure on functor categories
11+
12+
If `C` and `D` are categories and `D` is `R`-linear,
13+
then `C ⥤ D` is also `R`-linear.
14+
15+
-/
16+
17+
open_locale big_operators
18+
19+
namespace category_theory
20+
open category_theory.limits linear
21+
22+
variables {R : Type*} [semiring R]
23+
variables {C D : Type*} [category C] [category D] [preadditive D] [linear R D]
24+
25+
instance functor_category_linear : linear R (C ⥤ D) :=
26+
{ hom_module := λ F G,
27+
{ smul := λ r α,
28+
{ app := λ X, r • α.app X,
29+
naturality' := by { intros, rw [comp_smul, smul_comp, α.naturality] } },
30+
one_smul := by { intros, ext, apply one_smul },
31+
zero_smul := by { intros, ext, apply zero_smul },
32+
smul_zero := by { intros, ext, apply smul_zero },
33+
add_smul := by { intros, ext, apply add_smul },
34+
smul_add := by { intros, ext, apply smul_add },
35+
mul_smul := by { intros, ext, apply mul_smul } },
36+
smul_comp' := by { intros, ext, apply smul_comp },
37+
comp_smul' := by { intros, ext, apply comp_smul } }
38+
39+
namespace nat_trans
40+
41+
variables {F G : C ⥤ D}
42+
43+
/-- Application of a natural transformation at a fixed object,
44+
as group homomorphism -/
45+
@[simps] def app_linear_map (X : C) : (F ⟶ G) →ₗ[R] (F.obj X ⟶ G.obj X) :=
46+
{ to_fun := λ α, α.app X,
47+
map_add' := λ _ _, rfl,
48+
map_smul' := λ _ _, rfl, }
49+
50+
@[simp] lemma app_smul (X : C) (r : R) (α : F ⟶ G) : (r • α).app X = r • α.app X := rfl
51+
52+
end nat_trans
53+
54+
end category_theory
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/-
2+
Copyright (c) 2022 Scott Morrison. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Scott Morrison
5+
-/
6+
import category_theory.linear.linear_functor
7+
import category_theory.monoidal.preadditive
8+
9+
/-!
10+
# Linear monoidal categories
11+
12+
A monoidal category is `monoidal_linear R` if it is monoidal preadditive and
13+
tensor product of morphisms is `R`-linear in both factors.
14+
-/
15+
16+
namespace category_theory
17+
18+
open category_theory.limits
19+
open category_theory.monoidal_category
20+
21+
variables (R : Type*) [semiring R]
22+
variables (C : Type*) [category C] [preadditive C] [linear R C]
23+
variables [monoidal_category C] [monoidal_preadditive C]
24+
25+
/--
26+
A category is `monoidal_linear R` if tensoring is `R`-linear in both factors.
27+
-/
28+
class monoidal_linear :=
29+
(tensor_smul' : ∀ {W X Y Z : C} (f : W ⟶ X) (r : R) (g : Y ⟶ Z),
30+
f ⊗ (r • g) = r • (f ⊗ g) . obviously)
31+
(smul_tensor' : ∀ {W X Y Z : C} (r : R) (f : W ⟶ X) (g : Y ⟶ Z),
32+
(r • f) ⊗ g = r • (f ⊗ g) . obviously)
33+
34+
restate_axiom monoidal_linear.tensor_smul'
35+
restate_axiom monoidal_linear.smul_tensor'
36+
attribute [simp] monoidal_linear.tensor_smul monoidal_linear.smul_tensor
37+
38+
variables [monoidal_linear R C]
39+
40+
instance tensor_left_linear (X : C) : (tensor_left X).linear R := {}
41+
instance tensor_right_linear (X : C) : (tensor_right X).linear R := {}
42+
instance tensoring_left_linear (X : C) : ((tensoring_left C).obj X).linear R := {}
43+
instance tensoring_right_linear (X : C) : ((tensoring_right C).obj X).linear R := {}
44+
45+
end category_theory

src/category_theory/monoidal/transport.lean

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ variables {D : Type u₂} [category.{v₂} D]
3232
/--
3333
Transport a monoidal structure along an equivalence of (plain) categories.
3434
-/
35-
@[simps]
35+
@[simps {attrs := [`_refl_lemma]}] -- We just want these simp lemmas locally
3636
def transport (e : C ≌ D) : monoidal_category.{v₂} D :=
3737
{ tensor_obj := λ X Y, e.functor.obj (e.inverse.obj X ⊗ e.inverse.obj Y),
3838
tensor_hom := λ W X Y Z f g, e.functor.map (e.inverse.map f ⊗ e.inverse.map g),
@@ -137,6 +137,13 @@ def transported (e : C ≌ D) := D
137137
instance (e : C ≌ D) : monoidal_category (transported e) := transport e
138138
instance (e : C ≌ D) : inhabited (transported e) := ⟨𝟙_ _⟩
139139

140+
section
141+
local attribute [simp] transport_tensor_unit
142+
143+
section
144+
local attribute [simp] transport_tensor_hom transport_associator
145+
transport_left_unitor transport_right_unitor
146+
140147
/--
141148
We can upgrade `e.functor` to a lax monoidal functor from `C` to `D` with the transported structure.
142149
-/
@@ -191,6 +198,7 @@ def lax_to_transported (e : C ≌ D) : lax_monoidal_functor C (transported e) :=
191198
congr' 1,
192199
simp only [←right_unitor_naturality, id_comp, ←tensor_comp_assoc, comp_id],
193200
end, }.
201+
end
194202

195203
/--
196204
We can upgrade `e.functor` to a monoidal functor from `C` to `D` with the transported structure.
@@ -200,6 +208,7 @@ def to_transported (e : C ≌ D) : monoidal_functor C (transported e) :=
200208
{ to_lax_monoidal_functor := lax_to_transported e,
201209
ε_is_iso := by { dsimp, apply_instance, },
202210
μ_is_iso := λ X Y, by { dsimp, apply_instance, }, }
211+
end
203212

204213
instance (e : C ≌ D) : is_equivalence (to_transported e).to_functor :=
205214
by { dsimp, apply_instance, }

src/category_theory/preadditive/functor_category.lean

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

2222
variables {C D : Type*} [category C] [category D] [preadditive D]
2323

24-
instance : preadditive (C ⥤ D) :=
24+
instance functor_category_preadditive : preadditive (C ⥤ D) :=
2525
{ hom_group := λ F G,
2626
{ add := λ α β,
2727
{ app := λ X, α.app X + β.app X,

src/representation_theory/Action.lean

Lines changed: 103 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ import category_theory.limits.preserves.basic
1010
import category_theory.adjunction.limits
1111
import category_theory.monoidal.functor_category
1212
import category_theory.monoidal.transport
13+
import category_theory.monoidal.linear
1314
import category_theory.monoidal.braided
1415
import category_theory.abelian.functor_category
1516
import category_theory.abelian.transfer
17+
import category_theory.linear.functor_category
1618

1719
/-!
1820
# `Action V G`, the category of actions of a monoid `G` inside some category `V`.
@@ -25,7 +27,7 @@ and construct the restriction functors `res {G H : Mon} (f : G ⟶ H) : Action V
2527
2628
* When `V` has (co)limits so does `Action V G`.
2729
* When `V` is monoidal, braided, or symmetric, so is `Action V G`.
28-
* When `V` is preadditive or abelian so is `Action V G`.
30+
* When `V` is preadditive, linear, or abelian so is `Action V G`.
2931
-/
3032

3133
universes u
@@ -272,8 +274,33 @@ instance : preadditive (Action V G) :=
272274

273275
instance : functor.additive (functor_category_equivalence V G).functor := {}
274276

277+
@[simp] lemma zero_hom {X Y : Action V G} : (0 : X ⟶ Y).hom = 0 := rfl
278+
@[simp] lemma neg_hom {X Y : Action V G} (f : X ⟶ Y) : (-f).hom = -f.hom := rfl
279+
@[simp] lemma add_hom {X Y : Action V G} (f g : X ⟶ Y) : (f + g).hom = f.hom + g.hom := rfl
280+
275281
end preadditive
276282

283+
section linear
284+
variables [preadditive V] {R : Type*} [semiring R] [linear R V]
285+
286+
instance : linear R (Action V G) :=
287+
{ hom_module := λ X Y,
288+
{ smul := λ r f, ⟨r • f.hom, by simp [f.comm]⟩,
289+
one_smul := by { intros, ext, exact one_smul _ _, },
290+
smul_zero := by { intros, ext, exact smul_zero _, },
291+
zero_smul := by { intros, ext, exact zero_smul _ _, },
292+
add_smul := by { intros, ext, exact add_smul _ _ _, },
293+
smul_add := by { intros, ext, exact smul_add _ _ _, },
294+
mul_smul := by { intros, ext, exact mul_smul _ _ _, }, },
295+
smul_comp' := by { intros, ext, exact linear.smul_comp _ _ _ _ _ _, },
296+
comp_smul' := by { intros, ext, exact linear.comp_smul _ _ _ _ _ _, }, }
297+
298+
instance : functor.linear R (functor_category_equivalence V G).functor := {}
299+
300+
@[simp] lemma smul_hom {X Y : Action V G} (r : R) (f : X ⟶ Y) : (r • f).hom = r • f.hom := rfl
301+
302+
end linear
303+
277304
section abelian
278305
/-- Auxilliary construction for the `abelian (Action V G)` instance. -/
279306
def abelian_aux : Action V G ≌ (ulift.{u} (single_obj G) ⥤ V) :=
@@ -290,6 +317,47 @@ variables [monoidal_category V]
290317
instance : monoidal_category (Action V G) :=
291318
monoidal.transport (Action.functor_category_equivalence _ _).symm
292319

320+
@[simp] lemma tensor_V {X Y : Action V G} : (X ⊗ Y).V = X.V ⊗ Y.V := rfl
321+
@[simp] lemma tensor_rho {X Y : Action V G} {g : G} : (X ⊗ Y).ρ g = X.ρ g ⊗ Y.ρ g := rfl
322+
@[simp] lemma tensor_hom {W X Y Z : Action V G} (f : W ⟶ X) (g : Y ⟶ Z) :
323+
(f ⊗ g).hom = f.hom ⊗ g.hom := rfl
324+
@[simp] lemma associator_hom_hom {X Y Z : Action V G} :
325+
hom.hom (α_ X Y Z).hom = (α_ X.V Y.V Z.V).hom :=
326+
begin
327+
dsimp [monoidal.transport_associator],
328+
simp,
329+
end
330+
@[simp] lemma associator_inv_hom {X Y Z : Action V G} :
331+
hom.hom (α_ X Y Z).inv = (α_ X.V Y.V Z.V).inv :=
332+
begin
333+
dsimp [monoidal.transport_associator],
334+
simp,
335+
end
336+
@[simp] lemma left_unitor_hom_hom {X : Action V G} :
337+
hom.hom (λ_ X).hom = (λ_ X.V).hom :=
338+
begin
339+
dsimp [monoidal.transport_left_unitor],
340+
simp,
341+
end
342+
@[simp] lemma left_unitor_inv_hom {X : Action V G} :
343+
hom.hom (λ_ X).inv = (λ_ X.V).inv :=
344+
begin
345+
dsimp [monoidal.transport_left_unitor],
346+
simp,
347+
end
348+
@[simp] lemma right_unitor_hom_hom {X : Action V G} :
349+
hom.hom (ρ_ X).hom = (ρ_ X.V).hom :=
350+
begin
351+
dsimp [monoidal.transport_right_unitor],
352+
simp,
353+
end
354+
@[simp] lemma right_unitor_inv_hom {X : Action V G} :
355+
hom.hom (ρ_ X).inv = (ρ_ X.V).inv :=
356+
begin
357+
dsimp [monoidal.transport_right_unitor],
358+
simp,
359+
end
360+
293361
variables (V G)
294362

295363
/-- When `V` is monoidal the forgetful functor `Action V G` to `V` is monoidal. -/
@@ -302,20 +370,35 @@ def forget_monoidal : monoidal_functor (Action V G) V :=
302370
instance forget_monoidal_faithful : faithful (forget_monoidal V G).to_functor :=
303371
by { change faithful (forget V G), apply_instance, }
304372

305-
instance [braided_category V] : braided_category (Action V G) :=
373+
section
374+
variables [braided_category V]
375+
376+
instance : braided_category (Action V G) :=
306377
braided_category_of_faithful (forget_monoidal V G) (λ X Y, mk_iso (β_ _ _) (by tidy)) (by tidy)
307378

308379
/-- When `V` is braided the forgetful functor `Action V G` to `V` is braided. -/
309380
@[simps]
310-
def forget_braided [braided_category V] : braided_functor (Action V G) V :=
381+
def forget_braided : braided_functor (Action V G) V :=
311382
{ ..forget_monoidal _ _, }
312383

313-
instance forget_braided_faithful [braided_category V] : faithful (forget_braided V G).to_functor :=
384+
instance forget_braided_faithful : faithful (forget_braided V G).to_functor :=
314385
by { change faithful (forget V G), apply_instance, }
315386

387+
end
388+
316389
instance [symmetric_category V] : symmetric_category (Action V G) :=
317390
symmetric_category_of_faithful (forget_braided V G)
318391

392+
variables [preadditive V] [monoidal_preadditive V]
393+
394+
local attribute [simp] monoidal_preadditive.tensor_add monoidal_preadditive.add_tensor
395+
396+
instance : monoidal_preadditive (Action V G) := {}
397+
398+
variables {R : Type*} [semiring R] [linear R V] [monoidal_linear R V]
399+
400+
instance : monoidal_linear R (Action V G) := {}
401+
319402
end monoidal
320403

321404
/-- Actions/representations of the trivial group are just objects in the ambient category. -/
@@ -365,6 +448,14 @@ attribute [simps] res_comp
365448
-- TODO promote `res` to a pseudofunctor from
366449
-- the locally discrete bicategory constructed from `Monᵒᵖ` to `Cat`, sending `G` to `Action V G`.
367450

451+
variables {G} {H : Mon.{u}} (f : G ⟶ H)
452+
453+
instance res_additive [preadditive V] : (res V f).additive := {}
454+
455+
variables {R : Type*} [semiring R]
456+
457+
instance res_linear [preadditive V] [linear R V] : (res V f).linear R := {}
458+
368459
end Action
369460

370461
namespace category_theory.functor
@@ -387,4 +478,12 @@ def map_Action (F : V ⥤ W) (G : Mon.{u}) : Action V G ⥤ Action W G :=
387478
map_id' := λ M, by { ext, simp only [Action.id_hom, F.map_id], },
388479
map_comp' := λ M N P f g, by { ext, simp only [Action.comp_hom, F.map_comp], }, }
389480

481+
variables (F : V ⥤ W) (G : Mon.{u}) [preadditive V] [preadditive W]
482+
483+
instance map_Action_preadditive [F.additive] : (F.map_Action G).additive := {}
484+
485+
variables {R : Type*} [semiring R] [category_theory.linear R V] [category_theory.linear R W]
486+
487+
instance map_Action_linear [F.additive] [F.linear R] : (F.map_Action G).linear R := {}
488+
390489
end category_theory.functor

src/representation_theory/Rep.lean

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Also `V.ρ` gives the homomorphism `G →* (V →ₗ[k] V)`.
1818
Conversely, given a homomorphism `ρ : G →* (V →ₗ[k] V)`,
1919
you can construct the bundled representation as `Rep.of ρ`.
2020
21-
We verify that `Rep k G` is an abelian symmetric monoidal category with all (co)limits.
21+
We verify that `Rep k G` is a `k`-linear abelian symmetric monoidal category with all (co)limits.
2222
-/
2323

2424
universes u
@@ -27,10 +27,14 @@ open category_theory
2727
open category_theory.limits
2828

2929
/-- The category of `k`-linear representations of a monoid `G`. -/
30-
@[derive [large_category, concrete_category, has_limits, has_colimits, abelian]]
30+
@[derive [large_category, concrete_category, has_limits, has_colimits,
31+
preadditive, abelian]]
3132
abbreviation Rep (k G : Type u) [ring k] [monoid G] :=
3233
Action (Module.{u} k) (Mon.of G)
3334

35+
instance (k G : Type u) [comm_ring k] [monoid G] : linear k (Rep k G) :=
36+
by apply_instance
37+
3438
namespace Rep
3539

3640
variables {k G : Type u} [ring k] [monoid G]
@@ -64,5 +68,7 @@ variables {k G : Type u} [comm_ring k] [monoid G]
6468

6569
-- Verify that the symmetric monoidal structure is available.
6670
example : symmetric_category (Rep k G) := by apply_instance
71+
example : monoidal_preadditive (Rep k G) := by apply_instance
72+
example : monoidal_linear k (Rep k G) := by apply_instance
6773

6874
end Rep

0 commit comments

Comments
 (0)