/* In this case we let H denote a copy of PSL(2,8), L denote the subgroup 2^3.7, and let G denote G2(7).
We give matrices defining L, an element of order 2 and an element of order 7. We give an element x that
conjugates our version of L into G, as constructed using the ChevalleyGroup command. We give H as a pair
of matrices, which were chosen at random. A posteriori, one could produce H as a subgroup of F4 and show
that no other overgroup of L preserves the F4 trilinear form, but we prefer a less synthetic proof. Note
that G2 contains a copy of H, but only over a field of size 343. We therefore aim to show that this field
is necessary for the conjugacy to work.
*/
F:=GF(7);

l1:=GL(26,F)![[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,1,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,6,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,6,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,1,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,1,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,6,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,6,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0],
[0,0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0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[6,0,0,0,0,0,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[5,2,0,0,0,2,3,5,3,0,6,2,6,1,0,0,0,0,0,0,0,0,0,0,0,0],
[3,3,0,0,0,2,0,4,1,0,2,6,6,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,6,0,0,0,1,4,3,3,0,2,0,6,0,1,0,0,0,0,0,0,0,0,0,0,0],
[4,1,0,0,0,4,4,5,6,0,0,6,6,0,0,1,0,0,0,0,0,0,0,0,0,0],
[5,4,0,0,0,1,5,0,1,0,6,5,6,0,0,0,0,0,1,0,0,0,0,0,0,0],
[4,5,0,0,0,4,5,4,0,0,5,2,6,0,0,0,0,1,0,0,0,0,0,0,0,0],
[5,2,5,0,0,0,3,3,6,0,5,5,0,1,1,1,1,1,1,0,0,0,0,0,0,0],
[4,1,0,4,0,5,5,3,4,0,0,4,2,1,3,6,0,5,4,5,2,0,0,0,0,0],
[1,3,5,6,0,5,0,3,0,0,4,0,2,0,1,2,0,4,5,5,0,0,0,0,0,0],
[1,0,5,5,0,5,3,5,4,0,4,0,0,1,1,6,0,4,0,5,0,2,0,0,0,0],
[5,6,3,2,0,2,3,3,2,0,0,0,6,1,3,0,0,0,5,5,0,0,2,0,0,0],
[2,2,4,1,0,5,3,0,0,0,0,2,0,3,0,2,0,5,5,5,0,0,0,0,0,2],
[1,2,4,3,0,2,3,3,0,0,2,4,6,3,1,0,0,5,4,5,0,0,0,0,2,0],
[5,3,6,0,3,0,5,5,2,3,2,2,0,1,1,0,2,5,5,0,2,2,2,2,2,2]];

/* We next give the symmetric trilinear form that comes from F4, which is determined by G2. This was found by
choosing elements of G2, looking at a module for G2(7) hich restricts to L, and then using the G-invariance of
the form to obtain constraints on the structure constants of it. Code is included at the end to reconstruct
this, but it can take a short while, so we give it here for ease of calculations.
*/

f26:=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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,6,5,4,1,4,4,3,6
,5,3,2,5,3,5,5,1,4,0,0,1,4,4,3,2,2,1,2,1,1,5,4,3,0,4,1,1,5,0,0,4,5,1,5,0,1,0,0,4,4,5,1,4,3,3,6,1,5,4,1,2,4,4,0,3,4,1,1,3,0,5,0,4,1,2,3,5,5,2,1,2,0,5,1,0,5
,5,0,1,0,1,0,0,4,5,0,1,3,4,1,1,2,4,5,4,2,3,5,4,5,2,2,1,1,1,3,5,0,1,0,0,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,0,4,4,4,4,4,4,4,4,4,4,4,4,4,4
,4,4,4,4,4,4,0,4,4,4,4,4,4,4,4,4,4,4,4,4,4,0,4,4,4,4,4,4,4,4,4,0,4,4,4,4,4,0,4,4,0];

// We need the indices of the trilinear form as well.
seqs:=[[i,j,k]:i,j,k in [1..26]|i le j and j le k];

// Now set up the centralizer of L in GL(26,F), which is given by all possible matrices scal below. Note that a and c also
// centralize H, so we may assume that a=1 and c=0 when doing computations.

R<a,b,c,d,e,m1,m2,m3,m4,m5,m6,m7,m8,m9>:=PolynomialRing(F,14);
mats:=MatrixRing(R,26);
scal:=DiagonalMatrix([a,a,a,a,a,m1,m1,m1,m1,m1,m1,m1,m5,m5,m5,m5,m5,m5,m5,m9,m9,m9,m9,m9,m9,m9]);
scal[2,1]:=b; scal[3,2]:=b; scal[4,3]:=b; scal[5,4]:=b;
scal[3,1]:=c; scal[4,2]:=c; scal[5,3]:=c;
scal[4,1]:=d; scal[5,2]:=d;
scal[5,1]:=e;

for i in [6..12] do
  scal[i,i+7]:=m2; scal[i,i+14]:=m3;
  scal[i+7,i]:=m4; scal[i+7,i+14]:=m6;
  scal[i+14,i]:=m7; scal[i+14,i+7]:=m8;
end for;

scal*mats!l1 eq mats!l1*scal and scal*mats!l2 eq mats!l2*scal;

// The automorphisms [a,0,c,-c,e,a,0,0,c,a,0,e,c,a] also centralize H, so we may quotient out by them, and assume that
// a=1, c=0, e=0 with all other parameters allowed to vary.

function Matricise(v)
return Matrix(1,NumberOfColumns(v),[R!v[i]:i in [1..NumberOfColumns(v)]]);
end function;

// We now show that g, which is the second generator of H (the first lies in L, so is fine) satisfies the equations mentioned
V:=GModule(L);
g:=mats!(H.2);

ents:=[i:i in [1..#f26]|f26[i] ne 0];
intseqs1:=[seqs[i]:i in ents];
intseqs:=&join{{[i[1],i[2],i[3]],[i[1],i[3],i[2]],[i[2],i[1],i[3]],[i[2],i[3],i[1]],[i[3],i[1],i[2]],[i[3],i[2],i[1]]}:i in intseqs1};

function ProdRel(seq)

u:=V.seq[1]; v:=V.seq[2]; w:=V.seq[3];
u1:=Matricise(u)*scal; v1:=Matricise(v)*scal; w1:=Matricise(w)*scal;
u2:=Matricise(u)*g*scal; v2:=Matricise(v)*g*scal; w2:=Matricise(w)*g*scal;
e1:=&+[u1[1,i[1]]*v1[1,i[2]]*w1[1,i[3]]*f26[Position(seqs,Sort([i[1],i[2],i[3]]))]:i in intseqs];
e2:=&+[u2[1,i[1]]*v2[1,i[2]]*w2[1,i[3]]*f26[Position(seqs,Sort([i[1],i[2],i[3]]))]:i in intseqs];

return e1-e2;
end function;

function ProdRelGen(seq,gg)

u:=V.seq[1]; v:=V.seq[2]; w:=V.seq[3];
u1:=Matricise(u)*scal; v1:=Matricise(v)*scal; w1:=Matricise(w)*scal;
u2:=Matricise(u)*mats!gg*scal; v2:=Matricise(v)*mats!gg*scal; w2:=Matricise(w)*mats!gg*scal;
e1:=&+[u1[1,i[1]]*v1[1,i[2]]*w1[1,i[3]]*f26[Position(seqs,Sort([i[1],i[2],i[3]]))]:i in intseqs];
e2:=&+[u2[1,i[1]]*v2[1,i[2]]*w2[1,i[3]]*f26[Position(seqs,Sort([i[1],i[2],i[3]]))]:i in intseqs];

return e1-e2;
end function;

function ProdRelForScal(seq)

u:=V.seq[1]; v:=V.seq[2]; w:=V.seq[3];
u1:=Matricise(u); v1:=Matricise(v); w1:=Matricise(w);
u2:=Matricise(u)*scal; v2:=Matricise(v)*scal; w2:=Matricise(w)*scal;
e1:=&+[u1[1,i[1]]*v1[1,i[2]]*w1[1,i[3]]*f26[Position(seqs,Sort([i[1],i[2],i[3]]))]:i in intseqs];
e2:=&+[u2[1,i[1]]*v2[1,i[2]]*w2[1,i[3]]*f26[Position(seqs,Sort([i[1],i[2],i[3]]))]:i in intseqs];

return e1-e2;
end function;

coeffs0:=[a,b,c,d,e,m1,m2,m3,m4,m5,m6,m7,m8,m9];

function ChangeCoefficient(coeffs,coeff,target)
coeffs2:=coeffs;
nn:=Position(coeffs0,coeff);
coeffs2[nn]:=target;
return [Evaluate(i,coeffs2):i in coeffs];
end function;

function ChangeCoefficients(coeffs,coeff,target)
coeffs2:=coeffs;
for i in [1..#coeff] do
  nn:=Position(coeffs0,coeff[i]);
  coeffs2[nn]:=target[i];
end for;
return [Evaluate(i,coeffs2):i in coeffs];
end function;


function CheckDetermination()

// Since a ne 0, the next two factorizations prove that a + 3*m1 + 3*m2 + 5*m3=0.
ProdRel([1,3,5]) eq 2*(a+m1+m2+4*m3)*(a+3*m1+3*m2+5*m3)^2;
ProdRel([1,1,6]) eq (m1+m2+4*m3)^2*(a+3*m1+3*m2+5*m3);
// Thus m3=4*a+5*m1+5*m2
coeffs1:=ChangeCoefficient(coeffs0,m3,4*a+5*m1+5*m2);

Evaluate(ProdRel([1,2,6]),coeffs1) eq a^2*(5*b+2*m1-m2);
// Therefore m2=5*b+2*m1.
coeffs2:=ChangeCoefficient(coeffs1,m2,5*b+2*m1);

Evaluate(ProdRel([1,3,6]),coeffs2)-5*Evaluate(ProdRel([1,5,5]),coeffs2) eq a^2*(a+3*b+2*c+3*m1+6*m4+6*m5+3*m6);
// Therefore m6=2*a + 6*b + 4*c + 6*m1 + 5*m4 + 5*m5
coeffs3:=ChangeCoefficient(coeffs2,m6,2*a+6*b+4*c+6*m1+5*m4+5*m5);

// At this point it seems very difficult to find another variable. What we can do is assume that a=1, by multiplying scal by a scalar matrix.

coeffs3again:=ChangeCoefficient(coeffs3,a,1);
3*Evaluate(ProdRel([1,5,5]),coeffs3again) eq 2*b^2+4*b+3-m1;
// Thus m1=2*b^2+4*b+3.
coeffs4:=ChangeCoefficient(coeffs3again,m1,2*b^2+4*b+3);

2*Evaluate(ProdRel([1,4,6]),coeffs4) eq (2*b^3+b^2+2*b*c+b+3*c+3*d+2*m4+3)-m5;
// Thus m5=2*b^3+b^2+2*b*c+b+3*c+3*d+2*m4+3.
coeffs5:=ChangeCoefficient(coeffs4,m5,2*b^3+b^2+2*b*c+b+3*c+3*d+2*m4+3);

-Evaluate(ProdRel([1,7,16]),coeffs5) eq (2*b^3+4*b^2+b*c+b+6*c)-d;
// Thus d=2*b^3+4*b^2+b*c+b+6*c.
coeffs6:=ChangeCoefficient(coeffs5,d,2*b^3+4*b^2+b*c+b+6*c);

Evaluate(ProdRel([1,3,13]),coeffs6) eq (6*b^4+6*b^3+2*b^2*c+4*b*c+5*b+3*c+2)-m4;
// Thus m4=6*b^4+6*b^3+2*b^2*c+4*b*c+5*b+3*c+2.
coeffs7:=ChangeCoefficient(coeffs6,m4,6*b^4+6*b^3+2*b^2*c+4*b*c+5*b+3*c+2);

2*Evaluate(ProdRel([1,5,6]),coeffs7) eq (2*b^4+4*b^3+5*b^2*c+4*b^2+6*b*c+4*b+6*c+4*e+5*m7+5*m8+1)-m9;
// Thus m9=2*b^4+4*b^3+5*b^2*c+4*b^2+6*b*c+4*b+6*c+4*e+5*m7+5*m8+1
coeffs8:=ChangeCoefficient(coeffs7,m9,2*b^4+4*b^3+5*b^2*c+4*b^2+6*b*c+4*b+6*c+4*e+5*m7+5*m8+1);

4*Evaluate(ProdRel([1,7,23]),coeffs8) eq (6*b^5+5*b^4+b^3*c+5*b^3+4*b^2*c+4*b*c+5*b*e+b+3*c+2*m7+2)-m8;
// Thus m8=6*b^5+5*b^4+b^3*c+5*b^3+4*b^2*c+4*b*c+5*b*e+b+3*c+2*m7+2
coeffs9:=ChangeCoefficient(coeffs8,m8,6*b^5+5*b^4+b^3*c+5*b^3+4*b^2*c+4*b*c+5*b*e+b+3*c+2*m7+2);

Evaluate(ProdRel([1,3,20]),coeffs9) eq (b^6+4*b^5+6*b^4*c+4*b^4+b^3*c+5*b^3+4*b^2*c+2*b^2*e+4*b^2+b*c+4*b*e+4*b+2*c+3*e)-m7;
//Thus m7=b^6+4*b^5+6*b^4*c+4*b^4+b^3*c+5*b^3+4*b^2*c+2*b^2*e+4*b^2+b*c+4*b*e+4*b+2*c+3*e.
coeffs10:=ChangeCoefficient(coeffs9,m7,b^6+4*b^5+6*b^4*c+4*b^4+b^3*c+5*b^3+4*b^2*c+2*b^2*e+4*b^2+b*c+4*b*e+4*b+2*c+3*e);

// This satisfies all coefficients. To check this takes ages, but simply involves doing ProdRel on every sequence and evaluating it
// on these coefficients. The answer is always 0. Note that b,c,e are arbitrary (and a was chosen to be 1), so this is a 4-space of
// solutions. This seems right, as L has a 1-dimensional centralizer in F4 (the U in the UG2<A1G2 that contains L), and H has a
// 3-dimensional centralizer in GL(26,k). In order to confirm this we need to construct the centralizer of L in F4 (it must consist
// of matrices of the form scal) first.

// We now check that we can place a copy of H.3 (the matrix j2) above one of the copies of H. Since we will show that they are all
// conjugate by elements C_G(L) afterwards it doesn't matter which we choose.

Evaluate(ProdRelGen([1,5,5],j2),coeffs10) eq b^2+6*b+5*c+4; // Thus c=4*b^2+3*b+2
coeffs11:=ChangeCoefficient(coeffs10,c,4*b^2+3*b+2);

4*Evaluate(ProdRelGen([1,6,20],j2),coeffs11) eq 5*b^4+5*b^3+2*b+6*e; // Thus e=5*b^4+5*b^3+2*b
coeffs12:=ChangeCoefficient(coeffs11,e,5*b^4+5*b^3+2*b);

// This satisfies all coefficients. To check this takes ages, but simply involves doing ProdRelGen on every sequence and evaluating
// it on these coefficients. The answer is always 0. Note that b is arbitrary (and a was chosen to be 1), so this is a 2-space of
// solutions.

// The next step is to compute the centralizer in F4 of L, which is unipotent of dimension 1.

ProdRelForScal([1,4,4]) eq (a-4)*(a-2)*(a-1);
// Note that the scalar matrices with entries 2 and 4 also centralize the trilinear form. The one that we want is
c1:=[1,b,c,d,e,m1,m2,m3,m4,m5,m6,m7,m8,m9];

Evaluate(ProdRelForScal([1,6,6]),c1) eq (m1+m2+4*m3+1)*(m1+m2+4*m3+6);
Evaluate(ProdRelForScal([6,6,7]),c1) eq 3*(m1+m2+4*m3+3)*(m1+m2+4*m3+5)*(m1+m2+4*m3+6);
// Thus m1+m2+4*m3+6=0, so m3=5*m1+5*m2+2

Evaluate(ProdRelForScal([1,13,13]),c1) eq (m4+m5+4*m6+1)*(m4+m5+4*m6+6);
Evaluate(ProdRelForScal([13,13,14]),c1) eq 3*(m4+m5+4*m6+3)*(m4+m5+4*m6+5)*(m4+m5+4*m6+6);
// Thus m4+m5+4*m6+3=0, so m6=5*m4+5*m5+2

Evaluate(ProdRelForScal([1,20,20]),c1) eq (m7+m8+4*m9+3)*(m7+m8+4*m9+4);
Evaluate(ProdRelForScal([20,20,21]),c1) eq 3*(m7+m8+4*m9+3)*(m7+m8+4*m9+5)*(m7+m8+4*m9+6);
// Thus m7+m8+4*m9+3=0, so m9=5*m7+5*m8+1

Evaluate(ProdRelForScal([1,5,5]),c1) eq b^2 + 6*b + 5*c; //Thus c=4*b^2+3*b
c2:=ChangeCoefficients(c1,[c,m3,m6,m9],[4*b^2+3*b,5*m1+5*m2+2,5*m4+5*m5+2,5*m7+5*m8+1]);


5*Evaluate(ProdRelForScal([2,20,20]),c2) eq 3*b+2*m7-m8;
-Evaluate(ProdRelForScal([2,13,13]),c2) eq 6*b+2*m4+1-m5;
-Evaluate(ProdRelForScal([2,6,6]),c2) eq 6*b+2*m1+5-m2;
// Thus m8=3*b+2*m7, m5=6*b+2*m4+1, m2=6*b+2*m1+5
2*Evaluate(ProdRelForScal([2,5,5]),c2) eq 6*b^3+3*b^2+5*b-d; //Thus d=6*b^3+3*b^2+5*b
c3:=ChangeCoefficients(c2,[d,m2,m5,m8],[6*b^3+3*b^2+5*b,6*b+2*m1+5,6*b+2*m4+1,3*b+2*m7]);

-Evaluate(ProdRelForScal([4,4,5]),c3) eq 5*b^4+5*b^3+6*b^2+5*b-e; //Thus e=5*b^4+5*b^3+6*b^2+5*b
Evaluate(ProdRelForScal([3,13,13]),c3) eq b^2-m4; // Thus m4=b^2
2*Evaluate(ProdRelForScal([3,20,20]),c3) eq 4*b^2+b-m7; // Thus m7=4*b^2+b
c4:=ChangeCoefficients(c3,[e,m4,m7],[5*b^4+5*b^3+6*b^2+5*b,b^2,4*b^2+b]);

Evaluate(ProdRelForScal([3,12,25]),c4) eq b^2+6*b+1-m1; // Thus m1=b^2+6*b+1
c5:=ChangeCoefficients(c4,[m1],[b^2+6*b+1]);

// This is the centralizer in F4 of L, as a generic element
cent:=Evaluate(scal,c5);

// Now check that the possibilities for H.3 are just conjugates by C_G(L):
mov1:=Evaluate(scal,coeffs12);
mov:=Evaluate(mov1,[0:i in [1..14]]);
mov1 eq mov*cent;


// Of course, mov1 is a subset of movall:
movall:=Evaluate(scal,coeffs10);

// Here is the centralizer of H, and then determinant 1 matrices
coeffscent:=[a,0,c,-c,e,a,0,0,c,a,0,e,c,a];
centH:=Evaluate(scal,coeffscent);
scoeffscent:=[1,0,c,-c,e,1,0,0,c,1,0,e,c,1];
scentH:=Evaluate(scal,scoeffscent);

// We shift the expression of scoeffscent, but of course this is the same group if one fixes b.
scoeffscent:=[1,0,c-4*b^2-3*b-2,-(c-4*b^2-3*b-2),e-(3*b^4+6*b^3+4*b^2*c+6*b^2+2*b*c+6*b+2*c+3)
,1,0,0,c-4*b^2-3*b-2,1,0,e-(3*b^4+6*b^3+4*b^2*c+6*b^2+2*b*c+6*b+2*c+3),c-4*b^2-3*b-2,1];
scentH:=Evaluate(scal,scoeffscent);

// Notice that every element of movall can be written as the product of an element of this complicated scentH and an element of mov1.
scentH*mov1 eq movall;

// Thus all overgroups H containing L are C_G(L)-conjugate, including for the finite group.

return "";
end function;


// We now give code that can prove that the trilinear form we gave is the correct one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4,6,1],
[5,3,2,5,4,3,1],
[5,3,3,6,4,2,3],
[1,6,3,2,2,3,2],
[3,0,1,5,4,0,0],
[0,4,1,1,5,1,5]];

NL:=sub<GG|nl1,nl2>;
ActionGenerators(Restriction(M26,NL)) eq [l1,l2];

// Now build the matrix of linear relations that the trilinear form must satisfy.
mat:=[];
for g in [l1,l2] do
  for nn in [1..#seqs] do a:=seqs[nn,1]; b:=seqs[nn,2]; c:=seqs[nn,3];// a,b,c;
    val:=[F!0:i in [1..#seqs]];
    for i in [1..26] do if(g[a,i] ne 0) then for j in [1..26] do if(g[b,j] ne 0) then for k in [1..26] do
      val[Position(seqs,Sort([i,j,k]))]+:=g[a,i]*g[b,j]*g[c,k];
    end for; end if; end for; end if; end for;
    val[nn]-:=1; Append(~mat,val); delete val;
  end for;
end for;

"At this point you should have a space of forms of dimension 62";
Dimension(Nullspace(Transpose(Matrix(F,mat)))) eq 62;

g:=ActionGenerator(M26,2);
for nn in [1..62] do a:=seqs[nn,1]; b:=seqs[nn,2]; c:=seqs[nn,3];
  val:=[F!0:i in [1..#seqs]];
  for i in [1..26] do if(g[a,i] ne 0) then for j in [1..26] do if(g[b,j] ne 0) then for k in [1..26] do
    val[Position(seqs,Sort([i,j,k]))]+:=g[a,i]*g[b,j]*g[c,k];
  end for; end if; end for; end if; end for;
  val[nn]-:=1; Append(~mat,val); delete val;
end for;

ftest:=Nullspace(Transpose(Matrix(F,mat))).1;
"Is the trilinear form given in this document correct?";
return &and[ftest[i] eq f26[i]:i in [1..#f26]];

end function;

"The function CheckF4Form() checks that the trilinear form f26 from F4 is correct";
"The function CheckDetermination() checks that the determination of the possible conjugates into F4 is correct.";
