/* Here we consider H=PSL(2,27)<F_4(13). Let L=3^3.13 be the Borel subgroup of H. Since L is also contained
   in an exotic 3-local subgroup P=3^3.SL(3,3), and both H and P act irreducibly on M(F4), we take random
   conjugates of P by elements in the centralizer of L (in GL(26,k)) until we find one such that G=<H,P>=F4(13).
   Once we have this, we are able to prove that there is a unique H1 containing L among C_{GL(26,k)}(L)-conjugates
   and contained in G. Since |N_G(L):N_H(L)|=3, this yields exactly three subgroups H1 such that L<H1<G.
*/

// Start by setting up L, H and P.

F:=GF(13);

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

h2:=GL(26,F)![[3,12,5,9,9,12,3,1,1,10,7,4,8,6,2,1,1,10,4,12,4,9,2,2,8,0],
[11,0,6,8,7,7,5,11,11,5,11,8,9,6,4,7,12,0,7,11,9,1,10,11,4,3],
[10,1,10,2,7,7,9,3,7,4,2,4,0,8,10,7,0,6,1,12,4,5,11,0,11,4],
[0,11,12,9,0,3,2,4,10,10,1,1,1,4,8,4,12,0,5,4,8,3,8,11,11,10],
[10,9,4,8,12,4,11,8,12,9,0,10,12,11,0,11,9,4,7,12,11,5,4,7,10,4],
[2,1,6,5,10,6,12,12,1,4,5,10,5,1,9,6,11,4,11,12,3,3,6,5,8,5],
[11,4,6,1,6,3,4,12,2,8,6,7,7,5,2,4,12,12,1,3,3,0,0,3,1,7],
[9,10,6,1,10,0,5,12,9,10,0,9,1,0,9,1,8,12,4,6,6,4,5,9,11,7],
[12,10,12,3,4,11,9,6,7,1,10,7,12,1,2,3,5,9,2,2,0,1,11,9,8,12],
[11,7,12,4,5,0,10,6,4,9,12,6,1,1,3,6,8,10,7,4,4,4,7,9,6,4],
[7,12,11,5,5,0,1,5,12,11,11,5,3,4,12,3,9,6,8,9,11,6,0,12,8,4],
[4,12,8,6,11,1,5,3,2,2,5,4,12,12,0,3,10,5,11,5,2,0,2,8,7,7],
[10,2,3,5,2,8,10,0,7,5,10,1,5,8,9,3,4,1,8,11,10,1,12,8,2,3],
[3,10,3,2,5,2,6,4,9,12,8,11,11,6,4,2,5,12,6,10,7,10,10,4,6,4],
[8,12,6,4,10,2,10,6,0,8,8,12,2,6,2,6,0,6,1,10,5,5,6,8,7,5],
[12,3,6,10,5,6,11,12,3,11,0,10,5,3,11,5,0,6,0,4,6,12,5,10,6,2],
[10,0,10,2,2,2,4,4,10,6,2,7,0,3,12,9,10,1,2,6,1,11,10,5,10,0],
[6,5,10,8,4,8,1,7,5,1,10,3,1,5,1,2,3,6,4,2,9,1,1,6,12,5],
[4,4,11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0,1,0,2],
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,8],
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,10],
[0,0,0,0,0,0,0,0,0,0,7,0,9,0,1,0,0,0,0,0,0,0,0,7,0,0],
[0,0,0,0,0,0,0,0,0,0,7,0,9,0,0,0,0,0,0,1,0,0,0,7,0,0],
[0,0,0,0,0,0,0,0,0,0,7,0,9,0,0,0,0,1,0,0,0,0,0,7,0,0],
[0,0,0,0,0,0,0,0,0,0,7,0,9,1,0,0,0,0,0,0,0,0,0,7,0,0],
[0,0,0,0,0,0,2,0,0,0,7,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,7,0,9,0,0,0,0,0,0,0,1,0,0,7,0,0],
[0,0,0,0,0,0,0,7,0,0,7,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,7,7,6,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,6,7,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,7,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,12,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0,7,0,9,0,0,1,0,0,0,0,0,0,0,7,0,0],
[0,0,0,0,0,0,0,0,0,0,7,0,9,0,0,0,3,0,0,0,0,0,0,8,0,0]];

