Autos.nb

Automorphisms of free groups and character varieties

W.Goldman,   9 March 2003

Preliminaries

Off[General::"spell1"]; Off[General::"spell"]; 
    Off[Syntax::"tsntxi"];

First, turn off the annoying warning messages. Also, here is a useful matrix output routine:

MF[l_List]  :=  Map[MatrixForm, l]

The Word Datatype

We define a head Word which implements reduced words in a free group. The generators are given by positive
integers, and their inverses are given by their negatives.  For example Word[3] denotes the third generator and
Word[-3]  denotes its inverse. The Dot function implements multiplication in the free group and Inverse  implements inversion:

Unprotect[Word, Dot, Inverse];
Word[a___, m_Integer, n_Integer, b___]  :=  
      Word[a, b]  /;  m  +  n  ==  0
\(Dot[Word[], Word[]]\  := \ \(Word[]

      Dot[Word[], Word[a__]]\  := \ \(Word[a]

        Dot[Word[a__], Word[]]\  := \ Word[a]\)\)\)
Dot[Word[a___], Word[b___]]  :=  Word[a, b]
Word[a___, 0, b___]  :=  Word[a, b]
Inverse[Word[]]  :=  Word[]
Inverse[Word[n_Integer]]  :=  Word[- n]
Inverse[Word[a___, n_Integer]]  :=  
      Word[- n]  .  Inverse[Word[a]]
Protect[Dot, Word, Inverse];

Here is an example of the implementation of reduced words:

Word[1, 2, -2, 3]

Here is an example of the implementation of multiplication of reduced words:

Word[1]  .  Word[2]

Here is an example of the implementation of inversion of reduced words:

Inverse[Word[1, 2, 3, -4]]

KWord = Word[1, 2, -1, -2];

Words and Lists

Here are routines for converting between words (as defined above) and lists. The function toList[w] drops the head Word and returns the list of variables. The function toWord[l] applies the head Word to the list l.

toList[w_Word]  :=  Apply[List, w];
toWord[l_List]  :=  Apply[Word, l];

toList[Word[2, 3, 4, 1, 2, 3, 2]]

toWord[{2, 3, 4, 1, 2, 4}]

Notice that toWord automatically reduces the word.

toWord[{1, -1, 2}]

Output routine

A routine for converting a Word into its standard notation.

