Imports
/- Copyright (c) 2025 Joseph Tooby-Smith. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Tooby-Smith -/ module public import Physlib.Relativity.Tensors.ComponentIdx.Single public import Physlib.Relativity.Tensors.Reindexing public import Physlib.Relativity.Tensors.Contraction.SuccSuccAbove public import Mathlib.Topology.Algebra.Module.ModuleTopology public import Mathlib.Analysis.RCLike.Basic public import Mathlib.Tactic.Cases

Tensors

This module sets up the tensors used for index notation in Physlib.

Physics picture:

    Choose a symmetry group G (for example, the Lorentz group).

    Give each index kind a name called a color (encoded by a type C). In Lorentzian notation, a typical choice is two colors: up and down.

    For each color, choose a representation of G.

    Fix a basis for each color. This determines which values that index can take and lets us speak about tensor components explicitly.

    Specify a dual color for each color, telling us which index pairs can contract.

    For dual pairs, provide the contraction/unit/metric data used for contraction and for raising/lowering indices.

All of this structure is packaged as a TensorSpecies.

For S : TensorSpecies and a list of index colors c : Fin n → C:

    Tensor S c is the type of tensors with those indices.

    Pure S c is the type of pure tensors, i.e. tensors of the form v₀ ⊗ₜ v₁ ⊗ₜ v₂ ….

    ComponentIdx S c is the type of allowed component labels for those indices.

This file realizes Tensor S c as a PiTensorProduct, relates pure tensors to their components, constructs the component basis, and supplies the inherited finite-dimensional and module-topology instances. It also defines the natural action of G on pure tensors and tensors, the associated permutation maps, and the map from rank-zero tensors to the base field.

From this setup we get the usual index-notation operations in a uniform way: contraction, raising/lowering, and permutation of indices.

@[expose] public section

The tensors associated with a list of indices of a given color c : Fin n → C.

set_option linter.unusedVariables false in@[nolint unusedArguments] noncomputable abbrev Tensor {n : } (S : TensorSpecies k C G V basisIdx rep b) (c : Fin n C) : Type := PiTensorProduct k (fun i => V (c i))

Components of tensors

Pure tensors

The type of pure tensors associated to a list of indices c : OverColor C. A pure tensor is a tensor which can be written in the form v1 ⊗ₜ v2 ⊗ₜ v3 ….

