(* ::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.                                                         *)
(************************************************************************)



\[Lambda]Collect[\[Lambda][\[Omega]_, \[Mu]_]] := \[Lambda][\[Omega], Collect[\[Mu], _h, Expand]];
\[Lambda] /: Series[\[Lambda][\[Omega]_, \[Mu]_], d_Integer] := \[Lambda][\[Omega], Collect[\[Mu], _h, MakeLieSeries[d,#]&]];
Random\[Lambda][d_,m_,n_] := Module[{bas},
bas=AllLyndonWords[{d}, Characters[StringTake["1234567890", m]]];
Series[\[Lambda][0, Expand[Sum[
h[j](RandomInteger[{-2,2},Length[bas]].bas),
{j,n}
]]], d] // \[Lambda]Collect
];
hL[\[Lambda]_] := Union[Cases[\[Lambda], h[s_] :> s, Infinity]];
\[Lambda] /: \[Lambda][\[Omega]1_, \[Mu]1_] == \[Lambda][\[Omega]2_, \[Mu]2_] := \[Omega]1==\[Omega]2 && (And @@ ((D[\[Mu]1, h[#]]==D[\[Mu]2, h[#]])& /@ hL[{\[Mu]1, \[Mu]2}]));


tm[x_,y_,z_][\[Lambda][\[Omega]_, \[Mu]_]] := \[Lambda][0, \[Mu] // LieMorphism[{\[LeftAngleBracket]x\[RightAngleBracket]->\[LeftAngleBracket]z\[RightAngleBracket], \[LeftAngleBracket]y\[RightAngleBracket]->\[LeftAngleBracket]z\[RightAngleBracket]}]];
hm[x_,y_,z_][\[Lambda][\[Omega]_, \[Mu]_]] := \[Lambda][0, Plus[
\[Mu] /. {h[x]->0, h[y]->0},
h[z]BCH[D[\[Mu], h[x]], D[\[Mu], h[y]]]
]];
hta[x_,y_,z_][\[Lambda][\[Omega]_, \[Mu]_]] := \[Lambda][0,
FixedPoint[LieMorphism[{
LW[y] -> Ad[-D[\[Mu], h[x]]][LW[z]]
}],
\[Mu]]
];
hta[x_,y_][\[Lambda]_] := \[Lambda] // hta[x,y,LW["z"]] // LieMorphism[{LW["z"] -> LW[y]}];
dm[x_,y_,z_][\[Lambda]_] := \[Lambda] // hta[y,x] // tm[x,y,z] // hm[x,y,z];
Rp[x_,y_] := \[Lambda][0,h[y]\[LeftAngleBracket]x\[RightAngleBracket]];
\[Lambda] /: \[Lambda][\[Omega]1_, \[Mu]1_]\[Lambda][\[Omega]2_,\[Mu]2_] := \[Lambda][\[Omega]1+\[Omega]2, \[Mu]1+\[Mu]2];



