// this code exhibits an exhaustion of subgroups generated by conjugates of mI0,mI1,mI2
// it is a companion to the note - THE COMMENSURABILITY CLASS OF THE DODECAHEDRAL KNOT COMPLEMENTS
// We stop adding conjugates of these three candidate meridians in one of two cases:
// First, if magma shows a group is finite index in G.
// Second, if we can explicitly construct a torsion element in the group
// often this element is of order 5 (with trace +/- .61803). This computation
// is given in the accompanying mathematica file.
// 
//
// Finally, the code can be verified in the following way:
/*
//First copy and paste the code into a magma shell:

For example, if all the previous code has been copied in then inputting:

H01010:=sub<G|mI0,m11,m20,m31,m40>; Index(G,H01010);
Order(quo<H01010|m11>);
//60                                                                                                            
//1                                                                                                              
H01011:=sub<G|mI0,m11,m20,m31,m41>; Index(G,H01011);
//1      

Returns:

> H01010:=sub<G|mI0,m11,m20,m31,m40>; Index(G,H01010);
60
> Order(quo<H01010|m11>);
1
> //60                                                                                                          \
    
> //1                                                                                                           \
    
> H01011:=sub<G|mI0,m11,m20,m31,m41>; Index(G,H01011);
1
> //1   

Notice that the commented out output agrees with magma's output showing that Index(G,H01010);
is indeed index 60.

 */ 



// First we give G(5,2,2,3,3,3)


G<x,y,z>:=Group<x,y,z|x^5,y^2,z^2,(y*z^-1)^3,(x*y^-1)^3,(z*x^-1)^3>;

//next we give the possible meridians fixing infinity
// we denote them by mI0 mI1 and mI2 as noted in the paper
// and we remark that by prop 3.2 we only have to consider 
// possible knot groups with mI0 as an element

mI0:=x*y^-1*z*y^-1;
mI1:=z*x^-1*z*y^-1;
mI2:=z*x^-1*y*x^-1;

gP1:=y;

m10:=y*mI0*y;
m11:=y*mI1*y;
m12:=y*mI2*y;

// note that y*mI2*y^-1 * mI0 gives an element of order 5
// and that we may assume that y*mI1*y is our meridian fixing 0

gP2:=x*y*x^2*y*x;

m20:=gP2*mI0*gP2^-1;
m21:=gP2*mI1*gP2^-1;
m22:=gP2*mI2*gP2^-1;


// note that all of the following generate torsion
//gP3.mI0.Inverse[gP3].gP2.mI2.Inverse[gP2]
//gP3.mI1.Inverse[gP3].gP2.mI1.Inverse[gP2]
//gP3.mI2.Inverse[gP3].gP2.mI0.Inverse[gP2]

gP3:=mI1^-1*y;

m30:=gP3*mI0*gP3^-1;
m31:=gP3*mI1*gP3^-1;
m32:=gP3*mI2*gP3^-1;

// this is the last of the gP's we need to get our first
// index 60 knot group. The additional gP's assure we always
// get a finite index subgroup

gP4:=m10;

m40:=gP4*mI0*gP4^-1;
m41:=gP4*mI1*gP4^-1;
m42:=gP4*mI2*gP4^-1;

//the following computations show
// H01000, H01002, H01012, H01210, H01221
// require further investigation 



//and that H01010 is an index 60 knot group

//we begin with the smallest sets of generators
 H01:=sub<G|mI0,m11>; Index(G,H01);                                            
//0
 H010:=sub<G|mI0,m11,m20>; Index(G,H010);
//0
 H011:=sub<G|mI0,m11,m21>; Index(G,H011);
//0
 H012:=sub<G|mI0,m11,m22>; Index(G,H012);
//0
 H0100:=sub<G|mI0,m11,m20,m30>; Index(G,H0100);
//0
 H0101:=sub<G|mI0,m11,m20,m31>; Index(G,H0101);
//0
 H0102:=sub<G|mI0,m11,m20,m32>; Index(G,H0101);
//0
 H0110:=sub<G|mI0,m11,m21,m30>; Index(G,H0110);
//1
 H0111:=sub<G|mI0,m11,m21,m31>; Index(G,H0111);
//1
 H0112:=sub<G|mI0,m11,m21,m32>; Index(G,H0112);
