(*In this notebook we examine properly convex structures on the figure-eight knot complement*)

(*We exhibit a family of representations of the figure-eight group by specifying their values on the generators A and B. The hyperbolic structure occurs at x=1/2*)

(A={{1,0,1,x-1},{0,1,1,x},{0,0,1,1/2+x},{0,0,0,1}})//MatrixForm
(B={{1,0,0,0},{2+1/x,1,0,0},{2,1,1,0},{1,1,0,1}})//MatrixForm
W=B.Inverse[A].Inverse[B].A;

(*The figure-eight group has a single relation of the for AW=WB. The next calculation shows that these are indeed representations*)

A.W-W.B//Simplify//MatrixForm

(L=Together[Simplify[W.A.Inverse[B].Inverse[A].B]])//MatrixForm (*This is a longitude of the figure-eight*)

A.L-L.A//Simplify//MatrixForm (*L commutes with A*)

(*Let L be the rank 2 abelian Lie group of matrices of the following form*)

(L=MatrixExp[{{0,0,b,-a},{0,a,0,0},{0,0,0,b},{0,0,0,0}}]//Simplify)//MatrixForm

(*We will now conjugate and projectively scale so that A and L are contained in L0*)

{U,V}=JordanDecomposition[L];
Ui=Inverse[U];
Perm={{0,1,0,0},{0,0,1,0},{1,0,0,0},{0,0,0,1}};
Permi=Inverse[Perm];
W={{1,0,(( (-1+2 x) (Sqrt[-1+4 (x^2)]) (Sqrt[Log[2 x]]))/(2 (Sqrt[3]) (Sqrt[x]) (1+2 x))),0},{0,1,0,0},{0,0,(( (Sqrt[-1+4 (x^2)]) (Sqrt[Log[2 x]]))/((Sqrt[3]) (Sqrt[x]))),0},{0,0,0,64  (x^4) (Log[2]+Log[x])}};
Wi=Inverse[W];

1/(2x)Wi.Permi.Ui.L.U.Perm.W//FullSimplify//MatrixForm
Wi.Permi.Ui.A.U.Perm.W//FullSimplify//MatrixForm

(*If we perform the coordinate change E^y=1/16x^4 then we get new matrices. In these new coordinates we see that the hyperbolic structure occurs at y=0*)

(NewA={{1,0,0,-y},{0,E^y,0,0},{0,0,1,0},{0,0,0,1}})//MatrixForm
(NewL={{1,0,Sqrt[y Sinh[y/4]/3],y Sinh[y/4]/6},{0,1,0,0},{0,0,1,Sqrt[y Sinh[y/4]/3]},{0,0,0,1}})//MatrixForm

(*Let Lx be the rank 2 abelian Lie group of matrices of the form*)
(Lx=MatrixExp[{{0,a,b,0},{0,a x ,0,a},{0,0,0,b},{0,0,0,0}}]//Simplify)//MatrixForm

(*We can conjugate so that A and L are conjugate into Lx*)

Conj={{-1/y,1/y,0,0},{0,1,0,1},{0,0,-1,0},{0,0,0,-y}};
Conji=Inverse[Conj];
Conj.NewA.Conji//FullSimplify//MatrixForm
Conj.NewL.Conji//FullSimplify//MatrixForm

(*As y->0 the new matrices limit into SO(3,1)*)

Limit[Conj.NewA.Conji//Simplify,y->0]//MatrixForm
Limit[Conj.NewL.Conji//Simplify,y->0]//MatrixForm

(*We can also examine how the affine action converges to a Euclidean action as y->0*)

SmallA=(Conj.NewA.Conji//Simplify)[[2;;4,2;;4]];
SmallL=(Conj.NewL.Conji)[[2;;4,2;;4]];

p0={0,0,1}

T1=Table[Graphics[{Blue,Line[{(MatrixPower[SmallA,m].MatrixPower[SmallL,n].p0)[[1;;2]],(MatrixPower[SmallA,m+1].MatrixPower[SmallL,n].p0)[[1;;2]]}]}],{m,-5,5},{n,-5,5}];

T2=Table[Graphics[{Red,Line[{(MatrixPower[SmallA,m].MatrixPower[SmallL,n].p0)[[1;;2]],(MatrixPower[SmallA,m].MatrixPower[SmallL,n+1].p0)[[1;;2]]}]}],{m,-5,5},{n,-5,5}];

Manipulate[Show[T1/.y->y0,T2/.y->y0,PlotRange->{{-3,3},{-2,2}}],{y0,7,.0001}]