set_option linter.unusedVariables false in@[nolint unusedArguments] abbrev Pure (S : TensorSpecies k C G V basisIdx rep b) (c : Fin n C) : Type := (i : Fin n) V (c i)
All goals completed! 🐙) (p j) = p i := k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:c:Fin n Cp:Pure S ci:Fin nj:Fin nh:i = j(LinearEquiv.cast ) (p j) = p i k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:c:Fin n Cp:Pure S ci:Fin n(LinearEquiv.cast ) (p i) = p i All goals completed! 🐙All goals completed! 🐙 : c j = c') (p j) := k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:c:Fin n Cc':Cp:Pure S ci:Fin nj:Fin nh:i = jhi:c i = c'hj:c j = c'(LinearEquiv.cast ) (p i) = (LinearEquiv.cast ) (p j) k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:c:Fin n Cp:Pure S ci:Fin nhj:c i = c i(LinearEquiv.cast ) (p i) = (LinearEquiv.cast ) (p i) All goals completed! 🐙All goals completed! 🐙 : c i = c1 j) (p i) = (p' j) := k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:n1:c:Fin n Cc1:Fin n1 Cp:Pure S cp':Pure S c1c':Ci:Fin nj:Fin n1hi:c i = c'hj:c1 j = c'(LinearEquiv.cast ) (p i) = (LinearEquiv.cast ) (p' j) (LinearEquiv.cast ) (p i) = p' j k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:n1:c:Fin n Cc1:Fin n1 Cp:Pure S cp':Pure S c1i:Fin nj:Fin n1hi:c i = c1 j(LinearEquiv.cast ) (p i) = (LinearEquiv.cast ) (p' j) (LinearEquiv.cast ) (p i) = p' j All goals completed! 🐙lemma toTensor_apply {n : } (c : Fin n C) (p : Pure S c) : toTensor p = PiTensorProduct.tprod k p := rfl

Given a list of indices c of n indices, a pure tensor p, an element i : Fin n and a x in V (c i) then update p i x corresponds to p where the ith part of p is replaced with x.

E.g. if n = 2 and p = v₀ ⊗ₜ v₁ then update p 0 x = x ⊗ₜ v₁.

def update {n : } {c : Fin n C} [inst : DecidableEq (Fin n)] (p : Pure S c) (i : Fin n) (x : V (c i)) : Pure S c := Function.update p i x
lemma update_eq_function_update {n : } {c : Fin n C} [inst : DecidableEq (Fin n)] (p : Pure S c) (i : Fin n) (x : V (c i)) : update p i x = Function.update p i x := rfl@[simp] lemma update_same {n : } {c : Fin n C} [inst : DecidableEq (Fin n)] (p : Pure S c) (i : Fin n) (x : V (c i)) : (update p i x) i = x := k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:c:Fin n Cinst:DecidableEq (Fin n)p:Pure S ci:Fin nx:V (c i)p.update i x i = x All goals completed! 🐙All goals completed! 🐙All goals completed! 🐙@[simp] lemma toTensor_update_add {n : } {c : Fin n C} [inst : DecidableEq (Fin n)] (p : Pure S c) (i : Fin n) (x y : V (c i)) : (update p i (x + y)).toTensor = (update p i x).toTensor + (update p i y).toTensor := k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:c:Fin n Cinst:DecidableEq (Fin n)p:Pure S ci:Fin nx:V (c i)y:V (c i)(p.update i (x + y)).toTensor = (p.update i x).toTensor + (p.update i y).toTensor All goals completed! 🐙@[simp] lemma toTensor_update_smul {n : } {c : Fin n C} [inst : DecidableEq (Fin n)] (p : Pure S c) (i : Fin n) (r : k) (y : V (c i)) : (update p i (r y)).toTensor = r (update p i y).toTensor := k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:c:Fin n Cinst:DecidableEq (Fin n)p:Pure S ci:Fin nr:ky:V (c i)(p.update i (r y)).toTensor = r (p.update i y).toTensor All goals completed! 🐙

Given a list of indices c of length n + 1, a pure tensor p and an i : Fin (n + 1), then drop p i is the tensor p with it's ith part dropped.

For example, if n = 2 and p = v₀ ⊗ₜ v₁ ⊗ₜ v₂ then drop p 1 = v₀ ⊗ₜ v₂.

def drop {n : } {c : Fin (n + 1) C} (p : Pure S c) (i : Fin (n + 1)) : Pure S (c i.succAbove) := fun j => p (i.succAbove j)
@[simp] lemma update_succAbove_drop {n : } {c : Fin (n + 1) C} [inst : DecidableEq (Fin (n + 1))] (p : Pure S c) (i : Fin (n + 1)) (k : Fin n) (x : V (c (i.succAbove k))) : (update p (i.succAbove k) x).drop i = (p.drop i).update k x := Function.update_comp_eq_of_injective' p Fin.succAbove_right_injective k x@[simp] lemma update_drop_self {n : } {c : Fin (n + 1) C} [inst : DecidableEq (Fin (n + 1))] (p : Pure S c) (i : Fin (n + 1)) (x : V (c i)) : (update p i x).drop i = p.drop i := k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:c:Fin (n + 1) Cinst:DecidableEq (Fin (n + 1))p:Pure S ci:Fin (n + 1)x:V (c i)(p.update i x).drop i = p.drop i k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:c:Fin (n + 1) Cinst:DecidableEq (Fin (n + 1))p:Pure S ci:Fin (n + 1)x:V (c i)j:Fin n(p.update i x).drop i j = p.drop i j All goals completed! 🐙

Components

lemma component_eq {n : } {c : Fin n C} (p : Pure S c) (φ : ComponentIdx c) : p.component φ = i, (b (c i)).repr (p i) (φ i) := k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:c:Fin n Cp:Pure S cφ:ComponentIdx cp.component φ = i, ((b (c i)).repr (p i)) (φ i) All goals completed! 🐙lemma component_eq_drop {n : } {c : Fin (n + 1) C} (p : Pure S c) (i : Fin (n + 1)) (φ : ComponentIdx c) : p.component φ = ((b (c i)).repr (p i) (φ i)) * ((drop p i).component (fun j => φ (i.succAbove j))) := Fin.prod_univ_succAbove (fun j => (b (c j)).repr (p j) (φ j)) i@[simp] lemma component_update_add {n : } [inst : DecidableEq (Fin n)] {c : Fin n C} (p : Pure S c) (i : Fin n) (x y :V (c i)) (b : ComponentIdx c) : (update p i (x + y)).component b = (update p i x).component b + (update p i y).component b := k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b✝:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep b✝n:inst:DecidableEq (Fin n)c:Fin n Cp:Pure S ci:Fin nx:V (c i)y:V (c i)b:ComponentIdx c(p.update i (x + y)).component b = (p.update i x).component b + (p.update i y).component b k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b✝:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep b✝inst:DecidableEq (Fin 0)c:Fin 0 Cp:Pure S ci:Fin 0x:V (c i)y:V (c i)b:ComponentIdx c(p.update i (x + y)).component b = (p.update i x).component b + (p.update i y).component bk:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b✝:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep b✝n✝:inst:DecidableEq (Fin (n✝ + 1))c:Fin (n✝ + 1) Cp:Pure S ci:Fin (n✝ + 1)x:V (c i)y:V (c i)b:ComponentIdx c(p.update i (x + y)).component b = (p.update i x).component b + (p.update i y).component b k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b✝:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep b✝inst:DecidableEq (Fin 0)c:Fin 0 Cp:Pure S ci:Fin 0x:V (c i)y:V (c i)b:ComponentIdx c(p.update i (x + y)).component b = (p.update i x).component b + (p.update i y).component b All goals completed! 🐙 k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b✝:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep b✝n✝:inst:DecidableEq (Fin (n✝ + 1))c:Fin (n✝ + 1) Cp:Pure S ci:Fin (n✝ + 1)x:V (c i)y:V (c i)b:ComponentIdx c(p.update i (x + y)).component b = (p.update i x).component b + (p.update i y).component b All goals completed! 🐙@[simp] lemma component_update_smul {n : } [inst : DecidableEq (Fin n)] {c : Fin n C} (p : Pure S c) (i : Fin n) (x : k) (y : V (c i)) (b : ComponentIdx c) : (update p i (x y)).component b = x * (update p i y).component b := k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b✝:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep b✝n:inst:DecidableEq (Fin n)c:Fin n Cp:Pure S ci:Fin nx:ky:V (c i)b:ComponentIdx c(p.update i (x y)).component b = x * (p.update i y).component b k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b✝:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep b✝x:kinst:DecidableEq (Fin 0)c:Fin 0 Cp:Pure S ci:Fin 0y:V (c i)b:ComponentIdx c(p.update i (x y)).component b = x * (p.update i y).component bk:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b✝:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep b✝x:kn✝:inst:DecidableEq (Fin (n✝ + 1))c:Fin (n✝ + 1) Cp:Pure S ci:Fin (n✝ + 1)y:V (c i)b:ComponentIdx c(p.update i (x y)).component b = x * (p.update i y).component b k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b✝:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep b✝x:kinst:DecidableEq (Fin 0)c:Fin 0 Cp:Pure S ci:Fin 0y:V (c i)b:ComponentIdx c(p.update i (x y)).component b = x * (p.update i y).component b All goals completed! 🐙 k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b✝:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep b✝x:kn✝:inst:DecidableEq (Fin (n✝ + 1))c:Fin (n✝ + 1) Cp:Pure S ci:Fin (n✝ + 1)y:V (c i)b:ComponentIdx c(p.update i (x y)).component b = x * (p.update i y).component b All goals completed! 🐙@[simp] lemma componentMap_apply {n : } (c : Fin n C) (p : Pure S c) : componentMap c p = p.component := k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:c:Fin n Cp:Pure S c(componentMap c) p = p.component All goals completed! 🐙@[simp] lemma component_basisVector {n : } (c : Fin n C) (b1 b2 : ComponentIdx (S := S) c) : (basisVector c b1).component b2 = if b1 = b2 then 1 else 0 := k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:c:Fin n Cb1:ComponentIdx cb2:ComponentIdx c(basisVector c b1).component b2 = if b1 = b2 then 1 else 0 All goals completed! 🐙lemma induction_on_pure {n : } {c : Fin n C} {P : S.Tensor c Prop} (h : (p : Pure S c), P p.toTensor) (hsmul : (r : k) t, P t P (r t)) (hadd : t1 t2, P t1 P t2 P (t1 + t2)) (t : S.Tensor c) : P t := k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:c:Fin n CP:S.Tensor c Proph: (p : Pure S c), P p.toTensorhsmul: (r : k) (t : S.Tensor c), P t P (r t)hadd: (t1 t2 : S.Tensor c), P t1 P t2 P (t1 + t2)t:S.Tensor cP t k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:c:Fin n CP:S.Tensor c Proph: (p : Pure S c), P p.toTensorhsmul: (r : k) (t : S.Tensor c), P t P (r t)hadd: (t1 t2 : S.Tensor c), P t1 P t2 P (t1 + t2)t:S.Tensor cr:kp:(i : Fin n) V (c i)P (PiTensorProduct.tprodCoeff k r p) k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:c:Fin n CP:S.Tensor c Proph: (p : Pure S c), P p.toTensorhsmul: (r : k) (t : S.Tensor c), P t P (r t)hadd: (t1 t2 : S.Tensor c), P t1 P t2 P (t1 + t2)t:S.Tensor cr:kp:(i : Fin n) V (c i)P (r (PiTensorProduct.tprod k) p) All goals completed! 🐙

The basis

The linear map from tensors to its components.

def componentMap {n : } (c : Fin n C) : S.Tensor c →ₗ[k] (ComponentIdx (S := S) c k) := PiTensorProduct.lift (Pure.componentMap c)
@[simp] lemma componentMap_pure {n : } (c : Fin n C) (p : Pure S c) : componentMap c (p.toTensor) = Pure.componentMap c p := PiTensorProduct.lift.tprod p

The tensor created from it's components.

def ofComponents {n : } (c : Fin n C) : (ComponentIdx (S := S) c k) →ₗ[k] S.Tensor c where toFun f := b, f b (Pure.basisVector c b).toTensor map_add' fb gb := k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S✝:TensorSpecies k C G V basisIdx rep bS:TensorSpecies k C G V basisIdx rep bn✝:n':n2:c✝:Fin n✝ Cc':Fin n' Cc2:Fin n2 Cn:c:Fin n Cfb:ComponentIdx c kgb:ComponentIdx c k b_1, (fb + gb) b_1 (Pure.basisVector c b_1).toTensor = b_1, fb b_1 (Pure.basisVector c b_1).toTensor + b_1, gb b_1 (Pure.basisVector c b_1).toTensor All goals completed! 🐙 map_smul' fb r := k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S✝:TensorSpecies k C G V basisIdx rep bS:TensorSpecies k C G V basisIdx rep bn✝:n':n2:c✝:Fin n✝ Cc':Fin n' Cc2:Fin n2 Cn:c:Fin n Cfb:kr:ComponentIdx c k b_1, (fb r) b_1 (Pure.basisVector c b_1).toTensor = (RingHom.id k) fb b_1, r b_1 (Pure.basisVector c b_1).toTensor All goals completed! 🐙
@[simp] lemma componentMap_ofComponents {n : } (c : Fin n C) (f : ComponentIdx c k) : componentMap c (ofComponents (S := S) c f) = f := k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:c:Fin n Cf:ComponentIdx c k(componentMap c) ((ofComponents c) f) = f k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b✝:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:c:Fin n Cf:ComponentIdx c kb:ComponentIdx c(componentMap c) ((ofComponents c) f) b = f b All goals completed! 🐙@[simp] lemma ofComponents_componentMap {n : } (c : Fin n C) (t : S.Tensor c) : ofComponents c (componentMap c t) = t := k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:c:Fin n Ct:S.Tensor c(ofComponents c) ((componentMap c) t) = t k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:c:Fin n Ct:S.Tensor c b_1, (componentMap c) t b_1 (Pure.basisVector c b_1).toTensor = t induction t using induction_on_pure with k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:c:Fin n Cp:Pure S c b_1, (componentMap c) p.toTensor b_1 (Pure.basisVector c b_1).toTensor = p.toTensor k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:c:Fin n Cp:Pure S c x, p.component x (Pure.basisVector c x).toTensor = p.toTensor simp_rw k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:c:Fin n Cp:Pure S c x, p.component x (Pure.basisVector c x).toTensor = p.toTensork:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:c:Fin n Cp:Pure S c x, (∏ i, ((b (c i)).repr (p i)) (x i)) (Pure.basisVector c x).toTensor = p.toTensor k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:c:Fin n Cp:Pure S c x, (∏ i, ((b (c i)).repr (p i)) (x i)) (PiTensorProduct.tprod k) (Pure.basisVector c x) = (PiTensorProduct.tprod k) p k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:c:Fin n Cp:Pure S c(∑ x, (PiTensorProduct.tprod k) fun i => ((b (c i)).repr (p i)) (x i) Pure.basisVector c x i) = (PiTensorProduct.tprod k) p k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:c:Fin n Cp:Pure S c(∑ x, (PiTensorProduct.tprod k) fun i => ((b (c i)).repr (p i)) (x i) (b (c i)) (x i)) = (PiTensorProduct.tprod k) p] k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:c:Fin n Cp:Pure S c(∑ x, (PiTensorProduct.tprod k) fun i => ((b (c i)).repr (p i)) (x i) (b (c i)) (x i)) = (PiTensorProduct.tprod k) fun i => x, ((b (c i)).repr (p i)) x (b (c i)) xk:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:c:Fin n Cp:Pure S c((PiTensorProduct.tprod k) fun i => x, ((b (c i)).repr (p i)) x (b (c i)) x) = (PiTensorProduct.tprod k) p k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:c:Fin n Cp:Pure S c(∑ x, (PiTensorProduct.tprod k) fun i => ((b (c i)).repr (p i)) (x i) (b (c i)) (x i)) = (PiTensorProduct.tprod k) fun i => x, ((b (c i)).repr (p i)) x (b (c i)) x All goals completed! 🐙 All goals completed! 🐙 k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:c:Fin n Cr:kt:S.Tensor cht: b_1, (componentMap c) t b_1 (Pure.basisVector c b_1).toTensor = t b_1, (componentMap c) (r t) b_1 (Pure.basisVector c b_1).toTensor = r t All goals completed! 🐙 k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:c:Fin n Ct1:S.Tensor ct2:S.Tensor ch1: b_1, (componentMap c) t1 b_1 (Pure.basisVector c b_1).toTensor = t1h2: b_1, (componentMap c) t2 b_1 (Pure.basisVector c b_1).toTensor = t2 b_1, (componentMap c) (t1 + t2) b_1 (Pure.basisVector c b_1).toTensor = t1 + t2 All goals completed! 🐙

