<Chapter><Heading>An Introduction to L-presented groups</Heading>
<Section><Heading>Definitions</Heading>
Let <M>S</M> be an alphabet, <M>Q</M> and <M>R</M> be subsets of the
free group <M>F_S</M> over this alphabet, and <M>\Phi</M> be a set of
free group endomorphisms <M>\varphi\colon F_S\to F_S</M>. An
<E>L-presentation</E> is a quadruple <M>(S,Q,\Phi,R)</M> and it is called
<E>finite</E> if the sets <M>S</M>, <M>Q</M>, <M>\Phi</M>, and <M>R</M> are
finite. A (finite) L-presentation <M>(S,Q,\Phi,R)</M> defines the
(<E>finitely</E>) <E>L-presented group</E>

<Display> G=\left\langle S \left|  Q\cup \bigcup_{\varphi\in\Phi^*}R^\varphi\right.\right\rangle</Display>
where <M>\Phi^*</M> denotes the free monoid generated by <M>\Phi</M>;
that is, the closure of <M>\Phi\cup\{\rm id\}</M> under composition.<P/>

The elements in <M>Q</M> are the <E>fixed relators</E> and the
elements in <M>R</M> are the <E>iterated relators</E> of the L-presentation
<M>(S,Q,\Phi,R)</M>. An L-presentation of the form
<M>(S,\emptyset,\Phi,R)</M> is an <E>ascending L-presentation</E> and it is
an <E>invariant L-presentation</E> if the normal subgroup

<Display>K=\left\langle Q\cup \bigcup_{\varphi\in\Phi^*}R^\varphi\right\rangle^{F_S}</Display>
is <M>\varphi</M>-invariant for each <M>\varphi\in\Phi</M>; that is,
if <M>K</M> satisfies <M>K^\varphi\subset K</M> for each
<M>\varphi\in\Phi</M>.  Note that every ascending L-presentation is
invariant and for each L-presentation <M>(S,Q,\Phi,R)</M> there is a
unique <E>underlying ascending L-presentation</E>
<M>(S,\emptyset,\Phi,R)</M> which is invariant. In general it is not
decidable whether or not a given L-presentation is invariant as this
would require a solution to the word-problem.<P/>

In the remainder of this manual, an L-presented group is always
finitely L-presented.<P/>
</Section>

<Section Label="createlp"><Heading>Creating an L-presented group</Heading>

The construction of an L-presented group is similar to the
construction of a finitely presented group (see Chapter <Ref
Chap="Finitely Presented Groups" BookName="ref"/>
of the &GAP; Reference manual for further details).

<ManSection><Func Name="LPresentedGroup" Arg="F frels endos irels"/>
<Description>
  returns the &GAP; object of an L-presented group with the underlying
  free group <A>F</A>, the fixed relators <A>frels</A>, the set of
  endomorphisms <A>endos</A>, and the iterated relators
  <A>irels</A>. The input variables <A>frels</A> and <A>irels</A> need
  to be finite subsets of the underlying free group <A>F</A> and
  <A>endos</A> needs to be a finite list of homomorphisms <M>F\to F</M>.<P/>

  For example, the Grigorchuk group, 
  <Display> \Big\langle a,b,c,d \Big| a^2,b^2,c^2,d^2,bcd,[d,d^a]^{\sigma^n},[d,d^{acaca}]^{\sigma^n},(n\in&NN;_0) \Big\rangle,</Display>
  can be constructed as follows.
  <Example><![CDATA[
gap> F:=FreeGroup( "a", "b", "c", "d" );
<free group on the generators [ a, b, c, d ]>
gap> AssignGeneratorVariables( F );
#I  Assigned the global variables [ a, b, c, d ]
gap> frels:=[a^2, b^2, c^2, d^2, b*c*d];;
gap> endos:=[GroupHomomorphismByImagesNC( F, F, [a, b, c, d], [c^a, d, b, c])];;
gap> irels:=[Comm( d, d^a ), Comm( d, d^(a*c*a*c*a) )];;
gap> G:=LPresentedGroup( F, frels, endos, irels );
<L-presented group on the generators [ a, b, c, d ]>
]]></Example>
</Description>
</ManSection>

There are various examples of finitely L-presented groups available
in the library of the &lpres;-package.