//1
 H0120:=sub<G|mI0,m11,m22,m30>; Index(G,H0120);
//1
 H0121:=sub<G|mI0,m11,m22,m31>; Index(G,H0121);
//0
 H0122:=sub<G|mI0,m11,m22,m32>; Index(G,H0122);
//0

H01000:=sub<G|mI0,m11,m20,m30,m40>; Index(G,H01000);                   
//0
H01001:=sub<G|mI0,m11,m20,m30,m41>; Index(G,H01001);
//1
H01002:=sub<G|mI0,m11,m20,m30,m42>; Index(G,H01002);
//0
H01010:=sub<G|mI0,m11,m20,m31,m40>; Index(G,H01010);
Order(quo<H01010|m11>);
//60
//1
H01011:=sub<G|mI0,m11,m20,m31,m41>; Index(G,H01011);
//1
H01012:=sub<G|mI0,m11,m20,m31,m42>; Index(G,H01012);
//0
H01020:=sub<G|mI0,m11,m20,m32,m40>; Index(G,H01020);
//1
H01021:=sub<G|mI0,m11,m20,m32,m41>; Index(G,H01021);
//1
H01022:=sub<G|mI0,m11,m20,m32,m42>; Index(G,H01022);
//1
H01100:=sub<G|mI0,m11,m21,m30,m40>; Index(G,H01100);
//1
H01101:=sub<G|mI0,m11,m21,m30,m41>; Index(G,H01101);
//1
H01102:=sub<G|mI0,m11,m21,m30,m42>; Index(G,H01102);
//1
H01110:=sub<G|mI0,m11,m21,m31,m40>; Index(G,H01110);
//1
H01111:=sub<G|mI0,m11,m21,m31,m41>; Index(G,H01111);
//1
H01112:=sub<G|mI0,m11,m21,m31,m42>; Index(G,H01112);
//1
H01120:=sub<G|mI0,m11,m21,m32,m40>; Index(G,H01120);
//1
H01121:=sub<G|mI0,m11,m21,m32,m41>; Index(G,H01121);
//1
H01122:=sub<G|mI0,m11,m21,m32,m42>; Index(G,H01122);
//1
H01200:=sub<G|mI0,m11,m22,m30,m40>; Index(G,H01200);
//1
H01201:=sub<G|mI0,m11,m22,m30,m41>; Index(G,H01201);
//1
H01202:=sub<G|mI0,m11,m22,m30,m42>; Index(G,H01202);
//1
H01210:=sub<G|mI0,m11,m22,m31,m40>; Index(G,H01210);
//0
H01211:=sub<G|mI0,m11,m22,m31,m41>; Index(G,H01211);
//1
H01212:=sub<G|mI0,m11,m22,m31,m42>; Index(G,H01212);
//1
H01220:=sub<G|mI0,m11,m22,m32,m40>; Index(G,H01220);
//1
H01221:=sub<G|mI0,m11,m22,m32,m41>; Index(G,H01221);
//0
H01222:=sub<G|mI0,m11,m22,m32,m42>; Index(G,H01222);
//1

// H01000, H01002, H01012, H01210, H01221
// we note that if the index contains **20*,**11* or
// **02* it has torsion (see mathematica file)
//
// if 0**2* is part of the index then the group has
// torsion 
// this eliminates H01221 

// So our list is paired down to 
// H01000, H01002, H01012, H01210


//first we deal with H01000 by adding more candidate meridians

gP5:=mI1*m10;
m50:=gP5*mI0*gP5^-1;
m51:=gP5*mI1*gP5^-1;
m52:=gP5*mI2*gP5^-1;

//notice that adding any of these meridians produces an index 1 subgroup
H01000E0:=sub<G|mI1,m11,m20,m30,m40,m50>; Index(G,H01000E0);                                                   
//1
H01000E1:=sub<G|mI1,m11,m20,m30,m40,m51>; Index(G,H01000E1);
//1
H01000E2:=sub<G|mI1,m11,m20,m30,m40,m52>; Index(G,H01000E2);
//1


