Skip to content

Commit 3741129

Browse files
feat(RepresentationTheory/Action): Create representation from Action, second step of refactor Rep (#36341)
1 parent f07649f commit 3741129

File tree

4 files changed

+482
-0
lines changed

4 files changed

+482
-0
lines changed

Mathlib.lean

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6034,11 +6034,13 @@ public import Mathlib.Probability.Process.Stopping
60346034
public import Mathlib.Probability.ProductMeasure
60356035
public import Mathlib.Probability.StrongLaw
60366036
public import Mathlib.Probability.UniformOn
6037+
public import Mathlib.RepresentationTheory.Action
60376038
public import Mathlib.RepresentationTheory.AlgebraRepresentation.Basic
60386039
public import Mathlib.RepresentationTheory.Basic
60396040
public import Mathlib.RepresentationTheory.Character
60406041
public import Mathlib.RepresentationTheory.Coinduced
60416042
public import Mathlib.RepresentationTheory.Coinvariants
6043+
public import Mathlib.RepresentationTheory.Equiv
60426044
public import Mathlib.RepresentationTheory.FDRep
60436045
public import Mathlib.RepresentationTheory.FinGroupCharZero
60446046
public import Mathlib.RepresentationTheory.FiniteIndex
Lines changed: 279 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,279 @@
1+
/-
2+
Copyright (c) 2026 Yunzhou Xie. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Yunzhou Xie
5+
-/
6+
module
7+
8+
public import Mathlib.RepresentationTheory.Intertwining
9+
public import Mathlib.CategoryTheory.Action.Monoidal
10+
11+
/-!
12+
13+
## Main Purpose
14+
This file is the preliminary for the `linearize` functor from `Action (Type w) G` to `Rep k G`,
15+
constructing the functor from the `Representation` would reduce the amount of DefEq abuses that we
16+
currently are doing in the `Rep` file.
17+
18+
TODO (Edison) : Refactor `Rep` to be a concrete category of `Representation` and
19+
reconstruct the current `lineaization` functor using this file.
20+
21+
-/
22+
23+
universe w w' u u' v v'
24+
@[expose] public section
25+
namespace Representation
26+
27+
open Representation.IntertwiningMap Representation.TensorProduct
28+
29+
noncomputable section
30+
31+
variable {k : Type u} {G : Type v} {V : Type u'} {W : Type v'} [Monoid G] [Semiring k]
32+
[AddCommGroup V] [Module k V] [AddCommGroup W] [Module k W]
33+
{σ : Representation k G V} {ρ : Representation k G W} {X Y Z : Action (Type w) G}
34+
35+
open CategoryTheory
36+
37+
variable (k G X) in
38+
/-- Every Set `X` that has a `G`-action on it can be made into a `G`-rep by using `X →₀ k` as
39+
the base module and `G`-action on it is induced by the `G`-action on `X`. -/
40+
@[simps]
41+
def linearize : Representation k G (X.V →₀ k) where
42+
toFun g := Finsupp.lmapDomain k k (X.ρ g)
43+
map_one' := by ext; simp
44+
map_mul' _ _ := by ext; simp
45+
46+
lemma linearize_single (g : G) (x : X.V) :
47+
linearize k G X g (Finsupp.single x 1) = Finsupp.single (X.ρ g x) 1 := by
48+
simp
49+
50+
set_option backward.isDefEq.respectTransparency false in
51+
/-- Every morphism between `G`-sets could be made into an intertwining map between
52+
`Representation`s by the linear map induced on the indexing sets. -/
53+
def linearizeMap (f : X ⟶ Y) : IntertwiningMap (A := k) (linearize k G X) (linearize k G Y) where
54+
__ := Finsupp.lmapDomain k k f.hom
55+
isIntertwining' g := by ext x y; simp [(congr($(f.comm g) x) : f.hom (X.ρ g x) = Y.ρ g (f.hom x))]
56+
57+
@[simp]
58+
lemma linearizeMap_single (f : X ⟶ Y) (x : X.V) :
59+
(linearizeMap f).toLinearMap (Finsupp.single x (1 : k)) = Finsupp.single (f.hom x) 1 := by
60+
simp [linearizeMap]
61+
62+
lemma linearizeMap_toLinearMap (f : X ⟶ Y) :
63+
(linearizeMap f).toLinearMap = Finsupp.lmapDomain k k f.hom := rfl
64+
65+
namespace LinearizeMonoidal
66+
67+
open scoped MonoidalCategory
68+
69+
attribute [local simp] types_tensorObj_def types_tensorUnit_def
70+
71+
-- These two unification hints are to help lean understand the underlying types of these actions
72+
-- which it fails without them because `types` abuses defeq.
73+
unif_hint (X Y : Action (Type w) G) where ⊢ (X ⊗ Y).V ≟ X.V × Y.V
74+
unif_hint where ⊢ (𝟙_ (Action (Type w) G)).V ≟ PUnit
75+
76+
lemma _root_.Action.tensor_ρ_apply (g : G) (xy : (X ⊗ Y).V) :
77+
(X ⊗ Y).ρ g xy = (X.ρ g xy.1, Y.ρ g xy.2) := rfl
78+
79+
set_option backward.isDefEq.respectTransparency false in
80+
variable (k G) in
81+
-- I could use `Action.trivial G (PUnit)` but that's not reducibly equal to the tensor unit
82+
/-- The counit of the linearize functor. -/
83+
@[simps toLinearMap]
84+
def ε : (trivial k G k).IntertwiningMap (linearize k G (MonoidalCategoryStruct.tensorUnit
85+
(Action (Type w) G))) where
86+
__ := Finsupp.LinearEquiv.finsuppUnique k k PUnit|>.symm.toLinearMap
87+
isIntertwining' g := by ext1; simp [linearize_single _]
88+
89+
lemma ε_one : ε k G 1 = Finsupp.single PUnit.unit 1 := by
90+
simp [← toLinearMap_apply, types_tensorUnit_def]
91+
92+
open scoped MonoidalCategory
93+
94+
variable (k G) in
95+
/-- The unit of the linearize functor. -/
96+
@[simps toLinearMap]
97+
def η : (linearize k G (𝟙_ (Action (Type u) G))).IntertwiningMap (trivial k G k) where
98+
__ := (Finsupp.LinearEquiv.finsuppUnique k k PUnit).toLinearMap
99+
isIntertwining' g := by ext; simp [linearize_single _]
100+
101+
lemma η_single (x : PUnit) : η k G (Finsupp.single x 1) = 1 := by
102+
simp [← toLinearMap_apply, types_tensorUnit_def]
103+
104+
variable (k G) in
105+
lemma ε : (ε k G).comp (η k G) = .id _ := by ext; simp
106+
107+
variable (k G) in
108+
lemma η : (η k G).comp (ε k G) = .id _ := by ext; simp
109+
110+
section comm
111+
112+
open scoped MonoidalCategory
113+
114+
variable {k : Type u} [CommSemiring k] [Module k V] [Module k W] {σ : Representation k G V}
115+
{ρ : Representation k G W}
116+
117+
variable (X Y) in
118+
/-- The tensor (multiplication) of the linearize functor. -/
119+
@[simps toLinearMap]
120+
def μ : ((linearize k G X).tprod (linearize k G Y)).IntertwiningMap
121+
(linearize k G (X ⊗ Y)) where
122+
__ := finsuppTensorFinsupp' k X.V Y.V
123+
isIntertwining' g := by ext; simp [linearize_single _, Action.tensor_ρ_apply _]
124+
125+
lemma μ_apply_single_single (x : X.V) (y : Y.V) :
126+
μ (k := k) X Y (Finsupp.single x 1 ⊗ₜ Finsupp.single y 1) = Finsupp.single (x, y) 1 := by
127+
ext; simp [← toLinearMap_apply]
128+
129+
open TensorProduct in
130+
lemma μ_apply_apply (l1 : X.V →₀ k) (l2 : Y.V →₀ k) (xy : (X ⊗ Y).V) :
131+
μ X Y (l1 ⊗ₜ l2) xy = l1 xy.1 * l2 xy.2 := by
132+
simp [← toLinearMap_apply, types_tensorObj_def, finsuppTensorFinsupp'_apply_apply _]
133+
134+
lemma μ_comp_rTensor (f : X ⟶ Y) (Z : Action (Type w) G) :
135+
(μ Y Z).comp (rTensor (linearize k G Z) (linearizeMap f)) =
136+
(linearizeMap (f ▷ Z)).comp (μ X Z) := by
137+
ext; simp [linearizeMap_single _]
138+
139+
lemma μ_comp_lTensor (f : X ⟶ Y) (Z : Action (Type w) G) :
140+
(μ Z Y).comp ((linearizeMap f).lTensor (linearize k G Z)) =
141+
(linearizeMap (Z ◁ f)).comp (μ Z X) := by
142+
ext : 6; simp [linearizeMap_single _]
143+
144+
variable (X Y Z) in
145+
set_option backward.isDefEq.respectTransparency false in
146+
lemma μ_comp_assoc : ((linearizeMap (α_ X Y Z).hom).comp
147+
(μ (X ⊗ Y) Z)).comp ((μ X Y).rTensor (linearize k G Z)) = ((μ X (Y ⊗ Z)).comp
148+
((μ Y Z).lTensor (linearize k G X))).comp (assoc (linearize k G X) (linearize k G Y)
149+
(linearize k G Z)).toIntertwiningMap := by
150+
ext x y z : 9
151+
-- experiment with monoidal structure of `Action` on `Type`
152+
simp only [Action.tensorObj_V, types_tensorObj_def, comp_toLinearMap, μ_toLinearMap,
153+
toLinearMap_rTensor, LinearMap.coe_comp, Function.comp_apply, Finsupp.lsingle_apply,
154+
TensorProduct.AlgebraTensorModule.curry_apply, LinearMap.restrictScalars_self,
155+
TensorProduct.curry_apply, LinearEquiv.coe_coe, LinearMap.rTensor_tmul,
156+
finsuppTensorFinsupp'_single_tmul_single, mul_one, toLinearMap_lTensor, toLinearMap_assoc,
157+
TensorProduct.assoc_tmul, LinearMap.lTensor_tmul]
158+
-- after fixing the defeq problems in `Action` and in the monoidal category structure of `types`
159+
-- this line should close the goal so this is left as an indicator.
160+
with_reducible convert linearizeMap_single (α_ X Y Z).hom ((x, y), z)
161+
with_reducible simp only [Action.tensorObj_V, types_tensorObj_def, Action.associator_hom_hom]
162+
with_reducible refine Prod.ext ?_ (Prod.ext ?_ ?_)
163+
<;> with_reducible simp
164+
165+
variable (X) in
166+
lemma μ_leftUnitor : (lid k (linearize k G X)).toIntertwiningMap =
167+
((linearizeMap (λ_ X).hom).comp (μ (𝟙_ (Action (Type w) G)) X)).comp (rTensor
168+
(linearize k G X) (ε k G)) := by
169+
ext x1 : 5
170+
simpa [types_tensorObj_def, types_tensorUnit_def] using
171+
linearizeMap_single (k := k) (λ_ X).hom (PUnit.unit, x1) |>.symm
172+
173+
variable (X) in
174+
set_option backward.isDefEq.respectTransparency false in
175+
lemma μ_rightUnitor : (rid k (linearize k G X)).toIntertwiningMap =
176+
((linearizeMap (ρ_ X).hom).comp (μ X (𝟙_ (Action (Type w) G)))).comp ((ε k G).lTensor
177+
(linearize k G X)) := by
178+
ext x; simp [types_tensorObj_def, types_tensorUnit_def, Action.tensorObj_V, linearizeMap,
179+
Action.rightUnitor_hom_hom, rightUnitor_hom_apply (p := PUnit.unit)]
180+
181+
variable (X Y) in
182+
/-- The comultiplication of the linearize functor. -/
183+
def δ : (linearize k G (X ⊗ Y)).IntertwiningMap
184+
((linearize k G X).tprod (linearize k G Y)) where
185+
__ := (finsuppTensorFinsupp' k X.V Y.V).symm
186+
isIntertwining' g := by
187+
ext; simp [types_tensorObj_def, linearize_single _, Action.tensor_ρ_apply g,
188+
finsuppTensorFinsupp'_symm_single_eq_single_one_tmul k]
189+
190+
set_option backward.isDefEq.respectTransparency false in
191+
lemma δ_apply_single (xy : (X ⊗ Y).V) :
192+
(δ (k := k) X Y).toLinearMap (Finsupp.single xy 1) = Finsupp.single xy.1 1 ⊗ₜ
193+
Finsupp.single xy.2 1 := by
194+
simp [δ, finsuppTensorFinsupp'_symm_single_eq_single_one_tmul k]
195+
196+
variable (Z) in
197+
lemma rTensor_comp_δ (f : X ⟶ Y) :
198+
((linearizeMap f).rTensor (linearize k G Z)).comp (δ X Z) =
199+
(δ Y Z).comp (linearizeMap (f ▷ Z)) := by
200+
ext;
201+
simp [linearizeMap_single _, δ_apply_single _]
202+
203+
variable (Z) in
204+
lemma lTensor_comp_δ (f : X ⟶ Y) :
205+
((linearizeMap f).lTensor (linearize k G Z)).comp (δ Z X) =
206+
(δ Z Y).comp (linearizeMap (Z ◁ f)) := by
207+
ext; simp [linearizeMap_single _, δ_apply_single _]
208+
209+
variable (X Y Z) in
210+
lemma assoc_comp_δ : ((assoc (linearize k G X) (linearize k G Y)
211+
(linearize k G Z)).toIntertwiningMap.comp ((δ X Y).rTensor (linearize k G Z))).comp
212+
(δ (X ⊗ Y) Z) = (((δ Y Z).lTensor (linearize k G X)).comp (δ X (Y ⊗ Z))).comp
213+
(linearizeMap (α_ X Y Z).hom) := by
214+
ext
215+
-- TODO : try not to `simp` with `δ` and `linearizeMap` directly here
216+
simp [linearizeMap, δ, finsuppTensorFinsupp'_symm_single_eq_single_one_tmul k]
217+
218+
lemma leftUnitor_δ (X : Action (Type u) G) : (lid k (linearize k G X)).symm.toIntertwiningMap =
219+
(((η k G).rTensor (linearize k G X) ).comp (δ (𝟙_ (Action (Type u) G)) X)).comp
220+
(linearizeMap (λ_ X).inv) := by
221+
ext
222+
-- TODO : try not to `simp` with `δ` and `linearizeMap` directly here
223+
simp [linearizeMap, δ, finsuppTensorFinsupp'_symm_single_eq_single_one_tmul]
224+
225+
unif_hint (X : Action (Type u) G) where ⊢ (X ⊗ 𝟙_ (Action (Type u) G)).V ≟ X.V × PUnit in
226+
lemma rightUnitor_δ (X : Action (Type u) G) : (rid k (linearize k G X)).symm.toIntertwiningMap =
227+
(((η k G).lTensor (linearize k G X)).comp (δ X (𝟙_ (Action (Type u) G)))).comp
228+
(linearizeMap (ρ_ X).inv) := by
229+
ext; simp [linearizeMap_single _, δ_apply_single _]
230+
231+
variable (X Y) in
232+
lemma μ : (μ X Y).comp (δ (k := k) X Y) = .id _ := by
233+
ext; simp [δ_apply_single _]
234+
235+
variable (X Y) in
236+
lemma δ : (δ X Y).comp (μ (k := k) X Y) = .id _ := by
237+
ext; simp [δ_apply_single _]
238+
239+
end comm
240+
241+
lemma linearizeTrivial_def (X : Type w) (g : G) :
242+
linearize k G (Action.trivial _ X) g = LinearMap.id := by
243+
ext (x : X) : 2
244+
rw [LinearMap.comp_apply, LinearMap.id_comp, Finsupp.lsingle_apply, linearize_single]
245+
simp only [Action.trivial_V, Action.trivial_ρ]
246+
rfl
247+
248+
variable (k G) in
249+
/-- This a type-changing equivalence (which requires a non-trivial proof that
250+
`LinearEquiv.refl _ _` is `G`-equivariant) to avoid abusing defeq. -/
251+
def linearizeTrivialIso (X : Type w) : (linearize k G (Action.trivial _ X)).Equiv
252+
(trivial k G (X →₀ k)) :=
253+
.mk (LinearEquiv.refl _ _) fun g ↦ by
254+
simpa using linearizeTrivial_def (k := k) X g
255+
256+
open CategoryTheory
257+
lemma linearizeTrivialIso_apply {X : Type w} (f : (Action.trivial _ X).V →₀ k) :
258+
(linearizeTrivialIso k G X) f = f := rfl
259+
260+
lemma linearizeTrivialIso_symm_apply {X : Type w} (f : X →₀ k) :
261+
(linearizeTrivialIso k G X).symm f = f := rfl
262+
263+
variable (k G) in
264+
/-- This a type-changing equivalence to avoid abusing defeq. -/
265+
def linearizeOfMulActionIso (H : Type w) [MulAction G H] :
266+
(linearize k G (Action.ofMulAction G H)).Equiv (ofMulAction k G H) :=
267+
.mk (LinearEquiv.refl _ _) fun g ↦ by rfl
268+
269+
variable (k G) in
270+
/-- This a type-changing equivalence to avoid abusing defeq. -/
271+
def linearizeDiagonalEquiv (n : ℕ) : (linearize k G (Action.diagonal G n)).Equiv
272+
(diagonal k G n) :=
273+
.mk (LinearEquiv.refl _ _) fun g ↦ by rfl
274+
275+
end LinearizeMonoidal
276+
277+
end
278+
279+
end Representation

0 commit comments

Comments
 (0)