<ManSection><Func Name="ExamplesOfLPresentations" Arg="n"/>
<Description>
  returns some well-known examples of finitely L-presented groups. The
  input of this function needs to be a positive integer at most
  <M>10</M>.<P/>

  <List>
    <Mark>n=1</Mark><Item>The Grigorchuk group on 4 generators;
    cf. <Cite Key="Grigorchuk80"/>, <Cite Key="Lysenok85"/>, and <Cite
    Key="Bartholdi03" Where="Theorem 4.6"/>,</Item>

    <Mark>n=2</Mark><Item>the Grigorchuk group on 3 generators;
    cf. <Cite Key="Grigorchuk80"/>, <Cite Key="Lysenok85"/>, and <Cite
    Key="Bartholdi03" Where="Theorem 4.6"/>,</Item>

    <Mark>n=3</Mark><Item>the lamplighter group <M>&ZZ;/2\wr&ZZ;</M>;
    cf. <Cite Key="Bartholdi03" Where="Theorem 4.1"/>,</Item>

    <Mark>n=4</Mark><Item>the Brunner-Sidki-Vieira group; cf. <Cite
    Key="BrunnerVieiraSidki99"/> and <Cite Key="Bartholdi03"
    Where="Theorem 4.4"/>,</Item>

    <Mark>n=5</Mark><Item>the Grigorchuk supergroup; cf. <Cite
    Key="BartholdiGrigorchuk02"/> and <Cite Key="Bartholdi03"
    Where="Theorem 4.6"/>,</Item>

    <Mark>n=6</Mark><Item>the Fabrykowski-Gupta group; cf. <Cite
    Key="FabrykowskiGupta85"/> and <Cite Key="BEH08"/>,</Item>

    <Mark>n=7</Mark><Item>the Gupta-Sidki group; cf. <Cite
    Key="Sidki87"/> and <Cite Key="BEH08"/>,</Item>

    <Mark>n=8</Mark><Item>an index-<M>3</M> subgroup of the
    Gupta-Sidki group,</Item>

    <Mark>n=9</Mark><Item>the Basilica group; cf. <Cite
    Key="GrigorchukZuk02"/> and <Cite Key="BartholdiVirag05"/>,</Item>
 
    <Mark>n=10</Mark><Item>Baumslag's finitely generated, infinitely
    related group with a trivial multiplier; cf. <Cite
    Key="Baumslag71"/>.</Item>
  </List>
</Description>
</ManSection>

Furthermore, every free group in a variety of groups satisfying finitely
many identities is finitely L-presented. Some of these groups are
available from the &lpres;-package using the following operations; for
further details we refer to the diploma thesis <Cite Key="H08"/>.

<ManSection><Oper Name="FreeEngelGroup" Arg="n num"/>
<Description>
  returns an L-presentation for the free <A>n</A>-Engel group on
  <A>num</A> generators; that is, the free group in the variety of
  <A>num</A>-generated groups satisfying the <A>n</A>-Engel
  identity.
</Description>
</ManSection>

<ManSection><Oper Name="FreeBurnsideGroup" Arg="exp num"/>
<Description>
  returns an L-presentation for the free Burnside group on <A>num</A>
  generators with exponent <A>exp</A>; that is, the free group in the
  variety of <A>num</A>-generated groups with exponent <A>exp</A>.
</Description>
</ManSection>

<ManSection><Oper Name="FreeNilpotentGroup" Arg="c num"/>
<Description>
  returns an L-presentation for the free nilpotent group of class
  <A>c</A> on <A>num</A> generators; that is, the free group in the
  variety of <A>num</A>-generated, nilpotent groups with nilpotency
  class <A>c</A>.
</Description>
</ManSection>

<ManSection><Oper Name="GeneralizedFabrykowskiGuptaLpGroup" Arg="n"/>
<Description>
  returns an L-presentation for the <A>n</A>-th generalized
  Fabrykowski-Gupta group as constructed in <Cite Key="BEH08"/>.
</Description>
</ManSection>

<ManSection><Oper Name="LamplighterGroup" Arg="filter int" Label="llint"/>
<Oper Name="LamplighterGroup" Arg="filter pcgroup" Label="llpcgroup"/>
<Description>
  returns a finite L-presentation for the lamplighter group on
  <A>int</A> lamp states in the first case, if <A>filter</A> is the
  filter <C>IsLpGroup</C>. In the second case, the group
  <A>pcgroup</A> must be a finite cyclic group. Then the method
  returns a finite L-presentation for the lamplighter group on
  <C>Size(pcgroup)</C> lamp states; for details on the L-presentation
  see <Cite Key="Bartholdi03"/>.
  <Example><![CDATA[
gap> LamplighterGroup( IsLpGroup, 2 );
<L-presented group on the generators [ a, t, u ]>
gap> LamplighterGroup( IsLpGroup, CyclicGroup(3) );
<L-presented group on the generators [ a, t, u ]>
]]></Example></Description>
</ManSection>

