<<PolylogTools`

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

basgen[i_,n_] := Table[If[k==i,1,0], {k, 1, n}];

cr[a_,b_,c_,d_]:=(a-c) (b-d)/((a-d) (b-c));
cr[a_,b_,c_,d_,e_]:={cr[a,b,c,d],cr[a,b,c,e]};
cr[a_,b_,c_,d_,e_,f_]:={cr[a,b,c,d],cr[a,b,c,e],cr[a,b,c,f]};

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

args = cr@@@Permutations[{a,b,c,d,e}];

sum = Sum[c[i]*I41@@args[[i]], {i,1,Length[args]}];

tensor = sum//CreateTensor//del//Expand;

tensor//Length

ByteCount[tensor]

%/1024/1024

%//N

coeffs = tensor//NoWedge//GatherCiTiList[#][[All,2]]&;

coeffs//Length

coeffstally = coeffs//Tally;

coeffstally//Length

coeffstally[[1]]

matrix = coeffstally[[All,1]]/.c[i_]:>basgen[i,Length[args]];

MatrixRank[matrix]

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

I311[x_,y_,z_] := G[z, y, 0, 0, x, 1];

i311tensor = I311@@cr[a,b,c,d,e,f]//CreateTensor//del//Expand;

i311tensor//Length

i41tensor = I41@@cr[a,b,c,d,e]//CreateTensor//del//Expand;

i41tensor//Length

(6!/5!) *(i311tensor//Length)/(i41tensor//Length)//N