\(\(\(SymbolWord[w_Word]\)\(\ \)\(:=\)\(\ \)\(Apply[StringJoin, 
	
        Map[{\ "b", \ "a", \ "E", \ "A", "B"}[\([#]\)] &, 
		3\  + \ toList[w]]]\)\(\ \)\)\)

SymbolWord[l_List]  :=  Map[SymbolWord, l]

SymbolWord[Word[1, 2, 1, -2, 1, 2, -1]]

Applying Words to Other Words (substitution)

Here is the routine for applying a word Word[a] to a list of elements of a free group.

ApplyWord[Word[], l_List]  :=  Word[]
ApplyWord[Word[a_ /; a >  0, b___], l_List ]  :=  
      l[[a]]  .  ApplyWord [Word[b], l]
ApplyWord[Word[a_ /; a < 0, b___], l_List]  :=  
      Inverse[l[[-a]] ]  .  ApplyWord[Word[b], l]

For example, ApplyWord[KWord,{ W1,W2}] returns the commutator of W1 and W2.

ApplyWord[KWord, {Word[3], Word[4, 5]}]

Free group automorphisms

An automorphism A of F2 will be given by a pair of words {W1,W2} which freely generate F2.  The elements of this list are W1 = A(Word[1]) and W2 = A(Word[2]).

ApplyAuto[A_, W_Word]  :=  ApplyWord[W, A]

Composing automorphisms A1 and A2  is implemented as follows. The following function gives the composition A1 o A2:

ComposeAuto[A1_, A2_]  :=  Map[ApplyWord[#, A2] &, A1]

While we're at it, let's extend this function so we can compose several automorphisms at a time:

ComposeAuto[A1_, A2_, X__]  :=  
      ComposeAuto[A1, ComposeAuto[A2, X]]

The identity automorphism is just given by the standard basis:

Basis0  =  {Word[1], Word[2]};

The Three-Generator (Geometric) Presentation of F2

For several applications the presentation of F2 with three generators and one relation is uesful. This
presentation corresponds to the "pair of pants" (3-holed sphere) which has fundamental group F2.
Its generators A,B,C correspond to the three boundary components and satisfy the relation ABC=I.

ThreeGenerators   = {Word[1], Word[2], 
          Word[-2, -1]};

PantsRep[A_]  :=  Map[ApplyAuto[A, #] &, ThreeGenerators]

PantsRep[Basis0] // MatrixForm

Here's a useful display routine to see the action of sets of automorphisms on this generating set:

DisplayPantsRep[A__]  :=  
      Map[PantsRep, Prepend[List[A], Basis0]] // MF

Inner Automorphisms

InnerAutomorphism[w1_Word, w2_Word]   :=  
      w1  .  w2  .  Inverse[w1]

Inn[w_Word]  :=  Map[InnerAutomorphism[w, #] &, Basis0]

Inn[w] returns the inner automorphism determined by w.

Inn[Word[2, 1]]

Here's a convenient shorthand:

Inn[w__]  :=  Inn[Word[w]]

Let's display a few inner automorphisms in the 3-generator set:

DisplayPantsRep[Inn[1], Inn[2], Inn[1, 2], Inn[KWord]]

Permutations

Here are the permutation generators of Aut(F2): The symbol P12 denotes the transposition (12) etc.

P12  =  {Word[2], Word[1]};

Although P12  interchanges the two free generators Word[1], Word[2], it doesn't leave invariant the third generator
Word[-2,-1]  in the geometric presentation Word[1] Word[2] Word[-2,-1] = I  corresponding to pants:

Map[PantsRep, {Basis0, P12}] // MF

It does preserve KWord  up to inversion:

{ApplyAuto[P12, KWord], Inverse[KWord]}

This automorphism has order two:

{ComposeAuto[P12, P12], Basis0}

We define a function to detect whether an automorphism is an involution taking KWord to its inverse:

KWordInv[A_] := {ApplyAuto[A, KWord] == Inverse[KWord], ComposeAuto[A, A] == Basis0}

Next we permute the first and third generator for this presentation to obtain an automorphism P13:

P13  =  {Word[-2, -1], Word[1, 2, -1]};

Map[PantsRep, {Basis0, P13}] // MF

It's an involution and  preserves KWord  up to inversion:

KWordInv[P13]

Next we permute the second and third generator for this presentation to obtain the permutation P23:

P23 =  ComposeAuto[P12, P13, P12]

KWordInv[P23]

The composition P13 P12 is the 3-cycle (123). Remember that permutations act on the left on symbols!

P123  = ComposeAuto[P13, P12]

Its inverse is the 3-cycle (132):

P132 = ComposeAuto[P12, P13]

Map[PantsRep, {Basis0, P123, P132}] // MF

P123 and P132 are mutually inverse and are normalized:

{ComposeAuto[P123, P132] == Basis0, 
      Map[ApplyAuto[#, KWord] == KWord &, {P123, P132}]}

but they only have order three up to an inner automorphism:

ComposeAuto[P123, P123, P123] ==  Inn[Inverse[KWord]]

The Elliptic Involution

See 2.1 of the Modular Group paper.

EllInv  =  {Word[-1],  Word[-2]}

ComposeAuto[EllInv, EllInv]

so indeed EllInv is an involution. However:

ApplyAuto[EllInv, KWord]

so EllInv  is not normalized.  Normalize  EllInv by composing with the inner automorphism Inn[Word[2,1]]:

EllAut  =  ComposeAuto[EllInv, Inn[Word[2, 1]]]

ApplyAuto[EllAut, KWord]

so EllAut is normalized. However, it no longer has order 2 in Aut(F2):

ComposeAuto[EllAut, EllAut]  ==  Inn[Inverse[KWord]]

The elliptic involution commutes with the permutation P12:

{ComposeAuto[EllInv, P12], ComposeAuto[P12, EllInv]} // MF

But it doesn't commute with P23 (and thus neither with the other permutations):

{ComposeAuto[P23, EllInv], ComposeAuto[EllInv, P23]} // MF

Here is the action of EllInv on the 3-element generating set:

DisplayPantsRep[EllInv]

Other involutions

These next automorphisms induce the quadratic reflections on the character variety (see 2.3 of the Modular Group paper).  Begin with the following automorphism. It's obviously an involution:

Qz1  =  {Word[1], Word[-2]};
ComposeAuto[Qz1, Qz1] == Basis0

but it's not normalized:

ApplyAuto[Qz1, KWord]

Let's normalize it:

ApplyAuto[ComposeAuto[Inn[-1], Qz1], KWord]

ApplyAuto[ComposeAuto[Inn[-2, -1], Qz1], KWord]

ApplyAuto[Qz  =  ComposeAuto[Inn[1, -2, -1], Qz1], 
      KWord]

so composing with Inn[1,-2,-1] normalizes it. Is it an involution?

ComposeAuto[Qz, Qz] == Basis0

We could have used our little function KWordInv:

KWordInv[Qz]

Here's what it looks like:

Qz

We obtain the other involutions Qy and Qx by conjugating by P23 and P13:

{Qy  =  ComposeAuto[P23, Qz, P23], 
        Qx  =  ComposeAuto[P13, Qz, P13]} // MF

They are normalized involutions:

Map[KWordInv, {Qy, Qx}]

Here is what they look like on the 3 generators:

DisplayPantsRep[Qx, Qy, Qz]

An order-four automorphism

A4a = {Word[-2], Word[1]};

Thus A4a has order 4:

ComposeAuto[A4a, A4a] == EllInv

but it's not normalized:

ApplyAuto[A4a, KWord]

ApplyAuto[A4 = ComposeAuto[Inn[-1], A4a], KWord]

Now A4  is normalized. However, it no longer has order 4:

ComposeAuto[A4, A4, A4, A4] == Inn[Inverse[KWord]]

DisplayPantsRep[A4]

A Dehn twist

Here is the automorphism (Nielsen transformation) corresponding to Dehn twist about X:

Tx  =  {Word[1], Word[2, 1]}

Here is the inverse:

Txi  =  {Word[1], Word[2, -1]};

ComposeAuto[Tx, Txi]

These automorphisms are normalized:

Map[ApplyAuto[#, KWord] == KWord  &, {Tx, Txi}]

A relation between Tx, Qz and  P23:

DisplayPantsRep[Tx, P23, Qz]

DisplayPantsRep[ComposeAuto[Qz, P23] , Tx, 
      ComposeAuto[Inn[2, 1, -2, -1], Tx]]

ComposeAuto[Inn[2, 1, -2, -1], Tx] ==  
      ComposeAuto[Qz, P23]

Tx  ==  ComposeAuto[Inn[1, 2, -1, -2], Qz, P23]

More Dehn twists

We define the Dehn twist about Y:

Ty  =  ComposeAuto[P12, Tx, P12]

Here is the inverse:

Tyi  =  {Word[1, -2], Word[2]};

The Fibonacci automorphism

FibAut  =  {Word[2, 1], Word[1]};

This is the simplest hyperbolic automorphism of F2.

Map[SymbolWord[#[[2]] ] &, 
        NestList[ComposeAuto[FibAut, #] &, FibAut, 8]] // 
      MatrixForm

Homology

First we need a function to compute the total exponent sum of a letter in a word.
Length[Cases[List,Integer]] returns the number of occurrences of Integer in List (with multiplicity).

ExponentSum[l_List, j_Integer]  :=  
      Length[Cases[l, j]]  -  Length[Cases[l, -j]]

The function HomologyClass[W] returns the homology class (an element in Z^2) of the word W.

HomologyClass[w_Word]  :=  
      Module[{l = toList[w]}, Table[ExponentSum[l, j], {j, 2}]]

HomologyClass[Word[1, 2, -1, 2]]

The action on homology is determined by the homology classes of the images of the generators.

AutToGL2Z[A_]  :=  Transpose[Map[HomologyClass, A]]

Representation of the Symmetric Group

For example here is the representation of the symmetric group in GL(2,Z):

(Sym3  = 
          Map[AutToGL2Z[#] &, {Basis0, P12, P23, P13, P123, P132}] ) // 
      MF

Table[Sym3[[i]] . Sym3[[j]], {i, 6}, {j, 6}] // 
      MatrixForm

For future reference, here is the multiplication table for the Symmetric Group:

\(\((Sym3MultiplicationTable\  = \ {
		{"P0", "P12", "P23", "P13", "P123", "P132"}, 
	\ \ {"P12", "P0", "P132", "P123", "P13", "P23"}, 
		{"P23", "P123", "P0", "P132", "P12", "P13"}, 
		{"P13", "P132", "P123", "P0", "P23", "P12"}, 
		{"P123", "P23", "P13", "P12", "P132", "P0"}, 
		{"P132", "P13", "P12", "P23", "P0", "P123"}
					\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ })\)\  // MatrixForm\)

GL(2,Z) representations of other automorphisms

Map[AutToGL2Z[#] &, {EllAut, Qx, Qy, Qz, A4, Tx, Ty, FibAut}] // 
      MF

Let's check the relation between  the Dehn twist, the reflection and the permutation in terms of matrices:

({p23, qz, tx}  =  Map[AutToGL2Z[#] &, {P23, Qz, Tx}]) // 
      MF

p23 . qz  ==  tx

The Trace Function in SL(2)

If W(x1,...,xn) is an element in the free group Fn, then the trace function trace W(X1,...,Xn),  where X1,....,Xn are elements of SL(2), is a polynomial in the traces of monomials trace(Xi Xj Xk ...)  where i < j < k ...  The algorithm below uses several easy facts about the trace  function and the basic trace relation  trace(XY) + tr(XY^{-1}) = trace(X)trace(Y)  to compute this polynomial from W:

The TTrace Function

First implement some easy facts: the trace of the identity is 2 and the trace is invariant under conjugation.

TTrace[Word[]]  :=  2

TTrace[Word[i_Integer, a__, j_Integer]]  :=  
      TTrace[Word[a]]      /;  i + j  == 0

TTrace[Word[j_Integer, a___]]  :=  
      TTrace[Inverse[Word[a, j]]]    /;  j  <  0

Next, use the basic trace relation to eliminate repeated letters:

\(TTrace[Word[a___, i_Integer, b__, j_Integer, c___]]\  := \ 
	
      TTrace[Word[c, a, i]]\ TTrace[Word[b, j]]\  - 
	
          TTrace[Word[c, a] . 
              Inverse[Word[b]]]\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \  /; \ 
        i\  == \ j\)

\(TTrace[Word[a___, i_Integer, j_Integer, c___]]\  := \ 
	
      TTrace[Word[c, a, i]]\ TTrace[Word[j]]\  - 
	
          TTrace[Word[c, a]]\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \  /; \ 
        i\  == \ j\)

The case when the letters have opposite sign is slightly different:

\(TTrace[Word[a__, i_Integer, b___, j_Integer, c___]]\  := \ 
	
      TTrace[Word[c, a, i]]\ TTrace[Word[b, j]]\  + 
	
          TTrace[Word[c, a] . Inverse[Word[b]]]\ \ \ \  - 
	
          TTrace[Word[c, a, i] . Inverse[Word[b]]]\ TTrace[Word[i]]\  /; \ 
        i + j\  == \ 0\)

Finally, we want to reduce to traces of words with only positive exponents:

\(Letters[w_Word]\  := \ 
      Sort[Union[
\ \ \ \ \ \ \ \ Abs[
            Map[w[\([#]\)] &, Range[Length[w]]]]\ ]\ ]\)

This just lists the letters in a word.

Unprotect[PositiveQ];
PositiveQ[Word[a___, j_Integer]]  :=  
      PositiveQ[Word[a]]      /;  j  >  0
PositiveQ[Word[a___, j_Integer, b___]]  :=  
      False              /;  j  <  0
PositiveQ[Word[]]  :=  True ;
Protect[PositiveQ];

This detects when a word is positive:

\(\(LetterLessThanQ[j_Integer, w_Word]\  := 
	
        Apply[And, Map[j < # &, \ Letters[w]]]\ ;\)\)

This function detects when letter j is less than any of the letters in Word w.

\(\(\(LetterMoreThanQ[j_Integer, w_Word]\)\(\ \)\(:=\)\(
\)\(	\)\(Apply[
        And, Map[j > # &, \ Letters[w]]]\)\(\ \)\)\)

This function detects when letter j is more than any of the letters in Word w.

\(TTrace[Word[a__, j_Integer /; j < 0, b___]]\  := 
	
      TTrace[Word[a]]\ TTrace[Word[j, b]]\  - \ 
	
          TTrace[Word[a] . 
              Inverse[Word[j, 
                  b]]]\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \  /; \ \((PositiveQ[
              Word[a]]\  && \ 
            LetterNotInWordQ[\(-j\), 
              Word[a]]\  && 
		LetterLessThanQ[\(-j\), 
              Word[b]]\  && 
		LetterMoreThanQ[\(-j\), 
              Word[a]])\)\)

TTrace[Word[i_Integer, j_Integer /; j < 0]]  :=  
      TTrace[Word[i]] TTrace[Word[j]]  -  
        TTrace[Word[i, -j]]

LetterNotInWordQ[j_Integer, 
        w_Word]   :=  (Position[Letters[w], j]  ==  {})

\(\(\( (*\ 
      Fricke\ Relation\ puts\ the\ letters\ in\ order\ *) \)\(
\)\(TTrace[
        Word[a__, j_Integer, k_Integer, 
          b___]]\  := 	
	\(\(TTrace[Word[a]]\ TTrace[
              Word[j, k, b]]\  + \ 
	
          TTrace[Word[j]]\ TTrace[Word[k, b, a]]\  + \ 
	
          TTrace[Word[k, b]]\ TTrace[Word[a, j]]\  - 
	
          TTrace[Word[a]]\ TTrace[Word[j]]\ TTrace[Word[k, b]]\  - 
	
          TTrace[Word[a, k, b, j]]\)\(\ 				\)\(/;\)\((Abs[k]\  < \ 
            Abs[j])\)\(\ \)\)\)\)\)

\(TTrace[
        Word[j_Integer, k_Integer, b___]]\  := \ 
		\(\(TTrace[
          Word[k, b, 
            j]]\)\(\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \)\(/;\)\((Abs[
              k]\  < \ Abs[j])\)\(\ \)\)\)

Some Examples

TTrace[Word[...]] expresses the trace of a word in elements of SL(2) in terms of traces of the generators and their products, in increasing order.  Here are some examples:

TTrace[Word[1, 2, -3]]

TTrace[Word[1, -2, -3]]

TTrace[Word[1, 2, -1, 2, 2]]

Using Mathematica's substitution rules, we can write the trace polynomials in terms of variables. Here we use the Fricke  coordinates  (TTrace[Word[1]],TTrace[Word[2]],TTrace[Word[1,2]]):

TracePoly[Word[w__], {x_, y_, z_}]  :=  
      Expand[TTrace[Word[w]] /. {TTrace[Word[1]] -> x, TTrace[Word[2]] -> y, 
            TTrace[Word[1, 2]] -> z}]

Here is a typical trace polynomial:

TracePoly[Word[1, 2, -1, 2, 2], {a, y, z}]

Tschebyshev Polynomials

The traces of powers of an element A  of SL(2) are Tschebyshev polynomials in the trace of A.

Map[TracePoly[Apply[Word, Table[1, {#}]], {x, y, z}] &, Range[12]] // 
      MatrixForm

The Commutator Trace

Here is the familiar cubic polynomial expressing the commutator trace in F2:

Kappa[{x_, y_, z_}]  :=  TracePoly[KWord, {x, y, z}]

Kappa[{a, b, c}]

Traces in a rank 3 free group

TracePoly3[Word[w__], {t12_, t23_, t13_, t1_, t2_, t3_, t123_}]  :=  
      Expand[TTrace[Word[w]] /. {TTrace[Word[1]] -> t1, 
            TTrace[Word[2]] -> t2, 
            TTrace[Word[1, 2]] -> 
              t12, 
TTrace[Word[3]] ->  t3,  
            TTrace[Word[1, 3]] -> t13,  
            TTrace[Word[2, 3]] ->  t23, 
            TTrace[Word[1, 2, 3]] -> t123}]

tList  = {t12, t23, t13, t1, t2, t3, t123} ;

S12sub  =  {t1 -> a, t2 -> x, t3 -> y, 
          t12 -> w, t13 -> p, t23 -> z, 
          t123 ->  u};

(t123m2  =  TracePoly3[Word[ 1, 2, 3, -2], tList]) /. 
      S12sub

(t123m2m3 =  TracePoly3[Word[ 1, 2, 3, -2, -3], tList]) /. 
      S12sub

FrickePolynomial[{{a_, b_, c_, d_}, {x_, y_, z_}}] := 
      Simplify[(x^2) + (y^2) + (z^2) + 
          x y z - (a b + c d) x - (b c + a d) y - (a c + 
                b d) z + (-4 + (a^2) + (b^2) + (c^2) + (d^2) + 
              a b c d)]

k  =  x^2   +  y^2  +  z^2  -  x y z  -  2

fp = 
      FrickePolynomial[{{a, b, y, y}, {k, v, p}}] /.  {p ->  
              u x  +  a y  -  w z  -  v} // Expand

fp  -  (fp /. {a -> b, b -> a, x -> y,  
              y -> x, v -> u, u -> v}) // Expand

Computations for the 1-holed Klein Bottle

The boundary element of a 1-holed Klein bottle

KleinBottleDWord  =  Word[1, 1, 2, 2];

The simple loop on the  1-holed Klein bottle separating off a handle from the boundary

KleinBottleCWord  =  
      ApplyWord[KWord, {Word[1, 1], Word[2]}]

We assume that the elements X, Y  reverse orientation and thus XY preserves orientation.

kbd  =  TracePoly[KleinBottleDWord, {I x,  I y, z}]

This is the peripheral trace for the 1-holed Klein bottle.

kbc  =  TracePoly[KleinBottleCWord, {I x,  I y, z}]

kappa  =  Kappa[{I x,  I y, z}]

kbc  -  (- (kappa  -  2 ) (x^2)   +  2) // 
      Simplify

Automorphisms of the Character Variety

Now we see how Aut(F2)  acts by polynomial automorphisms of the relative character variety. That is, we find polynomial automorphisms of affine 3-space which preserve the Kappa polynomial.

P12

Map[TracePoly[#, {x, y, z}] &, P12]

PantsRep[P12]

Map[TracePoly[#, {x, y, z}] &, PantsRep[P12]]

Map[TracePoly[#, {x, y, z}] &, PantsRep[Qx]]

The TrAuto[A]  computes the action on traces induced by the inverse of the automorphism A  of F2.

TrAuto[A_]  :=  
      Map[TracePoly[#, {x, y, z}] &, PantsRep[A]]

TrAuto[EllInv]

TrAuto[P23]

TrAuto[P123]

TrAuto[Tx]

Relations in the Mapping Class Group

The Braid Relation

The twist automorphisms Tx, Tyi  satisfy the relation Tx Tyi Tx = Tyi Tx Tyi.  This common value is the element  A4 which has order 4 in Out(F2).

Map[# == A4 &, {ComposeAuto[Tx, Tyi, Tx], 
        ComposeAuto[Tyi, Tx, Tyi]}]

{ComposeAuto[Tx, Tyi, Tx], ComposeAuto[Tyi, Tx, Tyi], A4} // 
      MF

Here is what their images in GL(2,Z) look like:

Map[AutToGL2Z, {Tx, Tyi, ComposeAuto[Tx, Tyi,  Tx]}] // MF

ComposeAuto[A4, A4, A4, A4]  ==  
      Inn[Word[2, 1, -2, -1]]

The modular group SL(2,Z) (by Matt Bainbridge)

\(expand[M_]\  := \ 
      Block[{w\  = \ Word[], \ m\  = \ M, \ i\  = \ 0, \ 
          s}, \ 
\ \ \ \ \ While[
          m[\([1, 1]\)]\  != \ 0\  && \ 
            m[\([2, 1]\)]\  != \ 0, \ 
\ \ \ \ \ If[
            Abs[m[\([2, 1]\)]]\  > \ 
              Abs[m[\([1, 
                    1]\)]], \ 
\ \ \ \ \ \ \ \ \ m\  = \ {{0, \ \(-1\)}, \ {1, \ 0}}\  . \ m; \ 
\ \ \ \ \ \ \ \ \ w\  = \ 
              w\  . \ Word[2]]; \ 
\ \ \ \ \ \ \ \ w\  = \ 
            w\  . \ Word[
                s\  = \ Sign[m[\([1, 1]\)]]*
                    Sign[m[\([2, 
                          1]\)]]]; \ 
\ \ \ \ \ \ \ \ m\  = \ {{1, \ \(-s\)}, \ {0, \ 1}}\  . \ m]; \ 
\ \ \ \ \ If[
          m[\([1, 1]\)]\  == \ 
            0, \ 
\ \ \ \ \ \ \ m\  = \ {{0, \ \(-1\)}, \ {1, \ 0}}\  . \ 
              m; \ 
\ \ \ \ \ \ \ w\  = \ w\  . \ Word[2]]; \ 
\ \ \ \ \ If[
          m[\([1, 1]\)]\  == \ \(-1\), \ 
\ \ \ \ \ \ \ m\  = \ {{\(-1\), \ 
                  0}, \ {0, \ \(-1\)}}\  . \ m; \ 
\ \ \ \ \ \ \ w\  = \ 
            w\  . \ Word[2, \ 2]]; \ 
\ \ \ \ \ \ For[i\  = \ 1, \ 
          i\  <= \ Abs[m[\([1, 2]\)]], \ 
\ \ \ \ \ \ \ \ \ \ \(i++\), \ 
          w\  = \ w\  . \ Word[Sign[m[\([1, 2]\)]]]]; \ w]\)

Uu[n_]  :=  {{1, n}, {0, 1}}

Uu[5] // MatrixForm

expand[Uu[5]]

expand[Uu[-6]]

expand[{{5, -1}, {1, 0}} . {{0, -1}, {1, 3}}]

The Trace-Reduction Algorithm (by George Stantchev)

\(traceReduce[v_List] := 
      Module[{l, \ 
          w}, 
	 (*	\(If[f @@ v\  < \ 2, \ 
              Print["character < 2. Exiting..."]; \ 
              Return[]];\)
			*) 
If[\((v[\([1]\)]\  - 
                  2\ )\)*\((\ v[\([2]\)]\  - 2)\)\ *\((\ 
                v[\([3]\)]\  - \ 2)\)\  <= 0, \ 
          Print[
				"character in [-inf, 2]^3. Exiting..."]; \ 
	
          If[v[\([1]\)]\  > \ \(-2\)\  || \ v[\([2]\)]\  > \ \(-2\)\  || \ 
              v[\([3]\)]\  > \ \(-2\), \ 
            Print[
	"character in [-2, 2]"]]; 
          Print[v]; 
			count\  = \ 0; 
          Return[]]; 
w\  = \ 
          v; 
Print["v=", \ 
          v]; 
Print["count =", \ 
          count]; 
If[w[\([1]\)]\  < \ \(-2\), \ 
          w[\([1]\)]\  = \ \(-w[\([1]\)]\)]; 
If[
          w[\([2]\)]\  < \ \(-2\), \ 
          w[\([2]\)]\  = \ \(-w[\([2]\)]\)]; 
If[
          w[\([3]\)]\  < \ \(-2\), \ w[\([3]\)]\  = \ \(-w[\([3]\)]\)]; 
        If[w[\([1]\)]\  <= 2\  || \ w[\([2]\)]\  <= 2\  || 
            w[\([3]\)]\  <= \ 2, \ 
          Print[
				"character in [-2, 2]. Exiting..."]; 		
				Print[v]; count = 0; Return[]]; 
		w\  = 
          Sort[w]; 
		w[\([3]\)]\  = \ 
          w[\([1]\)]*w[\([2]\)]\  - \ w[\([3]\)]; 
		\(count++\); 
	
        traceReduce[w];
		]\)

An example

ExampleAuto  =  ComposeAuto[Ty, Tx, Ty, Tx, Ty]

ExampleTrace  =  TrAuto[ExampleAuto]

count  =  0;
traceReduce[
      ExampleTrace  /.  {x ->  -3, y -> -3, 
          z -> -3}]

traceReduce[
      ExampleTrace  /.  {x ->  -3, y -> -3, z -> 0}]

Free Groups of Rank 3

Trace Computations

The following function expresses the trace of a word in 3 generators Word[1], Word[2], Word[3] in terms of the traces of the words  Word[1,], Word[2], Word[3], Word[1,2], Word[2,3], Word[1,3]  and Word[1,2,3].

TracePoly3[Word[w__], {t12_, t23_, t13_, t1_, t2_, t3_, t123_}]  :=  
      Expand[TTrace[Word[w]] /. {TTrace[Word[1]] -> t1, 
            TTrace[Word[2]] -> t2, 
            TTrace[Word[1, 2]] -> 
              t12, 
TTrace[Word[3]] ->  t3,  
            TTrace[Word[1, 3]] -> t13,  
            TTrace[Word[2, 3]] ->  t23, 
            TTrace[Word[1, 2, 3]] -> t123}]

tList  = {t12, t23, t13, t1, t2, t3, t123} ;

Let's define a shorthand  function for dealing with traces.

t[inputs__] :=  TracePoly3[Word[inputs], tList]

t[2, 3, 1]

t[1, 2, 3]

Derivation of Fricke's 3-Generator Sum Formula

t[1, 3, 2]

t[1, 2, 3]  +  t[1, 3, 2]

obtaining Fricke's Sum Formula.

Derivation of Fricke's 3-Generator Product Formula

The Product Formula is trickier. We want to use the Basic Identity to express the product 
                        Trace(Word[1,2,3]) Trace(Word[1,3,2])  as the sum 
Trace[Word[1,2,3] Word [1,3,2]) + Trace[Word[1,2,3] Inverse(Word[1,3,2])] 
 but our algorithm expresses the first summand in terms of Trace[Word[1,2,3]] = t[1,2,3].

t[1, 2, 3, 1, 3, 2]

The other summand is OK:

t[1, 2, 3, -2, -3, -1]

So let's break up
              Word[1,2,3,1,3,2]
as the product Word[1,2] Word[3,1,3,2]  and express the traces in terms of positive words of length at most 2.

Word[1, 2] . Word[3, 1, 3, 2]

Inverse[Word[1, 2]] . Word[3, 1, 3, 2]

These are the words to which we apply the Basic Identity, obtaining an expression for the trace of Word[1,2,3,1,3,2]  in terms of traces of words of length at most 2.

temp123132  = 
      t[1, 2] t[3, 1, 3, 2] - t[-2, -1, 3, 1, 3, 2] // 
        Expand

This expression represents the trace  t[1,2,3,1,3,2] of Word[1,2,3,1,3,2].

The product t[1,2,3] t[1,3,2] equals the sum t[1,2,3,1,3,2] + t[1,2,3,-2,-3,-1]  so that t[1,2,3] t[1,3,2]  equals:

temp123132   +  t[1, 2, 3, -2, -3, -1]

obtaining Fricke's Product Formula.

The Four-Holed Sphere

The fundamental group of the 4-holed sphere S4 has presentation
			< A , B, C, D |     A B C D = 1>

{AA, BB, CC, DD} =  {Word[1], Word[2],  Word[3], 
          Word[-3, -2, -1]};

AA .  BB .  CC .  DD  == Word[]

\(QTracePoly[Word[w__], {a_, b_, c_, d_, x_, y_, z_}]\  := \ 
      Expand[TTrace[Word[w]] /. {TTrace[Word[1]] -> a, 
            TTrace[Word[2]] -> b, 
				TTrace[Word[3]] -> \ c, \ 
            TTrace[Word[1, 2, 3]] -> \ d, 
					TTrace[Word[1, 2]] -> 
              x, \ TTrace[Word[2, 3]] -> \ y, \ 
            TTrace[Word[3, 1]] -> z}]\)

abcd  =  {a, b, c, d, x, y, z};

The symmetric group acting on S4

The permutations of the boundary components act on the surface S4,. The action on the fundamental
group is described as follows:

Q12  =  {Word[2], Word[-2, 1, 2], 
          Word[3]};

    Q23  =  {Word[1], Word[3], Word[-3, 2, 3]};

    Q34  =  {Word[1], Word[2],  
          Word[-3, -2, -1]};

The induced maps on boundary traces are:

Q12: (a,b,c,d) |-> (b,a,c,d),
Q23: (a,b,c,d) |-> (a,c,b,d)
Q34: (a,b,c,d_|-> (a,b,d,c).

For the interior traces, let:

zprime  =  -z  -  x y  +  a c  +  b d;
xprime  =  -x  -  y z  +  a b  +  
          c d;
yprime  =   -y -  x z   +  b c + a d;

and the induced maps on interior traces are:
Q12: (x, y, z) |-> (x, zprime, y),
Q23: (x, y, z) |-> (z, y, xprime),
Q34: (x, y, z) |-> (x, zprime, y). 
 
 The even involutions act trivially on the three interior traces.

The genus-1 double cover of S4

To understand the mapping class group of the 4-holed sphere S4, we pass to the double covering
defined by the 2-fold character which is nontrivial on each boundary component.
The total space is a  4-holed torus T4  whose fundamental group has  presentation

			< U, V, AA, BB, CC, DD   |   U V u v AA BB CC DD = 1 >

T4Relation = KWord . Word[3, 4, 5, 6]

The covering space induces the homomorphism

U 	|->	A B
V	|->	C A
AA	|->	(C A c)^2
BB 	|->	(C B c)^2
CC	|->	C ^2
DD	|->	(D)^2

We verify that this induces a homorphism of fundamental groups:

{UU  =  Word[1, 2],  VV  =  Word[3, 1]};

{AA2, BB2, CC2, DD2}  =  {InnerAutomorphism[CC, AA . AA], 
          InnerAutomorphism[CC, 
            BB . BB], (CC . CC), (DD . DD)};

ApplyWord[T4Relation, {UU, VV, AA2, BB2, CC2, DD2}]  == 
      Word[]

The homology of T4 is obtained by killing AA,BB,CC,DD.

We work in the fundamental group of S4, where the generators A, B, C are denoted
Word]1], Word[2], Word[3] respectively. Here is the first Dehn twist (around X = AB ):

Dehn Twists

(Twx  =  {Word[1], Word[2], Word[1, 2, 3, -2, -1]}) // 
      MatrixForm

Since the images of U and V generate the homology, it suffices to check the effect of an automorphism
on U = Word[1,2] and V = Word[3,1]:

Map[ApplyAuto[Twx, #] &, {UU, VV}]

ApplyAuto[Twx, Word[3, 1]]  == 
UU .  
        Word[3, 3]  .  (DD . DD) .  UU .  VV

Thus this Dehn twist corresponds to the matrix

MatrixForm[MatrixTwx = {{1, 2}, {0, 1}}]

(Twy  =  {Word[2, 3, 1, -3, -2], Word[2], Word[3]}) // 
      MatrixForm

Map[ApplyAuto[Twy, #] &, {UU, VV}]

Map[
        ApplyAuto[Twy, #] &, {UU, VV}]  == {Inverse[VV] . 
          Inverse[UU] . Inverse[DD2] . Inverse[VV] . AA2, 
        BB2 . CC2 . DD2 . UU . VV . VV . DD2 . UU . VV}

Thus this Dehn twist corresponds to the matrix

MatrixForm[MatrixTwy = {{-1, 2}, {-2, 3}}]

(Twz  =  {Word[1], Word[3, 1, 2, -1, -3], Word[3]}) // 
      MatrixForm

ApplyAuto[Twz, UU]

YY = Word[2, 3]

mm = 
      Map[QTracePoly[ApplyAuto[Twz, #], abcd] &, {UU, YY, VV}]

mm[[1]]  -  xprime   +  z ( yprime  -  y) // 
      Simplify

Map[ApplyAuto[Twz, #] &, {UU, VV}]

Map[
        ApplyAuto[Twz, #] &, {UU, VV}]  == 
{UU . 
          Inverse[VV] . Inverse[UU] . Inverse[DD2] . Inverse[CC2] . 
          Inverse[BB2] . CC2 . UU . Inverse[VV], VV}

Thus this Dehn twist corresponds to the matrix

MatrixForm[MatrixTwz = {{1, 0}, {-2, 1}}]

These are the generators of the level 2 congruence subgroup of SL(2,Z).

MF[{MatrixTwx, MatrixTwy, MatrixTwz}]

MatrixTwx . MatrixTwz . MatrixTwy  // MatrixForm

The Lantern Relation

Now we consider a free group of rank 3.  Recall the Dehn twists   Twx, Twy, Twz.
The following is a convenient shorthand for inner automorphisms of a rank 3 free group.

Inn3[w__]  :=  Inn3[Word[w]]
Inn3[w_Word]  :=  (InnerAutomorphism[w,  #1]  & )  /@  
        Map[Word, Range[3]]

Inn3[3] // MatrixForm

{ComposeAuto[Twz, Twx, Twy], ComposeAuto[Inn3[1], Inn3[3], Inn3[2]]} // 
      MF

{MatrixTwz, MatrixTwy, MatrixTwx} // MF

MatrixTwz . MatrixTwy . MatrixTwx // MatrixForm

A quadratic reflection

QRz  = {Inverse[AA], 
        InnerAutomorphism[AA, 
          Inverse[BB]], 
InnerAutomorphism[AA . BB, 
          Inverse[CC]]}

QRzUV  =  Map[ApplyAuto[QRz, #] &, {UU, YY, VV}]

QRzUV  =  Map[ApplyAuto[QRz, #] &, {UU, VV}]

QRzUV  ==  {Inverse[UU], 
        UU . DD2 . UU . Inverse[AA2] . VV}

Thus this reflection corresponds to the matrix

MatrixForm[MatrixQz = {{-1, 0}, {2, 1}}]

MatrixQz . MatrixTwz

abcd  =  {a, b, c, d, x, y, z};

QTracePoly[
      Word[2, -3, -2, -1], {a, b, c, d, x, y, z}]

(QRR  = ComposeAuto[QRz, Twz]) // MatrixForm

(QRR1  = ComposeAuto[QRR, Inn3[Word[-1, -3, -1]]])  // 
      MatrixForm

ApplyAuto[QRR1, UU]

ff  = QTracePoly[ApplyAuto[QRR1, UU], abcd]

Simplify[
      ff  +  z yprime  -  ( -x  +  a b  +  c d) == 
        0]

ApplyAuto[QRR1, YY = Word[2, 3]]

yprime  ==  
      QTracePoly[ApplyAuto[QRR1, YY = Word[2, 3]], abcd]

zprime  =  -z  -  x y  +  a c  +  b d;
xprime  =  -x  -  y z  +  a b  +  
          c d;
yprime  =   -y -  x z   +  b c + a d;

QTracePoly[ApplyAuto[QRz, VV], abcd] == zprime

ffz  -  zprime

ffz  -  zprime  -  x yprime // Expand

%341  +  xprime yprime // Expand

ffz  = QTracePoly[ApplyAuto[QRR1, VV], abcd] // Expand

ApplyAuto[QRR1, VV]

QRR1

Map[QTracePoly[ApplyAuto[QRR1, #], abcd] &, {UU, VV}] // 
      MatrixForm

ww  = ApplyAuto[QRz, VV]

UU

UU . DD2 . UU . Inverse[AA2] . VV

Inverse[VV] . Inverse[AA2] . VV

Inverse[AA]

abcd  =  {a, b, c, d, x, y, z};

The orientable double cover of the 2-holed projective plane

The orientable double cover of the punctured Moebius band  P (2-holed projective plane) 
is a 4-holed sphere S ; the corresponding monomorphism of fundamental groups is:
A = X Y,  B = y X,  C = x  y, D = Y x,  where    <A,B,C,D| ABCD = 1>  is the fundamental group
of S (the generators A,B,C,D correspond to bd S)
and  <X,Y> is the fundamental group of P (bd P corresponds to  XY and Xy). If
I xx  denotes the trace of X,  I yy the trace of Y and  zz the trace  of Z, then the corresponding
characters for S  are given by the following:

Fricke[{{a, b, c, d}, {x, y, z}} /. {
a -> 
            zz, 
b -> -xx yy  -  
              zz,  
c  ->  
            zz, 
d  ->  -xx yy  -  
              zz, 
x  ->  - xx^2  - 
              2,  
y  ->  -yy^2  - 
              2,  
z -> -xx^2  -  yy^2  +  
              zz^2  +  xx yy zz  - 2}]

This defines the mapping of the character variety of P into that of S.

S12sub  =  {t1 -> a, t2 -> x, t3 -> y, 
          t12 -> w, t13 -> p, t23 -> z, 
          t123 ->  u};

(t123m2  =  TracePoly3[Word[ 1, 2, 3, -2], tList]) /. 
      S12sub

(t123m2m3 =  TracePoly3[Word[ 1, 2, 3, -2, -3], tList]) /. 
      S12sub

FrickePolynomial[{{a_, b_, c_, d_}, {x_, y_, z_}}] := 
      Simplify[(x^2) + (y^2) + (z^2) + 
          x y z - (a b + c d) x - (b c + a d) y - (a c + 
                b d) z + (-4 + (a^2) + (b^2) + (c^2) + (d^2) + 
              a b c d)]

k  =  x^2   +  y^2  +  z^2  -  x y z  -  2

FrickePolynomial[{{a, b, y, y}, {k, v, p}}] /.  {p ->  
            u x  +  a y  -  w z  -  v} // Expand

The Mapping Class Group of the Four-Holed Sphere

The fundamental group of the 4-holed sphere S4 has presentation
			A , B, C, D |     A B C D=1

{AA, BB, CC, DD} =  {Word[1], Word[2],  Word[3], 
          Word[-3, -2, -1]};

AA .  BB .  CC .  DD  == Word[]

To understand the mapping class group of the 4-holed sphere S4, we pass to the double covering
defined by the 2-fold character which is nontrivial on each boundary component.
The total space is a  4-holed torus T4  whose fundamental group has  presentation

			U, V, AA, BB, CC, DD   |   U V u v AA BB CC DD = 1

T4Relation = KWord . Word[3, 4, 5, 6]

The covering space induces the homomorphism

U 	|->	A B
V	|->	C A
AA	|->	(C A c)^2
BB 	|->	(C B c)^2
CC	|->	C ^2
DD	|->	(D)^2

{UU  =  Word[1, 2],  VV  =  Word[3, 1]};

{AA2, BB2, CC2, DD2}  =  {InnerAutomorphism[CC, AA . AA], 
          InnerAutomorphism[CC, 
            BB . BB], (CC . CC), (DD . DD)};

ApplyWord[T4Relation, {UU, VV, AA2, BB2, CC2, DD2}]  == 
      Word[]

The homology of T4 is obtained by killing AA,BB,CC,DD.

Dehn Twists

We work in the fundamental group of S4, where the generators A, B, C are denoted
Word]1], Word[2], Word[3] respectively. Here is the first Dehn twist (around X = AB ):

(Twx  =  {Word[1], Word[2], Word[1, 2, 3, -2, -1]}) // 
      MatrixForm

Since the images of U and V generate the homology, it suffices to check the effect of an automorphism
on U = Word[1,2] and V = Word[3,1]:

Map[ApplyAuto[Twx, #] &, {UU, VV}]

ApplyAuto[Twx, Word[3, 1]]  == 
UU .  
        Word[3, 3]  .  (DD . DD) .  UU .  VV

Thus this Dehn twist corresponds to the matrix

MatrixForm[MatrixTwx = {{1, 2}, {0, 1}}]

(Twy  =  {Word[2, 3, 1, -3, -2], Word[2], Word[3]}) // 
      MatrixForm

Map[ApplyAuto[Twy, #] &, {UU, VV}]

Map[
        ApplyAuto[Twy, #] &, {UU, VV}]  == {Inverse[VV] . 
          Inverse[UU] . Inverse[DD2] . Inverse[VV] . AA2, 
        BB2 . CC2 . DD2 . UU . VV . VV . DD2 . UU . VV}

Thus this Dehn twist corresponds to the matrix

MatrixForm[MatrixTwy = {{-1, 2}, {-2, 3}}]

(Twz  =  {Word[1], Word[3, 1, 2, -1, -3], Word[3]}) // 
      MatrixForm

ApplyAuto[Twz, UU]

\(QTracePoly[Word[w__], {a_, b_, c_, d_, x_, y_, z_}]\  := \ 
      Expand[TTrace[Word[w]] /. {TTrace[Word[1]] -> a, 
            TTrace[Word[2]] -> b, 
				TTrace[Word[3]] -> \ c, \ 
            TTrace[Word[1, 2, 3]] -> \ d, 
					TTrace[Word[1, 2]] -> 
              x, \ TTrace[Word[2, 3]] -> \ y, \ 
            TTrace[Word[3, 1]] -> z}]\)

(mm = Map[QTracePoly[ApplyAuto[Twz, #], abcd] &, {UU, YY, VV}])  // 
      MatrixForm

mm[[1]]  -  xprime   +  z ( yprime  -  y) // 
      Simplify

Map[ApplyAuto[Twz, #] &, {UU, VV}]

Map[
        ApplyAuto[Twz, #] &, {UU, VV}]  == 
{UU . 
          Inverse[VV] . Inverse[UU] . Inverse[DD2] . Inverse[CC2] . 
          Inverse[BB2] . CC2 . UU . Inverse[VV], VV}

Thus this Dehn twist corresponds to the matrix

MatrixForm[MatrixTwz = {{1, 0}, {-2, 1}}]

These are the generators of the level 2 congruence subgroup of SL(2,Z).

MF[{MatrixTwx, MatrixTwy, MatrixTwz}]

MatrixTwx . MatrixTwz . MatrixTwy  // MatrixForm

The Lantern Relation

Now we consider a free group of rank 3.  Recall the Dehn twists   Twx, Twy, Twz.
The following is a convenient shorthand for inner automorphisms of a rank 3 free group.

Inn3[w__]  :=  Inn3[Word[w]]
Inn3[
        w_Word]  :=  (InnerAutomorphism[
              w,  #1]  & )  /@ (Identity3Aut  =   Map[Word, 
              Range[3]])

{Identity3Aut, Inn3[3]} // MF

{ComposeAuto[Twz, Twx, Twy], ComposeAuto[Inn3[1], Inn3[3], Inn3[2]]} // 
      MF

{MatrixTwz, MatrixTwy, MatrixTwx} // MF

MatrixTwz . MatrixTwy . MatrixTwx // MatrixForm

A quadratic reflection

QRz  = {Inverse[AA], 
        InnerAutomorphism[AA, 
          Inverse[BB]], 
InnerAutomorphism[AA . BB, 
          Inverse[CC]]}

QRzUV  =  Map[ApplyAuto[QRz, #] &, {UU, VV}]

QRzUV  ==  {Inverse[UU], 
        UU . DD2 . UU . Inverse[AA2] . VV}

Thus this reflection corresponds to the matrix

MatrixForm[MatrixQz = {{-1, 0}, {2, 1}}]

MatrixQz . MatrixTwz

QTracePoly[
      Word[2, -3, -2, -1], {a, b, c, d, x, y, z}]

(QRR  = ComposeAuto[QRz, Twz]) // MatrixForm

(QRR1  = ComposeAuto[QRR, Inn3[Word[-1, -3, -1]]])  // 
      MatrixForm

ApplyAuto[QRR1, UU]

ff  = QTracePoly[ApplyAuto[QRR1, UU], abcd]

Simplify[
      ff  +  z yprime  -  ( -x  +  a b  +  c d) == 
        0]

ApplyAuto[QRR1, YY = Word[2, 3]]

yprime  ==  
      QTracePoly[ApplyAuto[QRR1, YY = Word[2, 3]], abcd]

zprime  =  -z  -  x y  +  a c  +  b d;
xprime  =  -x  -  y z  +  a b  +  
          c d;
yprime  =   -y -  x z   +  b c + a d;

QTracePoly[ApplyAuto[QRz, VV], abcd] == zprime

ffz  -  zprime

ffz  -  zprime  -  x yprime // Expand

%341  +  xprime yprime // Expand

ffz  = QTracePoly[ApplyAuto[QRR1, VV], abcd] // Expand

ApplyAuto[QRR1, VV]

QRR1

Map[QTracePoly[ApplyAuto[QRR1, #], abcd] &, {UU, VV}] // 
      MatrixForm

ww  = ApplyAuto[QRz, VV]

UU

UU . DD2 . UU . Inverse[AA2] . VV

Inverse[VV] . Inverse[AA2] . VV

Inverse[AA]

abcd  =  {a, b, c, d, x, y, z};

The 4-holed Sphere

In analogy with the punctured torus and pair-of-pants, we find geometric parameters for the character varieties.
We consider a 4-holed sphere with boundary components  A = Word[1], B= Word[2], C=Word[3], 
D=Word[-3,-2,-1] and  interior simple closed curves X = Word[1,2], Y = Word[2,3], Z = Word[3,1].

\(QTracePoly[Word[w__], {a_, b_, c_, d_, x_, y_, z_}]\  := \ 
      Expand[TTrace[Word[w]] /. {TTrace[Word[1]] -> a, 
            TTrace[Word[2]] -> b, 
				TTrace[Word[3]] -> \ c, \ 
            TTrace[Word[1, 2, 3]] -> \ d, 
					TTrace[Word[1, 2]] -> 
              x, \ TTrace[Word[2, 3]] -> \ y, \ 
            TTrace[Word[3, 1]] -> z}]\)

QTracePoly[Word[1, 3, 2], {a, b, c, d, x, y, z}]

QTracePoly[
      Word[2, -3, -2, -1], {a, b, c, d, x, y, z}]

The orientable double cover of the punctured Moebius band  P (2-holed projective plane) 
is a 4-holed sphere S ; the corresponding monomorphism of fundamental groups is:
A = X Y,  B = y X,  C = x  y, D = Y x,  where    <A,B,C,D| ABCD = 1>  is the fundamental group
of S (the generators A,B,C,D correspond to bd S)
and  <X,Y> is the fundamental group of P (bd P corresponds to  XY and Xy). If
I xx  denotes the trace of X,  I yy the trace of Y and  zz the trace  of Z, then the corresponding
characters for S  are given by the following:

Fricke[{{a, b, c, d}, {x, y, z}} /. {
a -> 
            zz, 
b -> -xx yy  -  
              zz,  
c  ->  
            zz, 
d  ->  -xx yy  -  
              zz, 
x  ->  - xx^2  - 
              2,  
y  ->  -yy^2  - 
              2,  
z -> -xx^2  -  yy^2  +  
              zz^2  +  xx yy zz  - 2}]

This defines the mapping of the character variety of P into that of S.

The 2-holed torus

We want to find trace coordinates for the relative character variety of the 2-holed torus. The fundamental group is freely generated by X, Y, U with peripheral elements  A = Uyx  and B = Uyx. This gives
the more familiar presentation   AXYxyb = 1. The variables   x,y,z,u,v,w,a,b represent the traces
of the words   X, Y, XY,U,Ux,Uy,A,B respectively. Fricke's relation gives the presentation

a + b = x w + y v + u z - x y u

a  b =   x^2 + y^2 + u^2 + v^2 + w^2 + z^2+ v w z - x y z - x u v - y u w - 4

BoundarySum  =  (x w + y v + u z - x y u);

BoundaryProduct  =  (x^2 + y^2 + u^2 + v^2 + w^2 + z^2 + 
            v w z - x y z - x u v - y u w - 4);

The 2-holed torus doubly covering the 1-holed torus

Let  <P,Q> be the fundamental group of a 1-holed torus and  consider the covering space
corresponding to the Z/2-valued homomorphism which is nontrivial on P and Q.  The commuator identity
[S,T^2] = [S,T] S [S,.T] s  implies (taking S = y x and  T = X ) that  

A = [P,q p] = PqpQ 
B = P q P Q p^2
X = q p  
Y = P^2 

satisfy  AXYxyb = 1. The corresponding embedding of fundamental groups
			<A,B,X,Y | AXYxyb = 1>     ----->   < P,Q >  
		maps elements
Z = X Y 			|->	 q P
V = B Y			|->        P q P Q
U = A X Y = B Y X		|->         P q
W = A X 			|-> 	P Q p p

with the corresponding map of character varieties

Embedding = 
{a -> 
            p^2 + q^2 + r^2 - p q r - 2, 
b -> 
            p^2 + q^2 + r^2 - p q r - 2, 
x -> 
            r, 
y -> 
            p^2 - 2, 
z -> p q - r, 
          u -> 
            p q - r, 
v -> -q^2 - r^2 + p q r + 
              2, 
w -> r};

BoundarySum  =  (x w + y v + u z - x y u);

BoundaryProduct  =  (x^2 + y^2 + u^2 + v^2 + w^2 + z^2 + 
            v w z - x y z - x u v - y u w - 4);

Simplify[{a  +  b  -  BoundarySum,  a b  - BoundaryProduct} /. 
        Embedding]

An involution interchanging the boundary components

Here is a basic (orientation-reversing) symmetry which interchanges the two boundary components
A  and B.  It operates by interchanging X and Y. From the defining relation in the form
 					A X Y = B Y X 
one sees that V = B Y  and W = A X  are interchanged. However the traces of  Z= X Y  and U = A X Y
are  fixed. We check that it leaves invariant the two boundary parameters.

S12inv  =  {a -> b, b -> a, v -> w, w -> v, 
          x -> y, y -> x};

Map[
      Expand[#  -  (# /. S12inv)] &, {BoundarySum, 
        BoundaryProduct}]

Another trace

We next write the character variety of the rank-three free group in terms of the peripheral structure.
We introduce a new variable p which is the trace of the word AY. We compute the trace
of AXYx = B Y = V  in two different ways. First make a substitution rule implementing
the definition of p.

S12sub  =  {t1 -> a, t2 -> x, t3 -> y, 
          t12 -> w, t13 -> p, t23 -> z, 
          t123 ->  u};

vPoly  = (t123m2  =  
            TracePoly3[Word[ 1, 2, 3, -2], tList]) /. 
        S12sub

This expresses relates p  to  v. Here is the inverse substitution:

pSub  =  {p ->  -v  +  u x  +  a y  -  
            w z }

Now we compute the trace of xyAXYY in terms of a,x,y,z,w,p.

(tm2m31233  =  
          TracePoly3[Word[ -2, -3, 1, 2, 3, 3], tList]) /. 
      S12sub

% /. pSub // Expand

Collect[%, y]

(tm2m31323  =  
              TracePoly3[Word[-2, -3, 1, 3, 2, 3], tList]) /.  
          S12sub  /.  pSub  // Expand

(tm2m31323  =  
            TracePoly3[Word[-2, -3, 1, 3, 2, 3], tList]) /.  
        S12sub //Expand

% /. pSub

% // Expand

Collect[%297, z]

%135  /. (a ->  BoundarySum  -  b) // Expand

tList

(tm1m231212m1  =  
          TracePoly3[Word[ -2, -3, 1, 2, 3, 3], tList]) /. 
      S12sub

Collect[%, p]

%266 /. pSub // Expand

(tm1m23122 =  
          TracePoly3[Word[ -1, -2, 3, 1, 2, 2], tList]) /. 
      S12sub

Collect[%, p]

Collect[Expand[%], {p, x, px, x^2, x^3}]

( %265  +  y BoundaryDifference  -  p) /. pSub  // 
      Expand

BoundaryDifference  =  2 a - BoundarySum

BoundarySum

%277  -  y BoundarySum  - (p /. pSub) // Expand

pSub

Output routine

\(\(\(SymbolWordS12[w_Word]\)\(\ \)\(:=\)\(\ \)\(Apply[StringJoin, 
	
        Map[{\ "y", "x", \ "a", \ "E", \ "A", "X", "Y"}[\([#]\)] &, 
		4 + \ toList[w]]]\)\(\ \)\)\)

SymbolWordS12[l_List]  :=  Map[SymbolWordS12, l]

Here is the word for  V = Inverse( BY):

SymbolWordS12[Word[1, 2, 3, -2]]

The 2-holed torus doubly covering the 1-holed torus

Let  <P,Q> be the fundamental group of a 1-holed torus and  consider the covering space
corresponding to the Z/2-valued homomorphism which is nontrivial on P and Q.  The commuator identity
[S,T^2] = [S,T] S [S,.T] s  implies (taking S = y x and  T = X ) that  

A = [P,q p] = PqpQ 
B = P q P Q p^2
X = q p  
Y = P^2 

satisfy  AXYxyb = 1. The corresponding embedding of fundamental groups
			<A,B,X,Y | AXYxyb = 1>     ----->   < P,Q >  
		maps elements
Z = X Y 			|->	 q P
V = B Y			|->        P q P Q
U = A X Y = B Y X		|->         P q
W = A X 			|-> 	P Q p p

with the corresponding map of character varieties

Embedding = 
{a -> 
            p^2 + q^2 + r^2 - p q r - 2, 
b -> 
            p^2 + q^2 + r^2 - p q r - 2, 
x -> 
            r, 
y -> 
            p^2 - 2, 
z -> p q - r, 
          u -> 
            p q - r, 
v -> -q^2 - r^2 + p q r + 
              2, 
w -> r};

BoundarySum  =  (x w + y v + u z - x y u);

BoundaryProduct  =  (x^2 + y^2 + u^2 + v^2 + w^2 + z^2 + 
            v w z - x y z - x u v - y u w - 4);

Simplify[{a  +  b  -  BoundarySum,  a b  - BoundaryProduct} /. 
        Embedding]

The  Mapping Class Group of the 2-holed torus

We use the presentation  A = Word[1], X = Word[2], Y = Word[3],  B = Word[3,2,-3,-2,-1]  with defining relation  A X Y x y b .  
Let V  denote the word  B Y; then the simple loops Y, X, V  form a spine for T2. Here are the Dehn twists:

VWord  =  Word[1, 2, 3, -2];

T2x  =  {Word[1], Word[2],  
          Word[3, 2]};
T2y  =  {Word[1],  Word[2, -3],  
          Word[3]};
T2v  =  {Word[1],  Word[2] . VWord,  
          Inverse[VWord] . Word[3] . VWord};

T2vi = {Word[1],  Word[2] . Inverse[VWord],  
        VWord . Word[3] . Inverse[VWord]}

Map[MatrixForm[SymbolWordS12[#]] &, {T2x, T2y, T2v, T2vi}]

ComposeAuto[T2y, T2v]  // SymbolWordS12  // MatrixForm

Y and V  are disjoint, so their respective Dehn twists commute.

ComposeAuto[T2v, T2y] == ComposeAuto[T2y, T2v]

X  and  Y intersect once transversely, so their Dehn twists satisfy a braid relation:

brXY  =  ComposeAuto[T2x, T2y, T2x]

ComposeAuto[T2y, T2x, T2y] ==  
      ComposeAuto[T2x, T2y, T2x]

Unlike a torus (where this element has order 4), or a 1-holed torus (where the 4th power is an 
inner automorphism), the 4th power here is a Dehn twist around the simple loop separating
the handle from the two boundary components.

ComposeAuto[brXY, brXY, brXY, brXY]

X  and  V also intersect once transversely, so their Dehn twists also satisfy a braid relation:

brXV  =  ComposeAuto[T2x, T2vi, T2x]

ComposeAuto[T2vi, T2x, T2vi] == brXV

T2yxv  = ComposeAuto[T2y, T2x, T2vi]

ComposeAuto[T2yxv, Inn3[3, 2, -3, -2, -1]]

ComposeAuto[Inn3[-1], T2yxv, T2yxv, T2yxv, T2yxv]

Thus the 4th power of the product Ty Tx Tz  is inverse Dehn twist around the boundary component  A,

TP12  = (Expand[TracePoly3[#, tList] /. S12sub  /.  
                pSub]  &);

Map[MatrixForm[Map[TP12, #]] &, {T2y, T2x, T2v, T2vi}]

S12sub

Map[TP12, 
      S12Words = {Word[2], Word[3], Word[2, 3], Word[1, 2, 3], 
          Word[1, 2, 3, -2], Word[1, 2]}]

AutoS12[a_]  := Map[ApplyAuto[a, #] &, S12Words]

AutoS12[T2vi]

TPolyS12[a_]  :=  Map[TP12, AutoS12[a]]

TPolyS12[T2vi] // MatrixForm

Map[
      MatrixForm[TPolyS12[#]] &, {Identity3Aut, T2x, T2y, T2v, 
        T2vi}]