// next we deal with H01002
//1
H01002E0:=sub<G|mI0,m11,m20,m30,m42,m50>; Index(G,H01002E0);
//0
H01002E1:=sub<G|mI0,m11,m20,m30,m42,m51>; Index(G,H01002E1);
//1
H01002E2:=sub<G|mI0,m11,m20,m30,m42,m52>; Index(G,H01002E2);
//0

gP6:=m31;
m60:=gP6*mI0*gP6^-1;
m61:=gP6*mI1*gP6^-1;
m62:=gP6*mI2*gP6^-1;



//So H01002E0 and H01002E2 require further telescoping
// we add m60,m61,m62
H01002E00:=sub<G|mI0,m11,m20,m30,m42,m50,m60>; Index(G,H01002E00);
//0
H01002E01:=sub<G|mI0,m11,m20,m30,m42,m50,m61>; Index(G,H01002E01);
Order(quo<H01002E01|m30>);
//60
//1
H01002E02:=sub<G|mI0,m11,m20,m30,m42,m50,m62>; Index(G,H01002E02);
//1

// so now H01002E00 requires further telescoping
//we add elements m70, m71, m72
gP7:=m12;
m70:=gP7*mI0*gP7^-1;
m71:=gP7*mI1*gP7^-1;
m72:=gP7*mI2*gP7^-1;

H01002E000:=sub<G|mI0,m11,m20,m30,m42,m50,m60,m70>; Index(G,H01002E000);
Order(quo<H01002E000|mI0>);
//60                                                                                                            
//1                                                                                                              
H01002E001:=sub<G|mI0,m11,m20,m30,m42,m50,m60,m71>; Index(G,H01002E001);
//1                                                                                                              
H01002E002:=sub<G|mI0,m11,m20,m30,m42,m50,m60,m72>; Index(G,H01002E002);
Order(quo<H01002E002|mI0>);
//60                                                                                                            
//1   


// next we add m60,m61,m62 to H01002E2 
H01002E20:=sub<G|mI0,m11,m20,m30,m42,m52,m60>; Index(G,H01002E20);
Order(quo<H01002E20|m30>);
//60
//1
H01002E21:=sub<G|mI0,m11,m20,m30,m42,m52,m61>; Index(G,H01002E21);
Order(quo<H01002E21|mI0>);
//60 
//1
H01002E22:=sub<G|mI0,m11,m20,m30,m42,m52,m62>; Index(G,H01002E22);
//1

//this now shows H01002 always is part of a finite index subgroup

//our remaining cases are  H01012, H01210 

//H01012:=sub<G|mI0,m11,m20,m31,m42>; Index(G,H01012);
//H01210:=sub<G|mI0,m11,m22,m31,m40>; Index(G,H01210);

// We now tackle H01012
// first we add m50,m51,m52
H01012E0:=sub<G|mI0,m11,m20,m31,m42,m50>; Index(G,H01012E0);    
//0
H01012E1:=sub<G|mI0,m11,m20,m31,m42,m51>; Index(G,H01012E1);
//1
H01012E2:=sub<G|mI0,m11,m20,m31,m42,m52>; Index(G,H01012E2);
//1

//then we add m70,m71,m72 
// notationally we add the extra E to indicate we skip m60,m61,m62 
H01012E0E0:=sub<G|mI0,m11,m20,m31,m42,m50,m70>; Index(G,H01012E0E0);
Order(quo<H01012E0E0|mI0>);
//60
//1
H01012E0E1:=sub<G|mI0,m11,m20,m31,m42,m50,m71>; Index(G,H01012E0E1);
//1
H01012E0E2:=sub<G|mI0,m11,m20,m31,m42,m50,m72>; Index(G,H01012E0E2);
Order(quo<H01012E0E2|mI0>);  
//60
//1

//Thus, we covered all possibilities for H01012

//now to consider H01210 first we add the meridians m50,m51,m52
H01210E0:=sub<G|mI0,m11,m22,m31,m40,m50>; Index(G,H01210E0);
//0
H01210E1:=sub<G|mI0,m11,m22,m31,m40,m51>; Index(G,H01210E1);
//1
H01210E2:=sub<G|mI0,m11,m22,m31,m40,m52>; Index(G,H01210E2);
//1

