  
  [1X2 [33X[0;0YFR package[133X[101X
  
  
  [1X2.1 [33X[0;0YA brief mathematical introduction[133X[101X
  
  [33X[0;0YThis  chapter  assumes that you have no familiarity with groups generated by
  automata. If you do, and wish to see their usage within [5XGAP[105X through a sample
  session,  please  skip  to Section [14X2.2[114X. For a more thourough introduction on
  self-similar groups see [BGN03] or [BG{Š}03].[133X
  
  [33X[0;0YWe shall here be interested in groups [22XG[122X defined by their action on a regular
  rooted  tree.  Let  [22XX[122X  be  a finite set; and let [22XX^*[122X denote the set of words
  (free  monoid)  over  [22XX[122X.  Then  [22XX^*[122X naturally has the structure of a regular
  rooted  tree: the root is the empty word, and vertex [22Xv ∈ X^*[122X is connected to
  vertex  [22Xvx[122X  for  all choices of [22Xx ∈ X[122X. Each vertex except the root therefore
  has [22X#X+1[122X neighbours.[133X
  
  [33X[0;0YLet  [22XW[122X  denote  the automorphism group of the graph [22XX^*[122X. Given [22Xa ∈ W[122X, we may
  restrict  its  action  to [22XX ⊂ X^*[122X, and obtain a permutation [22Xπ_a[122X on [22XX[122X, called
  the [13Xactivity[113X of [22Xa[122X. We may also obtain, for all [22Xx∈ X[122X, a tree automorphism [22Xa_x
  ∈ W[122X, called the [13Xstate of [22Xa[122X at [22Xx[122X[113X, by the formula[133X
  
  
  [24X[33X[0;6Y(v){a_x} = w \quad\textrm{if}\quad (xv)a = x^{\pi_a}w.[133X
  
  [124X
  
  [33X[0;0YThe  data [22X(a_x,π_a)[122X determine uniquely the automorphism [22Xa[122X, and any choice of
  [22Xa_x[122X and [22Xπ_a[122X defines a tree isometry. We therefore have a group isomorphism[133X
  
  
  [24X[33X[0;6Y\phi: W \to W\wr \mathop{Sym}(X),[133X
  
  [124X
  
  [33X[0;0Ycalled  the  [13XWreath  recursion[113X.  The  image of [22Xϕ[122X is the permutational wreath
  product [22XW^X ⋊ Sym(X)[122X.[133X
  
  [33X[0;0YThe state [22Xa_x[122X should be interpreted as the restriction of the action of [22Xa[122X on
  the  subtree  [22XxX^*[122X; the automorphism [22Xa[122X is defined by acting first on each of
  the  subtrees  of  the form [22XxX^*[122X by its respective state, and then permuting
  these subtrees according to [22Xπ_a[122X. The wreath recursion can be iterated on the
  states of [22Xa[122X, to define states [22Xa_v[122X for any [22Xv ∈ X^*[122X.[133X
  
  [33X[0;0YThe  automorphism  [22Xa ∈ W[122X may be represented by a graph, as follows. There is
  one  vertex for each state [22Xa_v[122X of [22Xa[122X, labeled [22Xπ_a_v[122X; and for each [22Xx ∈ X[122X there
  is  one  edge from state [22Xa_v[122X to state [22Xa_vx[122X, labeled [22Xx[122X. This graph is nothing
  but  a  quotient  of the regular rooted tree [22XX^*[122X, where vertices [22Xv[122X and [22Xw[122X are
  identified  if  [22Xa_v=a_w[122X. Again, this graph, with a choice of initial vertex,
  determines uniquely the automorphism [22Xa[122X.[133X
  
  [33X[0;0YThis graph may be conveniently encoded in what is called a [13XMoore machine[113X: it
  consists  of  a  set  [22XQ[122X,  the  vertex  set  of  the graph; an alphabet, [22XX[122X; a
  `transition'  function  [22Xϕ:Q× X-> Q[122X, where [22Xϕ(q,x)[122X is the endpoint of the edge
  starting at [22Xq[122X and labeled [22Xx[122X; and a labeling [22Xπ[122X of [22XX[122X by the symmetric group on
  [22XX[122X.  We  will  use  the  equivalent  [13XMealy  machines[113X, given by a `transition'
  function [22Xϕ:Q× X-> X× Q[122X, encoding both [22Xϕ[122X and [22Xπ[122X together.[133X
  
  [33X[0;0YOf   particular   interest   are   [13Xfinite-state   automorphisms[113X:  these  are
  automorphisms  whose Mealy machine has finitely many states. The product and
  inverse of finite-state automorphisms is again finite-state.[133X
  
  [33X[0;0YA  subgroup  [22XG le W[122X is [13Xself-similar[113X if [22XG^ϕ ⊂ G≀Sym(X)[122X. This is equivalent to
  asking, for every [22Xa ∈ G[122X, that all of its states [22Xa_x[122X also belong to [22XG[122X.[133X
  
  [33X[0;0YThe  following  important properties have also been considered. A subgroup [22XG
  le  W[122X  is  [13Xlevel-transitive[113X if its action is transitive on all the [22XG[122X-subsets
  [22XX^n[122X.  It  is [13Xweakly branched[113X if it is level-transitive, and for every [22Xv∈ X^*[122X
  there  is  a  non-trivial  [22Xa_v∈  G[122X  that fixes [22XX^* ∖ vX^*[122X. It is [13Xbranched[113X if
  furthermore  for each [22Xn ∈ N[122X the group generated by all such [22Xa_v[122X for all [22Xv[122X of
  length [22Xn[122X has finite index in [22XG[122X.[133X
  
  [33X[0;0YA  self-similar  finitely generated group [22XG le W[122X is [13Xcontracting[113X if there are
  constants  [22XK,n  ∈ N[122X and [22Xλ<1[122X such that [22X|a_v|leλ|a|+K[122X for all [22Xa∈ G[122X and [22Xv∈ X^n[122X;
  here  [22X|a|[122X  denotes  the minimal number of generators needed to express [22Xa[122X. It
  then follows that there exists a finite set [22XN⊂ G[122X such that for all [22Xa∈ G[122X, all
  but  finitely  many  of  the  states of [22Xa[122X belong to [22XN[122X. The minimal such [22XN[122X is
  called  the  [13Xnucleus[113X  of  [22XG[122X. Since the states of elements of the nucleus are
  again  in the nucleus, we see that the nucleus is naturally a Mealy machine.
  By  considering  all  elements  of  [22XW[122X  obtained  from  this Mealy machine by
  choosing  all possible initial states, we obtain a generating set for [22XG[122X made
  of  all  states  of  a  single  machine;  this is the [13Xgroup generated[113X by the
  machine.[133X
  
  [33X[0;0YIn  this  package,  we  are  mainly  interested  in  self-similar  groups of
  finite-state  automorphisms.  The reason is historical: Aleshin [Ale83], and
  later  Grigorchuk  [Gri80]  and  Gupta and Sidki [GS83] constructed peculiar
  examples  of groups using self-similar finite-state automorphisms. All these
  groups can be defined by drawing a small machine (at most five vertices) and
  considering the group that they generate.[133X
  
  [33X[0;0YWe  assumed for simplicity that the elements [22Xa[122X were invertible. Actually, in
  the  definition  of  Mealy machines it makes sense to accept arbitrary maps,
  and  not  necessarily  bijections of [22XX[122X as a label at each vertex. One may in
  this way define peculiar semigroups.[133X
  
  
  [1X2.2 [33X[0;0YAn example session[133X[101X
  
  [33X[0;0YThis  is a brief introduction describing some of the simpler features of the
  [5XFR[105X  package.  It assumes you have some familiarity with the theory of groups
  defined  by automata; if not, a brief mathematical introduction may be found
  in Section [14X2.1[114X. We show here and comment a typical use of the package.[133X
  
  [33X[0;0YThe  package  is installed by unpacking the archive in the [11Xpkg/[111X directory of
  your  [5XGAP[105X  installation.  It  can also be placed in a local directory, which
  must be added to the load-path by invoking [10Xgap[110X with the [10X-l[110X option.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XLoadPackage("fr");[127X[104X
    [4X[28X----------------------------------------------------------------[128X[104X
    [4X[28XLoading FR 0.857142p5 (Functionally recursive and automata groups)[128X[104X
    [4X[28Xby Laurent Bartholdi (http://www.uni-math.gwdg.de/laurent)[128X[104X
    [4X[28X----------------------------------------------------------------[128X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [33X[0;0YMany  FR  groups  are  predefined by [5XFR[105X, see Chapter [14X9[114X. We consider here the
  [13XBasilica group[113X, considered in [G{\.Z}02] and [BV05].[133X
  
  [33X[0;0YWe  may start by defining a group: it has two generators [22Xa[122X and [22Xb[122X, satisfying
  the specified recursions.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XB := FRGroup("a=<1,b>(1,2)","b=<1,a>",IsFRMealyElement);[127X[104X
    [4X[28X<self-similar group over [ 1 .. 2 ] with 2 generators>[128X[104X
    [4X[25Xgap>[125X [27XAssignGeneratorVariables(B);[127X[104X
    [4X[28X#I  Assigned the global variables [ a, b ][128X[104X
  [4X[32X[104X
  
  [33X[0;0YWe have just created the group [22XB=⟨ a,b⟩[122X.[133X
  
  [33X[0;0YNote  that  this  group  is  predefined as [10XBasilicaGroup[110X. We now compute the
  decompositions of the generators:[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XDecompositionOfFRElement(a); DecompositionOfFRElement(b);[127X[104X
    [4X[28X[ [ <2|identity ...>, <2|b> ], [ 2, 1 ] ][128X[104X
    [4X[28X[ [ <2|identity ...>, <2|a> ], [ 1, 2 ] ][128X[104X
  [4X[32X[104X
  
  [33X[0;0YElements  are  described  as  words  in  the generators; they are printed as
  [10X<2|a>[110X, where the [22X2[122X reminds of the degree of the tree on which [22Xa[122X acts.[133X
  
  [33X[0;0YThe  optional  argument  [2XIsFRElement[102X ([14X10.2-11[114X) tells [5XFR[105X to store elements in
  this  way.  This  representation  is  always  possible,  but  it  is usually
  inefficient for calculations. The argument [2XIsMealyElement[102X ([14X10.2-4[114X) forces [5XFR[105X
  to  use  a  more  efficient  representation, which in some cases may take an
  infinite  time  to set up. With no extra argument, [5XFR[105X does what it thinks is
  best.  The  advantages of both representations are sometimes obtained by the
  argument [2XIsFRMealyElement[102X ([14X10.2-12[114X), which stores both representations.[133X
  
  [33X[0;0YElements act on sequences over [22X{1,2}[122X. The action is computed in the standard
  manner:[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27X1^a; [1]^a; [1,1]^a;[127X[104X
    [4X[28X2[128X[104X
    [4X[28X[ 2 ][128X[104X
    [4X[28X[ 2, 1 ][128X[104X
  [4X[32X[104X
  
  [33X[0;0YPeriodic  sequences  are  also  implemented  in  [5XFR[105X; they are constructed by
  giving  the period and preperiod. The period is printed by preceding it with
  a "/":[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xv := PeriodicList([1],[2]);[127X[104X
    [4X[28X[ 1, / 2 ][128X[104X
    [4X[25Xgap>[125X [27Xv^a; v^(a^2);[127X[104X
    [4X[28X[/ 2 ][128X[104X
    [4X[28X[/ 1, 2 ][128X[104X
    [4X[25Xgap>[125X [27Xlast{[1..10]};[127X[104X
    [4X[28X[ 1, 2, 1, 2, 1, 2, 1, 2, 1, 2 ][128X[104X
  [4X[32X[104X
  
  [33X[0;0YMost  computations  are much more efficient if [22XB[122X's elements are converted to
  [13XMealy representation[113X,[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XBm := Image(IsomorphismMealyGroup(B));[127X[104X
    [4X[28X<recursive group over [ 1 .. 2 ] with 2 generators>[128X[104X
    [4X[25Xgap>[125X [27Xa := Bm.1; b := Bm.2;[127X[104X
    [4X[28X<Mealy element on alphabet [ 1, 2 ] with 3 states>[128X[104X
    [4X[28X<Mealy element on alphabet [ 1, 2 ] with 3 states>[128X[104X
  [4X[32X[104X
  
  [33X[0;0YThis could have been done automatically by specifying [10XIsMealyElement[110X as last
  argument in the call to [10XFRGroup[110X.[133X
  
  [33X[0;0YThe group [22XB[122X is torsion-free, and its elements are bounded automata. Although
  torsion-freeness  is  difficult  to  check  for  [5XFR[105X,  it  can  be checked on
  individual elements:[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XIsBoundedFRSemigroup(Bm);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XOrder(a); Order(b);[127X[104X
    [4X[28Xinfinity[128X[104X
    [4X[28Xinfinity[128X[104X
    [4X[25Xgap>[125X [27Xg := PseudoRandom(B);; Length(InitialState(g));[127X[104X
    [4X[28X4679[128X[104X
    [4X[25Xgap>[125X [27XOrder(g); time;[127X[104X
    [4X[28Xinfinity[128X[104X
    [4X[28X2599[128X[104X
  [4X[32X[104X
  
  [33X[0;0YThe  group  [22XB[122X  is  weakly  branched; more precisely, the derived subgroup [22XB'[122X
  contains  [22XB' × B'[122X. To prove that, it suffices to check [22X[a,b] × 1∈ B'[122X and [22X1 ×
  [a,b]∈ B'[122X. These elements are constructed using [2XVertexElement[102X ([14X4.1-5[114X):[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xc := Comm(a,b);[127X[104X
    [4X[28X<Mealy element on alphabet [ 1, 2 ] with 9 states>[128X[104X
    [4X[25Xgap>[125X [27XK := NormalClosure(Bm,Group(c));[127X[104X
    [4X[28X<self-similar group over [ 1 .. 2 ] with 3 generators>[128X[104X
    [4X[25Xgap>[125X [27XVertexElement(1,c) in K; VertexElement(1,c) in K;[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XDecompositionOfFRElement(VertexElement(1,c))=[[c,One(Bm)],[1,2]];[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XVertexElement(2,c)=Comm(b,a^2);[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [33X[0;0YNote  that we had to guess the form of the element [10XVertexElement(2,c)[110X above.
  This could have been found out by [5XGAP[105X using [2XShortGroupWordInSet[102X ([14X11.4-2[114X).[133X
  
  [33X[0;0YWe  may also check the relations [22X[b^p,(b^p)^a^p]=1[122X and [22X[a^2p,(a^2p)^b^p][122X for
  [22Xp[122X any power of [22X2[122X:[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XForAll([0..10],i->IsOne(Comm(b^(2^i),(b^(2^i))^((a^(2^i)))))); time;[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[28X1361[128X[104X
  [4X[32X[104X
  
  [33X[0;0YSince the group [22XB[122X is bounded, it is contracting. We compute its nucleus:[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XNucleusOfFRSemigroup(B);[127X[104X
    [4X[28X[ <2|identity ...>, <2|b>, <2|b^-1>, <2|a>, <2|a^-1>, <2|b^-1*a>, <2|a^-1*b> ][128X[104X
  [4X[32X[104X
  
  [33X[0;0YWe  then  compute  the Mealy machine with stateset this nucleus, and draw it
  graphically (this requires the external programs [5Xgraphviz[105X and [5Ximagemagick[105X):[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XN := NucleusMachine(B);[127X[104X
    [4X[28X<Mealy machine on alphabet [ 1, 2 ] with 7 states>[128X[104X
    [4X[25Xgap>[125X [27XDraw(N);[127X[104X
  [4X[32X[104X
  
  [33X[0;0YWe  may  also draw powers of the dual automaton: these are approximations to
  the  Schreier graph of [22XB[122X. However, we also construct a smaller Mealy machine
  with states only [22Xa[122X and [22Xb[122X, which give better images:[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XDraw(DualMachine(N)^3);[127X[104X
    [4X[25Xgap>[125X [27XM := AsMealyMachine(FRMachine(a))[1];[127X[104X
    [4X[28X<Mealy machine on alphabet [ 1, 2 ] with 3 states>[128X[104X
    [4X[25Xgap>[125X [27XDraw(DualMachine(M)^4);[127X[104X
  [4X[32X[104X
  
  [33X[0;0YThese  Schreier  graphs  are  orbits  of the group; they can be displayed as
  follows:[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XWordGrowth(B:point:=[1,1,1,1],draw);[127X[104X
  [4X[32X[104X
  
  [33X[0;0YMore  properties  of  [22XB[122X  can be checked, or experimented with, on its finite
  quotients obtained by truncating the tree on which [22XB[122X acts at a given length.
  [10XPermGroup(B,n)[110X  constructs a permutation group which is the natural quotient
  of [22XB[122X acting on [22X2^n[122X points:[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XG := PermGroup(B,7);[127X[104X
    [4X[28X<permutation group with 2 generators>[128X[104X
    [4X[25Xgap>[125X [27XSize(G); LogInt(last,2);[127X[104X
    [4X[28X309485009821345068724781056[128X[104X
    [4X[28X88[128X[104X
  [4X[32X[104X
  
  [33X[0;0YWe  may "guess" the structure of the Lie algebra of [22XB[122X by examining the ranks
  of the successive quotients along its Jennings series:[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XJ := JenningsLieAlgebra(G); time;[127X[104X
    [4X[28X<Lie algebra of dimension 88 over GF(2)>[128X[104X
    [4X[28X18035[128X[104X
    [4X[25Xgap>[125X [27XList([1..15],i->Dimension(Grading(J).hom_components(i)));[127X[104X
    [4X[28X[ 2, 3, 1, 4, 1, 2, 1, 4, 1, 2, 1, 3, 1, 2, 1 ][128X[104X
  [4X[32X[104X
  
  [33X[0;0YThe  "[22X4[122X"  in position [22X8[122X of that list should really be a "[22X5[122X"; computations on
  finite quotients of [22XB[122X usually give lower bounds for invariants of [22XB[122X. In that
  case,  we guess that the ranks behave like a "ruler" function, i.e. that the
  rank of the homogeneous component of degree [22Xi[122X is [22X2+ν_2(i)[122X if [22Xi[122X is a power of
  [22X2[122X and is [22X1+ν_2(i)[122X otherwise; here [22Xν_2(i)[122X is the number of times [22X2[122X divides [22Xi[122X.[133X
  