G:=sub<GL(26,F)|l1,l2,h2,p2>;
H:=sub<GL(26,F)|l1,l2,h2>;
P:=sub<GL(26,F)|l1,l2,p2>;
L:=sub<GL(26,F)|l1,l2>;

// 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];

/* We next give the symmetric trilinear form that comes from F4. This was found by choosing elements of F4, 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 while, so we give it here for ease of calculations.
*/

ents:=[2,3,4,5,6,7,8,9,10,11,12,13,27,28,29,30,31,32,33,34,35,36,37,38,51,52,53,54,55,56,57,58,59,60,61,62,67,76,77,78,79,
80,81,82,83,84,85,91,99,100,101,102,103,104,105,106,107,121,122,123,124,125,126,127,128,136,137,142,143,144,145,146,147,148,
157,162,163,164,165,166,167,170,174,181,182,183,184,185,192,199,200,201,202,203,206,216,217,218,232,233,235,247,272,275,284,
295,305,312,314,320,322,329,335,336,340,344,347,349,350,353,354,355,356,357,358,359,360,361,362,363,377,378,379,380,381,382,
383,384,385,386,387,388,392,401,402,403,404,405,406,407,408,409,410,414,424,425,426,427,428,429,430,431,432,446,447,448,449,
450,451,452,453,462,467,468,469,470,471,472,473,487,488,489,490,491,492,495,504,506,507,508,509,510,517,524,525,526,527,528,
541,542,543,546,557,558,560,564,572,595,607,618,628,630,634,637,645,652,657,658,661,663,667,668,669,670,678,679,680,681,682,
683,684,685,686,687,692,701,702,703,704,705,706,707,708,709,710,715,720,724,725,726,727,728,729,730,731,732,737,738,746,747,
748,749,750,751,752,753,758,762,767,768,769,770,771,772,773,778,787,788,789,790,791,792,795,797,806,807,808,809,810,815,817,
824,825,826,827,828,832,834,841,842,843,848,857,858,860,863,870,872,877,894,906,910,917,926,927,930,936,944,945,951,957,961,
962,963,964,965,966,978,979,980,981,982,983,984,985,986,1000,1001,1002,1003,1004,1005,1006,1007,1008,1013,1022,1023,1024,1025,
1026,1027,1028,1029,1031,1038,1043,1044,1045,1046,1047,1048,1049,1063,1064,1065,1066,1067,1068,1071,1082,1083,1084,1085,1086,1093,
1099,1100,1101,1102,1103,1104,1117,1118,1119,1133,1134,1136,1148,1169,1170,1181,1192,1196,1202,1206,1211,1219,1221,1226,1232,1233,
1234,1235,1236,1237,1254,1255,1256,1257,1258,1259,1260,1261,1275,1276,1277,1278,1279,1280,1281,1282,1291,1296,1297,1298,1299,1300,
1301,1302,1310,1316,1317,1318,1319,1320,1321,1324,1335,1336,1337,1338,1339,1342,1346,1353,1354,1355,1356,1357,1358,1359,1360,1361,
1362,1363,1364,1365,1366,1367,1368,1369,1370,1371,1372,1382,1386,1387,1389,1401,1426,1433,1459,1474,1490,1495,1507,1508,1509,1510,
1511,1512,1513,1522,1527,1528,1529,1530,1531,1532,1533,1542,1546,1547,1548,1549,1550,1551,1552,1555,1561,1566,1567,1568,1569,1570,
1577,1579,1580,1584,1585,1586,1587,1588,1596,1601,1602,1603,1612,1617,1618,1619,1620,1627,1632,1641,1648,1660,1671,1672,1673,1674,
1675,1676,1677,1678,1679,1680,1681,1685,1690,1705,1707,1721,1738,1739,1740,1741,1742,1743,1757,1758,1759,1760,1761,1762,1765,1776,
1777,1778,1779,1780,1787,1794,1795,1796,1797,1798,1802,1811,1812,1813,1825,1827,1828,1829,1830,1831,1832,1833,1834,1835,1836,1837,
1838,1839,1840,1841,1842,1862,1877,1882,1900,1915,1931,1948,1949,1950,1951,1952,1955,1966,1967,1968,1969,1970,1972,1973,1977,1984,
1985,1986,1987,1988,1990,1995,2001,2002,2003,2006,2007,2017,2018,2020,2021,2032,2035,2050,2051,2062,2073,2083,2090,2092,2093,2094,
2095,2096,2097,2098,2099,2100,2105,2121,2130,2138,2139,2140,2141,2148,2155,2156,2157,2158,2159,2165,2172,2173,2174,2175,2176,2177,
2178,2179,2180,2181,2182,2183,2184,2185,2186,2187,2188,2189,2191,2196,2203,2210,2221,2255,2261,2276,2292,2296,2309,2310,2311,2312,
2325,2326,2327,2328,2341,2342,2343,2344,2356,2357,2390,2402,2414,2429,2432,2445,2462,2463,2477,2478,2480,2487,2492,2507,2550,2553,
2565,2570,2581,2598,2600,2612,2614,2655,2670,2671,2675,2685,2701,2717,2775,2790,2806,2823,2824,2825,2826,2827,2828,2829,2830,2831,
2832,2833,2834,2835,2836,2837,2838,2839,2840,2841,2842,2843,2844,2845,2846,2847,2848,2849,2850,2851,2852,2853,2854,2855,2856,2857,
2858,2859,2860,2861,2862,2863,2864,2865,2866,2867,2868,2869,2870,2871,2872,2873,2874,2875,2876,2877,2878,2879,2880,2881,2882,2883,
2884,2885,2886,2887,2888,2889,2890,2891,2892,2893,2894,2895,2896,2897,2898,2899,2900,2901,2902,2903,2904,2905,2906,2907,2908,2909,
2910,2911,2912,2914,2915,2916,2917,2918,2919,2920,2921,2922,2923,2924,2925,2926,2927,2928,2929,2930,2931,2932,2933,2934,2935,2936,
2937,2938,2939,2940,2941,2942,2943,2944,2945,2946,2947,2948,2949,2950,2951,2952,2953,2954,2955,2956,2957,2958,2959,2960,2961,2962,
2963,2964,2965,2966,2967,2968,2969,2970,2971,2972,2973,2974,2975,2976,2977,2978,2979,2980,2981,2982,2983,2984,2985,2986,2987,2988,
2989,2990,2992,2993,2994,2995,2996,2997,2998,2999,3000,3001,3002,3003,3004,3005,3006,3007,3008,3009,3010,3011,3012,3013,3014,3015,
3016,3017,3018,3019,3020,3021,3022,3023,3024,3025,3026,3027,3028,3029,3030,3031,3032,3033,3034,3035,3036,3037,3038,3039,3040,3041,
3042,3043,3044,3045,3046,3047,3048,3049,3050,3051,3052,3053,3054,3055,3056,3058,3059,3060,3061,3062,3063,3064,3065,3066,3067,3068,
3069,3070,3071,3072,3073,3074,3075,3076,3077,3078,3079,3080,3081,3082,3083,3084,3085,3086,3087,3088,3089,3090,3091,3092,3093,3094,
3095,3096,3097,3098,3099,3100,3101,3102,3103,3104,3105,3106,3107,3108,3109,3110,3111,3113,3114,3115,3116,3117,3118,3119,3120,3121,
3122,3123,3124,3125,3126,3127,3128,3129,3130,3131,3132,3133,3134,3135,3136,3137,3138,3139,3140,3141,3142,3143,3144,3145,3146,3147,
3148,3149,3150,3151,3152,3153,3154,3155,3156,3158,3159,3160,3161,3162,3163,3164,3165,3166,3167,3168,3169,3170,3171,3172,3173,3174,
3175,3176,3177,3178,3179,3180,3181,3182,3183,3184,3185,3186,3187,3188,3189,3190,3191,3192,3194,3195,3196,3197,3198,3199,3200,3201,
3202,3203,3204,3205,3206,3207,3208,3209,3210,3211,3212,3213,3214,3215,3216,3217,3218,3219,3220,3222,3223,3224,3225,3226,3227,3228,
3229,3230,3231,3232,3233,3234,3235,3236,3237,3238,3239,3240,3241,3243,3244,3245,3246,3247,3248,3249,3250,3251,3252,3253,3254,3255,
3256,3258,3259,3260,3261,3262,3263,3264,3265,3266,3267,3268,3269,3270,3271,3272,3274,3275];