<ManSection><Oper Name="EmbeddingOfIASubgroup" Arg="a"/>
<Description>
  computes an L-presentation for the IA-automorphism group of a free group.
  This is the subgroup of automorphisms of a free group <M>f</M> that act
  trivially on the abelianization of <M>f</M>.<P/>

  The L-presentation is taken from <Cite Key="DayPutman"/>.
<Example><![CDATA[
gap> f := FreeGroup(3);
<free group on the generators [ f1, f2, f3 ]>
gap> a := AutomorphismGroup(f);
<group of size infinity with 3 generators>
gap> ia := Source(EmbeddingOfIASubgroup(a));
<invariant LpGroup on the generators [ C(1,2), C(1,3), C(2,1), C(2,3), C(3,1), C(3,2), M(1,[2,3]),
  M(2,[1,3]), M(3,[1,2]) ]>
gap> rank := 3;
3
gap> q := NilpotentQuotient(ia,rank);;
gap> lcs := LowerCentralSeries(q);;
gap> for i in [1..Length(lcs)-1] do
>         r := AbelianInvariants(lcs[i]/lcs[i+1]);
>         Print(i); if i>3 then Print("th"); else Print(ELM_LIST(["st","nd","rd"],i)); fi;
>         Print(" quotient: abelian invariants ",r," (collected ",Collected(r),")\n");
>     od;
1st quotient: abelian invariants [ 0, 0, 0, 0, 0, 0, 0, 0, 0 ] (collected [ [ 0, 9 ] ])
2nd quotient: abelian invariants [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
 ] (collected [ [ 0, 18 ] ])
3rd quotient: abelian invariants [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3 ] (collected [ [ 0, 43 ], [ 2, 14 ], [ 3, 9 ] ])
]]></Example>
</Description>
</ManSection>

</Section>

<Section><Heading>The underlying free group</Heading>
An L-presented group is defined as an image of its underlying free
group.  Note that these are two different &GAP; objects. The elements
of the L-presented group are represented by words in the underlying
free group.

<ManSection><Attr Name="FreeGroupOfLpGroup" Arg="lpgroup"/>
<Returns>the underlying free group of the L-presented group <A>lpgroup</A></Returns>
</ManSection>

<ManSection><Attr Name="FreeGeneratorsOfLpGroup" Arg="lpgroup"/>
<Returns>the generators of the free group which underlies the L-presented
group <A>lpgroup</A></Returns>
</ManSection>

<ManSection><Attr Name="GeneratorsOfGroup" Arg="lpgroup"/>
<Returns>the generators of the L-presented group
<A>lpgroup</A>. These are the images of the generators of the
underlying free group under the natural homomorphism.</Returns>
</ManSection>

<ManSection><Oper Name="UnderlyingElement" Arg="elm"/>
<Description>
  returns the preimage of an L-presented group element <A>elm</A> in
  the underlying free group. More precisely, each element of an
  L-presented group is represented by an element in the free
  group. This method returns the corresponding element in the free
  group.
</Description>
</ManSection>

<ManSection><Oper Name="ElementOfLpGroup" Arg="fam elm"/>
<Description>
  returns the element in the L-presented group represented by the word
  <A>elm</A> on the generators of the underlying free group, if
  <A>fam</A> is the family of L-presented group elements.
  <Example><![CDATA[
gap> F:=FreeGroup( 2 );;
gap> G:=LPresentedGroup( F, [ F.1^2 ], [ IdentityMapping( F ) ], [ F.2 ] );;
gap> FreeGroupOfLpGroup( G ) = F;
true
gap> GeneratorsOfGroup( G );
[ f1, f2 ]
gap> FreeGeneratorsOfLpGroup( G );
[ f1, f2 ]
gap> last = last2;
false
gap> UnderlyingElement( G.1 );
f1
gap> last in F;
true
gap> ElementOfLpGroup( ElementsFamily( FamilyObj( G ) ), last2 ) in G;
true
]]></Example>
</Description>
</ManSection>
</Section>

<Section><Heading>Accessing an L-presentation</Heading>

The fixed relators, the iterated relators, and the endomorphisms of an
L-presented group are accessible with the following methods.

<ManSection><Attr Name="FixedRelatorsOfLpGroup" Arg="lpgroup"/>
<Returns>the fixed relators of the L-presented group <A>lpgroup</A> as elements
of the underlying free group.</Returns>
</ManSection>

<ManSection><Attr Name="IteratedRelatorsOfLpGroup" Arg="lpgroup"/>
<Returns>the iterated relators of the L-presented group <A>lpgroup</A>
as elements of the underlying free group.</Returns>
</ManSection>

