PreImage( bij, img )
In this form PreImage
returns the preimage of the element img of the
range of the bijection bij under bij. The preimage is the unique
element of the source of bij that is mapped by bij to img. Note
that bij must be a bijection, a mapping that is not a bijection is not
allowed (see PreImages).
gap> g := Group( (1,2,3,4), (2,4), (5,6,7) );; g.name := "g";; gap> p4 := MappingByFunction( g, g, x -> x^4 ); MappingByFunction( g, g, function ( x ) return x ^ 4; end ) gap> PreImage( p4, (5,6,7) ); Error, <bij> must be a bijection, not an arbitrary mapping gap> p5 := MappingByFunction( g, g, x -> x^5 ); MappingByFunction( g, g, function ( x ) return x ^ 5; end ) gap> PreImage( p5, (2,4)(5,6,7) ); (2,4)(5,7,6)
PreImage( bij, imgs )
In this form PreImage
returns the preimage of the elements imgs of
the range of the bijection bij under bij. The primage of imgs is
the set of all preimages of the elements in imgs. imgs may be a
proper set (see Set) or a domain (see Domains). The result will be a
subset of the source of bij, either as a proper set or as a domain.
Again bij must be a bijection, a mapping that is not a bijection is not
allowed (see PreImages).
gap> PreImage( p4, [ (), (5,6,7) ] ); [ (), (5,6,7), (2,4), (2,4)(5,6,7), (1,2)(3,4), (1,2)(3,4)(5,6,7), (1,2,3,4), (1,2,3,4)(5,6,7), (1,3), (1,3)(5,6,7), (1,3)(2,4), (1,3)(2,4)(5,6,7), (1,4,3,2), (1,4,3,2)(5,6,7), (1,4)(2,3), (1,4)(2,3)(5,6,7) ] gap> PreImage( p5, Subgroup( g, [ (5,7,6), (2,4) ] ) ); [ (), (5,6,7), (5,7,6), (2,4), (2,4)(5,6,7), (2,4)(5,7,6) ]
PreImage( map )
In this form PreImage
returns the preimage of the mapping map. The
preimage is the set of elements elm of the source of map that are
actually mapped to at least one element, i.e., for which PreImages(
map, elm )
is nonempty. Note that in this case the argument may be
an arbitrary mapping (especially a multi valued one).
gap> PreImage( p4 ) = g; true
PreImage
firsts checks in which form it is called.
In the first case it calls bij.operations.PreImageElm( bij, elm )
and returns this value.
The default function called this way is MappingOps.PreImageElm
, which
checks that bij is indeed a bijection, calls PreImages( bij, elm
)
, and returns the single element of the set returned by PreImages
.
Look in the index under PreImage to see for which mappings this
function is overlaid.
In the second case it calls bij.operations.PreImageSet( bij, elms
)
and returns this value.
The default function called this way is MappingOps.PreImageSet
, which
checks that map is indeed a bijection, calls PreImages( bij, elms
)
, and returns this value. Look in the index under PreImage to see
for which mappings this is overlaid.
In the third case it tests if the field map.preImage
is bound. If
this field is bound, it simply returns this value. Otherwise it calls
map.operations.PreImageRange( map )
, remembers the returned value
in map.preImage
, and returns it.
The default function called this way is MappingOps.PreImageRange
, which
calls PreImages( map, map.source )
, and returns this value. This
function is seldom overlaid, since all the work is done by
map.operations.PreImagesSet
.
GAP 3.4.4