<<PolylogTools`

I13[x_,y_] := G[0,0, y,x,1]

I23[x_,y_] := G[0,0, y,0,x,1]

I33[x_,y_] := G[0,0, y,0,0,x,1]

I42[x_,y_] := G[0, y,0,0,0,x,1]

I32[x_,y_] := G[0, y,0,0,x,1]

I22[x_,y_] := G[0, y,0,x,1]

I12[x_,y_] := G[0, y,x,1]

Li[{5}, {x_}] := -G[0, 0, 0, 0, 1/x, 1]

Li[{6}, {x_}] := -G[0, 0, 0, 0, 0, 1/x, 1]

GatherCiTiList[expr_]:=Block[{temp=flatTensor[Expand[expr]]},
temp=GatherBy[List@@CollectCiTi[temp,1],Last];
temp=CleanUp/@temp;
Return[temp];
];
CleanUp[list_List]:={list[[1,2]],Total[list[[All,1]]]}
CollectCiTi[sum_Plus,a_]:=CollectCiTi[#,a]&/@sum;
CollectCiTi[a_. ct_CiTi,b_]:=CollectCiTi[a, ct b];

CreateTensor[I32[x,y] + I32[1/x,1/y]]//sh//Expand

CreateTensor[I42[x,y] - I42[1/x,1/y]]//del//Expand

CreateTensor[I33[x,y] - I33[1/x,1/y]]//del//Expand

(*** generally Iab[x,y] - (-1)^(a+b)Iab[1/x,1/y] = 0 mod del?! ***)

original = I32[x,y] + I32[1/x,1/y];

CreateTensor[original]//sh//flatTensor//Expand

CreateTensor[Li[{5}, {x}]]//sh//flatTensor//Expand

c[1] = -6; c[3] = -4; c[2] = 1;

tbl = {Li[{5}, {x/y}], Li[{5}, {x}], Li[{5}, {y}]};
sum = CreateTensor[original + Sum[c[i] tbl[[i]], {i, 1, Length[tbl]}]]//sh//flatTensor//Expand;
#[[2]] & /@ GatherCiTiList[sum]

sum

original + Sum[c[i] tbl[[i]], {i, 1, Length[tbl]}]

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

original = I33[x,y] - I33[1/x,1/y];

CreateTensor[original]//sh//flatTensor//Expand

CreateTensor[Li[{6}, {x}]]//sh//flatTensor//Expand

Clear[c]

c[1] = -10; c[3] = 10; c[2] = -1;

tbl = {Li[{6}, {x/y}], Li[{6}, {x}], Li[{6}, {y}]};
sum = CreateTensor[original + Sum[c[i] tbl[[i]], {i, 1, Length[tbl]}]]//sh//flatTensor//Expand;
Union[#[[2]] & /@ GatherCiTiList[sum]]

sum

original + Sum[c[i] tbl[[i]], {i, 1, Length[tbl]}]

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

original = I42[x,y] - I42[1/x,1/y];

CreateTensor[original]//sh//flatTensor//Expand

CreateTensor[Li[{6}, {x}]]//sh//flatTensor//Expand

Clear[c]

c[1] = 10; c[2] = -1; c[3] = -5;

tbl = {Li[{6}, {x/y}], Li[{6}, {x}], Li[{6}, {y}]};
sum = CreateTensor[original + Sum[c[i] tbl[[i]], {i, 1, Length[tbl]}]]//sh//flatTensor//Expand;
Union[#[[2]] & /@ GatherCiTiList[sum]]

sum

original + Sum[c[i] tbl[[i]], {i, 1, Length[tbl]}]

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

original = I23[x,y] + I23[1/x,1/y];

CreateTensor[original]//sh//flatTensor//Expand;

CreateTensor[Li[{5}, {x}]]//sh//flatTensor//Expand

Clear[c]

c[1] = 6; c[2] = 4; c[3] = 1;

tbl = {Li[{5}, {y}], Li[{5}, {x/y}], Li[{5}, {x}]};
sum = CreateTensor[original + Sum[c[i] tbl[[i]], {i, 1, Length[tbl]}]]//sh//flatTensor//Expand;
Union[#[[2]] & /@ GatherCiTiList[sum]]

sum

original + Sum[c[i] tbl[[i]], {i, 1, Length[tbl]}]

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

CreateTensor[I12[x,y] + I12[1/x,1/y] - 2 Li[{3}, {y}] - Li[{3}, {x/y}] + Li[{3}, {x}]]//sh//flatTensor//Expand

CreateTensor[I22[x,y] - I22[1/x,1/y] - 3 Li[{4}, {y}] +3 Li[{4}, {x/y}] - Li[{4}, {x}]]//sh//flatTensor//Expand

CreateTensor[I32[x,y] + I32[1/x,1/y] - 4 Li[{5}, {y}] - 6 Li[{5}, {x/y}] + Li[{5}, {x}]]//sh//flatTensor//Expand

CreateTensor[I42[x,y] - I42[1/x,1/y] - 5 Li[{6}, {y}] + 10 Li[{6}, {x/y}] - Li[{6}, {x}]]//sh//flatTensor//Expand

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

CreateTensor[I13[x,y] - I13[1/x,1/y] + 3 Li[{4}, {y}] - Li[{4}, {x/y}] - Li[{4}, {x}]]//sh//flatTensor//Expand

CreateTensor[I23[x,y] + I23[1/x,1/y] + 6 Li[{5}, {y}] + 4Li[{5}, {x/y}] + Li[{5}, {x}]]//sh//flatTensor//Expand

CreateTensor[I33[x,y] - I33[1/x,1/y] + 10 Li[{6}, {y}] - 10Li[{6}, {x/y}] - Li[{6}, {x}]]//sh//flatTensor//Expand

Iab[{a_Integer/; a≥1,b_Integer /; b ≥ 1}, {x_,y_}] := G@@Join[Table[0, {b-1}], {y} , Table[0, {a-1}], {x, 1}]

Iab[{0,3}, {x,y}]

identity[a_Integer, b_Integer] := Iab[{a,b}, {x,y}] - (-1)^(a+b) Iab[{a,b}, {1/x,1/y}] - (-1)^(a+b) Li[{a+b}, {x}] -(-1)^b Binomial[a+b-1,b-1] Li[{a+b}, {y}] + (-1)^(a) Binomial[a+b-1, b] Li[{a+b}, {x/y}]

CreateTensor[identity[1,1]]//sh//flatTensor//Expand

Table[CreateTensor[identity[a,b]]//sh//flatTensor//Expand, {b, 1, 5}, {a, 1, 6-b}]

LiM[n_, x_, y_] := Sum[(-Log[x])^i Li[{n-i},{y}]/i!,{i,0,n-1}]

(-1)^n (Li[{n+1},{x}]+n Li[{n+1},{x/y}])+
LiM[n+1, x, y] - 
(-1)^n Log[x/y] Li[{n}, {x/y}] -
(-1)^n(Log[x/y]^(n+1) - Log[x]^(n+1))/(n+1)!

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

c[1] = .; c[2] = 1; c[5] = -1; c[6] = 1; c[7] = 1;

tbl = Join[List@@LiM[3,x,y], {Log[x/y] Li[{2}, {x/y}], Log[x/y]^3/3!, Log[x]^3/3!, Li[{3}, {x}], Li[{3}, {x/y}]}]

sum = Iab[{1,2}, {x,y}] + Iab[{1,2}, {1/x,1/y}] - Sum[c[i] tbl[[i]], {i, 1 , Length[tbl]}];
tensor = CreateTensor[sum];
Union[#[[2]] & /@ GatherCiTiList[tensor]]

CreateTensor[Iab[{1,2}, {x,y}] + Iab[{1,2}, {1/x,1/y}] ]

DeleteCases[%, x_Integer]

Solve[# == 0 & /@ %]

identity[1,2]

original = Iab[{1,2}, {x,y}] + Iab[{1,2}, {1/x,1/y}]+Li[{3},{x}]-Li[{3},{x/y}]-2 Li[{3},{y}];

CreateTensor[original]

Clear[c]

c[1] = -1; c[2] = 1; c[3] = 1;

tbl = {Log[x-y] Log[y]^2/2, Log[x]^2Log[x-y]/2, Log[x] Li[{2}, {y}], Log[x] Li[{2}, {x/y}]}

sum = original + Sum[c[i]tbl[[i]], {i, 1 ,Length[tbl]}];
tensor = CreateTensor[sum]
Union[#[[2]] & /@ GatherCiTiList[tensor]]

CreateTensor[Li[{1}, {x/y}]]

GatherCiTiList[tensor]

CreateTensor[Log[x-y]Li[{2}, {y}]]

CreateTensor /@ Join[{Li[{3},{y}],-Li[{2},{y}] Log[x], Log[x/y] Li[{2}, {x/y}], Log[x/y]^3/3!, Log[x]^3/3!, Li[{3}, {x}], Li[{3}, {x/y}]}]

List@@LiM[2,x,y]

CreateTensor[Log[x] Li[{2}, {x/y}] - 0Log[x]Log[y]]

CreateTensor[identity[3,2]]

CreateTensor[Iab[{1,1}, {x,y}] + Iab[{1,1}, {1/x,1/y}]+Li[{2},{x}]-Li[{2},{x/y}]+Li[{2},{y}]]//sh//Expand