// so we add meridians to H01210E0
H01210E00:=sub<G|mI0,m11,m22,m31,m40,m50,m60>; Index(G,H01210E00);
//0
H01210E01:=sub<G|mI0,m11,m22,m31,m40,m50,m61>; Index(G,H01210E01);
//1
H01210E02:=sub<G|mI0,m11,m22,m31,m40,m50,m62>; Index(G,H01210E02);
//1

// so we add meridians to H01210E00
H01210E000:=sub<G|mI0,m11,m22,m31,m40,m50,m60,m70>; Index(G,H01210E000);
//1
H01210E001:=sub<G|mI0,m11,m22,m31,m40,m50,m60,m71>; Index(G,H01210E001);
//1
H01210E002:=sub<G|mI0,m11,m22,m31,m40,m50,m60,m72>; Index(G,H01210E002);
//0


//So we need to add more meridians to H01210E0
// we add m70,m71,m72
H01210E0E0:=sub<G|mI0,m11,m22,m31,m40,m50,m60,m70>; Index(G,H01210E0E0);
//1
H01210E0E1:=sub<G|mI0,m11,m22,m31,m40,m50,m60,m71>; Index(G,H01210E0E1);
//1
H01210E0E2:=sub<G|mI0,m11,m22,m31,m40,m50,m60,m72>; Index(G,H01210E0E2);
//0


// we need to add further meridians to H01210E0E2
gP8:=mI1*m10;
m80:=gP8*mI0*gP8^-1;
m81:=gP8*mI1*gP8^-1;
m82:=gP8*mI2*gP8^-1;


H01210E0E20:=sub<G|mI0,m11,m22,m31,m40,m50,m60,m72,m80>; Index(G,H01210E0E20);
//0
H01210E0E21:=sub<G|mI0,m11,m22,m31,m40,m50,m60,m72,m81>; Index(G,H01210E0E21);
//1
H01210E0E22:=sub<G|mI0,m11,m22,m31,m40,m50,m72,m82>; Index(G,H01210E0E22);
//1

//finally we add back in m60,m61,m62 to H01210E0E20
H01210E0020:=sub<G|mI0,m11,m22,m31,m40,m50,m60,m72,m80>; Index(G,H01210E0020);
//0
H01210E0120:=sub<G|mI0,m11,m22,m31,m40,m50,m61,m72,m80>; Index(G,H01210E0120);
//1
H01210E0220:=sub<G|mI0,m11,m22,m31,m40,m50,m62,m72,m80>; Index(G,H01210E0220);
//1

gP9:=mI1*y;
m90:=gP9*mI0*gP9^-1;
m91:=gP9*mI1*gP9^-1;
m92:=gP9*mI2*gP9^-1;

H01210E00200:=sub<G|mI0,m11,m22,m31,m40,m50,m60,m72,m80,m90>; Index(G,H01210E00200);
//1
H01210E00201:=sub<G|mI0,m11,m22,m31,m40,m50,m60,m72,m80,m91>; Index(G,H01210E00201);
//0
H01210E00202:=sub<G|mI0,m11,m22,m31,m40,m50,m60,m72,m80,m92>; Index(G,H01210E00202);
//1

gP10:=x;
m100:=gP10*mI0*gP10^-1;
m101:=gP10*mI1*gP10^-1;
m102:=gP10*mI2*gP10^-1;

H01210E002010:=sub<G|mI0,m11,m22,m31,m40,m50,m60,m72,m80,m91,m100>; Index(G,H01210E002010);
//1
H01210E002011:=sub<G|mI0,m11,m22,m31,m40,m50,m60,m72,m80,m91,m101>; Index(G,H01210E002011);
//1
H01210E002012:=sub<G|mI0,m11,m22,m31,m40,m50,m60,m72,m80,m91,m102>; Index(G,H01210E002012);
//1

// This completes the proof of the main the theorem
//The next step is classifying the knot groups for the corollary

// The knot groups are 
// H01010,H01002E01,H01002E000,H01002E002,H01002E20, H01002E21
// H01012E0E0,H01012E0E2
// In G the classes are
// class 1 H01010,H01002E000
// class 2 H01002E01,H01002E20,H01012E0E2
// class 3 H01002E002,H01002E21,H01012E0E0


//class 1
IsConjugate(G,H01010,H01002E000);
//true z^-1

//class 2
IsConjugate(G,H01002E01,H01002E20); 
//true x^2 * z^-1
IsConjugate(G,H01002E01,H01012E0E2);
//true z^-1