<ManSection><Attr Name="EndomorphismsOfLpGroup" Arg="lpgroup"/>
<Returns>the endomorphisms of the L-presented group <A>lpgroup</A> as
endomorphisms of the underlying free group.</Returns>
<Description>
<Example><![CDATA[
gap> F:=FreeGroup( 2 );;
gap> G:=LPresentedGroup( F, [ F.1^2 ], [ IdentityMapping( F ) ], [ F.2 ] );
<L-presented group on the generators [ f1, f2 ]>
gap> FixedRelatorsOfLpGroup( G );
[ f1^2 ]
gap> IteratedRelatorsOfLpGroup( G );
[ f2 ]
gap> EndomorphismsOfLpGroup( G );
[ IdentityMapping( <free group on the generators [ f1, f2 ]> ) ]
]]></Example>
</Description>
</ManSection>
</Section>

<Section><Heading>Attributes and properties of L-presented groups</Heading>

For the method-selection of the nilpotent quotient algorithm, an
L-presented group may have the following attributes and properties.


<ManSection><Attr Name="UnderlyingAscendingLPresentation" Arg="lpgroup"/>
<Description>
returns the underlying ascending L-presentation of <A>lpgroup</A>; that
is, if <A>lpgroup</A> is finitely L-presented by <M>(S,Q,\Phi,R)</M>, the
underlying ascending L-presentation is <M>(S,\emptyset,\Phi,R)</M>.<P/>
</Description>
</ManSection>

<ManSection><Attr Name="UnderlyingInvariantLPresentation" Arg="lpgroup"/>
<Description>
attempts to compute a ``good'' underlying invariant L-presentation for
<A>lpgroup</A>; that is, if <A>lpgroup</A> is finitely L-presented by
<M>(S,Q,\Phi,R)</M>, then this method seeks to find a subset
<M>Q'\subseteq Q</M> such that <M>(S,Q',\Phi,R)</M> is an invariant
L-presentation. Note that there is always the underlying ascending
L-presentation <M>(S,\emptyset,\Phi,R)</M>. However, for the
efficiency of the nilpotent quotient algorithm it is important that
the subset <M>Q'</M> is as big as possible.<P/>

Since it is undecidable, in general, whether or not a given L-presentation
is invariant, there is no algorithm which can determine the best
possible underlying invariant L-presentation. The method implemented for
this attribute tries to compute a ``good'' invariant L-presentation and
will return the underlying ascending L-presentation in the worst case.<P/>

This attribute can be set manually using
<C>SetUnderlyingInvariantLPresentation</C>. For instance, the Grigorchuk group 
<Display> \Big\langle a,b,c,d \Big| a^2,b^2,c^2,d^2,bcd,[d,d^a]^{\sigma^n},
   [d,d^{acaca}]^{\sigma^n},(n\in&NN;_0) \Big\rangle,</Display>
is invariantly L-presented and therefore, it should be constructed
as follows:
<Example><![CDATA[
gap> F:=FreeGroup( "a", "b", "c", "d" );;
gap> AssignGeneratorVariables( F );
#I  Assigned the global variables [ a, b, c, d ]
gap> frels:=[ a^2, b^2, c^2, d^2, b*c*d ];;
gap> endos:=[ GroupHomomorphismByImagesNC( F, F, [ a, b, c, d ], [ c^a, d, b, c ]) ];;
gap> irels:=[ Comm( d, d^a ), Comm( d, d^(a*c*a*c*a) ) ];;
gap> G:=LPresentedGroup( F, frels, endos, irels );
<L-presented group on the generators [ a, b, c, d ]>
gap> SetUnderlyingInvariantLPresentation( G, G );;
]]></Example>
</Description>
</ManSection>

<ManSection><Prop Name="IsAscendingLPresentation" Arg="lpgroup"/>
<Description>
checks whether the L-presentation of <A>lpgroup</A> is ascending; that
is, if the set of fixed relators is empty. This property is set
automatically when creating an L-presented group with no fixed
relators using the function <Ref Oper="LPresentedGroup"/>.
</Description>
</ManSection>

<ManSection><Prop Name="IsInvariantLPresentation" Arg="lpgroup"/>
<Description>
attempts to check whether the L-presentation of <A>lpgroup</A>
is invariant. In general, one cannot decide whether or not a
given L-presentation is invariant. There are mainly two methods
implemented for this property. The first method seeks to find a ``good''
underlying invariant L-presentation using the operation
<Ref Oper="UnderlyingInvariantLPresentation"/>. If this latter L-presentation
coincides with the L-presentation of <A>lpgroup</A>, then <A>lpgroup</A>
is invariantly L-presented. If this method fails, then the second
method uses the nilpotent quotient algorithm for L-presented groups
which yields a necessary condition for an L-presented group to
be invariantly L-presented. Note that the latter method may not
terminate. For instance, both methods fail on Baumslag's finitely
generated, infinitely related group with trivial multiplier returned by
<Ref Func="ExamplesOfLPresentations"/>.
</Description>
</ManSection>