The basis of tensors.

def basis {n : } (c : Fin n C) : Basis (ComponentIdx (S := S) c) k (S.Tensor c) where repr := (LinearEquiv.mk (componentMap c) (ofComponents c) (fun x => k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S✝:TensorSpecies k C G V basisIdx rep bS:TensorSpecies k C G V basisIdx rep bn✝:n':n2:c✝:Fin n✝ Cc':Fin n' Cc2:Fin n2 Cn:c:Fin n Cx:S.Tensor c(ofComponents c) ((componentMap c).toFun x) = x All goals completed! 🐙) (fun x => k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S✝:TensorSpecies k C G V basisIdx rep bS:TensorSpecies k C G V basisIdx rep bn✝:n':n2:c✝:Fin n✝ Cc':Fin n' Cc2:Fin n2 Cn:c:Fin n Cx:ComponentIdx c k(componentMap c).toFun ((ofComponents c) x) = x All goals completed! 🐙)).trans (Finsupp.linearEquivFunOnFinite k k ((j : Fin n) basisIdx (c j))).symm
lemma basis_apply {n : } (c : Fin n C) (φ : ComponentIdx (S := S) c) : basis c φ = (Pure.basisVector c φ).toTensor := k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:c:Fin n Cφ:ComponentIdx c(basis c) φ = (Pure.basisVector c φ).toTensor k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:c:Fin n Cφ:ComponentIdx c(ofComponents c) ((Finsupp.linearEquivFunOnFinite k k ((j : Fin n) basisIdx (c j))).symm.toEquiv.symm (Finsupp.single φ 1)) = (Pure.basisVector c φ).toTensor All goals completed! 🐙@[simp] lemma basis_repr_pure {n : } (c : Fin n C) (p : Pure S c) : (basis c).repr p.toTensor = p.component := k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:c:Fin n Cp:Pure S c((basis c).repr p.toTensor) = p.component k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:c:Fin n Cp:Pure S cφ:ComponentIdx c((basis c).repr p.toTensor) φ = p.component φ k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:c:Fin n Cp:Pure S cφ:ComponentIdx c(componentMap c) p.toTensor φ = p.component φ All goals completed! 🐙lemma induction_on_basis {n : } {c : Fin n C} {P : S.Tensor c Prop} (h : b, P (basis c b)) (hzero : P 0) (hsmul : (r : k) t, P t P (r t)) (hadd : t1 t2, P t1 P t2 P (t1 + t2)) (t : S.Tensor c) : P t := k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:c:Fin n CP:S.Tensor c Proph: (b_1 : ComponentIdx c), P ((basis c) b_1)hzero:P 0hsmul: (r : k) (t : S.Tensor c), P t P (r t)hadd: (t1 t2 : S.Tensor c), P t1 P t2 P (t1 + t2)t:S.Tensor cP t k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:c:Fin n CP:S.Tensor c Proph: (b_1 : ComponentIdx c), P ((basis c) b_1)hzero:P 0hsmul: (r : k) (t : S.Tensor c), P t P (r t)hadd: (t1 t2 : S.Tensor c), P t1 P t2 P (t1 + t2)t:S.Tensor c x Set.range (basis c), P x k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b✝:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:c:Fin n CP:S.Tensor c Proph: (b_1 : ComponentIdx c), P ((basis c) b_1)hzero:P 0hsmul: (r : k) (t : S.Tensor c), P t P (r t)hadd: (t1 t2 : S.Tensor c), P t1 P t2 P (t1 + t2)t:S.Tensor cb:ComponentIdx cP ((basis c) b) All goals completed! 🐙

