/* ****************** WE8 ********************* */

/* The purpose of this file is to write a 9-dimensional representation of W(E_8)
where we can embed the matrices SigmaMatrix, etc. */

s1 := RMatrixSpace(Integers(),9,9)
![1,0,0,0,0,0,0,0,0,
0,-1,1,0,0,0,0,0,0,
0,0,1,0,0,0,0,0,0,
0,0,0,1,0,0,0,0,0,
0,0,0,0,1,0,0,0,0,
0,0,0,0,0,1,0,0,0, 
0,0,0,0,0,0,1,0,0,
0,0,0,0,0,0,0,1,0,
0,0,0,0,0,0,0,0,1]; 

s2 := RMatrixSpace(Integers(),9,9)
![1,0,0,0,0,0,0,0,0,
0,1,0,0,0,0,0,0,0,
0,1,-1,1,0,0,0,0,0,
0,0,0,1,0,0,0,0,0,
0,0,0,0,1,0,0,0,0,
0,0,0,0,0,1,0,0,0, 
0,0,0,0,0,0,1,0,0,
0,0,0,0,0,0,0,1,0,
0,0,0,0,0,0,0,0,1]; 

s3 := RMatrixSpace(Integers(),9,9)
![1,0,0,0,0,0,0,0,0,
0,1,0,0,0,0,0,0,0,
0,0,1,0,0,0,0,0,0,   
0,0,1,-1,1,1,0,0,0,
0,0,0,0,1,0,0,0,0,
0,0,0,0,0,1,0,0,0, 
0,0,0,0,0,0,1,0,0,
0,0,0,0,0,0,0,1,0,
0,0,0,0,0,0,0,0,1]; 

s4 := RMatrixSpace(Integers(),9,9)
![1,0,0,0,0,0,0,0,0,
0,1,0,0,0,0,0,0,0,
0,0,1,0,0,0,0,0,0,  
0,0,0,1,0,0,0,0,0, 
0,0,0,1,-1,0,0,0,0,
0,0,0,0,0,1,0,0,0, 
0,0,0,0,0,0,1,0,0,
0,0,0,0,0,0,0,1,0,
0,0,0,0,0,0,0,0,1]; 

s5 := RMatrixSpace(Integers(),9,9)
![1,0,0,0,0,0,0,0,0,
0,1,0,0,0,0,0,0,0,
0,0,1,0,0,0,0,0,0,
0,0,0,1,0,0,0,0,0,  
0,0,0,0,1,0,0,0,0,   
0,0,0,1,0,-1,1,0,0,
0,0,0,0,0,0,1,0,0,
0,0,0,0,0,0,0,1,0, 
0,0,0,0,0,0,0,0,1];

s6 := RMatrixSpace(Integers(),9,9)
![1,0,0,0,0,0,0,0,0,
0,1,0,0,0,0,0,0,0,
0,0,1,0,0,0,0,0,0,
0,0,0,1,0,0,0,0,0,  
0,0,0,0,1,0,0,0,0,  
0,0,0,0,0,1,0,0,0, 
0,0,0,0,0,1,-1,1,0,
0,0,0,0,0,0,0,1,0, 
0,0,0,0,0,0,0,0,1];

s7 := RMatrixSpace(Integers(),9,9)
![1,0,0,0,0,0,0,0,0,
0,1,0,0,0,0,0,0,0,
0,0,1,0,0,0,0,0,0,
0,0,0,1,0,0,0,0,0,  
0,0,0,0,1,0,0,0,0,  
0,0,0,0,0,1,0,0,0,   
0,0,0,0,0,0,1,0,0, 
0,0,0,0,0,0,1,-1,1,
0,0,0,0,0,0,0,0,1];

s8 := RMatrixSpace(Integers(),9,9)
![1,0,0,0,0,0,0,0,0,
0,1,0,0,0,0,0,0,0,
0,0,1,0,0,0,0,0,0,
0,0,0,1,0,0,0,0,0,  
0,0,0,0,1,0,0,0,0,
0,0,0,0,0,1,0,0,0,  
0,0,0,0,0,0,1,0,0,  
0,0,0,0,0,0,0,1,0, 
0,0,0,0,0,0,0,1,-1];

Z:= Integers();
M := GL(9,Z);

s1 := M!s1;
s2 := M!s2;
s3 := M!s3;
s4 := M!s4;
s5 := M!s5;
s6 := M!s6;
s7 := M!s7;
s8 := M!s8;

hocus :=
RMatrixSpace(Integers(),9,9)![1,0,0,0,0,0,0,0,1,1,-1,0,0,1,0,0,0,0,1,1,
-1,0,1,0,0,0,0,1,0,1,-1,1,0,0,0,0,1,0,0,1,0,-1,0,0,0,1,0,0,0,0,1,-1,0,
0,1,0,0,0,0,0,1,-1,0,1,0,0,0,0,0,0,1,-1,-3,0,0,0,-1,0,0,0,0];

H := Transpose(hocus);

W := sub<M| [H^(-1)*Transpose(i)*H : i in {s1,s2,s3,s4,s5,s6,s7,s8}] >;