Datasets:
Tasks:
Text Generation
Modalities:
Text
Sub-tasks:
language-modeling
Languages:
English
Size:
100K - 1M
License:
File size: 13,817 Bytes
4365a98 fc5e983 4365a98 fc5e983 4365a98 fc5e983 4365a98 fc5e983 4365a98 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 |
/-
Copyright (c) 2022 Antoine Labelle. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Antoine Labelle
-/
import algebra.module.basic
import algebra.module.linear_map
import algebra.monoid_algebra.basic
import linear_algebra.trace
import linear_algebra.dual
import linear_algebra.free_module.basic
/-!
# Monoid representations
This file introduces monoid representations and their characters and defines a few ways to construct
representations.
## Main definitions
* representation.representation
* representation.character
* representation.tprod
* representation.lin_hom
* represensation.dual
## Implementation notes
Representations of a monoid `G` on a `k`-module `V` are implemented as
homomorphisms `G →* (V →ₗ[k] V)`.
-/
open monoid_algebra (lift) (of)
open linear_map
section
variables (k G V : Type*) [comm_semiring k] [monoid G] [add_comm_monoid V] [module k V]
/--
A representation of `G` on the `k`-module `V` is an homomorphism `G →* (V →ₗ[k] V)`.
-/
abbreviation representation := G →* (V →ₗ[k] V)
end
namespace representation
section trivial
variables {k G V : Type*} [comm_semiring k] [monoid G] [add_comm_monoid V] [module k V]
/--
The trivial representation of `G` on the one-dimensional module `k`.
-/
def trivial : representation k G k := 1
@[simp]
lemma trivial_def (g : G) (v : k) : trivial g v = v := rfl
end trivial
section monoid_algebra
variables {k G V : Type*} [comm_semiring k] [monoid G] [add_comm_monoid V] [module k V]
variables (ρ : representation k G V)
/--
A `k`-linear representation of `G` on `V` can be thought of as
an algebra map from `monoid_algebra k G` into the `k`-linear endomorphisms of `V`.
-/
noncomputable def as_algebra_hom : monoid_algebra k G →ₐ[k] (module.End k V) :=
(lift k G _) ρ
lemma as_algebra_hom_def : as_algebra_hom ρ = (lift k G _) ρ :=
rfl
@[simp]
lemma as_algebra_hom_single (g : G) (r : k) :
(as_algebra_hom ρ (finsupp.single g r)) = r • ρ g :=
by simp only [as_algebra_hom_def, monoid_algebra.lift_single]
lemma as_algebra_hom_single_one (g : G):
(as_algebra_hom ρ (finsupp.single g 1)) = ρ g :=
by simp
lemma as_algebra_hom_of (g : G) :
(as_algebra_hom ρ (of k G g)) = ρ g :=
by simp only [monoid_algebra.of_apply, as_algebra_hom_single, one_smul]
/--
If `ρ : representation k G V`, then `ρ.as_module` is a type synonym for `V`,
which we equip with an instance `module (monoid_algebra k G) ρ.as_module`.
You should use `as_module_equiv : ρ.as_module ≃+ V` to translate terms.
-/
@[nolint unused_arguments, derive [add_comm_monoid, module (module.End k V)]]
def as_module (ρ : representation k G V) := V
instance : inhabited ρ.as_module := ⟨0⟩
/--
A `k`-linear representation of `G` on `V` can be thought of as
a module over `monoid_algebra k G`.
-/
noncomputable instance as_module_module : module (monoid_algebra k G) ρ.as_module :=
module.comp_hom V (as_algebra_hom ρ).to_ring_hom
/--
The additive equivalence from the `module (monoid_algebra k G)` to the original vector space
of the representative.
This is just the identity, but it is helpful for typechecking and keeping track of instances.
-/
def as_module_equiv : ρ.as_module ≃+ V :=
add_equiv.refl _
@[simp]
lemma as_module_equiv_map_smul (r : monoid_algebra k G) (x : ρ.as_module) :
ρ.as_module_equiv (r • x) = ρ.as_algebra_hom r (ρ.as_module_equiv x) :=
rfl
@[simp]
lemma as_module_equiv_symm_map_smul (r : k) (x : V) :
ρ.as_module_equiv.symm (r • x) =
algebra_map k (monoid_algebra k G) r • (ρ.as_module_equiv.symm x) :=
begin
apply_fun ρ.as_module_equiv,
simp,
end
@[simp]
lemma as_module_equiv_symm_map_rho (g : G) (x : V) :
ρ.as_module_equiv.symm (ρ g x) = monoid_algebra.of k G g • (ρ.as_module_equiv.symm x) :=
begin
apply_fun ρ.as_module_equiv,
simp,
end
/--
Build a `representation k G M` from a `[module (monoid_algebra k G) M]`.
This version is not always what we want, as it relies on an existing `[module k M]`
instance, along with a `[is_scalar_tower k (monoid_algebra k G) M]` instance.
We remedy this below in `of_module`
(with the tradeoff that the representation is defined
only on a type synonym of the original module.)
-/
noncomputable
def of_module' (M : Type*) [add_comm_monoid M] [module k M] [module (monoid_algebra k G) M]
[is_scalar_tower k (monoid_algebra k G) M] : representation k G M :=
(monoid_algebra.lift k G (M →ₗ[k] M)).symm (algebra.lsmul k M)
section
variables (k G) (M : Type*) [add_comm_monoid M] [module (monoid_algebra k G) M]
/--
Build a `representation` from a `[module (monoid_algebra k G) M]`.
Note that the representation is built on `restrict_scalars k (monoid_algebra k G) M`,
rather than on `M` itself.
-/
noncomputable
def of_module :
representation k G (restrict_scalars k (monoid_algebra k G) M) :=
(monoid_algebra.lift k G
(restrict_scalars k (monoid_algebra k G) M →ₗ[k] restrict_scalars k (monoid_algebra k G) M)).symm
(restrict_scalars.lsmul k (monoid_algebra k G) M)
/-!
## `of_module` and `as_module` are inverses.
This requires a little care in both directions:
this is a categorical equivalence, not an isomorphism.
See `Rep.equivalence_Module_monoid_algebra` for the full statement.
Starting with `ρ : representation k G V`, converting to a module and back again
we have a `representation k G (restrict_scalars k (monoid_algebra k G) ρ.as_module)`.
To compare these, we use the composition of `restrict_scalars_add_equiv` and `ρ.as_module_equiv`.
Similarly, starting with `module (monoid_algebra k G) M`,
after we convert to a representation and back to a module,
we have `module (monoid_algebra k G) (restrict_scalars k (monoid_algebra k G) M)`.
-/
@[simp] lemma of_module_as_algebra_hom_apply_apply
(r : monoid_algebra k G) (m : restrict_scalars k (monoid_algebra k G) M) :
((((of_module k G M).as_algebra_hom) r) m) =
(restrict_scalars.add_equiv _ _ _).symm (r • restrict_scalars.add_equiv _ _ _ m) :=
begin
apply monoid_algebra.induction_on r,
{ intros g,
simp only [one_smul, monoid_algebra.lift_symm_apply, monoid_algebra.of_apply,
representation.as_algebra_hom_single, representation.of_module,
add_equiv.apply_eq_iff_eq, restrict_scalars.lsmul_apply_apply], },
{ intros f g fw gw,
simp only [fw, gw, map_add, add_smul, linear_map.add_apply], },
{ intros r f w,
simp only [w, alg_hom.map_smul, linear_map.smul_apply,
restrict_scalars.add_equiv_symm_map_smul_smul], }
end
@[simp]
lemma of_module_as_module_act (g : G) (x : restrict_scalars k (monoid_algebra k G) ρ.as_module) :
of_module k G (ρ.as_module) g x =
(restrict_scalars.add_equiv _ _ _).symm ((ρ.as_module_equiv).symm
(ρ g (ρ.as_module_equiv (restrict_scalars.add_equiv _ _ _ x)))) :=
begin
apply_fun restrict_scalars.add_equiv _ _ ρ.as_module using
(restrict_scalars.add_equiv _ _ _).injective,
dsimp [of_module, restrict_scalars.lsmul_apply_apply],
simp,
end
lemma smul_of_module_as_module (r : monoid_algebra k G)
(m : (of_module k G M).as_module) :
(restrict_scalars.add_equiv _ _ _) ((of_module k G M).as_module_equiv (r • m)) =
r • (restrict_scalars.add_equiv _ _ _) ((of_module k G M).as_module_equiv m) :=
by { dsimp, simp only [add_equiv.apply_symm_apply, of_module_as_algebra_hom_apply_apply], }
end
end monoid_algebra
section add_comm_group
variables {k G V : Type*} [comm_ring k] [monoid G] [I : add_comm_group V] [module k V]
variables (ρ : representation k G V)
instance : add_comm_group ρ.as_module := I
end add_comm_group
section mul_action
variables (k : Type*) [comm_semiring k] (G : Type*) [monoid G] (H : Type*) [mul_action G H]
/-- A `G`-action on `H` induces a representation `G →* End(k[H])` in the natural way. -/
noncomputable def of_mul_action : representation k G (H →₀ k) :=
{ to_fun := λ g, finsupp.lmap_domain k k ((•) g),
map_one' := by { ext x y, dsimp, simp },
map_mul' := λ x y, by { ext z w, simp [mul_smul] }}
variables {k G H}
lemma of_mul_action_def (g : G) : of_mul_action k G H g = finsupp.lmap_domain k k ((•) g) := rfl
end mul_action
section group
variables {k G V : Type*} [comm_semiring k] [group G] [add_comm_monoid V] [module k V]
variables (ρ : representation k G V)
@[simp] lemma of_mul_action_apply {H : Type*} [mul_action G H]
(g : G) (f : H →₀ k) (h : H) : of_mul_action k G H g f h = f (g⁻¹ • h) :=
begin
conv_lhs { rw ← smul_inv_smul g h, },
let h' := g⁻¹ • h,
change of_mul_action k G H g f (g • h') = f h',
have hg : function.injective ((•) g : H → H), { intros h₁ h₂, simp, },
simp only [of_mul_action_def, finsupp.lmap_domain_apply, finsupp.map_domain_apply, hg],
end
lemma of_mul_action_self_smul_eq_mul
(x : monoid_algebra k G) (y : (of_mul_action k G G).as_module) :
x • y = (x * y : monoid_algebra k G) :=
x.induction_on (λ g, by show as_algebra_hom _ _ _ = _; ext; simp)
(λ x y hx hy, by simp only [hx, hy, add_mul, add_smul])
(λ r x hx, by show as_algebra_hom _ _ _ = _; simpa [←hx])
/-- If we equip `k[G]` with the `k`-linear `G`-representation induced by the left regular action of
`G` on itself, the resulting object is isomorphic as a `k[G]`-module to `k[G]` with its natural
`k[G]`-module structure. -/
@[simps] noncomputable def of_mul_action_self_as_module_equiv :
(of_mul_action k G G).as_module ≃ₗ[monoid_algebra k G] monoid_algebra k G :=
{ map_smul' := of_mul_action_self_smul_eq_mul, ..as_module_equiv _ }
/--
When `G` is a group, a `k`-linear representation of `G` on `V` can be thought of as
a group homomorphism from `G` into the invertible `k`-linear endomorphisms of `V`.
-/
def as_group_hom : G →* units (V →ₗ[k] V) :=
monoid_hom.to_hom_units ρ
lemma as_group_hom_apply (g : G) : ↑(as_group_hom ρ g) = ρ g :=
by simp only [as_group_hom, monoid_hom.coe_to_hom_units]
end group
section tensor_product
variables {k G V W : Type*} [comm_semiring k] [monoid G]
variables [add_comm_monoid V] [module k V] [add_comm_monoid W] [module k W]
variables (ρV : representation k G V) (ρW : representation k G W)
open_locale tensor_product
/--
Given representations of `G` on `V` and `W`, there is a natural representation of `G` on their
tensor product `V ⊗[k] W`.
-/
def tprod : representation k G (V ⊗[k] W) :=
{ to_fun := λ g, tensor_product.map (ρV g) (ρW g),
map_one' := by simp only [map_one, tensor_product.map_one],
map_mul' := λ g h, by simp only [map_mul, tensor_product.map_mul] }
local notation ρV ` ⊗ ` ρW := tprod ρV ρW
@[simp]
lemma tprod_apply (g : G) : (ρV ⊗ ρW) g = tensor_product.map (ρV g) (ρW g) := rfl
lemma smul_tprod_one_as_module (r : monoid_algebra k G) (x : V) (y : W) :
(r • (x ⊗ₜ y) : (ρV.tprod 1).as_module) = (r • x : ρV.as_module) ⊗ₜ y :=
begin
show as_algebra_hom _ _ _ = as_algebra_hom _ _ _ ⊗ₜ _,
simp only [as_algebra_hom_def, monoid_algebra.lift_apply,
tprod_apply, monoid_hom.one_apply, linear_map.finsupp_sum_apply,
linear_map.smul_apply, tensor_product.map_tmul, linear_map.one_apply],
simp only [finsupp.sum, tensor_product.sum_tmul],
refl,
end
lemma smul_one_tprod_as_module (r : monoid_algebra k G) (x : V) (y : W) :
(r • (x ⊗ₜ y) : ((1 : representation k G V).tprod ρW).as_module) = x ⊗ₜ (r • y : ρW.as_module) :=
begin
show as_algebra_hom _ _ _ = _ ⊗ₜ as_algebra_hom _ _ _,
simp only [as_algebra_hom_def, monoid_algebra.lift_apply,
tprod_apply, monoid_hom.one_apply, linear_map.finsupp_sum_apply,
linear_map.smul_apply, tensor_product.map_tmul, linear_map.one_apply],
simp only [finsupp.sum, tensor_product.tmul_sum, tensor_product.tmul_smul],
end
end tensor_product
section linear_hom
variables {k G V W : Type*} [comm_semiring k] [group G]
variables [add_comm_monoid V] [module k V] [add_comm_monoid W] [module k W]
variables (ρV : representation k G V) (ρW : representation k G W)
/--
Given representations of `G` on `V` and `W`, there is a natural representation of `G` on the
module `V →ₗ[k] W`, where `G` acts by conjugation.
-/
def lin_hom : representation k G (V →ₗ[k] W) :=
{ to_fun := λ g,
{ to_fun := λ f, (ρW g) ∘ₗ f ∘ₗ (ρV g⁻¹),
map_add' := λ f₁ f₂, by simp_rw [add_comp, comp_add],
map_smul' := λ r f, by simp_rw [ring_hom.id_apply, smul_comp, comp_smul]},
map_one' := linear_map.ext $ λ x,
by simp_rw [coe_mk, inv_one, map_one, one_apply, one_eq_id, comp_id, id_comp],
map_mul' := λ g h, linear_map.ext $ λ x,
by simp_rw [coe_mul, coe_mk, function.comp_apply, mul_inv_rev, map_mul, mul_eq_comp,
comp_assoc ]}
@[simp]
lemma lin_hom_apply (g : G) (f : V →ₗ[k] W) : (lin_hom ρV ρW) g f = (ρW g) ∘ₗ f ∘ₗ (ρV g⁻¹) := rfl
/--
The dual of a representation `ρ` of `G` on a module `V`, given by `(dual ρ) g f = f ∘ₗ (ρ g⁻¹)`,
where `f : module.dual k V`.
-/
def dual : representation k G (module.dual k V) :=
{ to_fun := λ g,
{ to_fun := λ f, f ∘ₗ (ρV g⁻¹),
map_add' := λ f₁ f₂, by simp only [add_comp],
map_smul' := λ r f,
by {ext, simp only [coe_comp, function.comp_app, smul_apply, ring_hom.id_apply]} },
map_one' :=
by {ext, simp only [coe_comp, function.comp_app, map_one, inv_one, coe_mk, one_apply]},
map_mul' := λ g h,
by {ext, simp only [coe_comp, function.comp_app, mul_inv_rev, map_mul, coe_mk, mul_apply]}}
@[simp]
lemma dual_apply (g : G) : (dual ρV) g = module.dual.transpose (ρV g⁻¹) := rfl
lemma dual_tensor_hom_comm (g : G) :
(dual_tensor_hom k V W) ∘ₗ (tensor_product.map (ρV.dual g) (ρW g)) =
(lin_hom ρV ρW) g ∘ₗ (dual_tensor_hom k V W) :=
begin
ext, simp [module.dual.transpose_apply],
end
end linear_hom
end representation
|