G:=PSp(8,2);

load "Subgroups/functions.txt";

Irr:=OrderByDimension(StripDuplicates(CompositionFactors(PermutationModule(G,GF(2)))));
Remove(~Irr,3);
labs:=["1","8","26","48"];

L:=Subgroups(G:OrderEqual:=Order(SOPlus(8,2)))[1]`subgroup;
M:=Subgroups(G:OrderEqual:=Factorial(10))[1]`subgroup;
repeat g:=Random(G); until Order(L meet M^g) eq Factorial(9); M:=M^g; delete g;

&and[IsIrreducible(Restriction(i,L meet M)):i in Irr];

// Produce the quotient of the permutation module.

PM:=PermutationModule(G,M,GF(2));
JPM:=PM;
for i in [1,4,1,3,1,2,1] do
  homs:=AHom(JPM,Irr[i]);
  JPM:=&meet[Kernel(homs.i):i in [1..Dimension(homs)]];
end for;

PM1:=PM/JPM;
for i in Irr do Dimension(AHom(JPM,i)) eq 0; end for;

DescribeLayers(PM1,Irr,labs);
DescribeLayers(Dual(PM1),Irr,labs);

PM2:=PM1/Fix(PM1);
DescribeLayers(PM2,Irr,labs);
// We need to remove 26 from the second socle layer. This means that exactly one of the 8s must disappear as well.
Subs:=Submodules(Dual(PM2):CodimensionLimit:=34);
PM3:=Dual(Subs[1]);
DescribeLayers(PM3,Irr,labs);

Dimension(Ext(Irr[1],PM3)) eq 0;
Dimension(Ext(Irr[4],PM3)) eq 0;
E,rho:=Ext(Irr[3],PM3); Dimension(E) eq 1; M1:=Extension(Irr[3],PM3,E.1,rho);
DescribeLayers(M1,Irr,labs);
E,rho:=Ext(Irr[2],PM3); Dimension(E) eq 1; M2:=Extension(Irr[2],PM3,E.1,rho);
DescribeLayers(M2,Irr,labs);
Dimension(Ext(Irr[1],M2)) eq 0;

E,rho:=Ext(Dual(M2),Irr[3]); Dimension(E) eq 2; M3:=Dual(MaximalExtension(Dual(M2),Irr[3],E,rho));
DescribeLayers(M3,Irr,labs);

// To test and be absolutely sure that the 26s split off, we prove it completely, rather than just restrict M3 and check.

// First, we make M2 into a submodule of M3.
homs:=AHom(M2,M3);
repeat x:=Random(homs); until IsInjective(x);
M2a:=Image(x);

// Then restriction to L meet M.

M3r:=Restriction(M3,L meet M);
M2r:=sub<M3r|[M3!(M2a.i):i in [1..Dimension(M2a)]]>;
Bool,X:=HasComplement(M3r,M2r);
Bool; IsSemisimple(X);