InverseMapping( map )
InverseMapping
returns the inverse mapping of the mapping map. The
inverse mapping inv is a mapping with source map.range
, range
map.source
, such that each element elm of its source is mapped to
the set PreImages( map, elm )
(see PreImages). map may be a
multi valued 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> i4 := InverseMapping( p4 ); InverseMapping( MappingByFunction( g, g, function ( x ) return x ^ 4; end ) ) gap> Images( i4, () ); [ (), (2,4), (1,2)(3,4), (1,2,3,4), (1,3), (1,3)(2,4), (1,4,3,2), (1,4)(2,3) ]
InverseMapping
first tests if the field map.inverseMapping
is
bound. If the field is bound, it returns its value. Otherwise it calls
map.operations.InverseMapping( map )
, remembers the returned value
in map.inverseMapping
, and returns it.
The default function called this way is MappingOps.InverseMapping
,
which constructs a new mapping inv. This new mapping remembers map
as its own inverse mapping in inv.inverseMapping
and delegates
everything to it. For example to compute Image( inv, elm )
,
inv.operations.ImageElm
calls PreImage(inv.inverseMapping,elm)
.
Special types of mappings will overlay this default function with more
efficient functions.
GAP 3.4.4