<ManSection><Attr Name="EmbeddingOfAscendingSubgroup" Arg="lpgroup"/>
<Description>
stores an embedding of an ascendingly L-presented subgroup of the
L-presented group <A>lpgroup</A>. This attribute is set for ascending
L-presentations only. In this case, the identity map of <A>lpgroup</A>
is returned. This attribute is used in the
<Package>FR</Package>-package which can construct various finitely
L-presented groups. The embedding is useful for a nilpotent quotient
algorithm of a non-invariantly L-presented group.
</Description>
</ManSection>
</Section>

<Section><Heading>Methods for L-presented groups</Heading>

Some operations are natural extensions of the operations for finitely
generated groups. For example, <C>MappedWord(x,gens,imgs)</C>, when
applied to a word <C>x</C> in an L-presented group, returns the group
element obtained by replacing each occurrence of a generator in
<C>gens</C> by the corresponding element in the list <C>imgs</C>. The lists
<C>gens</C> and <C>imgs</C> need to have the same length.<P/>

Equality test of elements of L-presented groups is implemented using
the operation <Ref Func="NqEpimorphismNilpotentQuotient" BookName="nq"/> to compare
the images in a nilpotent quotient of the group. The implemented
method successively increases the class of the considered quotient
until the images differ. Hence, this method may not terminate and it
will only determine whether the elements are different.<P/>

<ManSection><Oper Name="EpimorphismFromFpGroup" Arg="lpgroup n"/>
<Description>
returns an epimorphism from a finitely presented group onto <A>lpgroup</A>. The
finitely presented group is obtained from <A>lpgroup</A> by applying only
words of length at most <A>n</A> in the endomorphisms of <A>lpgroup</A> to the
iterated relators of <A>lpgroup</A>.
</Description>
</ManSection>

<ManSection><Oper Name="SplitExtensionByAutomorphismsLpGroup" Arg="lpgroup H auts"/>
<Description>
returns an L-presentation for the split extension of <A>lpgroup</A> by
an L-presented or by a finitely presented group <A>H</A>. The action
of a generator of <A>H</A> on <A>lpgroup</A> is given by an
automorphism in the list <A>auts</A>. Thus for each generator of
<A>H</A> there must be an automorphism in the list <A>auts</A>.
<Example><![CDATA[
gap> F := FreeGroup( "a" );
<free group on the generators [ a ]>
gap> H := F / [ F.1^3 ];
<fp group on the generators [ a ]>
gap> U := ExamplesOfLPresentations( 8 );
<L-presented group on the generators [ t, u, v ]>
gap> aut:=GroupHomomorphismByImagesNC( U, U, [ U.1, U.2, U.3 ], [ U.2, U.3, U.1 ] );
[ t, u, v ] -> [ u, v, t ]
gap> SplitExtensionByAutomorphismsLpGroup( U, H, [ aut ] );
<L-presented group on the generators [ t, u, v, a ]>
]]></Example>
</Description>
</ManSection>


<ManSection><Oper Name="AsLpGroup" Arg="G"/>
<Description>
returns an ascending L-presentation for a finitely presented group
<A>G</A> or for a free group <A>G</A>.
</Description>
</ManSection>

<ManSection><Oper Name="IsomorphismLpGroup" Arg="G"/>
<Description>
returns an isomorphism from a finitely presented group <A>G</A> or
from a free group <A>G</A> to the L-presented group obtained from the
method <Ref Oper="AsLpGroup"/>.
<Example><![CDATA[
gap> F:=FreeGroup( 2 );
<free group on the generators [ f1, f2 ]>
gap> G:=F/[ F.1^2, F.2^2, Comm( F.1, F.2 ) ];
<fp group on the generators [ f1, f2 ]>
gap> IsomorphismLpGroup( G );
[ f1, f2 ] -> [ f1, f2 ]
gap> Range(last);
<L-presented group on the generators [ f1, f2 ]>
gap> Display(last);
generators = [ f1, f2 ]
fixed relators = [ ]
endomorphism = [
IdentityMapping( <free group on the generators [ f1, f2 ]> ) ]
iterated relators = [
f1^2,
f2^2,
f1^-1*f2^-1*f1*f2 ]
]]></Example>
</Description>
</ManSection>
</Section>
</Chapter>