vals:=[1,1,1,7,1,1,4,1,1,1,4,5,1,1,1,12,1,6,4,1,1,1,4,5,9,1,1,12,1,1,4,1,1,9,4,5,12,1,12,1,1,4,1,1,3,4,5,9,2,12,
12,9,12,12,12,9,8,1,1,4,1,1,1,4,5,9,12,1,4,1,1,1,4,5,1,3,4,4,4,3,7,1,10,1,1,1,6,5,10,1,1,4,5,10,1,1,4,5,3,7,
9,12,8,2,8,8,2,5,8,11,8,8,8,11,8,8,10,3,8,1,1,4,1,11,4,1,1,1,4,5,1,1,4,1,6,4,1,1,1,4,5,1,12,1,4,1,6,4,1,1,
3,4,5,3,3,6,11,3,4,4,4,3,7,1,6,4,1,1,1,4,5,12,11,11,6,6,6,11,4,3,4,4,4,3,7,1,10,1,12,1,4,5,10,1,1,4,5,10,1,
4,5,3,3,7,9,10,12,7,7,7,7,7,2,7,5,7,2,7,11,7,1,12,7,7,1,4,1,1,4,1,1,1,4,5,11,1,4,1,1,4,1,1,3,4,5,12,1,3,4,
4,3,4,4,4,3,7,9,4,1,1,10,1,1,1,4,5,12,12,1,4,12,1,1,4,5,12,3,4,4,4,3,7,1,9,1,1,1,4,5,12,10,1,1,4,5,10,12,3,
1,4,5,12,3,7,9,9,4,12,8,11,11,5,11,5,11,7,11,11,11,11,11,11,9,11,4,11,11,4,1,1,4,1,1,5,4,5,3,4,4,3,4,4,12,3,7,
4,1,1,4,1,1,3,4,5,1,12,1,6,1,1,3,4,5,3,4,4,12,3,7,1,1,1,3,4,5,10,9,1,3,9,5,10,5,12,2,3,7,9,12,8,5,8,8,5,8,
7,8,8,11,8,3,8,8,10,8,6,3,3,12,3,3,3,12,2,4,4,3,4,4,4,3,7,9,4,3,4,4,4,3,7,12,12,3,3,3,5,2,4,4,4,4,3,7,10,1,
4,4,3,7,10,9,9,9,9,9,9,9,9,9,8,9,9,4,3,7,10,12,2,10,9,11,8,2,5,5,8,1,4,1,1,1,4,5,11,1,4,1,1,1,4,5,12,3,3,4,
4,4,3,7,1,9,1,1,1,4,5,10,12,1,1,9,4,5,10,12,1,4,5,12,3,7,10,9,9,12,8,11,11,9,11,11,11,11,11,11,11,4,11,11,6,7,
11,6,11,4,1,1,1,4,5,3,4,4,4,3,7,1,1,1,1,4,5,10,1,1,4,5,10,9,1,4,5,1,3,7,1,10,1,1,1,1,1,1,1,1,11,1,1,12,6,5,
6,7,11,11,3,3,3,12,2,8,4,4,4,3,7,12,1,1,4,4,3,7,1,1,4,4,3,7,1,10,12,2,10,4,9,5,2,11,2,2,2,2,4,2,2,2,2,2,9,2,
2,5,5,8,1,1,4,5,7,1,1,4,5,10,10,1,4,5,12,12,12,12,12,12,9,12,12,12,2,12,12,3,7,9,1,12,11,6,2,7,11,11,6,1,4,5,7,
1,4,5,10,3,7,1,9,12,11,5,6,7,11,2,11,4,5,3,7,9,10,12,6,7,5,11,6,11,2,7,9,6,11,2,8,11,5,5,8,9,3,3,8,8,1,8,8,8,
8,8,8,10,8,8,8,8,11,8,11,8,8,8,8,10,8,8,8,11,8,8,8,8,8,8,10,8,5,1,11,11,11,11,11,11,4,11,11,8,8,8,8,8,8,10,8,
8,8,8,8,8,8,10,8,8,8,8,8,8,10,8,9,8,8,7,10,8,8,8,8,10,8,8,8,10,8,8,6,10,10,8,8,8,8,8,8,1,8,8,8,8,10,8,8,8,8,
8,11,8,8,8,8,10,8,8,8,7,11,8,8,8,8,10,8,8,8,11,8,8,8,8,10,8,8,1,11,11,11,11,4,11,11,8,8,8,8,10,8,9,8,8,8,10,7,
8,8,8,10,8,8,8,10,8,8,6,10,10,8,8,8,8,8,8,8,8,8,8,10,8,8,8,8,8,8,8,8,8,10,8,8,8,8,8,8,12,8,10,8,8,8,8,7,8,8,
10,8,8,8,8,8,8,10,8,9,8,8,8,10,8,8,8,8,10,8,8,8,10,8,8,6,10,10,8,8,8,8,8,8,8,8,8,10,8,8,8,8,8,8,8,8,10,8,8,
8,8,8,8,8,10,8,8,8,8,8,8,10,8,9,8,8,8,10,8,8,8,12,10,8,8,8,10,8,8,6,10,10,8,8,8,8,8,8,8,8,10,8,8,8,8,8,8,8,
10,8,8,8,8,8,8,10,8,9,8,8,8,10,8,8,8,8,10,8,8,8,10,8,8,6,10,10,8,5,8,8,8,8,8,10,8,8,8,8,7,8,10,8,9,8,8,8,10,
8,8,8,8,10,8,8,8,10,8,8,6,10,10,8,8,8,8,8,8,10,8,10,8,8,8,10,8,9,8,8,10,8,9,8,10,5,9,6,10,8,8,9,10,8,8,10,8,
8,8,8,10,8,8,8,10,8,8,6,10,10,8,8,8,8,10,8,8,8,10,8,8,6,10,10,8,8,8,10,8,8,6,10,10,8,8,8,1,6,6,10,10,10,8,8];

