Functionally recursive groups

Self-similar groups

Version &Version; Groups generated by automata or satisfying functional recursions
Laurent Bartholdi laurent dot bartholdi at gmail dot com laurent.bartholdi@gmail.com https://www.math.uni-sb.de/ag/bartholdi/
&Date;

      Mathematisches Institut
    Bunsenstraße 3-5
    D-37073 Göttingen
    Germany

This document describes the package FR, which implements in &GAP; the basic objects of Mealy machines and functional recursions; and handles groups that they generate.

The computer algebra system &GAP; is available at https://www.gap-system.org.

This documentation for FR is available at https://docs.gap-system.org/pkg/fr/doc/manual.pdf in PDF format, and may be accessed online at https://gap-packages.github.io/fr/.

The latest release of the package may be downloaded as https://github.com/gap-packages/fr/archive/&Version;.tar.gz (tar, gzipped). The latest repository version (possibly unstable) may be downloaded as https://github.com/gap-packages/fr/tarball/master (tar, gzipped), https://github.com/gap-packages/fr.git (git repository), or explored at https://github.com/gap-packages/fr/tree/master/.

Groups defined by a recursive action on a rooted tree can be defined in &GAP; via their recursion. Various algorithms are implemented to manipulate these groups and their elements.

For comments or questions on FR please contact the author; this package is still under development.
©right; 2006-2012 by Laurent Bartholdi
Part of this work is/was supported by the "Swiss National Fund for Scientific Research" and the "German Science Foundation".
This project started in the mid-1990s, when, as a PhD student I did many calculations with groups generated by automata, and realized the similarities between all calculations; it quickly became clear that these calculations could be done much better by a computer than by a human.

The first routines I wrote constructed finite representations of the groups considered, so as to get insight from fast calculations within &GAP;. The results then had to be proved correct within the infinite group under consideration, and this often involved guessing appropriate words in the infinite group with a given image in the finite quotient.

Around 2000, I had developed quite a few routines, which I assembled in a &GAP; package, that dealt directly with infinite groups. This package was primitive at its core, but was extended with various routines as they became useful.

I decided in late 2005 to start a new package from scratch, that would encorporate as much functionality as possible in a uniform manner; that would handle semigroups as well as groups; that could be easily extended; and with a complete, understandable documentation. I hope I am not too far from these objectives.
Licensing This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program, in the file COPYING. If not, see https://www.gnu.org/licenses/.
FR package
A brief mathematical introduction This chapter assumes that you have no familiarity with groups generated by automata. If you do, and wish to see their usage within &GAP; through a sample session, please skip to Section . For a more thourough introduction on self-similar groups see or .

We shall here be interested in groups G defined by their action on a regular rooted tree. Let X be a finite set; and let X^* denote the set of words (free monoid) over X. Then X^* naturally has the structure of a regular rooted tree: the root is the empty word, and vertex v \in X^* is connected to vertex vx for all choices of x \in X. Each vertex except the root therefore has \#X+1 neighbours.

Let W denote the automorphism group of the graph X^*. Given a \in W, we may restrict its action to X \subset X^*, and obtain a permutation \pi_a on X, called the activity of a. We may also obtain, for all x\in X, a tree automorphism a_x \in W, called the state of a at x, by the formula (v){a_x} = w \quad\textrm{if}\quad (xv)a = x^{\pi_a}w. The data (a_x,\pi_a) determine uniquely the automorphism a, and any choice of a_x and \pi_a defines a tree isometry. We therefore have a group isomorphism \phi: W \to W\wr \mathop{Sym}(X), called the Wreath recursion. The image of \phi is the permutational wreath product W^X \rtimes \mathop{Sym}(X).

The state a_x should be interpreted as the restriction of the action of a on the subtree xX^*; the automorphism a is defined by acting first on each of the subtrees of the form xX^* by its respective state, and then permuting these subtrees according to \pi_a. The wreath recursion can be iterated on the states of a, to define states a_v for any v \in X^*.

The automorphism a \in W may be represented by a graph, as follows. There is one vertex for each state a_v of a, labeled \pi_{a_v}; and for each x \in X there is one edge from state a_v to state a_{vx}, labeled x. This graph is nothing but a quotient of the regular rooted tree X^*, where vertices v and w are identified if a_v=a_w. Again, this graph, with a choice of initial vertex, determines uniquely the automorphism a.

This graph may be conveniently encoded in what is called a Moore machine: it consists of a set Q, the vertex set of the graph; an alphabet, X; a `transition' function \phi:Q\times X\to Q, where \phi(q,x) is the endpoint of the edge starting at q and labeled x; and a labeling \pi of X by the symmetric group on X. We will use the equivalent Mealy machines, given by a `transition' function \phi:Q\times X\to X\times Q, encoding both \phi and \pi together.

Of particular interest are finite-state automorphisms: these are automorphisms whose Mealy machine has finitely many states. The product and inverse of finite-state automorphisms is again finite-state.

A subgroup G \le W is self-similar if G^\phi \subset G\wr\mathop{Sym}(X). This is equivalent to asking, for every a \in G, that all of its states a_x also belong to G.

The following important properties have also been considered. A subgroup G \le W is level-transitive if its action is transitive on all the G-subsets X^n. It is weakly branched if it is level-transitive, and for every v\in X^* there is a non-trivial a_v\in G that fixes X^* \setminus vX^*. It is branched if furthermore for each n \in \mathbb N the group generated by all such a_v for all v of length n has finite index in G.