componentMap is the basis representation (basis c).repr definitionally; this bridges the two notations wherever a component computation meets a repr rewrite.

lemma componentMap_eq_repr {n : } (c : Fin n C) (t : S.Tensor c) (ψ : ComponentIdx (S := S) c) : componentMap c t ψ = (basis c).repr t ψ := rfl

Two tensors with the same colour sequence are equal when all their components agree.

All goals completed! 🐙

The rank

instance {k : Type} [Field k] {C : Type} {G : Type} [Group G] {V : C Type} [ c, AddCommGroup (V c)] [ c, Module k (V c)] {basisIdx : C Type} [ c, Fintype (basisIdx c)] [ c, DecidableEq (basisIdx c)] {rep : (c : C) Representation k G (V c)} {b : (c : C) Basis (basisIdx c) k (V c)} (S : TensorSpecies k C G V basisIdx rep b) {c : Fin n C} : FiniteDimensional k (S.Tensor c) := Module.Basis.finiteDimensional_of_finite (Tensor.basis c)instance {k : Type} [RCLike k] {C : Type} {G : Type} [Group G] {V : C Type} [ c, AddCommGroup (V c)] [ c, Module k (V c)] {basisIdx : C Type} [ c, Fintype (basisIdx c)] [ c, DecidableEq (basisIdx c)] {rep : (c : C) Representation k G (V c)} {b : (c : C) Basis (basisIdx c) k (V c)} (S : TensorSpecies k C G V basisIdx rep b) {c : Fin n C} : IsTopologicalAddGroup (S.Tensor c) := IsModuleTopology.topologicalAddGroup (R := k) (S.Tensor c)

The action

lemma actionP_eq {g : G} {p : Pure S c} : g p = fun i => rep (c i) g (p i) := rfllemma rep_cast {g : G} {c c1 : C} (p : V c) (h : c = c1) : LinearEquiv.cast (R := k) h (rep c g p) = rep c1 g (LinearEquiv.cast (R := k) h p) := k:Typeinst✝³:CommRing kC:TypeG:Typeinst✝²:Group GV:C Typeinst✝¹:(c : C) AddCommGroup (V c)inst✝:(c : C) Module k (V c)rep:(c : C) Representation k G (V c)g:Gc:Cc1:Cp:V ch:c = c1(LinearEquiv.cast h) (((rep c) g) p) = ((rep c1) g) ((LinearEquiv.cast h) p) k:Typeinst✝³:CommRing kC:TypeG:Typeinst✝²:Group GV:C Typeinst✝¹:(c : C) AddCommGroup (V c)inst✝:(c : C) Module k (V c)rep:(c : C) Representation k G (V c)g:Gc:Cp:V c(LinearEquiv.cast ) (((rep c) g) p) = ((rep c) g) ((LinearEquiv.cast ) p) All goals completed! 🐙lemma actionP_cast {g : G} {p : Pure S c} (h : c = c1) : LinearEquiv.cast (R := k) h (g p) = g LinearEquiv.cast (R := k) h p := k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:c:Fin n Cc1:Fin n Cg:Gp:Pure S ch:c = c1(LinearEquiv.cast h) (g p) = g (LinearEquiv.cast h) p k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:c:Fin n Cg:Gp:Pure S c(LinearEquiv.cast ) (g p) = g (LinearEquiv.cast ) p All goals completed! 🐙k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:c:Fin (n + 1) Ci:Fin (n + 1)p:Pure S cg:Gj:Fin n(fun i => ((rep (c i)) g) (p i)) (i.succAbove j) = (fun i_1 => ((rep ((c i.succAbove) i_1)) g) (p.drop i i_1)) j k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:c:Fin (n + 1) Ci:Fin (n + 1)p:Pure S cg:Gj:Fin n((rep (c (i.succAbove j))) g) (p (i.succAbove j)) = ((rep (c (i.succAbove j))) g) (p.drop i j) All goals completed! 🐙

The action on tensors

lemma actionT_eq {g : G} {t : S.Tensor c} : g t = PiTensorProduct.map (fun i => rep (c i) g) t := rfllemma actionT_pure {g : G} {p : Pure S c} : g p.toTensor = Pure.toTensor (g p) := PiTensorProduct.map_tprod (R := k) (fun i => rep (c i) g) plemma actionT_add {g : G} {t1 t2 : S.Tensor c} : g (t1 + t2) = g t1 + g t2 := k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:c:Fin n Cg:Gt1:S.Tensor ct2:S.Tensor cg (t1 + t2) = g t1 + g t2 All goals completed! 🐙@[simp] lemma actionT_smul {g : G} {r : k} {t : S.Tensor c} : g (r t) = r (g t) := k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:c:Fin n Cg:Gr:kt:S.Tensor cg r t = r g t All goals completed! 🐙lemma actionT_zero {g : G} : g (0 : S.Tensor c) = 0 := k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:c:Fin n Cg:Gg 0 = 0 All goals completed! 🐙k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:c:Fin n Cg:Gt:S.Tensor c(PiTensorProduct.map fun i => (rep (c i)) g) (-t) = -(g t) k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:c:Fin n Cg:Gt:S.Tensor c(PiTensorProduct.map fun i => (rep (c i)) g) t = g t All goals completed! 🐙

