############################################################################
##
#W lpres.gd 			The NQL-package			René Hartung
##
#H   @(#)$Id: lpres.gd,v 1.5 2008/08/28 08:23:37 gap Exp $
##
Revision.("nql/gap/lpres_gd"):=
  "@(#)$Id: lpres.gd,v 1.5 2008/08/28 08:23:37 gap Exp $";


############################################################################
##
#C  IsElementOfLpGroup
##
DeclareCategory( "IsElementOfLpGroup", 
   IsMultiplicativeElementWithInverse and IsAssociativeElement );

############################################################################
##
#C  IsElementOfLpGroupCollection
##
DeclareCategoryCollections( "IsElementOfLpGroup" );

############################################################################
##
#C  IsElementOfLpGroupFamily
##
DeclareCategoryFamily( "IsElementOfLpGroup" );

############################################################################
##
#C  IsLpGroup
##
DeclareCategory( "IsLpGroup", IsSubgroupFgGroup );

############################################################################
##
#C  IsLpGroup
##
InstallTrueMethod( IsLpGroup, IsGroup and IsElementOfLpGroupCollection );

############################################################################
##
#O  ElementOfLpGroup( <fam>, <word> )
##
## If <fam> is the elements-family of an L-presented group and <word> is a 
## word in the free generators underlying this L-presented group, this 
## operation creates the element with the representative <word> in the 
## LpGroup with elements-family <fam>.
## 
DeclareOperation( "ElementOfLpGroup",
                [ IsElementOfLpGroupFamily, IsAssocWordWithInverse ]);

############################################################################
##
#P  IsInvariantLPresentation ( <G> )
##
DeclareProperty( "IsInvariantLPresentation", IsLpGroup );

############################################################################
##
#P  IsAscendingLPresentation ( <G> )
##
DeclareProperty( "IsAscendingLPresentation", IsLpGroup );

#############################################################################
##
#A  FreeGeneratorsOfLpGroup( <G> )
##
## `FreeGeneratorsOfLpGroup' returns the underlying free generators
## corresponding to the generators of the L-presented group <G>.
##
DeclareAttribute( "FreeGeneratorsOfLpGroup", IsLpGroup and IsGroupOfFamily  );

############################################################################
##
#A  FixedRelatorsOfLpGroup( <G> )
##
## returns the fixed relators of the L-presented group <G> as words
## in the free generators obtained from `FreeGeneratorsOfFpGroup'.
##
DeclareAttribute("FixedRelatorsOfLpGroup",IsLpGroup and IsGroupOfFamily);

############################################################################
##
#A  EndomorphismsOfLpGroup( <G> )
##
## returns the endomorphisms of the L-presented group <G> as group 
## homomorphisms of the underlying free group.
##
DeclareAttribute( "EndomorphismsOfLpGroup", IsLpGroup and IsGroupOfFamily );

############################################################################
##
#A  IteratedRelatorsOfLpGroup( <G> )
##
## returns the iterated relators of the L-presented group <G> as words
## in the free generators obtained from `FreeGeneratorsOfFpGroup'.
##
DeclareAttribute( "IteratedRelatorsOfLpGroup", IsLpGroup and IsGroupOfFamily );

############################################################################
##
#A  FreeGroupOfLpGroup(<G>)
##
## returns the underlying free group of the L-presented group <G>; i.e.
## the group generated by the free generators obtained from
## `FreeGeneratorsOfFpGroup'.
##
DeclareAttribute( "FreeGroupOfLpGroup", IsLpGroup and IsGroupOfFamily );

############################################################################
##
#F  LPresentedGroup ( <FreeGroup>, <rels>, <endos>, <itrels> )
##
## constructs the L-presented group on the generators of <FreeGroup> with 
## the fixed relators <rels>, the free group endomorphisms <endos>, 
## and the iterated relators <itrels>.
##
DeclareGlobalFunction( "LPresentedGroup" );

############################################################################
##
#A  UnderlyingAscendingLPresentation( <LpGroup> )
##
## returns the underlying ascending L-presentation. 
##
DeclareAttribute( "UnderlyingAscendingLPresentation", IsLpGroup );

############################################################################
##
#A  UnderlyingInvariantLPresentation( <LpGroup> )
##
## attempts to compute an underlying invariant L-presentation for the
## group <LpGroup>. In the worst case, this routine returns the underlying
## ascending L-presentation. This attribute can be set manually by the user
## using `SetUnderlyingInvariantLPresentation'.
##
DeclareAttribute( "UnderlyingInvariantLPresentation", IsLpGroup );

############################################################################
##
#A  EmbeddingOfAscendingSubgroup ( <LpGroup> )
##
## an attribute which stores an embedding of an ascending L-presented 
## subgroup of the L-presented group <LpGroup>. This is useful for the 
## construction in FR of the Gupta-Sidki-Groups with its invariantly 
## L-presented index-3 subgroup.
##
DeclareAttribute( "EmbeddingOfAscendingSubgroup", IsLpGroup );

############################################################################
##
#O  EpimorphismFromFpGroup ( <LpGroup>, <n> )
##
## returns an epimorphism from a finitely presented group G which is obtained
## from <LpGroup> by applying word of length at most <n> in the endomorphisms 
## of the L-presented group <LpGroup>
##
DeclareOperation( "EpimorphismFromFpGroup", [ IsLpGroup, IsPosInt ] );

############################################################################
##
#O  SplitExtensionByAutomorphismsLpGroup ( <G>, <H>, <auts> )
##
## returns the split extension of <G> by <H> where the action of each 
## generator of <H> on <G> is given by the automorphisms <aut>: <H> -> <G>
## in the list <auts>.
##
DeclareOperation( "SplitExtensionByAutomorphismsLpGroup",
                 [ IsLpGroup, IsGroup, IsList ]);

############################################################################
##
#O  AsLpGroup ( <G> )
##
## returns an L-presented group which is isomorphic to <G>
##
DeclareOperation( "AsLpGroup", [ IsFpGroup ]);
DeclareOperation( "AsLpGroup", [ IsFreeGroup ]);

############################################################################
##
#O  IsomorphismLpGroup ( <G> )
##
## returns an isomorphism from an FpGroup (or from a FreeGroup) to the LpGroup
## obtained from `AsLpGroup'.
##
DeclareOperation( "IsomorphismLpGroup", [ IsFpGroup ]);
DeclareOperation( "IsomorphismLpGroup", [ IsFreeGroup ]);
