dim 0,7
v=e124+e235+e346+e457+e561+e672+e713;
w=v/e1234567;
f=(1-v)(1-e1234567);
o(x,y)=Re(x y f)+Pu(1,x y f);
say
say Here octonions are regarded as paravectors (= sums of scalars and vectors)
say in the subspace  R+R7  of the Clifford algebra  Cl_0,7 = M_8(R)+M_8(R).
say The product of two octonions  x  and  y  in the Cayley algebra  O  can
say be computed by  o(x,y).  For instance, compute
x=1+4e1+8e2
y=2+3e2+6e3
o(x,y)
say
say $mTo continue press <CARRIAGE RETURN> or <ENTER>
pause
say The octonion product is norm-preserving, that is,  |xy| = |x| |y|
abs(o(x,y))
abs(x) abs(y)
say
say and alternative, that is, x(xy) = (xx)y and x(yy) = (xy)y, which implies
say flexibility, that is, parentheses are not needed in  xyx:
o(x,o(y,x))
o(o(x,y),x)
pause
say The Moufang identities  x(yz)x=(xy)(zx)  and  x(y(xz))=((xy)x)z  say that
z=2+3e1+8e3+5e4+6e6;
o(o(x,o(y,z)),x)
o(o(x,y),o(z,x))
o(x,o(y,o(x,z)))
o(o(o(x,y),x),z)
say
pause
say The triality of a para-bivector (= a sum of a vector and a bivector)  F
say is computed by Trial(F).  For instance, compute
Trial(F)=F+1/2(v.Pu(1,F-v F)-Pu(1,v F+3 F));
Tri(F)=(Pu(1,F-1/2 F f)+Pu(2,F-1/2 F f))';
exp(e12 pi)
exp(Trial(e12 pi))
exp(Trial(Trial(e12 pi)))
exp(Trial(Trial(Trial(e12 pi))))
say
say and you can see that triality permutes the three central elements  -1,
say -e1234567  and  e1234567  of  Spin(8) = Spin(R+R^7).
pause
say Compute  u0=exp(F), u1=exp(Trial(F)), u2=exp(Trial(Trial(F))  for
say the following para-bivector
F=(2e12+3e15+4e23+e36+5e47+e57+3e2+6e5+e6)/10
say
say Next we will see that triality permutes the three elements
say u0, u1, u2  in  Spin(8).
pause
u0=exp(F)
pause
u1=exp(Trial(F))
pause
u2=exp(Trial(Trial(F)));
say
say Cartan's principle of triality equates the following two expressions
u0'*o(x,y)/u0
say
say $m... this might take a while ... just wait
o(u1 x/u1',u2 y/u2')
pause
say Porteous 1981 "Topological Geometry", p. 446 l. 15, p. 447 l. -1, writes
say Cartan's principle of triality in the form of equating the expressions:
u0 o(y,1/u1'*z u1)/u0'
o(u2'*y/u2,z)
pause
say Harvey 1990 "Spinors and Calibrations", p. 279 l. 3, writes  
say Cartan's principle of triality in the form equating the exressions:
o(z,u0 y/u0')
u1'*o(1/u2 z u2',y)/u1
pause
say The following definition of triality shows that triality is quadratic:
Pu056(u)=Re(u)+Pu(5,u)+Pu(6,u);
Pu01(u)=Re(u)+Pu(1,u);
Pu12(F)=Pu(1,F)+Pu(2,F);
n(u)=even(u*(1-j))
w(u)=(3-w) u/(3-w)
trial1(u)=1/2(1-j)Pu056(n(u')(1+w))+1/2(1+j)
trial2(u)=w(n(u))
trial(u)=trial1(u)trial2(u)
pause
say Check Cartan's principle of triality:
u0'*o(x,y)/u0
o(trial(u0) x/trial(u0)',trial(trial(u0)) y/trial(trial(u0))')
say
say $mEnd of the external file OCTONION