f26:=[F!0:i in [1..#seqs]];
for i in [1..#ents] do f26[ents[i]]:=vals[i]; end for;

// Now set up the centralizer of L in GL(26,F), which is given by all possible matrices scal below.
// We also need this matrix ring so we can multiply elements of F4 by scal, as we have to coerce
// them into this ring first.

R<a,b>:=PolynomialRing(F,2);
mats:=MatrixRing(R,NumberOfRows(l1));
scal:=mats!DiagonalMatrix([a,a,a,a,a,a,a,a,a,a,a,a,a,b,b,b,b,b,b,b,b,b,b,b,b,b]);

// Now we introduce some commands so allow us to proceed with the method in the paper.

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

V:=GModule(L);
g:=mats!h2;

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;

// This function determines all subgroups that lie in G and are C_{GL(26,k)}(L)-conjugate to H. It then checks
// that H, P and G are what I say they are. And then it checks that the three H1s are not all the same.

function CheckDetermination()

// First check that there is a single possible H. This is easy.
// We see from this that a must equal b (as a,b cannot be zero), so just a scalar matrix.

ProdRel([1,7,13]) eq -2*a*b*(a-b);

// Now we check that a generator for N_G(L)/N_H(L) does not act on H, but instead permutes three subgroups H containing L.

NL:=Normalizer(P,L); repeat x:=Random(NL); until not(x in L);
not(H eq H^x);

// Now check that H lies in F4. First we check that H is PSL(2,27) and P is 3^3.PSL(3,3), the exotic 3-local subgroup.

Bool:=IsIsomorphic(PSL(2,27),H); Bool;
NP:=NormalSubgroups(P:OrderEqual:=27)[1]`subgroup;
IsIsomorphic(PSL(3,3),P/NP) and IsElementaryAbelian(NP);

// Now we check that the subgroup generated by H and P has a 1-dimensional trilinear form

M:=GModule(G);
Dimension(Fix(SymmetricPower(M,3))) eq 1;

// Finally, we can check directly that they generate F4(13).

Gtree:=CompositionTree(G);
CompositionTreeNonAbelianFactors(G) eq [*<"F",4,13>*];

return "";
end function;

// We now give code that can prove that the trilinear form we gave is the correct one. Choose g in F4 one of l1,
// l2, h2 and p2, and use G-invariance to obtain linear relations.

function CheckF4Form()

mat:=[];
for g in [l1,l2,p2,h2] 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;

ftest:=Nullspace(Transpose(Matrix(F,mat))).1;
return &and[ftest[i] eq f26[i]:i in [1..#seqs]];
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.";