<!--

This chapter shows what one can do after a successful recognition.

-->

<Chapter Label="afterrecog">
<Heading>After successful recognition</Heading>

This chapter explains, what one can do with recognition nodes
after a successful recognition (and possibly verification).<P/>

Of course, one can inspect the whole tree of recognition nodes
just by looking at the stored attribute values. Moreover, constructive
membership tests can be performed using the function
<Ref Func="SLPforElement"/>, thereby writing an arbitrary element
in terms of the nice generators, which are stored in the attribute
<Ref Attr="NiceGens"/>. If <K>fail</K> is returned, then the
element in question does not lie in the recognised group or
the recognition made an error.<P/>

Here is an example of a successful recognition tree:

<Log>
<![CDATA[gap> g := DirectProduct(SymmetricGroup(12),SymmetricGroup(5));
Group([ (1,2,3,4,5,6,7,8,9,10,11,12), (1,2), (13,14,15,16,17), (13,14) ])
gap> ri := RecogniseGroup(g);
#I  Finished rank 90 method "NonTransitive": success.
#I  Going to the image (depth=0, try=1).
#I  Finished rank 95 method "MovesOnlySmallPoints": success.
#I  Back from image (depth=0).
#I  Calculating preimages of nice generators.
#I  Creating 20 random generators for kernel.
....................
#I  Going to the kernel (depth=0).
#I  Finished rank 80 method "Giant": success.
#I  Back from kernel (depth=0).
<recognition node NonTransitive
 F:<recognition node MovesOnlySmallPoints Size=120>
 K:<recognition node Giant Size=479001600>>]]>
</Log>

One sees that the recursive process runs, first it finds that the
permutation action is not transitive, a homomorphism is found by mapping
onto the action on one of the orbits. The image is recognised to permute
only a few points. The kernel is recognised to be a full symmetric group
in its natural action on at least 10 points (recognised as <Q>Giant</Q>).
<P/>

After this, we can write arbitrary group elements in the group <C>g</C>
in terms of the nice generators:

<Log>
<![CDATA[
gap> x := PseudoRandom(g);
(1,12)(2,5,9,11,10,3,4)(7,8)(13,14,16,15,17)
gap> slp := SLPforElement(ri,x);
<straight line program>
gap> ResultOfStraightLineProgram(slp,NiceGens(ri));
(1,12)(2,5,9,11,10,3,4)(7,8)(13,14,16,15,17)]]>
</Log>

Note that this example only works by using also the
<Package>recog</Package> package which contains the necessary recognition
methods.

<Section>
    <Heading>Functions and methods for recognition nodes</Heading>

If you need an element explicitly written in terms of the original
generators, you can use the following function:

<#Include Label="SLPforNiceGens">

<ManSection>
<Meth Name="\in" Arg="x, ri"/>
<Returns><K>true</K> or <K>false</K></Returns>
<Description>
    This method tests, whether the element <A>x</A> lies in the group
    recognised by the recognition node <A>ri</A>. Note that
    this is only a convenience method, in fact <Ref
        Func="SLPforElement"/> is used and the resulting straight line
    program is thrown away.
</Description>
</ManSection>

<ManSection>
<Meth Name="Size" Arg="ri"/>
<Returns>the size of the recognised group</Returns>
<Description>
    This method calculates the size of the recognised group
    by multiplying the size of the image and the kernel recursively.
    It is assumed that leaf nodes know already or can calculate the
    size of their group.
</Description>
</ManSection>

<#Include Label="DisplayCompositionFactors">

</Section>

<!-- ############################################################ -->

</Chapter>
