<<PolylogTools`

(* -------- *)

SetAttributes[L5sym, HoldAll];
Options[L5sym] = {oneOverY->False, oneMinusOneOverX->False};
L5sym[coeff_, arg_, opts:OptionsPattern[]] := Module[{oneOverYTF, oneMinusOneOverXTF, coeffs, args}, (
oneOverYTF = OptionValue[oneOverY]== True;
oneMinusOneOverXTF = OptionValue[oneMinusOneOverX]== True;

coeffs = {Hold[coeff]};
args =  {Hold[arg]};

If[oneMinusOneOverXTF,
coeffs = Join[coeffs, coeffs, coeffs];
args = Join[args, args/.{HoldPattern[x]->1-1/x}, args/.{HoldPattern[x]->1/(1-x)}];
];
If[oneOverYTF,
coeffs = Join[coeffs, -coeffs];
args = Join[args, args/.{y->1/y}];
];

Return[Plus@@Release[MapThread[#1L5i[#2]&, {coeffs, args}]]];
)];

L5can[expr_] := expr/.L5i[arg_]:>L5i[Sort[Factor[{arg, 1/arg}]][[1]]]

(* ----------- *)

I41[x_,y_]:=G[y,0,0,0,x,1];
I41m[x_,y_]:=(I41[x,y]-I41[x,1/y])/2;

N5[x_] := G[0, 0, 0, 1, 1,x];

L5[x_]:=-G[0,0,0,0,1/x,1];

(* ----------- *)

i41terms = I41m[x, y] + I41m[1/(1-x), y] + I41m[1-1/x, y];

li5termsFull = N5[y] +(1/2) L5i[1-y]-(1/4) L5i[(1/((-1+x) (-1+y)))]-(1/4) L5i[((-1+x)/(-1+y))]-(1/4) L5i[-(1/(x (-1+y)))]-(1/4) L5i[-((-1+x)/(x (-1+y)))]-(1/4) L5i[-(x/(-1+y))]-(1/4) L5i[-(x/((-1+x) (-1+y)))]-(1/12) L5i[-((-1+y)/((-1+x) x (y^2)))]-(1/12) L5i[-(((((-1+x))^2) (-1+y))/(x (y^2)))]-(1/12) L5i[(((x^2) (-1+y))/((-1+x) (y^2)))]-(3/2) L5i[(1/y)]-L5i[-(1/((-1+x) y))]+L5i[-((-1+x)/y)]+L5i[(1/(x y))]-L5i[((-1+x)/(x y))]-L5i[(x/y)]+L5i[(x/((-1+x) y))]+(1/12) L5i[-((-1+x)/((x^2) (-1+y) y))]+(1/12) L5i[(x/((((-1+x))^2) (-1+y) y))]+(1/12) L5i[(((-1+x) x)/((-1+y) y))]-(1/2) L5i[((-1+y)/y)]+(1/4) L5i[-((-1+y)/((-1+x) y))]+(1/4) L5i[-(((-1+x) (-1+y))/y)]+(1/4) L5i[((-1+y)/(x y))]+(1/4) L5i[(((-1+x) (-1+y))/(x y))]+(1/4) L5i[((x (-1+y))/y)]+(1/4) L5i[((x (-1+y))/((-1+x) y))];

li5termsShort = L5sym[(1/12),((x(1-x))/(y(1-y))),{oneMinusOneOverX->True,oneOverY->True}]+
+L5sym[1,x y,{oneMinusOneOverX->True,oneOverY->True}]+
-L5sym[(1/4),((1-y)/(x )),{oneMinusOneOverX->True,oneOverY->True}]+ 
-L5sym[(1/4),x (1-y),{oneMinusOneOverX->True,oneOverY->True}]+
 +L5sym[(1/6),1-y,{oneMinusOneOverX->True,oneOverY->True}] +
 - 3/2 L5i[y] + N5[y];

li5termsFull - li5termsShort//L5can//Expand

result = i41terms - li5termsShort/.{L5i->L5,I41i->I41};

result//CreateTensor//sh//flatTensor//Expand

(* ------------- *)

(- 3/2 L5i[y] + N5[y]) - (3/2 L5i[1/y] - N5[1/y])/.{L5i->L5}//CreateTensor//sh//flatTensor//Expand

N5[y] - N5[1/y]

(- 3/2 L5i[y] + N5[y]) - (N5[y] - N5[1/y])/2/.{L5i->L5}//CreateTensor//sh//flatTensor//Expand