Permutations

Given a permutation σ : Fin m → Fin n of indices satisfying IsReindexing through h, and a pure tensor p, permP σ h p is the pure tensor permuted according to σ.

For example if m = n = 2 and σ = ![1, 0], and p = v ⊗ₜ w then permP σ _ p = w ⊗ₜ v.

def Pure.permP {n m : } {c : Fin n C} {c1 : Fin m C} (σ : Fin m Fin n) (h : IsReindexing c c1 σ) (p : Pure S c) : Pure S c1 := fun i => LinearEquiv.cast (R := k) (k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S✝:TensorSpecies k C G V basisIdx rep bS:TensorSpecies k C G V basisIdx rep bn✝:n':n2:c✝:Fin n✝ Cc':Fin n' Cc2:Fin n2 Cn:m:c:Fin n Cc1:Fin m Cσ:Fin m Fin nh:IsReindexing c c1 σp:Pure S ci:Fin mc (σ i) = c1 i All goals completed! 🐙) (p (σ i))
@[simp] lemma Pure.permP_basisVector {n m : } {c : Fin n C} {c1 : Fin m C} (σ : Fin m Fin n) (h : IsReindexing c c1 σ) (φ : ComponentIdx (S := S) c) : Pure.permP σ h (Pure.basisVector c φ) = Pure.basisVector c1 (fun i => basisIdxCongr (k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S✝:TensorSpecies k C G V basisIdx rep bS:TensorSpecies k C G V basisIdx rep bn✝:n':n2:c✝:Fin n✝ Cc':Fin n' Cc2:Fin n2 Cn:m:c:Fin n Cc1:Fin m Cσ:Fin m Fin nh:IsReindexing c c1 σφ:ComponentIdx ci:Fin mc (σ i) = c1 i All goals completed! 🐙) (φ (σ i))) := k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:m:c:Fin n Cc1:Fin m Cσ:Fin m Fin nh:IsReindexing c c1 σφ:ComponentIdx cpermP σ h (basisVector c φ) = basisVector c1 fun i => (basisIdxCongr ) (φ (σ i)) k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:m:c:Fin n Cc1:Fin m Cσ:Fin m Fin nh:IsReindexing c c1 σφ:ComponentIdx ci:Fin mpermP σ h (basisVector c φ) i = basisVector c1 (fun i => (basisIdxCongr ) (φ (σ i))) i k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:m:c:Fin n Cc1:Fin m Cσ:Fin m Fin nh:IsReindexing c c1 σφ:ComponentIdx ci:Fin m(LinearEquiv.cast ) ((b (c (σ i))) (φ (σ i))) = (b (c1 i)) ((basisIdxCongr ) (φ (σ i))) All goals completed! 🐙lemma Pure.permP_equivariant {n m : } {c : Fin n C} {c1 : Fin m C} {σ : Fin m Fin n} (h : IsReindexing c c1 σ) (g : G) (p : Pure S c) : Pure.permP σ h (g p) = g Pure.permP σ h p := k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:m:c:Fin n Cc1:Fin m Cσ:Fin m Fin nh:IsReindexing c c1 σg:Gp:Pure S cpermP σ h (g p) = g permP σ h p k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:m:c:Fin n Cc1:Fin m Cσ:Fin m Fin nh:IsReindexing c c1 σg:Gp:Pure S ci:Fin mpermP σ h (g p) i = (g permP σ h p) i k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:m:c:Fin n Cc1:Fin m Cσ:Fin m Fin nh:IsReindexing c c1 σg:Gp:Pure S ci:Fin m(LinearEquiv.cast ) (((rep (c (σ i))) g) (p (σ i))) = ((rep (c1 i)) g) ((LinearEquiv.cast ) (p (σ i))) All goals completed! 🐙lemma permT_pure {n m : } {c : Fin n C} {c1 : Fin m C} {σ : Fin m Fin n} (h : IsReindexing c c1 σ) (p : Pure S c) : permT σ h p.toTensor = (p.permP σ h).toTensor := k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:m:c:Fin n Cc1:Fin m Cσ:Fin m Fin nh:IsReindexing c c1 σp:Pure S c(permT σ h) p.toTensor = (Pure.permP σ h p).toTensor k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:m:c:Fin n Cc1:Fin m Cσ:Fin m Fin nh:IsReindexing c c1 σp:Pure S c((PiTensorProduct.tprod k) fun i => (LinearEquiv.cast ) (p (h.toEquiv.symm i))) = (PiTensorProduct.tprod k) (Pure.permP σ h p) All goals completed! 🐙set_option backward.isDefEq.respectTransparency false in @[simp] lemma Pure.permP_id_self {n : } {c : Fin n C} (p : Pure S c) : Pure.permP (id : Fin n Fin n) (k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S✝:TensorSpecies k C G V basisIdx rep bS:TensorSpecies k C G V basisIdx rep bn✝:n':n2:c✝:Fin n✝ Cc':Fin n' Cc2:Fin n2 Cn:c:Fin n Cp:Pure S cIsReindexing c c id All goals completed! 🐙 : IsReindexing c c id) p = p := k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:c:Fin n Cp:Pure S cpermP id p = p k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:c:Fin n Cp:Pure S ci:Fin npermP id p i = p i All goals completed! 🐙@[simp] lemma permT_id_self {n : } {c : Fin n C} (t : S.Tensor c) : permT (id : Fin n Fin n) (k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S✝:TensorSpecies k C G V basisIdx rep bS:TensorSpecies k C G V basisIdx rep bn✝:n':n2:c✝:Fin n✝ Cc':Fin n' Cc2:Fin n2 Cn:c:Fin n Ct:S.Tensor cIsReindexing c c id All goals completed! 🐙 : IsReindexing c c id) t = t := k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:c:Fin n Ct:S.Tensor c(permT id ) t = t induction t using induction_on_pure with k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:c:Fin n Cp:Pure S c(permT id ) p.toTensor = p.toTensor All goals completed! 🐙 k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:c:Fin n Cr:kt:S.Tensor cht:(permT id ) t = t(permT id ) (r t) = r t All goals completed! 🐙 k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:c:Fin n Ct1:S.Tensor ct2:S.Tensor ch1:(permT id ) t1 = t1h2:(permT id ) t2 = t2(permT id ) (t1 + t2) = t1 + t2 All goals completed! 🐙lemma permT_congr_eq_id {n : } {c : Fin n C} (t : S.Tensor c) (σ : Fin n Fin n) ( : IsReindexing c c σ) (h : σ = id) : permT σ () t = t := k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:c:Fin n Ct:S.Tensor cσ:Fin n Fin n:IsReindexing c c σh:σ = id(permT σ ) t = t k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:c:Fin n Ct:S.Tensor c:IsReindexing c c id(permT id ) t = t All goals completed! 🐙lemma permT_congr_eq_id' {n : } {c : Fin n C} (t t1 : S.Tensor c) (σ : Fin n Fin n) ( : IsReindexing c c σ) (h : σ = id) (ht : t = t1) : permT σ () t = t1 := k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:c:Fin n Ct:S.Tensor ct1:S.Tensor cσ:Fin n Fin n:IsReindexing c c σh:σ = idht:t = t1(permT σ ) t = t1 k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:c:Fin n Ct:S.Tensor c:IsReindexing c c id(permT id ) t = t All goals completed! 🐙@[simp] lemma permT_equivariant {n m : } {c : Fin n C} {c1 : Fin m C} {σ : Fin m Fin n} (h : IsReindexing c c1 σ) (g : G) (t : S.Tensor c) : permT σ h (g t) = g permT σ h t := k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:m:c:Fin n Cc1:Fin m Cσ:Fin m Fin nh:IsReindexing c c1 σg:Gt:S.Tensor c(permT σ h) (g t) = g (permT σ h) t induction t using induction_on_pure with k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:m:c:Fin n Cc1:Fin m Cσ:Fin m Fin nh:IsReindexing c c1 σg:Gp:Pure S c(permT σ h) (g p.toTensor) = g (permT σ h) p.toTensor All goals completed! 🐙 k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:m:c:Fin n Cc1:Fin m Cσ:Fin m Fin nh:IsReindexing c c1 σg:Gr:kt:S.Tensor cht:(permT σ h) (g t) = g (permT σ h) t(permT σ h) (g r t) = g (permT σ h) (r t) All goals completed! 🐙 k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:m:c:Fin n Cc1:Fin m Cσ:Fin m Fin nh:IsReindexing c c1 σg:Gt1:S.Tensor ct2:S.Tensor ch1:(permT σ h) (g t1) = g (permT σ h) t1h2:(permT σ h) (g t2) = g (permT σ h) t2(permT σ h) (g (t1 + t2)) = g (permT σ h) (t1 + t2) All goals completed! 🐙@[congr] lemma Pure.permP_congr {n m : } {c : Fin n C} {c1 : Fin m C} {σ σ1 : Fin m Fin n} {h : IsReindexing c c1 σ} {h1 : IsReindexing c c1 σ1} {p p1 : Pure S c} (hmap : σ = σ1) (hpure : p = p1) : Pure.permP σ h p = Pure.permP σ1 h1 p1 := k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:m:c:Fin n Cc1:Fin m Cσ:Fin m Fin nσ1:Fin m Fin nh:IsReindexing c c1 σh1:IsReindexing c c1 σ1p:Pure S cp1:Pure S chmap:σ = σ1hpure:p = p1permP σ h p = permP σ1 h1 p1 k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:m:c:Fin n Cc1:Fin m Cσ:Fin m Fin nh:IsReindexing c c1 σp:Pure S ch1:IsReindexing c c1 σpermP σ h p = permP σ h1 p All goals completed! 🐙@[congr] lemma permT_congr {n m : } {c : Fin n C} {c1 : Fin m C} {σ σ1 : Fin m Fin n} {h : IsReindexing c c1 σ} {h1 : IsReindexing c c1 σ1} (hmap : σ = σ1) {t t1: S.Tensor c} (htensor : t = t1) : permT σ h t = permT σ1 h1 t1 := k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:m:c:Fin n Cc1:Fin m Cσ:Fin m Fin nσ1:Fin m Fin nh:IsReindexing c c1 σh1:IsReindexing c c1 σ1hmap:σ = σ1t:S.Tensor ct1:S.Tensor chtensor:t = t1(permT σ h) t = (permT σ1 h1) t1 k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:m:c:Fin n Cc1:Fin m Cσ:Fin m Fin nh:IsReindexing c c1 σt:S.Tensor ch1:IsReindexing c c1 σ(permT σ h) t = (permT σ h1) t All goals completed! 🐙set_option backward.isDefEq.respectTransparency false in @[simp] lemma Pure.permP_permP {n m1 m2 : } {c : Fin n C} {c1 : Fin m1 C} {c2 : Fin m2 C} {σ : Fin m1 Fin n} {σ2 : Fin m2 Fin m1} (h : IsReindexing c c1 σ) (h2 : IsReindexing c1 c2 σ2) (p : Pure S c) : Pure.permP σ2 h2 (Pure.permP σ h p) = Pure.permP (σ σ2) (h.comp h2) p := k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:m1:m2:c:Fin n Cc1:Fin m1 Cc2:Fin m2 Cσ:Fin m1 Fin nσ2:Fin m2 Fin m1h:IsReindexing c c1 σh2:IsReindexing c1 c2 σ2p:Pure S cpermP σ2 h2 (permP σ h p) = permP (σ σ2) p k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:m1:m2:c:Fin n Cc1:Fin m1 Cc2:Fin m2 Cσ:Fin m1 Fin nσ2:Fin m2 Fin m1h:IsReindexing c c1 σh2:IsReindexing c1 c2 σ2p:Pure S ci:Fin m2permP σ2 h2 (permP σ h p) i = permP (σ σ2) p i All goals completed! 🐙All goals completed! 🐙 k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:m1:m2:c:Fin n Cc1:Fin m1 Cc2:Fin m2 Cσ:Fin m1 Fin nσ2:Fin m2 Fin m1h:IsReindexing c c1 σh2:IsReindexing c1 c2 σ2(permT σ2 h2) ((permT σ h) 0) = (permT (σ σ2) ) 0 All goals completed! 🐙 k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:m1:m2:c:Fin n Cc1:Fin m1 Cc2:Fin m2 Cσ:Fin m1 Fin nσ2:Fin m2 Fin m1h:IsReindexing c c1 σh2:IsReindexing c1 c2 σ2r:kt:S.Tensor ch1:(permT σ2 h2) ((permT σ h) t) = (permT (σ σ2) ) t(permT σ2 h2) ((permT σ h) (r t)) = (permT (σ σ2) ) (r t) All goals completed! 🐙 k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:m1:m2:c:Fin n Cc1:Fin m1 Cc2:Fin m2 Cσ:Fin m1 Fin nσ2:Fin m2 Fin m1h:IsReindexing c c1 σh2✝:IsReindexing c1 c2 σ2t1:S.Tensor ct2:S.Tensor ch1:(permT σ2 h2✝) ((permT σ h) t1) = (permT (σ σ2) ) t1h2:(permT σ2 h2✝) ((permT σ h) t2) = (permT (σ σ2) ) t2(permT σ2 h2✝) ((permT σ h) (t1 + t2)) = (permT (σ σ2) ) (t1 + t2) All goals completed! 🐙k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:m:c:Fin n Cc1:Fin m Cσ:Fin m Fin nh:IsReindexing c c1 σφ:ComponentIdx c1b':ComponentIdx c((basis c1).repr ((basis c1) fun i => (basisIdxCongr ) (b' (σ i)))) φ = ((basis c).repr ((basis c) b')) fun i => (basisIdxCongr ) (φ (IsReindexing.inv σ h i)) k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:m:c:Fin n Cc1:Fin m Cσ:Fin m Fin nh:IsReindexing c c1 σφ:ComponentIdx c1b':ComponentIdx c(if (fun i => (basisIdxCongr ) (b' (σ i))) = φ then 1 else 0) = if b' = fun i => (basisIdxCongr ) (φ (IsReindexing.inv σ h i)) then 1 else 0 k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:m:c:Fin n Cc1:Fin m Cσ:Fin m Fin nh:IsReindexing c c1 σφ:ComponentIdx c1b':ComponentIdx c((fun i => (basisIdxCongr ) (b' (σ i))) = φ) = (b' = fun i => (basisIdxCongr ) (φ (IsReindexing.inv σ h i))) k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:m:c:Fin n Cc1:Fin m Cσ:Fin m Fin nh:IsReindexing c c1 σφ:ComponentIdx c1b':ComponentIdx c(fun i => (basisIdxCongr ) (b' (σ i))) = φ b' = fun i => (basisIdxCongr ) (φ (IsReindexing.inv σ h i)) k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:m:c:Fin n Cc1:Fin m Cσ:Fin m Fin nh:IsReindexing c c1 σφ:ComponentIdx c1b':ComponentIdx c(fun i => (basisIdxCongr ) (b' (σ i))) = φ b' = fun i => (basisIdxCongr ) (φ (IsReindexing.inv σ h i))k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:m:c:Fin n Cc1:Fin m Cσ:Fin m Fin nh:IsReindexing c c1 σφ:ComponentIdx c1b':ComponentIdx c(b' = fun i => (basisIdxCongr ) (φ (IsReindexing.inv σ h i))) (fun i => (basisIdxCongr ) (b' (σ i))) = φ k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:m:c:Fin n Cc1:Fin m Cσ:Fin m Fin nh:IsReindexing c c1 σφ:ComponentIdx c1b':ComponentIdx c(fun i => (basisIdxCongr ) (b' (σ i))) = φ b' = fun i => (basisIdxCongr ) (φ (IsReindexing.inv σ h i)) k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:m:c:Fin n Cc1:Fin m Cσ:Fin m Fin nh:IsReindexing c c1 σφ:ComponentIdx c1b':ComponentIdx ch':(fun i => (basisIdxCongr ) (b' (σ i))) = φb' = fun i => (basisIdxCongr ) (φ (IsReindexing.inv σ h i)) k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:m:c:Fin n Cc1:Fin m Cσ:Fin m Fin nh:IsReindexing c c1 σφ:ComponentIdx c1b':ComponentIdx ch':(fun i => (basisIdxCongr ) (b' (σ i))) = φx:Fin nb' x = (basisIdxCongr ) (φ (IsReindexing.inv σ h x)) All goals completed! 🐙 k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:m:c:Fin n Cc1:Fin m Cσ:Fin m Fin nh:IsReindexing c c1 σφ:ComponentIdx c1b':ComponentIdx c(b' = fun i => (basisIdxCongr ) (φ (IsReindexing.inv σ h i))) (fun i => (basisIdxCongr ) (b' (σ i))) = φ k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:m:c:Fin n Cc1:Fin m Cσ:Fin m Fin nh:IsReindexing c c1 σφ:ComponentIdx c1b':ComponentIdx ch':b' = fun i => (basisIdxCongr ) (φ (IsReindexing.inv σ h i))(fun i => (basisIdxCongr ) (b' (σ i))) = φ k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:m:c:Fin n Cc1:Fin m Cσ:Fin m Fin nh:IsReindexing c c1 σφ:ComponentIdx c1b':ComponentIdx ch':b' = fun i => (basisIdxCongr ) (φ (IsReindexing.inv σ h i))x:Fin m(basisIdxCongr ) (b' (σ x)) = φ x All goals completed! 🐙 k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:m:c:Fin n Cc1:Fin m Cσ:Fin m Fin nh:IsReindexing c c1 σφ:ComponentIdx c1((basis c1).repr ((permT σ h) 0)) φ = ((basis c).repr 0) fun i => (basisIdxCongr ) (φ (IsReindexing.inv σ h i)) All goals completed! 🐙 k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:m:c:Fin n Cc1:Fin m Cσ:Fin m Fin nh✝:IsReindexing c c1 σφ:ComponentIdx c1r:kt:S.Tensor ch:((basis c1).repr ((permT σ h✝) t)) φ = ((basis c).repr t) fun i => (basisIdxCongr ) (φ (IsReindexing.inv σ h✝ i))((basis c1).repr ((permT σ h✝) (r t))) φ = ((basis c).repr (r t)) fun i => (basisIdxCongr ) (φ (IsReindexing.inv σ h✝ i)) All goals completed! 🐙 k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:m:c:Fin n Cc1:Fin m Cσ:Fin m Fin nh:IsReindexing c c1 σφ:ComponentIdx c1t1:S.Tensor ct2:S.Tensor ch1:((basis c1).repr ((permT σ h) t1)) φ = ((basis c).repr t1) fun i => (basisIdxCongr ) (φ (IsReindexing.inv σ h i))h2:((basis c1).repr ((permT σ h) t2)) φ = ((basis c).repr t2) fun i => (basisIdxCongr ) (φ (IsReindexing.inv σ h i))((basis c1).repr ((permT σ h) (t1 + t2))) φ = ((basis c).repr (t1 + t2)) fun i => (basisIdxCongr ) (φ (IsReindexing.inv σ h i)) All goals completed! 🐙All goals completed! 🐙lemma permT_eq_zero_iff {n m : } {c : Fin n C} {c1 : Fin m C} {σ : Fin m Fin n} (h : IsReindexing c c1 σ) (t : S.Tensor c) : permT σ h t = 0 t = 0 := k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:m:c:Fin n Cc1:Fin m Cσ:Fin m Fin nh:IsReindexing c c1 σt:S.Tensor c(permT σ h) t = 0 t = 0 refine fun h' => ?_, fun h' => k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:m:c:Fin n Cc1:Fin m Cσ:Fin m Fin nh:IsReindexing c c1 σt:S.Tensor ch':t = 0(permT σ h) t = 0 All goals completed! 🐙 k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:m:c:Fin n Cc1:Fin m Cσ:Fin m Fin nh:IsReindexing c c1 σt:S.Tensor ch':(permT σ h) t = 0h2:(permT (IsReindexing.inv σ h) ) ((permT σ h) t) = (permT (IsReindexing.inv σ h) ) 0t = 0 rwa [k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:m:c:Fin n Cc1:Fin m Cσ:Fin m Fin nh:IsReindexing c c1 σt:S.Tensor ch':(permT σ h) t = 0h2:(permT (σ IsReindexing.inv σ h) ) t = (permT (IsReindexing.inv σ h) ) 0t = 0 k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:m:c:Fin n Cc1:Fin m Cσ:Fin m Fin nh:IsReindexing c c1 σt:S.Tensor ch':(permT σ h) t = 0h2:(permT (σ IsReindexing.inv σ h) ) t = 0t = 0 k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:m:c:Fin n Cc1:Fin m Cσ:Fin m Fin nh:IsReindexing c c1 σt:S.Tensor ch':(permT σ h) t = 0h2:t = 0t = 0k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:m:c:Fin n Cc1:Fin m Cσ:Fin m Fin nh:IsReindexing c c1 σt:S.Tensor ch':(permT σ h) t = 0h2:(permT (σ IsReindexing.inv σ h) ) t = 0σ IsReindexing.inv σ h = idk:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:m:c:Fin n Cc1:Fin m Cσ:Fin m Fin nh:IsReindexing c c1 σt:S.Tensor ch':(permT σ h) t = 0h2:t = 0t = 0k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:m:c:Fin n Cc1:Fin m Cσ:Fin m Fin nh:IsReindexing c c1 σt:S.Tensor ch':(permT σ h) t = 0h2:(permT (σ IsReindexing.inv σ h) ) t = 0σ IsReindexing.inv σ h = id at h2 k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bn:m:c:Fin n Cc1:Fin m Cσ:Fin m Fin nh:IsReindexing c c1 σt:S.Tensor ch':(permT σ h) t = 0h2:(permT (σ IsReindexing.inv σ h) ) t = 0x:Fin n(σ IsReindexing.inv σ h) x = id x All goals completed! 🐙

permT is injective.

lemma permT_injective {n m : } {c : Fin n C} {c1 : Fin m C} {σ : Fin m Fin n} (h : IsReindexing c c1 σ) : Function.Injective (permT (S := S) σ h) := (injective_iff_map_eq_zero' _).mpr (permT_eq_zero_iff h)

field

lemma toField_default {c : Fin 0 C} : toField (Pure.toTensor default : S.Tensor c) = 1 := k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bc:Fin 0 CtoField default.toTensor = 1 All goals completed! 🐙lemma toField_injective {c : Fin 0 C} : Function.Injective (toField : S.Tensor c k) := (PiTensorProduct.isEmptyEquiv (Fin 0)).injectiveAll goals completed! 🐙lemma toField_permT {c c1 : Fin 0 C} (σ : Fin 0 Fin 0) (h : IsReindexing c c1 σ) (t : S.Tensor c) : toField (permT σ h t) = toField t := k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bc:Fin 0 Cc1:Fin 0 Cσ:Fin 0 Fin 0h:IsReindexing c c1 σt:S.Tensor ctoField ((permT σ h) t) = toField t k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b✝:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bc:Fin 0 Cc1:Fin 0 Cσ:Fin 0 Fin 0h:IsReindexing c c1 σb:ComponentIdx ctoField ((permT σ h) ((basis c) b)) = toField ((basis c) b)k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bc:Fin 0 Cc1:Fin 0 Cσ:Fin 0 Fin 0h:IsReindexing c c1 σtoField ((permT σ h) 0) = toField 0k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bc:Fin 0 Cc1:Fin 0 Cσ:Fin 0 Fin 0h:IsReindexing c c1 σr:kt:S.Tensor cht:toField ((permT σ h) t) = toField ttoField ((permT σ h) (r t)) = toField (r t)k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bc:Fin 0 Cc1:Fin 0 Cσ:Fin 0 Fin 0h:IsReindexing c c1 σt1:S.Tensor ct2:S.Tensor ch1:toField ((permT σ h) t1) = toField t1h2:toField ((permT σ h) t2) = toField t2toField ((permT σ h) (t1 + t2)) = toField (t1 + t2) k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b✝:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bc:Fin 0 Cc1:Fin 0 Cσ:Fin 0 Fin 0h:IsReindexing c c1 σb:ComponentIdx ctoField ((permT σ h) ((basis c) b)) = toField ((basis c) b) All goals completed! 🐙 k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bc:Fin 0 Cc1:Fin 0 Cσ:Fin 0 Fin 0h:IsReindexing c c1 σtoField ((permT σ h) 0) = toField 0 All goals completed! 🐙 k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bc:Fin 0 Cc1:Fin 0 Cσ:Fin 0 Fin 0h:IsReindexing c c1 σr:kt:S.Tensor cht:toField ((permT σ h) t) = toField ttoField ((permT σ h) (r t)) = toField (r t) All goals completed! 🐙 k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bc:Fin 0 Cc1:Fin 0 Cσ:Fin 0 Fin 0h:IsReindexing c c1 σt1:S.Tensor ct2:S.Tensor ch1:toField ((permT σ h) t1) = toField t1h2:toField ((permT σ h) t2) = toField t2toField ((permT σ h) (t1 + t2)) = toField (t1 + t2) All goals completed! 🐙@[simp] lemma toField_basis_default {c : Fin 0 C} : toField (basis c (@default (ComponentIdx (S := S) c) Unique.instInhabited)) = 1 := k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bc:Fin 0 CtoField ((basis c) default) = 1 All goals completed! 🐙lemma toField_basis {c : Fin 0 C} (b : ComponentIdx (S := S) c) : toField (basis c b) = 1 := k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b✝:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep b✝c:Fin 0 Cb:ComponentIdx ctoField ((basis c) b) = 1 All goals completed! 🐙k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bc:Fin 0 Ct:ComponentIdx c →₀ kt default = t fun j => j.elim0 All goals completed! 🐙@[simp] lemma toField_equivariant {c : Fin 0 C} (g : G) (t : Tensor S c) : toField (g t) = toField t := k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bc:Fin 0 Cg:Gt:S.Tensor ctoField (g t) = toField t induction t using induction_on_pure with k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bc:Fin 0 Cg:Gp:Pure S ctoField (g p.toTensor) = toField p.toTensor All goals completed! 🐙 k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bc:Fin 0 Cg:Gr:kt:S.Tensor chp:toField (g t) = toField ttoField (g r t) = toField (r t) All goals completed! 🐙 k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bc:Fin 0 Cg:Gt1:S.Tensor ct2:S.Tensor chp1:toField (g t1) = toField t1hp2:toField (g t2) = toField t2toField (g (t1 + t2)) = toField (t1 + t2) All goals completed! 🐙lemma eq_smul_toField {c : Fin 0 C} (t : Tensor S c) : t = toField t (basis c (@default (ComponentIdx (S := S) c) Unique.instInhabited)) := k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bc:Fin 0 Ct:S.Tensor ct = toField t (basis c) default k:Typeinst✝⁵:CommRing kC:TypeG:Typeinst✝⁴:Group GV:C Typeinst✝³:(c : C) AddCommGroup (V c)inst✝²:(c : C) Module k (V c)basisIdx:C Typeinst✝¹:(c : C) Fintype (basisIdx c)inst✝:(c : C) DecidableEq (basisIdx c)rep:(c : C) Representation k G (V c)b:(c : C) Basis (basisIdx c) k (V c)S:TensorSpecies k C G V basisIdx rep bc:Fin 0 Ct:S.Tensor ctoField t = toField (toField t (basis c) default) All goals completed! 🐙