//class 3
IsConjugate(G,H01002E002,H01002E21);
//true z^-1 * x^-2
IsConjugate(G,H01002E002,H01012E0E0);
//true z^-1 * x^-1 * z^-1 * x * y^-1

//H01010bar
//H01010:=sub<G|mI0,m11,m20,m31,m40>; Index(G,H01010);
//Order(quo<H01010|m11>);
//mI0 is fixed
//m11 is sent to m10^-1
//m20
//gP2 is sent to x*z*x*x*z*x 
//m20 is sent to x*z*x*x*z*x*mI0*(x*z*x*x*z*x)^-1
gP2bar:=x*z*x*x*z*x;
m20bar:=gP2bar*mI0*gP2bar^-1;
//:=x*z*x*x*z*x*mI0*(x*z*x*x*z*x)^-1;
//gP3 is sent to mI1*Z 
gP3bar:=mI1*z;
// and mI1 is sent to mI2^-1
// so m31 is sent to mI1*Z*mI2^-1*Z*mI1^-1
m31bar:=gP3bar*mI2^-1*gP3bar^-1;
m30bar:=gP3bar*mI0*gP3bar^-1;

//gP4 is sent to z*mI0*z
//so m40 is sent to z*mI0*z*mI0*(z*mI0*z)^-1
H01010bar:=sub<G|mI0,m10,m20bar,mI1*z*mI2^-1*z*mI1^-1,z*mI0*z*mI0*(z*mI0*z)^-1>;

//however this group is not conjugate to class 2 or 3
//H01002E01:=sub<G|mI0,m11,m20,m30,m42,m50,m61>;
//let's look at H01002E01bar
//mI0,m11,m20 are covered above
// gP3 is is sent to mI1*Z and mI0 is fixed
// so m30 is sent to mI1*z*mI0*z*mI1^-1
//gP4 is sent to z*mI0*z and mI2 is sent to mI1^-1
gP4bar:=z*mI0*z;
m42bar:=gP4bar*mI1^-1*gP4bar^-1;
// so m42 is sent to z*mI0*z*mI1^-1*(z*mI0*z)^-1  
//gP5 is sent to mI0*m11^-1
// so m50 is sent to mI0*m11^-1*mI0*m11*mI0^-1
gP5bar:=mI0*m11^-1;
m50bar:=gP5bar*mI0*gP5bar^-1;
m52bar:=gP5bar*mI1^-1*gP5bar^-1;

// gp6 is sent to mI1*z*mI2^-1*z*mI1^-1
gP6bar:=mI1*z*mI2^-1*z*mI1^-1;
// m61 is sent to gP6bar*mI2^-1*gP6bar
m61bar:=gP6bar*mI2^-1*gP6bar^-1;

H01002E01bar:=sub<G|mI0,m10,m20bar,m30bar,m42bar, m50bar, m61bar>;


H01012E0E0bar:=sub<G|mI0,mI0,m20bar,m30bar,m42bar,m52bar,m61bar>;


// This program computes the conjugacy classes of knot groups commensurable with the dodecahedral knot complements
// This is done in the full commensurator G(5,2,2,6,2,3)                                                           
// the result shows that there are two conjugacy classes for the                                                   
// fundamental group of the fibered dodecahedral knot complement                                                   

m:=5;
n:=2;
p:=2;
r:=6;
s:=2;
t:=3;

G1<a,b,c>:=Group<a,b,c|a^m, b^n, c^p, (b*(c^-1))^r, (c*(a^-1))^s, (a*(b^-1))^t>;
/* L:=LowIndexSubgroups                                                                                            
LowIndexSubgroups      LowIndexSubgroupsSn                                                                         
  > L:=LowIndexSubgroups                                                                                          \
                                                                                                                   
LowIndexSubgroups      LowIndexSubgroupsSn                                                                         
  > L:=LowIndexSubgroups(G1,<2>);                                                                                 \
                                                                                                                   
*/                                                                                                                   
L:=LowIndexSubgroups(G1,2);                                                                                      
L;                                                                                                                 
/*                                                                                                              
[                                                                                                                 
    Finitely presented group on 3 generators                                                                       
    Index in group G1 is 1                                                                                         
    Generators as words in group G1                                                                                
        $.1 = a                                                                                                    
        $.2 = b                                                                                                    
             $.3 = c,                                                                                              
                                                                                                                   
    Finitely presented group on 3 generators                                                                       
    Index in group G1 is 2                                                                                         
    Generators as words in group G1                                                                                
        $.1 = a                                                                                                    
        $.2 = b                                                                                                    
        $.3 = c * b * c                                                                                            
*/

