IsMapping( map )
IsMapping returns true if the general mapping map is single valued
and false otherwise. Signals an error if map is not a general
mapping.
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> IsMapping( p4 );
true
gap> IsMapping( InverseMapping( p4 ) );
false # note that the inverse mapping is multi valued
gap> p5 := MappingByFunction( g, g, x -> x^5 );
MappingByFunction( g, g, function ( x )
return x ^ 5;
end )
gap> IsMapping( p5 );
true
gap> IsMapping( InverseMapping( p5 ) );
true # 'p5' is a bijection
IsMapping first tests if the flag map.isMapping is bound. If the
flag is bound, it returns its value. Otherwise it calls
map.operations.IsMapping( map ), remembers the returned value in
map.isMapping, and returns it.
The default function called this way is MappingOps.IsMapping, which
computes the sets of images of all the elements in the source of map,
provided this is finite, and returns true if all those sets have size
one. Look in the index under IsMapping to see for which mappings this
function is overlaid.
GAP 3.4.4