(* ::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:: *)
SetDirectory["C:\\drorbn\\AcademicPensieve\\People\\Kuno"];
<< FreeLie.m


(* ::Input::Initialization:: *)
Antipode[\[ScriptCapitalE]_]:=Expand[\[ScriptCapitalE]/.w_AW:>(-1)^Length[w] Reverse[w]]


(* ::Input::Initialization:: *)
R[_,0]=0;
R[A_,u_LW]:=R[A,u]=Module[{w1,w2},
If[Deg[u]===1,0,
{w1,w2}=LyndonFactorization[u];
Expand[
b[\[Iota][w1],R[A,w2]]+b[R[A,w1],\[Iota][w2]]
+Sum[(\[Tau][LW[\[Alpha]],w2]**AW[\[Alpha]]**Antipode[\[Tau][LW[\[Alpha]],w1]]-\[Tau][LW[\[Alpha]],w1]**AW[\[Alpha]]**Antipode[\[Tau][LW[\[Alpha]],w2]])/2,
{\[Alpha],A}]
]
]
];
Subscript[R, A_][\[ScriptCapitalE]_]:=Expand[\[ScriptCapitalE]/.LW[seq__]:>R[A,LW[seq]]];
Subscript[R, A_][ls_LieSeries] := Subscript[R, A][ls] = New[ASeries[as],
as[d_] := as[d] = Subscript[R, A][ls[d+1]]
];


(* ::Input::Initialization:: *)
P3[\[Psi]_LieSeries]:=Module[{pd},
pd=\[Tau][LW[y],\[Psi]];
pd + LieMorphism[{LW[x]->LW[y],LW[y]->0}]@pd - LieMorphism[{LW[x]->LW[x]+LW[y],LW[y]->0}]@pd-2\!\(\*SubscriptBox[\(R\), \({x, y}\)]\)[\[Psi]]
]