x:=a;
y:=b;
z:=c*b*c;
G:=sub<G1|x,y,z>;
Index(G1,G);

// Luckily this jives with the other presentation for G                                                            

// The knot groups are                                                                                            \
                                                                                                                   
// H01010,H01002E01,H01002E000,H01002E002,H01002E20, H01002E21                                                    \
                                                                                                                   
// H01012E0E0,H01012E0E2                                                                                          \
                                                                                                                   
// In G the classes are                                                                                           \
                                                                                                                   
// class 1 H01010,H01002E000                                                                                      \
                                                                                                                   
// class 2 H01002E01,H01002E20,H01012E0E2                                                                         \
                                                                                                                   
// class 3 H01002E002,H01002E21,H01012E0E0                                                                         

mI0:=x*y^-1*z*y^-1;
mI1:=z*x^-1*z*y^-1;
mI2:=z*x^-1*y*x^-1;

gP1:=y;
m10:=y*mI0*y;
m11:=y*mI1*y;
m12:=y*mI2*y;

gP2:=x*y*x^2*y*x;
m20:=gP2*mI0*gP2^-1;
m21:=gP2*mI1*gP2^-1;
m22:=gP2*mI2*gP2^-1;

gP3:=mI1^-1*y;
m30:=gP3*mI0*gP3^-1;
m31:=gP3*mI1*gP3^-1;
m32:=gP3*mI2*gP3^-1;

gP4:=m10;
m40:=gP4*mI0*gP4^-1;
m41:=gP4*mI1*gP4^-1;
m42:=gP4*mI2*gP4^-1;


gP5:=mI1*m10;
m50:=gP5*mI0*gP5^-1;
m51:=gP5*mI1*gP5^-1;
m52:=gP5*mI2*gP5^-1;


gP6:=m31;
m60:=gP6*mI0*gP6^-1;
m61:=gP6*mI1*gP6^-1;
m62:=gP6*mI2*gP6^-1;

gP7:=m12;
m70:=gP7*mI0*gP7^-1;
m71:=gP7*mI1*gP7^-1;
m72:=gP7*mI2*gP7^-1;

gP8:=mI1*m10;
m80:=gP8*mI0*gP8^-1;
m81:=gP8*mI1*gP8^-1;
m82:=gP8*mI2*gP8^-1;


gP9:=mI1*y;
m90:=gP9*mI0*gP9^-1;
m91:=gP9*mI1*gP9^-1;
m92:=gP9*mI2*gP9^-1;


gP10:=x;
m100:=gP10*mI0*gP10^-1;
m101:=gP10*mI1*gP10^-1;
m102:=gP10*mI2*gP10^-1;


H01010:=sub<G|mI0,m11,m20,m31,m40>; Index(G,H01010);

H01002E01:=sub<G|mI0,m11,m20,m30,m42,m50,m61>; Index(G,H01002E01);

H01002E000:=sub<G|mI0,m11,m20,m30,m42,m50,m60,m70>; Index(G,H01002E000);

H01002E20:=sub<G|mI0,m11,m20,m30,m42,m52,m60>; Index(G,H01002E20);

H01002E21:=sub<G|mI0,m11,m20,m30,m42,m52,m61>; Index(G,H01002E21);

H01002E002:=sub<G|mI0,m11,m20,m30,m42,m50,m60,m72>; Index(G,H01002E002);

H01012E0E0:=sub<G|mI0,m11,m20,m31,m42,m50,m70>; Index(G,H01012E0E0);

H01012E0E2:=sub<G|mI0,m11,m20,m31,m42,m50,m72>; Index(G,H01012E0E2);


IsConjugate(G1,H01002E01,H01002E002);
//true c^-1 * b^-1 * a^-1                                                                                          
IsConjugate(G,H01002E01,H01002E002);
//false
