(* ::Package:: *)

(************************************************************************)
(* This file was generated automatically by the Mathematica front end.  *)
(* It contains Initialization cells from a Notebook file, which         *)
(* typically will have the same name as this file except ending in      *)
(* ".nb" instead of ".m".                                               *)
(*                                                                      *)
(* This file is intended to be loaded into the Mathematica kernel using *)
(* the package loading commands Get or Needs.  Doing so is equivalent   *)
(* to using the Evaluate Initialization Cells menu command in the front *)
(* end.                                                                 *)
(*                                                                      *)
(* DO NOT EDIT THIS FILE.  This entire file is regenerated              *)
(* automatically each time the parent Notebook file is saved in the     *)
(* Mathematica front end.  Any changes you make to this file will be    *)
(* overwritten.                                                         *)
(************************************************************************)



(* ::Input::Initialization:: *)
Id=Cycles[{{}}];
Subscript[\[Sigma], i_,j_]:=Cycles[{{i,j}}];
ht[\[Sigma]_Cycles]=0;
\[Delta][\[Sigma]_Cycles]=0;
Subscript[c, k_][Cycles[l_List]]:=Cycles[k+l];


(* ::Input::Initialization:: *)
W[lft___,W[mid___],rgt___]:=W[lft,mid,rgt];
W[lft___,0,rgt___]=0;
W[lft___,s_Plus,rgt___]:=W[lft,#,rgt]&/@s;
W[lft___,c_?NumberQ * U_,rgt___]:=c W[lft,U,rgt];
W[lft___,Cycles@{},rgt___]:=W[lft,rgt];
W[lft___,p1_Cycles,p2_Cycles,rgt___] := W[lft,p1\[PermutationProduct]p2,rgt];
Subscript[c, k_][w_W]:=Subscript[c, k]/@w;


(* ::Input::Initialization:: *)
Subscript[c, k_][0]=0;
Subscript[c, k_][s_Plus]:=Subscript[c, k]/@s;
Subscript[c, k_][a_*w_W]:=a Subscript[c, k][w];
Subscript[c, k_][Subscript[U_, j_]]:= Subscript[U, k+j];


(* ::Input::Initialization:: *)
\[Sigma][Subscript[U_, k_]]:=Subscript[c, k][\[Sigma][U]];
\[Sigma][W[]]=Id;
\[Sigma][p_Cycles]:=p;
\[Sigma][W[f_,r___]] := \[Sigma][f]\[PermutationProduct]\[Sigma][W[r]];


(* ::Input::Initialization:: *)
\[Delta][0]=0;
\[Delta][s_Plus]:=\[Delta]/@s;
\[Delta][c_*w_W]:=c \[Delta][w];
\[Delta][W[]]=0;
\[Delta][Subscript[U_, k_]]:=Subscript[c, k][\[Delta][U]];
\[Delta][W[f_,r___]]:=W[\[Delta][f],r]+(-1)^ht[f] W[f,\[Delta][W[r]]];


(* ::Input::Initialization:: *)
ht[Subscript[U_, k_]]:=ht[U];


(* ::Input::Initialization:: *)
sfil[H]=1; vdeg[H]=1; ht[H]=0; \[Delta][H]=0; \[Sigma][H]=Id;


(* ::Input::Initialization:: *)
sfil[R[1]]=2; vdeg[R[1]]=1; ht[R[1]]=1; \[Delta][R[1]]:=W[Subscript[\[Sigma], 1,2],Subscript[H, 0]+Subscript[H, 1]]-W[Subscript[H, 0]+Subscript[H, 1],Subscript[\[Sigma], 1,2]]; \[Sigma][R[1]]=Subscript[\[Sigma], 1,2];


(* ::Input::Initialization:: *)
Subscript[\[ScriptCapitalU], s_,d_,h_][___] /; (d<0\[Or]h<0 ):= {};
Subscript[\[ScriptCapitalU], s_,0,0][___]:=W/@GroupElements@SymmetricGroup@s;
Subscript[\[ScriptCapitalU], s_,d_,h_][gens___]:=Flatten[Table[
Table[W[\[Sigma],Subscript[U, k],w],{w,Subscript[\[ScriptCapitalU], s,d-vdeg[U],h-ht[U]][gens]},{k,0,s-sfil[U]}],
{\[Sigma],GroupElements@SymmetricGroup@s},{U,{gens}}
]];
Subscript[\[ScriptCapitalU], p_Cycles,s_,d_,h_][gens___]:=Select[Subscript[\[ScriptCapitalU], s,d,h][gens],\[Sigma][#]==p&];


(* ::Input::Initialization:: *)
Subscript[\[Rho], p_,s_,d_,h_][gens___]:=Module[
{b0=Subscript[\[ScriptCapitalU], p,s,d,h-1][gens],b1=Subscript[\[ScriptCapitalU], p,s,d,h][gens],\[Delta]x},
If[b0==={}\[Or]b1==={},0,
MatrixRank[Table[\[Delta]x=\[Delta][x]; Table[Coefficient[\[Delta]x,y],{y,b0}], {x,b1}]]
]];
Subscript[\[Beta], p_,s_,d_,h_][gens___]:=Length[Subscript[\[ScriptCapitalU], p,s,d,h][gens]]-Subscript[\[Rho], p,s,d,h][gens]-Subscript[\[Rho], p,s,d,h+1][gens]