A self-similar finitely generated group G \le W is contracting if there are constants K,n \in \mathbb N and \lambda<1 such that |a_v|\le\lambda|a|+K for all a\in G and v\in X^n; here |a| denotes the minimal number of generators needed to express a. It then follows that there exists a finite set N\subset G such that for all a\in G, all but finitely many of the states of a belong to N. The minimal such N is called the nucleus of G. 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 W obtained from this Mealy machine by choosing all possible initial states, we obtain a generating set for G made of all states of a single machine; this is the group generated by the machine.

In this package, we are mainly interested in self-similar groups of finite-state automorphisms. The reason is historical: Aleshin , and later Grigorchuk and Gupta and Sidki 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.

We assumed for simplicity that the elements a were invertible. Actually, in the definition of Mealy machines it makes sense to accept arbitrary maps, and not necessarily bijections of X as a label at each vertex. One may in this way define peculiar semigroups.
An example session This is a brief introduction describing some of the simpler features of the FR 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 . We show here and comment a typical use of the package.

The package is installed by unpacking the archive in the pkg/ directory of your &GAP; installation. It can also be placed in a local directory, which must be added to the load-path by invoking gap with the -l option.
gap> LoadPackage("fr"); ---------------------------------------------------------------- Loading FR 0.857142p5 (Functionally recursive and automata groups) by Laurent Bartholdi (http://www.uni-math.gwdg.de/laurent) ---------------------------------------------------------------- true
Many FR groups are predefined by FR, see Chapter . We consider here the Basilica group, considered in and .

We may start by defining a group: it has two generators a and b, satisfying the specified recursions.
gap> B := FRGroup("a=<1,b>(1,2)","b=<1,a>",IsFRMealyElement); <self-similar group over [ 1 .. 2 ] with 2 generators> gap> AssignGeneratorVariables(B); #I Assigned the global variables [ a, b ]
We have just created the group B=\langle a,b\rangle.

Note that this group is predefined as BasilicaGroup. We now compute the decompositions of the generators:
gap> DecompositionOfFRElement(a); DecompositionOfFRElement(b); [ [ <2|identity ...>, <2|b> ], [ 2, 1 ] ] [ [ <2|identity ...>, <2|a> ], [ 1, 2 ] ]
Elements are described as words in the generators; they are printed as <2|a>, where the 2 reminds of the degree of the tree on which a acts.

The optional argument tells FR to store elements in this way. This representation is always possible, but it is usually inefficient for calculations. The argument forces FR to use a more efficient representation, which in some cases may take an infinite time to set up. With no extra argument, FR does what it thinks is best. The advantages of both representations are sometimes obtained by the argument , which stores both representations.

Elements act on sequences over \{1,2\}. The action is computed in the standard manner:
gap> 1^a; [1]^a; [1,1]^a; 2 [ 2 ] [ 2, 1 ]
Periodic sequences are also implemented in FR; they are constructed by giving the period and preperiod. The period is printed by preceding it with a "/":
gap> v := PeriodicList([1],[2]); [ 1, / 2 ] gap> v^a; v^(a^2); [/ 2 ] [/ 1, 2 ] gap> last{[1..10]}; [ 1, 2, 1, 2, 1, 2, 1, 2, 1, 2 ]

Most computations are much more efficient if B's elements are converted to Mealy representation,
gap> Bm := Image(IsomorphismMealyGroup(B)); <recursive group over [ 1 .. 2 ] with 2 generators> gap> a := Bm.1; b := Bm.2; <Mealy element on alphabet [ 1, 2 ] with 3 states> <Mealy element on alphabet [ 1, 2 ] with 3 states>
This could have been done automatically by specifying IsMealyElement as last argument in the call to FRGroup.

The group B is torsion-free, and its elements are bounded automata. Although torsion-freeness is difficult to check for FR, it can be checked on individual elements:
gap> IsBoundedFRSemigroup(Bm); true gap> Order(a); Order(b); infinity infinity gap> g := PseudoRandom(B);; Length(InitialState(g)); 4679 gap> Order(g); time; infinity 2599

The group B is weakly branched; more precisely, the derived subgroup B' contains B' \times B'. To prove that, it suffices to check [a,b] \times 1\in B' and 1 \times [a,b]\in B'. These elements are constructed using :
gap> c := Comm(a,b); <Mealy element on alphabet [ 1, 2 ] with 9 states> gap> K := NormalClosure(Bm,Group(c)); <self-similar group over [ 1 .. 2 ] with 3 generators> gap> VertexElement(1,c) in K; VertexElement(1,c) in K; true true gap> DecompositionOfFRElement(VertexElement(1,c))=[[c,One(Bm)],[1,2]]; true gap> VertexElement(2,c)=Comm(b,a^2); true
Note that we had to guess the form of the element VertexElement(2,c) above. This could have been found out by &GAP; using .

We may also check the relations [b^p,(b^p)^{a^p}]=1 and [a^{2p},(a^{2p})^{b^p}] for p any power of 2:
gap> ForAll([0..10],i->IsOne(Comm(b^(2^i),(b^(2^i))^((a^(2^i)))))); time; true 1361
Since the group B is bounded, it is contracting. We compute its nucleus:
gap> NucleusOfFRSemigroup(B); [ <2|identity ...>, <2|b>, <2|b^-1>, <2|a>, <2|a^-1>, <2|b^-1*a>, <2|a^-1*b> ]
We then compute the Mealy machine with stateset this nucleus, and draw it graphically (this requires the external programs graphviz and imagemagick):
gap> N := NucleusMachine(B); <Mealy machine on alphabet [ 1, 2 ] with 7 states> gap> Draw(N);
We may also draw powers of the dual automaton: these are approximations to the Schreier graph of B. However, we also construct a smaller Mealy machine with states only a and b, which give better images:
gap> Draw(DualMachine(N)^3); gap> M := AsMealyMachine(FRMachine(a))[1]; <Mealy machine on alphabet [ 1, 2 ] with 3 states> gap> Draw(DualMachine(M)^4);
These Schreier graphs are orbits of the group; they can be displayed as follows:
gap> WordGrowth(B:point:=[1,1,1,1],draw);
More properties of B can be checked, or experimented with, on its finite quotients obtained by truncating the tree on which B acts at a given length. PermGroup(B,n) constructs a permutation group which is the natural quotient of B acting on 2^n points:
gap> G := PermGroup(B,7); <permutation group with 2 generators> gap> Size(G); LogInt(last,2); 309485009821345068724781056 88
We may "guess" the structure of the Lie algebra of B by examining the ranks of the successive quotients along its Jennings series:
gap> J := JenningsLieAlgebra(G); time; <Lie algebra of dimension 88 over GF(2)> 18035 gap> List([1..15],i->Dimension(Grading(J).hom_components(i))); [ 2, 3, 1, 4, 1, 2, 1, 4, 1, 2, 1, 3, 1, 2, 1 ]
The "4" in position 8 of that list should really be a "5"; computations on finite quotients of B usually give lower bounds for invariants of B. In that case, we guess that the ranks behave like a "ruler" function, i.e. that the rank of the homogeneous component of degree i is 2+\nu_2(i) if i is a power of 2 and is 1+\nu_2(i) otherwise; here \nu_2(i) is the number of times 2 divides i.
Functionally recursive machines At the core of this package are functionally recursive machines. The internals of specific machines will be described later, but each machine M has an associated alphabet X, a set of states Q, and a transition function \phi:Q \times X \to X \times Q. An element, as we will see in Section , is given by a machine and an initial state q\in Q.

The element (M,q) defines a transformation on the set X^* of strings (finite or infinite) over the alphabet X, as follows: the empty string is always fixed. Given a string x_1x_2\ldots x_n with n\ge0, compute \phi(q,x_1)=(y_1,r); then compute the action of (M,r) on the string x_2\ldots x_n, and call the result y_2\ldots y_n. Then the action of (M,q) on x_1x_2\ldots x_n yields y_1y_2\ldots y_n.

This can be understood more formally as follows. The transition function \phi induces a map \phi^n:Q\times X^n \to X^n \times Q, defined by successively applying \phi to move the Q from the left to the right. Similarly, \phi can be extended to a map Q^m\times X^n \to X^n \times Q^m.

We see that the action on finite strings preserves their length, and also preserves prefixes: if (M,q) maps x_1\ldots x_n to y_1\ldots y_m, then necessarily m=n; and if k<n then T maps x_1\ldots x_k to y_1\ldots y_k.

The strings over the alphabet X can be naturally organised into a rooted tree. The root represents the empty string, and the strings x_1\ldots x_n and x_1\ldots x_{n+1} are connected by an edge, for all x_i\in X.
Types of machines Machines must be accessible to computation; therefore it is reasonable to assume that their alphabet X is finite.

If the stateset Q is also finite, the machine is called a Mealy machine, and its transition function \phi can be stored as a table.

More general machines are obtained if one allows the stateset Q to be a free group/semigroup/monoid generated by a finite set S, and the transition function \phi to be specified on S\times X. Its values are then extended naturally by composition.

Machines store their transitions (second coordinate of \phi), and their output, (first coordinate of \phi) in a matrix indexed by state and letter. In particular, PermList(output[state]) gives the action on the first level.

Because of the way &GAP; handles permutations and transformations, a permutation is never equal to a transformation, even though both can answer true to IsOne. Therefore, FR stores the output as a list, which can be then accessed (e.g. in commands such as ActivityPerm and ActivityTransformation either as a permutation or as a transformation. The command Activity itself will return a permutation if possible, and otherwise a transformation.
Products of machines Machines can be combined in different manners. If two machines act on the same alphabet, then their sum and product are defined as machines acting again on the same alphabet; the statesets are the free products (which is also their sum, in the category of semigroups) of the respective statesets. The sum or product of machines has a stateset of highest possible category, i.e. is a group unless some argument is a monoid, and a monoid unless some argument is a semigroup. The transition and output functions are the union of the respective functions of their arguments.

If a non-empty collection of machines have same stateset, then their tensor sum and tensor product are machines again with same stateset; the alphabets on which the machines act are the disjoint union, respectively cartesian product, of the arguments' alphabets. The transition and output functions are again the union or composition of the respective functions of their arguments.

The direct sum and direct product of a collection of machines are always defined. Its stateset is generated by the union of the arguments' statesets, as for a sum or a product; its alphabet is the disjoint union, respectively cartesian product of its arguments' alphabets, as for a tensor sum or product. The transition and output functions are again the union of the respective functions of their arguments.
Creators for FRMachines <#Include Label="FRMachine"> <#Include Label="AsGroupFRMachine">
Attributes for FRMachines <#Include Label="StateSet"> <#Include Label="Output/machine">
Operations for FRMachines <#Include Label="StructuralGroup"> <#Include Label="+"> <#Include Label="SubFRMachine"> <#Include Label="FR-Minimized">
Functionally recursive elements A functionally recursive element is given by a functionally recursive machine and an initial state q. Many functions for FR machines, which accept a state as an argument, apply to FR elements. In that case, no state is passed to the function.

The main function of FR elements is to serve as group/monoid/semigroup elements: they can be multiplied and divided, and they act naturally on sequences. They can also be tested for equality, and can be sorted.

FR elements are stored as free group/monoid/semigroup words. They are printed as <n|w>, where n is the degree of their alphabet.

Equality of FR elements is tested as follows. Given FR elements (m,q) and (m,r), we set up a "rewriting system" for m, which records a purported set of relations among states of m. We start by an empty rewriting system, and we always ensure that the rewriting system is reduced and shortlex-reducing. Then, to compare q and r, we first compare their activities. If they differ, the elements are distinct. Otherwise, we reduce q and r using the rewriting system. If the resulting words are graphically equal, then they are equal. Otherwise, we add the rule q\to r or r\to q to the rewriting system, and proceed recursively to compare coordinatewise the states of these reduced words. As a bonus, we keep the rewriting system to speed up future comparisons.

Efficient comparison requires lookup in sorted lists, aka "Sets". Given two FR elements x and y, we declare that x<y if, for the shortlex-first sequence l such that Output(Transition(x,l)) and Output(Transition(y,l)) differ, the former is less than the latter (compared as lists). In fact, a single internal function compares x and y and returns -1,0,1 depending on whether x<y or x=y or x>y. It traverses, in breadth first fashion, the alphabet sequences, and stops either when provably x=y or if different outputs appear.
Creators for FRElements <#Include Label="FRElement"> <#Include Label="AsGroupFRElement">
Operations and Attributes for FRElements <#Include Label="Output/element"> <#Include Label="States"> <#Include Label="InitialState"> <#Include Label="^">
Mealy machines and elements Mealy machines form a special class of FR machines. They have as stateset a finite set, as opposed to a free group/monoid/semigroup. All commands available for FR machines are also available for Mealy machines, but the latter have added functionality.

There are currently two types of Mealy machines; one has as stateset an interval of integers of the form [1..m] and as alphabet a set of integers; the other has an arbitrary domain as stateset and alphabet. Almost no functionality is implemented for the latter type, but there is a function converting it to the former type (see ).

The internal representation of a Mealy machine of the first kind is quite different from that of FR machines. The alphabet is assumed to be an interval [1..n], and the stateset is assumed to be an interval [1..m]. The transitions are stored as a m \times n matrix, and the outputs are stored in a list of length m, consisting of permutations or transformations.

Mealy machines have additional properties, in particular they can act on periodic sequences (see ). For example, the periodic sequence PeriodicList([1],[1,2]) describes the infinite ray [1,1,2,1,2,..] in the tree. In principle, Mealy machines could act on sequences accepted by an automaton, although this is not yet implemented.

Mealy elements are Mealy machines with an initial state. For efficiency reasons, Mealy elements are always minimized, and their states are ordered in a canonical top-down, left-to-right order of traversal of the tree. In particular, their initial state is always 1. In this implementation, multiplication of Mealy elements is slower than multiplication of group FR elements, while comparison of Mealy elements is faster than comparison of group FR elements. In practise, it is better to work with Mealy elements as often as possible.

Products of Mealy machines behave in the same way as products of general FR machines, see . The only difference is that now the sum and products of statesets are distinct; the sum of statesets being their disjoint union, and their product being their cartesian product.

Sometimes one would like to know how a Mealy element was obtained as a word in Mealy elements. This is possible within the representation , which combines the representations and . On top of usual FR elements, they have an attribute UnderlyingMealyMachine, which is used for faster comparison of elements, and computation of the action.

Therefore, if L is a list of FR elements, the call List(L,UnderlyingElement);; will set these attributes, and all calculations made with elements of L will use and propagate the attributes. FR-Mealy elements are displayed in the form <d|w|n>, where d is the degree of the alphabet, w is a word in the stateset, and n is the number of states of the underlying Mealy element.
Creators for MealyMachines and MealyElements <#Include Label="MealyMachine"> <#Include Label="AllMealyMachines">
Operations and Attributes for MealyMachines and MealyElements <#Include Label="Draw"> <#Include Label="MM-Minimized"> <#Include Label="DualMachine"> <#Include Label="StateGrowth"> <#Include Label="Signatures"> <#Include Label="AsMealyMachine"> <#Include Label="ConfinalityClasses"> <#Include Label="LimitMachine"> <#Include Label="GuessMealyElement">
Linear machines and elements Linear machines are a special class of FR machines, in which the stateset Q and the alphabet X are vector spaces over a field \Bbbk, and the transition map \phi: Q\otimes X\to X\otimes Q is a linear map; furthermore, there is a functional \pi:Q\to\Bbbk called the output.

As before, a choice of initial state q\in Q induces a linear map q:T(X)\to T(X), where T(X)=\bigoplus X^{\otimes n} is the tensor algebra generated by X. This map is defined as follows: given x=x_1\otimes\dots\otimes x_n\in T(X), rewrite q\otimes x as a sum of expressions of the form y\otimes r with y\in T(X) and r\in Q; then q, by definition, maps x to the sum of the \pi(r)y.

There are two sorts of linear machines: vector machines, for which the state space is a finite-dimensional vector space over a field; and algebra machines, for which the state space is a free algebra in a finite set of variables.

In a vector machine, the transition and output maps are stored as a matrix and a vector respectively. Minimization algorithms are implemented, as for Mealy machines.

In an algebra machine, the transition and output maps are stored as words in the algebra. These machines are natural extensions of group/monoid/semigroup machines.

Linear elements are given by a linear machine and an initial state. They can be added and multiplied, and act on the tensor algebra of the alphabet, admitting natural representations as matrices.
Methods and operations for LinearFRMachines and LinearFRElements <#Include Label="VectorMachine"> <#Include Label="AlgebraMachine"> <#Include Label="Transitions"> <#Include Label="AsLinearMachine">
Self-similar groups, monoids and semigroups Self-similar groups, monoids and semigroups (below FR semigroups) are simply groups, monoids and semigroups whose elements are FR machines. They naturally act on the alphabet of their elements, and on sequences over that alphabet.

Most non-trivial calculations in FR groups are performed as follows: &GAP; searches through words of short length in the generating set of a FR group to find a solution to a group-theoretic question, and at the same time searches through the finite quotients to prove the inexistence of a solution. Often the calculation ends with the answer fail, which means that no definite answer, neither positive nor negative, could be found; however, the cases where the calculation actually terminates have been most useful.

The maximal length of words to consider in the search is controlled by the variable FR&uscore;SEARCH.radius (initially 10), and the maximal depth of the tree in which to search is controlled by the variable FR&uscore;SEARCH.depth (initially 6). These limits can be modified in any function call using &GAP;'s options mechanism, e.g. in Index(G,H:FRdepth:=5,FRradius:=5).
Creators for FR semigroups The most straightforward creation method for FR groups is Group(), applied with FR elements as arguments. There are shortcuts to this somewhat tedious method: <#Include Label="FRGroup"> <#Include Label="SCGroup"> <#Include Label="FullSCGroup"> <#Include Label="IsomorphismFRGroup"> <#Include Label="FRGroupByVirtualEndomorphism"> <#Include Label="Products">
Operations for FR semigroups <#Include Label="PermGroup"> <#Include Label="StabilizerImage"> <#Include Label="IsStateClosed"> <#Include Label="IsFinitary"> <#Include Label="IsContracting"> <#Include Label="IsBranched"> <#Include Label="VertexTransformations"> <#Include Label="VirtualEndomorphism"> <#Include Label="EpimorphismFromFpGroup">
Properties for infinite groups <#Include Label="IsTorsionGroup">
Algebras Self-similar algebras and algebras with one (below FR algebras) are simply algebras [with one] whose elements are linear FR machines. They naturally act on the alphabet of their elements, which is a vector space.

Elements may be added, subtracted and multiplied. They can be vector or algebra linear elements; the vector elements are in general preferable, for efficiency reasons.

Finite-dimensional approximations of self-similar algebras can be computed; they are given as matrix algebras.
Creators for FR algebras The most straightforward creation method for FR algebras is Algebra(), applied with linear FR elements as arguments. There are shortcuts to this somewhat tedious method: <#Include Label="FRAlgebra"> <#Include Label="SCAlgebra">
Operations for FR algebras <#Include Label="MatrixQuotient"> <#Include Label="ThinnedAlgebra"> <#Include Label="Nillity">
Examples FR predefines a large collection of machines and groups. The groups are, whenever possible, defined as state closures of corresponding Mealy machines.
Examples of groups <#Include Label="FiniteDepthBinaryGroup"> <#Include Label="BinaryKneadingGroup"> <#Include Label="AddingMachine"> <#Include Label="MixerMachine"> <#Include Label="SunicMachine"> <#Include Label="GrigorchukGroup"> <#Include Label="BrunnerSidkiVieiraMachine"> <#Include Label="AleshinMachine"> <#Include Label="GuptaSidkiMachines"> <#Include Label="GammaPQ"> <#Include Label="OtherGroups"> <#Include Label="FRAffineGroup">
Examples of semigroups <#Include Label="I2Machine">
Examples of algebras <#Include Label="PSZAlgebra">
Bacher's determinant identities In his paper , Roland Bacher exhibits striking formulas for determinants of matrices obtained from binomial coefficients.

The general construction is as follows: let P be an infinite matrix, and let P(n) be its upper n\times n corner. To evaluate \det P(n), decompose P=LDR where L,D,R are respectively lower triangular, diagonal, and upper triangular, with 1's on the diagonals of L and R. Then that determinant is the product of the first n entries of D.

Bacher considers some natural examples of matrices arising from binomial coefficients, and notes that the matrix P is the limit of a convergent vector element (see ). He also notes that the decomposition P=LDR may be achieved within vector elements.

As a first example, consider the n\times n matrix P(n) with coefficients P_{s,t}={s+t \choose s}\pmod 2. Here and below, indices start at 0. Let also ds(n) denote the digit-sum of the integer n. Then \det(P(n))=\cases{ (-1)^{n/2} & if $n$ is even,\cr (-1)^{(n-1)/2+ds((n-1)/2)} & if $n$ is odd.} For the proof, note that P is a convergent infinite matrix; it may be presented as a self-similar linear element by FRAlgebra("P=[[P,P],[P,0]]"). It then suffices to construct an LR decomposition of P within FR vector elements, following Bacher:
gap> AssignGeneratorVariables(FRAlgebra(Rationals, "P=[[P,P],[P,0]]","L=[[L,0],[L,L]]","D=[[D,0],[0,-D]]")); gap> L*D*TransposedFRElement(L)=P; true
and to analyse the elements of the diagonal matrix D.

For a more complicated example, let v_2 denote 2-valuation of a rational, and construct the n\times n matrix V(n) with coefficients V_{s,t}=i^{v_2({s+t \choose s})}. Then \det(V(n))=\det(P(n))\prod_{k=1}^{n-1}(1-f(k)i), where f(k) is the regular paper-folding sequence defined by f(2^n)=1 and f(2^n+a)=-f(2^n-a) for 1\le a<2^n.

This is again proved by noticing that V is a corner in a self-similar element, namely
gap> AssignGeneratorVariables(FRAlgebra(GaussianRationals, "V1=[[V1,V2],[V2,E(4)*V1]]", "V2=[[V1,-E(4)*V1+(1+E(4))*V2],[-E(4)*V1+(1+E(4))*V2,-V1]]")); gap> Activity(V1,3)= List([0..7],s->List([0..7],t->E(4)^ValuationInt(Binomial(s+t,s),2))); true
The LR decomposition of V=V1 can be checked as follows:
gap> AssignGeneratorVariables(FRAlgebra(GaussianRationals, "L1=[[L1,0],[L3,L4]]", "L2=[[0,-E(4)*L2],[-L1+L3,-E(4)*L2-E(4)*L4]]:0", "L3=[[L1,L2],[-E(4)*L1+(1+E(4))*L3,L2+(1+E(4))*L4]]", "L4=[[L1,0],[(1-E(4))*L1+E(4)*L3,L4]]", "D1=[[D1,0],[0,D2]]", "D2=[[D3,0],[0,2*D1-D2+2*D3]]:-1+E(4)", "D3=[[D3,0],[0,-D2]]:-1+E(4)")); gap> L1*D1*TransposedFRElement(L1)=V1; true
The LR decomposition can also, in favourable situations, be discovered by FR through the command . This approach will be followed below.

For the next example, consider "Beeblebrox reduction" \beta(4k\pm1)=\pm1,\beta(2k)=0, and construct the n\times n matrix Z(n) (named after Zaphod Beeblebrox) with coefficients Z_{s,t}=\beta({s+t \choose s}). Then \det(Z(n))=\prod_{k=1}^{n-1}g(k), where g(\sum a_i2^i)=(-1)^{a_0}3^{\#\{i:a_i=a_{i+1}=1\}-\#\{i:a_i\neq a_{i+1}=1\}} with all a_i\in\{0,1\}.

This is again proved by noticing that Z is a corner in a self-similar element, namely
gap> beta := n->Jacobi(-1,n)*(n mod 2);; gap> Zaphod := GuessVectorElement(List([0..7],i->List([0..7],j->beta(Binomial(i+j,j))))); <Linear element on alphabet Rationals^2 with 3-dimensional stateset> gap> Display(Zaphod); Rationals | 1 | 2 | -----------+----------+----------+ 1 | 1 0 0 | 0 1 0 | | 1 0 0 | 0 1 0 | | 1 0 0 | 0 -1 0 | -----------+----------+----------+ 2 | 0 0 1 | 0 0 0 | | 0 0 -1 | 0 0 0 | | 0 0 1 | 0 0 0 | -----------+----------+----------+ Output: 1 1 1 Initial state: 1 0 0 gap> LDUDecompositionFRElement(guessZ); [ <Linear element on alphabet Rationals^2 with 4-dimensional stateset>, <Linear element on alphabet Rationals^2 with 2-dimensional stateset>, <Linear element on alphabet Rationals^2 with 4-dimensional stateset> ] gap> Display(last[2]); Rationals | 1 | 2 | -----------+---------+---------+ 1 | 1 0 | 0 0 | | 3 0 | 0 0 | -----------+---------+---------+ 2 | 0 0 | 0 1 | | 0 0 | 0 1/3 | -----------+---------+---------+ Output: 1 -1 Initial state: 1 0
and now the recursion read on this diagonal self-similar matrix gives immediately Bacher's recursion for \det(Z(n)).

Bacher notes that the group generated by a=L_1,b=L_2/2,c=L_3,d=L_4 in the last example may be of interest. A quick check produces the following relations (slightly rewritten):
gap> AssignGeneratorVariables(FRAlgebra(Rationals, "a=[[a,0],[c,d]]","b=[[-1/3*a,2*b],[1/3*c,d]]", "c=[[a,2*b],[c,d]]","d=[[a,0],[1/3*c,d]]")); gap> g := Group(List([a,b,c,d], x->Activity(x,3))); <matrix group with 4 generators> gap> FindShortGroupRelations(g,10); [ b*d^-1*c*a^-1, c*a^-1*c*a^-1, c*a*d^-1*a^-1*d^2*a^-1*b^-1, c*a*d^-1*c^-1*b*d*a^-1*b^-1, c*d*a^-2*d*a*d^-1*b^-1, c*a^2*d^-1*a^-2*d*a*d*a^-2*b^-1, d^2*a*d^-2*b^-1*c*a*d*a^-3, c*d*a*d^-2*a^-1*d*a*d*a^-2*b^-1 ]
Consider next the "triangular Beeblebrox matrix" with entries L_{s,t}=\beta({s \choose t}). The recurrence is now given by
gap> A := FRAlgebra(Rationals, "L1=[[L1,0],[L2,L3]]", "L2=[[L1,0],[L2,-L3]]", "L3=[[L1,0],[-L2,L3]]"); <self-similar algebra on alphabet Rationals^2 with 3 generators>
and it is striking that A is a graded algebra, with L_1,L_2,L_3 homogeneous of degree 1, and each homogeneous component is 3-dimensional; all of L_1,L_2,L_3 are invertible (with inverses have degree -1), and generate a group that admits a faithful 3\times 3 linear representation. As a final example, Bacher considers the "Jacobi character" \chi(8&ZZ;\pm1)=1,\chi(8&ZZ;\pm3)=-1,\chi(2&ZZ;)=0, and the associated matrix J_{s,t}=\chi({s+t \choose s}). He gives an easily-computed, but complicated formula for \det(J(n)). We can recover this formula, as before, by "guessing" an LR decomposition for J, which is self-similar and convergent:
gap> chi := function(x) if x mod 8 in [1,7] then return 1; elif x mod 8 in [3,5] then return -1; else return 0; fi; end;; gap> m := List([0..63],i->List([0..63],j->chi(Binomial(i+j,j))));; gap> J := GuessVectorElement(m,2); <Linear element on alphabet Rationals^2 with 9-dimensional stateset> gap> LDUDecompositionFRElement(J); [ <Linear element on alphabet Rationals^2 with 20-dimensional stateset>, <Linear element on alphabet Rationals^2 with 4-dimensional stateset>, <Linear element on alphabet Rationals^2 with 20-dimensional stateset> ] gap> time; 26869 gap> Display(last2[2]); Rationals | 1 | 2 | -----------+-----------------+-----------------+ 1 | 1 0 0 0 | 0 0 0 0 | | 0 0 1 0 | 0 0 0 0 | | 3 0 0 0 | 0 0 0 0 | | 0 0 3 0 | 0 0 0 0 | -----------+-----------------+-----------------+ 2 | 0 0 0 0 | 0 1 0 0 | | 0 0 0 0 | 0 0 0 1 | | 0 0 0 0 | 0 1/3 0 0 | | 0 0 0 0 | 0 0 0 1/3 | -----------+-----------------+-----------------+ Output: 1 -1 3 -1/3 Initial state: 1 0 0 0
VH groups FR understands a special kind of finitely presented groups, called VH groups. These are groups with two distinguished sets of generators, V and H, and such that for every choice of v\in V,h\in H there are unique v'\in V,h'\in H such that vh=h'v' and conversely. In other words, these are finitely presented groups whose Cayley complex is a product of two trees.

These groups are of particular interest thanks to the work of Burger and Mozes, see and , who constructed the first examples of finitely presented simple groups in this manner.

VH groups are connected to groups generated by automata as follows. Given a VH group, consider the automaton with stateset V, acting on alphabet H; its output and transition are determined by \Phi(v,h)=(h',v') where v',h' are determined by the equation vh=h'v'.

Conversely, any bireversible automaton gives rise to a VH group by the inverse construction.

FR contains commands that automatize the verification that a VH group is non-residually finite, or virtually simple. Inspiration came from Diego Rattaggi's PhD thesis . <#Include Label="VHGroup">
FR implementation details FR creates new categories for the various objects considered in the package. The first category is FRObject; all objects are in this category, and have an Alphabet method.

There are two categories below: FRMachine and FRElement. An FRMachine must have a StateSet, and methods for Output and a Transition. An FRElement must have an underlying FRMachine and InitialState, and Output and a Transition that use the initial state.

A self-similar group is simply a collections category of FR elements which is also a group.
The family of FR objects All FR objects have an associated . <#Include Label="FRMFamily"> <#Include Label="FREFamily"> <#Include Label="AlphabetOfFRObject"> This method takes as argument an FR object o: machine, element, or group, and produces an equivalent object whose outputs are permutations. In particular, it converts Mealy machines from domain representation to int representation.

If this is not possible, the method returns fail. This method takes as argument an FR object o: machine, element, or group, and produces an equivalent object whose outputs are transformations. In particular, it converts Mealy machines from domain representation to int representation.

Since transformations can never be inverted by &GAP;, even when they are invertible, this function returns a monoid when applied to a full SC group.
Filters for FRObjects <#Include Label="IsGroupFRMachine"> <#Include Label="IsFRMachineStdRep"> <#Include Label="IsMealyMachine"> <#Include Label="IsMealyMachineIntRep"> <#Include Label="IsVectorFRMachineRep"> <#Include Label="IsAlgebraFRMachineRep"> <#Include Label="IsLinearFRMachine"> <#Include Label="IsFRElement"> <#Include Label="IsFRObject"> <#Include Label="IsInvertible"> <#Include Label="IsFRGroup"> <#Include Label="IsFRAlgebra">
Some of the algorithms implemented Few calculations with infinite groups can be guaranteed to terminate --- and especially to terminate within reasonable time. This section describes some of the algorithms implemented in FR. <#Include Label="FRMachineRWS"> Order of FR elements

The order of an FR element e is computed as follows: the tree is traversed recursively, filling it as follows. For each cycle of e on the first level, the product of the states on that cycle are computed. The method continues recursively with that product, remembering the order of the cycle. Once a state reappears in the traversal, FR determines if one instance of the state is in the subtree of the other, and if so whether the top one was raised to a non-trivial power to yield the second one as a state. If this happens, then e has infinite order. Otherwise, the least common multiple of the powers that appeared in the traversal is returned.

This method is guaranteed to succeed if e is a bounded element. To improve chances of success, FR first computes whether e acts by vertex transformations belonging to an abelian group; and if so, if e is conjugate to an adding machine. In that case too, e has infinite order. Membership in semigroups The following algorithm is used to determine whether a Mealy element belongs to a self-similar group. The corresponding problem of membership of an FR element in a state-closed self-similar group can be much simpler, because an FR element has an associated FR machine, all of whose states belong to the group.

Assume the group is given by generators. FR attempts to express the given Mealy element as a product of generators. At the same time, it constructs epimorphisms to finite groups. It is hoped that one of these two processes will stop.

This amounts, in fact, to the following. Consider a group G acting on a tree. It has a natural, profinite closure \overline G. The algorithm then attempts either to write an element x as a product of generators of G, or to show that x does not belong to \overline G.

There are groups G such that \overline G\setminus G contains Mealy machines. For these, the above algorithm will not terminate.

An additional refinement is implemented for bounded groups (see ). The of an element are computed, and compared to the germs of elements in the group.

Finally, for a group that possesses self-similar data (see Section ), very fast methods are implemented to recognize and express an FR element as a product of generators. The conjugacy problem

The conjugacy problem for self-similar branch groups has been implemented by Thorsten Groth, as part of his Diploma Thesis. His code is integrated in FR.

Specialized algorithms are implemented for the Grigorchuk and Gupta-Sidki groups, and a generic algorithm is implemented, which is however not guaranteed to succeed. The implementation follows .

The following extra attibutes are part of his implementation: <#Include Label="CP"> Order of groups

The order of an FR group is computed as follows: if all generators are finitary, then enumeration will succeed in computing the order. If the action of the group is primitive, and it comes from a bireversible automaton, then the Thompson-Wielandt theorem is tested against. This theorem states that, in our context (a group acting on a rooted tree, coming from a larger group acting transitively), if the group is finite then the stabilizer of a sphere of radius 2 is a p-group; see . Then, FR attempts to find whether the group is level-transitive (in which case it would be infinite). Finally, it attempts to enumerate the group's elements, testing at the same time whether these elements have infinite order.

Needless to say, none except the first few steps are guaranteed to succeed. Images and preimages of some groups in f.p. and l.p. groups Contracting, branched groups admit finite L-presentations (see ), that is, presentations by finitely many generators, relators and endomorphisms; the (usual) relators are the images of the given relators under iteration by all endomorphisms.

Using the package NQL, it is possible to construct infinite nilpotent quotients of self-similar groups, and perform fast computations in them.

It is possible to construct, algorithmically, such an L-presentation from a self-similar groups; however, this algorithm has not been implemented yet, mainly because efficiency issues would make it usable only in very few cases.

For groups with an isomorphism to an L-presented group (constructed by ), a fast method expresses group elements as words in the L-presented group's generators. It proceeds recursively on the decomposition of the element, mapping elements that are expressible by short words over the nucleus (usually length 1; length 3 is needed for the ) to their value in the L-presented group, and using the presentation's endomorphism to construct words with appropriate decompositions.

In particular, the algorithm will stop, returning fail, if during the recursion it reaches an element x such that x is a state of x but x does not belong to the nucleus. Comparison of FR, Mealy, vector, and algebra elements FR and Mealy elements can be compared quite efficiently, as long as they are distinct. The algorithm runs as follows: let the two elements be x and y. Considering both in turn, FR constructs the first entries of minimal Mealy elements expressing x and y; as soon as an output entry is distinct for x and for y, the status of x<y is determined; and similarly for transition entries. Finally, if either of x or y is finite-state and the entries were identical up to that step, then the element with smallest stateset is considered smaller.

In this way, FR and Mealy elements can efficiently be compared. For Mealy elements, it suffices to follow their internal data; while for FR elements, this amounts to constructing Mealy elements approximating them to a sufficient precision so that they can be compared as such.

The algorithm first tries to test its arguments for equality; this test is not guaranteed to succeed.

A similar algorithm applies for linear elements. Here, one constructs vector element approximations; and compares, for ever-increasing values of i, first the output vectors of basis state i; then the transitions from state i to state j, for all j\in\{1,\ldots,i\}; then the transitions from state j to state i for all j\in\{1,\ldots,i-1\}. Inverses of linear elements It is probably difficult to compute the inverse of a vector element. The following approach is used: to compute the inverse of x, large (scalar) matrix approximations of x are computed; they are inverted using linear algebra; a vector element representing this inverse is guessed; and the guess is checked. As long as that check fails, larger approximations are computed.

Needless to say, this method need not succeed; for there are vector elements that are invertible, but whose inverse is not a vector element. A good test example appears in : consider the infinite matrix with 1's on the diagonal, and \omega below the diagonal. This element admits an inverse if and only if \omega is a root of unity. The complexity of the inverse grows as the degree of \omega grows. Here is an illustation:
gap> bacher := function(n) local f; f := CyclotomicField(n); return VectorElement(f,One(f)*[[[[1,0],[0,0]], [[0,0],[0,1]]],[[[0,1],[0,0]],[[1,0],[0,0]]]],[One(f),E(n)],[One(f),Zero(f)]); end;; gap> Inverse(bacher(3)); <Linear element on alphabet CF(3)^2 with 4-dimensional stateset> 6 gap> Inverse(bacher(5)); <Linear element on alphabet CF(5)^2 with 6-dimensional stateset>

Dimension of states of inverse
n 1 2 3 4 5 6 7 8 9 10
dimension 2 4 4 6 3 5 5 8 5
n 11 12 13 14 15 16 17 18 19 20
dimension ?5? 4 6 6? 7? 7
n 22 24 26 28 30 32 34 36 38 40
dimension ?6? 6? 7????

Miscellanea
Generic operations <#Include Label="TensorSum">
Periodic lists <#Include Label="PeriodicLists">
Word growth <#Include Label="WordGrowth">
Finding short relations <#Include Label="ShortMonoidRelations">
Braid groups <#Include Label="Braids">
Dirichlet series <#Include Label="dirichlet">
Projective representations <#Include Label="projreps">
Miscellanea <#Include Label="ForwardOrbit"> <#Include Label="Helpers"> <#Include Label="Posets"> <#Include Label="FIFOs"> <#Include Label="LowerCentralSeries"> <#Include Label="AlgebraHomomorphismbyFunction"> <#Include Label="fpliealgebra"> <#Include Label="solutionmatmodn">
User settings This is an Info class for the package FR. The command SetInfoLevel(InfoFR,1); switches on the printing of some information during the computations of certain FR functions; in particular all automatic conversions between FR machines and Mealy machines.

The command SetInfoLevel(InfoFR,2); requests a little more information, and in particular prints intermediate results in potentially long calculations such as .

The command SetInfoLevel(InfoFR,3); ensures that FR will print information every few seconds or so. This is useful to gain confidence that the program is not stuck due to a programming bug by the author of FR. <#Include Label="SEARCH@">