home *** CD-ROM | disk | FTP | other *** search
/ Math Solutions 1995 October / Math_Solutions_CD-ROM_Walnut_Creek_October_1995.iso / pc / mac / discrete / doc / mapping.tex < prev    next >
Encoding:
Text File  |  1993-05-05  |  42.1 KB  |  1,088 lines

  1. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2. %%
  3. %A  mapping.tex                 GAP documentation            Martin Schoenert
  4. %%
  5. %A  @(#)$Id: mapping.tex,v 3.5 1993/02/19 10:48:42 gap Exp $
  6. %%
  7. %Y  Copyright 1990-1992,  Lehrstuhl D fuer Mathematik,  RWTH Aachen,  Germany
  8. %%
  9. %%  This  file  describes   mappings,   their   functions   and   operations.
  10. %%
  11. %H  $Log: mapping.tex,v $
  12. %H  Revision 3.5  1993/02/19  10:48:42  gap
  13. %H  adjustments in line length and spelling
  14. %H
  15. %H  Revision 3.4  1993/02/11  15:52:14  martin
  16. %H  improved a comment in "Comparisons"
  17. %H
  18. %H  Revision 3.3  1993/02/08  15:56:55  felsch
  19. %H  examples fixed
  20. %H
  21. %H  Revision 3.2  1992/03/27  16:51:48  martin
  22. %H  added examples
  23. %H
  24. %H  Revision 3.1  1992/03/25  15:40:06  martin
  25. %H  initial revision under RCS
  26. %H
  27. %%
  28. \Chapter{Mappings}
  29.  
  30. A *mapping* is an object that maps each element of its source to a value
  31. in its range.
  32.  
  33. Precisely, a mapping is a triple.  The *source* is a set of objects.  The
  34. *range* is another set of objects.  The *relation* is a subset $S$ of the
  35. cartesian product  of  the  source  with  the range, such  that for  each
  36. element $elm$ of  the source there is exactly  one element  $img$ of  the
  37. range, so that the pair  $(elm,img)$ lies  in $S$.  This $img$ is  called
  38. the image of  $elm$  under the mapping, and we say that the  mapping maps
  39. $elm$ to $img$.
  40.  
  41. A  *multi valued mapping* is  an  object  that maps  each element  of its
  42. source to a set of values in its range.
  43.  
  44. Precisely,  a multi valued mapping is a triple.  The *source* is a set of
  45. objects.   The *range* is another set  of objects.  The *relation*  is  a
  46. subset $S$ of the  cartesian product of  the  source with the range.  For
  47. each  element  $elm$ of the  source  the  set  $img$  such  that the pair
  48. $(elm,img)$ lies in $S$ is called the set of *images* of $elm$ under  the
  49. mapping, and we say that the mapping maps $elm$ to this set.
  50.  
  51. Thus a mapping is a  special case of a multi valued mapping where the set
  52. of  images of  each element of the source contains  exactly one  element,
  53. which is then called the image of the element under the mapping.
  54.  
  55. Mappings    are   created    by    *mapping    constructors*    such   as
  56. 'MappingByFunction'  (see  "MappingByFunction") or  'NaturalHomomorphism'
  57. (see "NaturalHomomorphism").
  58.  
  59. This  chapter contains sections  that  describe the  functions that  test
  60. whether  an  object  is  a  mapping  (see "IsGeneralMapping"), whether  a
  61. mapping  is single valued (see  "IsMapping"), and  the various  functions
  62. that  test if such a mapping has a  certain property (see  "IsInjective",
  63. "IsSurjective",    "IsBijection",   "IsHomomorphism",   "IsMonomorphism",
  64. "IsEpimorphism", "IsIsomorphism", "IsEpimorphism", and "IsAutomorphism").
  65.  
  66. Next  this chapter  contains functions that  describe  how  mappings  are
  67. compared  (see  "Comparisons  of Mappings")  and the operations  that are
  68. applicable to mappings (see "Operations for Mappings").
  69.  
  70. Next this chapter contains sections that describe the functions that deal
  71. with the  images and preimages of elements  under  mappings (see "Image",
  72. "Images",   "ImagesRepresentative",   "PreImage",     "PreImages",    and
  73. "PreImagesRepresentative").
  74.  
  75. Next  this  chapter contains sections that  describe the  functions  that
  76. compute  the  composition  of two mappings,  the  power of a mapping, the
  77. inverse of a mapping, and the  identity mapping  on a certain domain (see
  78. "CompositionMapping",     "PowerMapping",      "InverseMapping",      and
  79. "IdentityMapping").
  80.  
  81. Finally this chapter also contains a section  that describes how mappings
  82. are represented internally (see "Mapping Records").
  83.  
  84. The   functions   described   in   this   chapter   are   in   the   file
  85. '<libname>/\"mapping.g\"'.
  86.  
  87. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  88. \Section{IsGeneralMapping}
  89.  
  90. 'IsGeneralMapping( <obj> )'
  91.  
  92. 'IsGeneralMapping'  returns  'true'  if the  object  <obj>  is a  mapping
  93. (possibly multi valued) and 'false' otherwise.
  94.  
  95. |    gap> g := Group( (1,2,3,4), (2,4), (5,6,7) );;  g.name := "g";;
  96.     gap> p4 := MappingByFunction( g, g, x -> x^4 );
  97.     MappingByFunction( g, g, function ( x )
  98.         return x ^ 4;
  99.     end )
  100.     gap> IsGeneralMapping( p4 );
  101.     true
  102.     gap> IsGeneralMapping( InverseMapping( p4 ) );
  103.     true    # note that the inverse mapping is multi valued
  104.     gap> IsGeneralMapping( x -> x^4 );
  105.     false    # a function is not a mapping |
  106.  
  107. See  "MappingByFunction"  for  the definition of  'MappingByFunction' and
  108. "InverseMapping" for 'InverseMapping'.
  109.  
  110. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  111. \Section{IsMapping}
  112.  
  113. 'IsMapping( <map> )'
  114.  
  115. 'IsMapping' returns 'true' if the general mapping <map>  is single valued
  116. and  'false'  otherwise.   Signals  an  error if  <map> is  not a general
  117. mapping.
  118.  
  119. |    gap> g := Group( (1,2,3,4), (2,4), (5,6,7) );;  g.name := "g";;
  120.     gap> p4 := MappingByFunction( g, g, x -> x^4 );
  121.     MappingByFunction( g, g, function ( x )
  122.         return x ^ 4;
  123.     end )
  124.     gap> IsMapping( p4 );
  125.     true
  126.     gap> IsMapping( InverseMapping( p4 ) );
  127.     false    # note that the inverse mapping is multi valued
  128.     gap> p5 := MappingByFunction( g, g, x -> x^5 );
  129.     MappingByFunction( g, g, function ( x )
  130.         return x ^ 5;
  131.     end )
  132.     gap> IsMapping( p5 );
  133.     true
  134.     gap> IsMapping( InverseMapping( p5 ) );
  135.     true    # 'p5' is a bijection |
  136.  
  137. 'IsMapping' first tests if the  flag '<map>.isMapping'  is bound.  If the
  138. flag   is   bound,   it   returns  its   value.    Otherwise   it   calls
  139. '<map>.operations.IsMapping( <map> )',  remembers the  returned  value in
  140. '<map>.isMapping', and returns it.
  141.  
  142. The default  function  called  this way is  'MappingOps.IsMapping', which
  143. computes the sets of images of  all the elements in  the source of <map>,
  144. provided  this is finite,  and returns 'true' if all those sets have size
  145. one.  Look in the index under *IsMapping* to see for  which mappings this
  146. function is overlaid.
  147.  
  148. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  149. \Section{IsInjective}
  150.  
  151. 'IsInjective( <map> )'
  152.  
  153. 'IsInjective'  returns  'true'  if  the  mapping  <map> is  injective and
  154. 'false' otherwise.  Signals an error if <map> is a multi valued mapping.
  155.  
  156. A mapping $map$  is *injective* if for  each element  $img$  of the range
  157. there  is at most one  element $elm$  of the  source that  $map$ maps  to
  158. $img$.
  159.  
  160. |    gap> g := Group( (1,2,3,4), (2,4), (5,6,7) );;  g.name := "g";;
  161.     gap> p4 := MappingByFunction( g, g, x -> x^4 );
  162.     MappingByFunction( g, g, function ( x )
  163.         return x ^ 4;
  164.     end )
  165.     gap> IsInjective( p4 );
  166.     false
  167.     gap> IsInjective( InverseMapping( p4 ) );
  168.     Error, <map> must be a single valued mapping
  169.     gap> p5 := MappingByFunction( g, g, x -> x^5 );
  170.     MappingByFunction( g, g, function ( x )
  171.         return x ^ 5;
  172.     end )
  173.     gap> IsInjective( p5 );
  174.     true
  175.     gap> IsInjective( InverseMapping( p5 ) );
  176.     true    # 'p5' is a bijection |
  177.  
  178. 'IsInjective' first tests if  the flag '<map>.isInjective'  is bound.  If
  179. the   flag   is  bound,  it  returns   this value.   Otherwise   it calls
  180. '<map>.operations.isInjective( <map> )', remembers  the returned value in
  181. '<map>.isInjective', and returns  it. 
  182.  
  183. The default  function called this  way is 'MappingOps.IsInjective', which
  184. compares  the sizes of the source and image of <map>, and  returns 'true'
  185. if they are equal (see "Image").  Look  in  the index under *IsInjective*
  186. to see for which mappings this function is overlaid.
  187.  
  188. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  189. \Section{IsSurjective}
  190.  
  191. 'IsSurjective( <map> )'
  192.  
  193. 'IsSurjective' returns  'true'  if  the mapping <map> is  surjective  and
  194. 'false' otherwise.  Signals an  error if <map> is a multi valued mapping.
  195.  
  196. A mapping  $map$ is *surjective* if for each element $img$  of the  range
  197. there  is at  least  one  element $elm$  of the source that $map$ maps to
  198. $img$.
  199.  
  200. |    gap> g := Group( (1,2,3,4), (2,4), (5,6,7) );;  g.name := "g";;
  201.     gap> p4 := MappingByFunction( g, g, x -> x^4 );
  202.     MappingByFunction( g, g, function ( x )
  203.         return x ^ 4;
  204.     end )
  205.     gap> IsSurjective( p4 );
  206.     false
  207.     gap> IsSurjective( InverseMapping( p4 ) );
  208.     Error, <map> must be a single valued mapping
  209.     gap> p5 := MappingByFunction( g, g, x -> x^5 );
  210.     MappingByFunction( g, g, function ( x )
  211.         return x ^ 5;
  212.     end )
  213.     gap> IsSurjective( p5 );
  214.     true
  215.     gap> IsSurjective( InverseMapping( p5 ) );
  216.     true    # 'p5' is a bijection |
  217.  
  218. 'IsSurjective' first tests if the flag '<map>.isSurjective' is bound.  If
  219. the   flag  is bound,  it   returns this    value.  Otherwise    it calls
  220. '<map>.operations.IsSurjective( <map> )', remembers the returned value in
  221. '<map>.isSurjective', and returns  it.
  222.  
  223. The default function called this  way is 'MappingOps.IsSurjective', which
  224. compares the sizes of the range and image of <map>, and returns 'true' if
  225. they are equal (see "Image").  Look in the  index under *IsSurjective* to
  226. see for which mappings this function is overlaid.
  227.  
  228. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  229. \Section{IsBijection}
  230.  
  231. 'IsBijection( <map> )'
  232.  
  233. 'IsBijection'  returns 'true'  if the  mapping  <map> is a bijection  and
  234. 'false' otherwise.  Signals an error if <map> is a multi valued mapping.
  235.  
  236. A mapping $map$ is a *bijection* if  for each  element $img$ of the range
  237. there is exactly  one  element  $elm$  of the  source that $map$ maps  to
  238. $img$.  We also say that $map$ is *bijective*.
  239.  
  240. |    gap> g := Group( (1,2,3,4), (2,4), (5,6,7) );;  g.name := "g";;
  241.     gap> p4 := MappingByFunction( g, g, x -> x^4 );
  242.     MappingByFunction( g, g, function ( x )
  243.         return x ^ 4;
  244.     end )
  245.     gap> IsBijection( p4 );
  246.     false
  247.     gap> IsBijection( InverseMapping( p4 ) );
  248.     Error, <map> must be a single valued mapping
  249.     gap> p5 := MappingByFunction( g, g, x -> x^5 );
  250.     MappingByFunction( g, g, function ( x )
  251.         return x ^ 5;
  252.     end )
  253.     gap> IsBijection( p5 );
  254.     true
  255.     gap> IsBijection( InverseMapping( p5 ) );
  256.     true    # 'p5' is a bijection |
  257.  
  258. 'IsBijection' first tests if  the flag '<map>.isBijection'  is bound.  If
  259. the   flag is  bound,    it    returns its  value.   Otherwise it   calls
  260. '<map>.operations.IsBijection( <map> )', remembers  the returned value in
  261. '<map>.isBijection', and  returns it.
  262.  
  263. The  default function called this  way is 'MappingOps.IsBijection', which
  264. calls 'IsInjective' and 'IsSurjective',  and returns the logical *and* of
  265. the  results.   This  function  is   seldom  overlaid,  because  all  the
  266. interesting work is done by 'IsInjective' and 'IsSurjective'.
  267.  
  268. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  269. \Section{Comparisons of Mappings}
  270.  
  271. '<map1> = <map2>' \\
  272. '<map1> \<> <map2>'
  273.  
  274. The  equality operator  '=' applied  to two  mappings  <map1>  and <map2>
  275. evaluates to 'true' if   the   two mappings    are equal and   to 'false'
  276. otherwise.  The unequality operator '\<>' applied  to two mappings <map1>
  277. and <map2> evaluates to 'true' if the  two mappings are  not equal and to
  278. 'false' otherwise.  A  mapping can also  be compared  with another object
  279. that is not a mapping, of course they are never equal.
  280.  
  281. Two mappings are considered equal if and only if their sources are equal,
  282. their ranges are equal, and for each elment <elm> of  the source 'Images(
  283. <map1>, <elm> )' is equal to 'Images( <map2>, <elm> )' (see "Images").
  284.  
  285. |    gap> g := Group( (1,2,3,4), (2,4), (5,6,7) );;  g.name := "g";;
  286.     gap> p4 := MappingByFunction( g, g, x -> x^4 );
  287.     MappingByFunction( g, g, function ( x )
  288.         return x ^ 4;
  289.     end )
  290.     gap> p13 := MappingByFunction( g, g, x -> x^13 );
  291.     MappingByFunction( g, g, function ( x )
  292.         return x ^ 13;
  293.     end )
  294.     gap> p4 = p13;
  295.     false
  296.     gap> p13 = IdentityMapping( g );
  297.     true |
  298.  
  299. '<map1> \<\ <map2>' \\
  300. '<map1> \<= <map2>' \\
  301. '<map1> >   <map2>' \\
  302. '<map1> >=  <map2>'
  303.  
  304. The  operators  '\<',  '\<=', '>',  and   '>='   applied  to two mappings
  305. evaluates to   'true'  if <map1> is less   than, less than  or  equal to,
  306. greater than, or greater than or equal to  <map2>  and 'false' otherwise.
  307. A mapping can also be compared with another object that is not a mapping,
  308. everything except booleans, strings, lists, and records is smaller than a
  309. mapping.
  310.  
  311. If the source of <map1> is less than the source of <map2>, then <map1> is
  312. considered to be less  than <map2>.  If  the sources  are  equal  and the
  313. range  of <map1> is less  than   the  range of   <map2>,  then <map1>  is
  314. considered  to be less than  <map2>.  If the  sources and the ranges  are
  315. equal the  mappings are compared lexicographically with   respect  to the
  316. sets of images of the elements of the source under the mappings.
  317.  
  318. |    gap> g := Group( (1,2,3,4), (2,4), (5,6,7) );;  g.name := "g";;
  319.     gap> p4 := MappingByFunction( g, g, x -> x^4 );
  320.     MappingByFunction( g, g, function ( x )
  321.         return x ^ 4;
  322.     end )
  323.     gap> p5 := MappingByFunction( g, g, x -> x^5 );
  324.     MappingByFunction( g, g, function ( x )
  325.         return x ^ 5;
  326.     end )
  327.     gap> p4 < p5;
  328.     true    # since '(5,6,7)' is the smallest nontrivial element of 'g'
  329.             # and the image of '(5,6,7)' under 'p4' is smaller
  330.             # than the image of '(5,6,7)' under 'p5' |
  331.  
  332. The  operator  '=' calls  '<map2>.operations.=(  <map1>,  <map2>  )'  and
  333. returns this value.  The operator '\<>' also calls  '<map2>.operations.=(
  334. <map1>, <map2> )' and returns the logical *not* of this value.
  335.  
  336. The  default  function  called this  way is  'MappingOps.=', which  first
  337. compares  the sources of  <map1> and  <map2>, then, if  they  are  equal,
  338. compares the ranges of <map1> and <map2>, and then, if both are equal and
  339. the source is finite, compares the images of all  elements of the  source
  340. under <map1> and <map2>.  Look  in the index under *equality*  to see for
  341. which mappings this function is overlaid.
  342.  
  343. The  operator  '\<'  calls  '<map2>.operations.\<( <map1>, <map2> )'  and
  344. returns this  value.  The  operator  '\<='  calls  '<map2>.operations.\<(
  345. <map2>, <map1> )'  and returns  the logical  *not*  of  this value.   The
  346. operator '>' calls '<map2>.operations.\<( <map2>, <map1>  )' and  returns
  347. this  value.   The  operator  '>=' calls  '<map2>.operations.\<(  <map1>,
  348. <map2> )' and returns the logical *not* of this value.
  349.  
  350. The  default function called this way  is  'MappingOps.\<',  which  first
  351. compares the sources  of  <map1> and  <map2>, then, if  they  are  equal,
  352. compares the ranges of <map1> and <map2>, and then, if both are equal and
  353. the source is finite, compares the  images of  all elements of the source
  354. under <map1>  and <map2>.  Look in the index under *ordering* to  see for
  355. which mappings this function is overlaid.
  356.  
  357. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  358. \Section{Operations for Mappings}
  359.  
  360. '<map1> \*\ <map2>'
  361.  
  362. The product  operator  '\*' applied  to  two  mappings <map1> and  <map2>
  363. evaluates to  the  product of the two  mappings, i.e., the  mapping <map>
  364. that maps each element <elm> of the source of <map1> to the value '(<elm>
  365. \^\  <map1>) \^\ <map2>'.  Note that the range of <map1> must be a subset
  366. of the source of <map2>.  If <map1> and <map2> are homomorphisms then  so
  367. is  the  result.   This  can also  be expressed  as  'CompositionMapping(
  368. <map2>, <map1> )' (see "CompositionMapping").  Note that the arguments of
  369. 'CompositionMapping' are reversed.
  370.  
  371. |    gap> g := Group( (1,2,3,4), (2,4), (5,6,7) );;  g.name := "g";;
  372.     gap> p4 := MappingByFunction( g, g, x -> x^4 );
  373.     MappingByFunction( g, g, function ( x )
  374.         return x ^ 4;
  375.     end )
  376.     gap> p5 := MappingByFunction( g, g, x -> x^5 );
  377.     MappingByFunction( g, g, function ( x )
  378.         return x ^ 5;
  379.     end )
  380.     gap> p20 := p4 * p5;
  381.     CompositionMapping( MappingByFunction( g, g, function ( x )
  382.         return x ^ 5;
  383.     end ), MappingByFunction( g, g, function ( x )
  384.         return x ^ 4;
  385.     end ) ) |
  386.  
  387. '<list> \*\ <map>' \\
  388. '<map> \*\ <list>'
  389.  
  390. As with  every other type of group  elements  a mapping <map> can also be
  391. multiplied  with a  list of  mappings <list>.   The result is a new list,
  392. such that each entry is  the product of the corresponding entry of <list>
  393. with <map> (see "Operations for Lists").
  394.  
  395. '<elm> \^\ <map>'
  396.  
  397. The  power operator '\^' applied to an element <elm> and  a mapping <map>
  398. evaluates to  the  image of <elm> under <map>,  i.e., the element  of the
  399. range to which <map> maps <elm>.  Note that <map> must be a single valued
  400. mapping, a multi valued mapping is not allowed (see "Images").  This  can
  401. also be expressed as 'Image( <map>, <elm> )' (see "Image").
  402.  
  403. |    gap> (1,2,3,4) ^ p4;
  404.     ()
  405.     gap> (2,4)(5,6,7) ^ p20;
  406.     (5,7,6) |
  407.  
  408. '<map> \^\ 0'
  409.  
  410. The power operator '\^' applied to a mapping <map>, for  which  the range
  411. must  be  a  subset of  the source, and the integer '0' evaluates  to the
  412. identity mapping on the source of <map>, i.e., the mapping that maps each
  413. element of the  source to  itself.  If <map> is a homomorphism then so is
  414. the result.  This can also be expressed as 'IdentityMapping( <map>.source
  415. )' (see "IdentityMapping").
  416.  
  417. |    gap> p20 ^ 0;
  418.     IdentityMapping( g ) |
  419.  
  420. '<map> \^\ <n>'
  421.  
  422. The power  operator '\^'  applied to a mapping <map>, for which the range
  423. must be a subset of the source, and an positive integer <n>  evaluates to
  424. the <n>-fold composition of <map>.  If <map> is a homomorphism then so is
  425. the result.  This  can also be  expressed as 'PowerMapping( <map>, <n> )'
  426. (see "PowerMapping").
  427.  
  428. |    gap> p16 := p4 ^ 2;
  429.     CompositionMapping( CompositionMapping( IdentityMapping( g ),
  430.     MappingByFunction( g, g, function ( x )
  431.         return x ^ 4;
  432.     end ) ), CompositionMapping( IdentityMapping( g ),
  433.     MappingByFunction( g, g, function ( x )
  434.         return x ^ 4;
  435.     end ) ) )
  436.     gap> p16 = MappingByFunction( g, g, x -> x^16 );
  437.     true |
  438.  
  439. '<bij> \^\ -1'
  440.  
  441. The power operator '\^' applied to a bijection <bij> and the integer '-1'
  442. evaluates to the inverse mapping  of <bij>,  i.e., the mapping that  maps
  443. each element <img> of the range of <bij> to the uniq element <elm> of the
  444. source of <bij> that maps to <img>.  Note that <bij> must be a bijection,
  445. a mapping  that  is not  a bijection is not allowed.   This can  also  be
  446. expressed as 'InverseMapping( <bij> )' (see "InverseMapping").
  447.  
  448. |    gap> p5 ^ -1;
  449.     InverseMapping( MappingByFunction( g, g, function ( x )
  450.         return x ^ 5;
  451.     end ) )
  452.     gap> p4 ^ -1;
  453.     Error, <lft> must be a bijection |
  454.  
  455. '<bij> \^\ <z>'
  456.  
  457. The  power  operator '\^'  applied to a  bijection  <bij>, for  which the
  458. source and  the  range  must  be equal, and  an integer  <z>  returns the
  459. <z>-fold composition of <bij>.  If <z> is 0 or positive see above, if <z>
  460. is negative, this is  equivalent to '(<bij> \^\ -1) \^\ -<z>'.  If  <bij>
  461. is an automorphism then so is  the result.
  462.  
  463. '<aut1> \^\ <aut2>'
  464.  
  465. The power operator '\^' applied to  two  automorphisms <aut1> and <aut2>,
  466. which must have equal sources (and thus ranges)  returns the conjugate of
  467. <aut1> by  <aut2>, i.e.,  '<aut2> \^\ -1  \*\ <aut1>  \*\  <aut2>'.   The
  468. result if of course again an automorphism.
  469.  
  470. The operator  '\*'  calls '<map2>.operations.\*(   <map1>, <map2>  )' and
  471. returns this value.
  472.  
  473. The  default function called  this  way is  'MappingOps.\*'  which  calls
  474. 'CompositionMapping' to  do  the work.  This function is seldom overlaid,
  475. since 'CompositionMapping' does all the interesting work.
  476.  
  477. The  operator  '\^' calls  '<map>.operations.\^(  <map1>,  <map2>  )' and
  478. returns this value.
  479.  
  480. The  default  function  called this  way is  'MappingOps.\^', which calls
  481. 'Image', 'IdentityMapping', 'InverseMapping', or 'PowerMapping' to do the
  482. work.     This   function    is   seldom    overlaid,   since    'Image',
  483. 'IdentityMapping',  'InverseMapping',   and  'PowerMapping'  do  all  the
  484. interesting work.
  485.  
  486. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  487. \Section{Image}
  488.  
  489. 'Image( <map>, <elm> )'
  490.  
  491. In this form 'Image' returns the image of the element <elm> of the source
  492. of the mapping <map> under <map>, i.e., the element of the range to which
  493. <map>  maps <elm>.   Note  that  <map> must be a single valued mapping, a
  494. multi  valued  mapping is not  allowed (see  "Images").  This can also be
  495. expressed as '<elm> \^\ <map>' (see "Operations for Mappings").
  496.  
  497. |    gap> g := Group( (1,2,3,4), (2,4), (5,6,7) );;  g.name := "g";;
  498.     gap> p4 := MappingByFunction( g, g, x -> x^4 );
  499.     MappingByFunction( g, g, function ( x )
  500.         return x ^ 4;
  501.     end )
  502.     gap> Image( p4, (2,4)(5,6,7) );
  503.     (5,6,7)
  504.     gap> p5 := MappingByFunction( g, g, x -> x^5 );
  505.     MappingByFunction( g, g, function ( x )
  506.         return x ^ 5;
  507.     end )
  508.     gap> Image( p5, (2,4)(5,6,7) );
  509.     (2,4)(5,7,6) |
  510.  
  511. 'Image( <map>, <elms> )'
  512.  
  513. In this form  'Image' returns the  image of the set of elements <elms> of
  514. the source  of the mapping <map> under <map>,  i.e., set of images of the
  515. elements in <elms>.  <elms> may be a proper set (see "Sets") or a  domain
  516. (see  "Domains").   The result will be  a subset  of the  range of <map>,
  517. either as a proper set  or  as  a  domain.  Again <map> must be a  single
  518. valued mapping, a multi valued mapping is not allowed (see "Images").
  519.  
  520. |    gap> Image( p4, Subgroup( g, [ (2,4), (5,6,7) ] ) );
  521.     [ (), (5,6,7), (5,7,6) ]
  522.     gap> Image( p5, [ (5,6,7), (2,4) ] );
  523.     [ (5,7,6), (2,4) ] |
  524.  
  525. Note that in the  first example, the  result is returned as a proper set,
  526. even though it is mathematically a subgroup.  This is because 'p4' is not
  527. known to be a homomorphism, even though it is one.
  528.  
  529. 'Image( <map> )'
  530.  
  531. In  this form 'Image' returns the image of the  mapping <map>, i.e.,  the
  532. subset  of element  of  the range  of <map>  that are  actually values of
  533. <map>.  Note that in  this case the argument may also be  a multi  valued
  534. mapping.
  535.  
  536. |    gap> Image( p4 );
  537.     [ (), (5,6,7), (5,7,6) ]
  538.     gap> Image( p5 ) = g;
  539.     true |
  540.  
  541. 'Image' firsts checks in which form it is called.
  542.  
  543. In the  first case it  calls '<map>.operations.ImageElm(  <map>, <elm> )'
  544. and returns this value.
  545.  
  546. The  default function called  this  way  is  'MappingOps.ImageElm', which
  547. checks that <map>  is  indeed  a single  valued  mapping,  calls 'Images(
  548. <map>, <elm> )', and  returns  the single element of the set  returned by
  549. 'Images'.  Look in the index under *Image* to see for which mappings this
  550. function is overlaid.
  551.  
  552. In the second case it calls '<map>.operations.ImageSet( <map>,  <elms> )'
  553. and returns this value.
  554.  
  555. The default  function  called this  way is  'MappingOps.ImageSet',  which
  556. checks that  <map>  is  indeed a  single valued  mapping,  calls 'Images(
  557. <map>, <elms>  )',  and returns  this  value.   Look  in the index  under
  558. *Image* to see for which mappings this function is overlaid.
  559.  
  560. In the third case  it tests if the field '<map>.image' is bound.  If this
  561. field  is  bound,  it  simply  returns this value.   Otherwise  it  calls
  562. '<map>.operations.ImageSource( <map> )', remembers the returned  value in
  563. '<map>.image', and returns it.
  564.  
  565. The default function  called this way is  'MappingOps.ImageSource', which
  566. calls 'Images(  <map>,  <map>.source  )',  and returns  this value.  This
  567. function  is  seldom   overlaid,  since   all   the   work  is   done  by
  568. '<map>.operations.ImagesSet'.
  569.  
  570. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  571. \Section{Images}
  572.  
  573. 'Images( <map>, <elm> )'
  574.  
  575. In this form 'Images' returns the set of images  of the element  <elm> in
  576. the source of the mapping <map> under <map>.  <map> may be a multi valued
  577. mapping.
  578.  
  579. |    gap> g := Group( (1,2,3,4), (2,4), (5,6,7) );;  g.name := "g";;
  580.     gap> p4 := MappingByFunction( g, g, x -> x^4 );
  581.     MappingByFunction( g, g, function ( x )
  582.         return x ^ 4;
  583.     end )
  584.     gap> i4 := InverseMapping( p4 );
  585.     InverseMapping( MappingByFunction( g, g, function ( x )
  586.         return x ^ 4;
  587.     end ) )
  588.     gap> IsMapping( i4 );
  589.     false    # 'i4' is multi valued
  590.     gap> Images( i4, () );
  591.     [ (), (2,4), (1,2)(3,4), (1,2,3,4), (1,3), (1,3)(2,4), (1,4,3,2),
  592.       (1,4)(2,3) ]
  593.     gap> p5 := MappingByFunction( g, g, x -> x^5 );
  594.     MappingByFunction( g, g, function ( x )
  595.         return x ^ 5;
  596.     end )
  597.     gap> i5 := InverseMapping( p5 );
  598.     InverseMapping( MappingByFunction( g, g, function ( x )
  599.         return x ^ 5;
  600.     end ) )
  601.     gap> Images( i5, () );
  602.     [ () ] |
  603.  
  604. 'Images( <map>, <elms> )'
  605.  
  606. In this form 'Images'  returns the set of  images of the set of  elements
  607. <elms> in the source  of <map> under  <map>.  <map> may be a multi valued
  608. mapping.   In any case 'Images' returns a set of elements of the range of
  609. <map>,  either as  a  proper  set  (see  "Sets")  or  as  a  domain  (see
  610. "Domains").
  611.  
  612. |    gap> Images( i4, [ (), (5,6,7) ] );
  613.     [ (), (5,6,7), (2,4), (2,4)(5,6,7), (1,2)(3,4), (1,2)(3,4)(5,6,7), 
  614.       (1,2,3,4), (1,2,3,4)(5,6,7), (1,3), (1,3)(5,6,7), (1,3)(2,4), 
  615.       (1,3)(2,4)(5,6,7), (1,4,3,2), (1,4,3,2)(5,6,7), (1,4)(2,3), 
  616.       (1,4)(2,3)(5,6,7) ]
  617.     gap> Images( i5, [ (), (5,6,7) ] );
  618.     [ (), (5,7,6) ] |
  619.  
  620. 'Images' first checks in which form it is called.
  621.  
  622. In the first  case it  calls '<map>.operations.ImagesElm( <map>, <elm> )'
  623. and returns this value.
  624.  
  625. The default  function  called  this way is 'MappingOps.ImagesElm',  which
  626. just raises an error, since their is no default way to compute the images
  627. of an element under a  mapping about which nothing is known.  Look in the
  628. index  under *Images*  to  see  how images are computed  for  the various
  629. mappings.
  630.  
  631. In the second case it calls '<map>.operations.ImagesSet( <map>, <elms> )'
  632. and returns this value.
  633.  
  634. The default  function  called this  way  is 'MappingOps.ImagesSet', which
  635. returns the union of the images of  all the elements  in  the set <elms>.
  636. Look in the index under *Images* to see for which mappings this  function
  637. is overlaid.
  638.  
  639. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  640. \Section{ImagesRepresentative}
  641.  
  642. 'ImagesRepresentative( <map>, <elm> )'
  643.  
  644. 'ImagesRepresentative'  returns a representative of  the set of images of
  645. <elm>  under <map>,  i.e.,  a single element  <img>,  such that '<img> in
  646. Images(  <map>,  <elm> )' (see "Images").   <map>  may be  a multi valued
  647. mapping.
  648.  
  649. |    gap> g := Group( (1,2,3,4), (2,4), (5,6,7) );;  g.name := "g";;
  650.     gap> p4 := MappingByFunction( g, g, x -> x^4 );
  651.     MappingByFunction( g, g, function ( x )
  652.         return x ^ 4;
  653.     end )
  654.     gap> i4 := InverseMapping( p4 );
  655.     InverseMapping( MappingByFunction( g, g, function ( x )
  656.         return x ^ 4;
  657.     end ) )
  658.     gap> IsMapping( i4 );
  659.     false    # 'i4' is multi valued
  660.     gap> ImagesRepresentative( i4, () );
  661.     () |
  662.  
  663. 'ImagesRepresentative' calls \\
  664. '<map>.operations.ImagesRepresentative( <map>, <elm> )'
  665. and returns this value.
  666.  
  667. The       default      function       called       this      way       is
  668. 'MappingOps.ImagesRepresentative', which calls 'Images(  <map>,  <elm> )'
  669. and  returns the first  element  in this set.   Look in  the  index under
  670. *ImagesRepresentative*  to  see  for  which  mappings  this  function  is
  671. overlaid.
  672.  
  673. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  674. \Section{PreImage}
  675.  
  676. 'PreImage( <bij>, <img> )'
  677.  
  678. In this form 'PreImage' returns the preimage  of the element <img> of the
  679. range  of the bijection  <bij>  under <bij>.  The preimage is  the unique
  680. element of the  source of <bij> that is  mapped  by <bij> to <img>.  Note
  681. that <bij> must be a bijection, a mapping that is not a  bijection is not
  682. allowed (see "PreImages").
  683.  
  684. |    gap> g := Group( (1,2,3,4), (2,4), (5,6,7) );;  g.name := "g";;
  685.     gap> p4 := MappingByFunction( g, g, x -> x^4 );
  686.     MappingByFunction( g, g, function ( x )
  687.         return x ^ 4;
  688.     end )
  689.     gap> PreImage( p4, (5,6,7) );
  690.     Error, <bij> must be a bijection, not an arbitrary mapping
  691.     gap> p5 := MappingByFunction( g, g, x -> x^5 );
  692.     MappingByFunction( g, g, function ( x )
  693.         return x ^ 5;
  694.     end )
  695.     gap> PreImage( p5, (2,4)(5,6,7) );
  696.     (2,4)(5,7,6) |
  697.  
  698. 'PreImage( <bij>, <imgs> )'
  699.  
  700. In  this form 'PreImage'  returns the preimage of the  elements <imgs> of
  701. the range of the bijection <bij>  under <bij>.  The  primage of <imgs> is
  702. the set  of all preimages  of the  elements  in <imgs>.   <imgs> may be a
  703. proper set (see "Set") or a domain (see "Domains").  The result will be a
  704. subset of the source  of <bij>, either  as a proper  set or  as a domain.
  705. Again <bij> must be a bijection, a mapping that is not a bijection is not
  706. allowed (see "PreImages").
  707.  
  708. |    gap> PreImage( p4, [ (), (5,6,7) ] );
  709.     [ (), (5,6,7), (2,4), (2,4)(5,6,7), (1,2)(3,4), (1,2)(3,4)(5,6,7), 
  710.       (1,2,3,4), (1,2,3,4)(5,6,7), (1,3), (1,3)(5,6,7), (1,3)(2,4), 
  711.       (1,3)(2,4)(5,6,7), (1,4,3,2), (1,4,3,2)(5,6,7), (1,4)(2,3), 
  712.       (1,4)(2,3)(5,6,7) ]
  713.     gap> PreImage( p5, Subgroup( g, [ (5,7,6), (2,4) ] ) );
  714.     [ (), (5,6,7), (5,7,6), (2,4), (2,4)(5,6,7), (2,4)(5,7,6) ] |
  715.  
  716. 'PreImage( <map> )'
  717.  
  718. In this form 'PreImage' returns the preimage of  the  mapping <map>.  The
  719. preimage is  the set of  elements <elm>  of the source of <map> that  are
  720. actually  mapped  to at least  one element,  i.e.,  for which 'PreImages(
  721. <map>, <elm> )' is nonempty.  Note that in this case the  argument may be
  722. an arbitrary mapping (especially a multi valued one).
  723.  
  724. |    gap> PreImage( p4 ) = g;
  725.     true |
  726.  
  727. 'PreImage' firsts checks in which form it is called.
  728.  
  729. In the first case it calls '<bij>.operations.PreImageElm( <bij>, <elm> )'
  730. and returns this value.
  731.  
  732. The default function called this  way  is 'MappingOps.PreImageElm', which
  733. checks that <bij> is indeed a  bijection, calls 'PreImages(  <bij>, <elm>
  734. )', and returns the single element of the  set returned  by  'PreImages'.
  735. Look in  the  index  under  *PreImage* to see  for  which  mappings  this
  736. function is overlaid.
  737.  
  738. In the second case  it calls '<bij>.operations.PreImageSet( <bij>, <elms>
  739. )' and returns this value.
  740.  
  741. The default  function called  this way is 'MappingOps.PreImageSet', which
  742. checks that <map> is indeed a bijection,  calls 'PreImages( <bij>, <elms>
  743. )',  and  returns  this value.  Look in the index under *PreImage* to see
  744. for which mappings this is overlaid.
  745.  
  746. In the third case it tests  if the field  '<map>.preImage' is bound.   If
  747. this field is bound,  it simply returns  this  value.  Otherwise it calls
  748. '<map>.operations.PreImageRange( <map> )',  remembers  the returned value
  749. in '<map>.preImage', and returns it.
  750.  
  751. The default function called this way is 'MappingOps.PreImageRange', which
  752. calls 'PreImages( <map>, <map>.source  )',  and returns this value.  This
  753. function  is   seldom  overlaid,   since   all  the   work  is  done   by
  754. '<map>.operations.PreImagesSet'.
  755.  
  756. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  757. \Section{PreImages}
  758.  
  759. 'PreImages( <map>, <img> )'
  760.  
  761. In the first form 'PreImages' returns the set of elements from the source
  762. of the mapping <map> that are mapped by <map> to the element <img> in the
  763. range  of <map>,  i.e.,  the set of elements  <elm> such  that  '<img> in
  764. Images(  <map>, <elm>  )' (see "Images").  <map> may  be  a  multi valued
  765. mapping.
  766.  
  767. |    gap> g := Group( (1,2,3,4), (2,4), (5,6,7) );;  g.name := "g";;
  768.     gap> p4 := MappingByFunction( g, g, x -> x^4 );
  769.     MappingByFunction( g, g, function ( x )
  770.         return x ^ 4;
  771.     end )
  772.     gap> PreImages( p4, (5,6,7) );
  773.     [ (5,6,7), (2,4)(5,6,7), (1,2)(3,4)(5,6,7), (1,2,3,4)(5,6,7), 
  774.       (1,3)(5,6,7), (1,3)(2,4)(5,6,7), (1,4,3,2)(5,6,7), 
  775.       (1,4)(2,3)(5,6,7) ]
  776.     gap> p5 := MappingByFunction( g, g, x -> x^5 );
  777.     MappingByFunction( g, g, function ( x )
  778.         return x ^ 5;
  779.     end )
  780.     gap> PreImages( p5, (2,4)(5,6,7) );
  781.     [ (2,4)(5,7,6) ] |
  782.  
  783. 'PreImages( <map>, <imgs> )'
  784.  
  785. In the  second form 'PreImages' returns  the set of all  preimages of the
  786. elements in the set of elements <imgs>, i.e., the  union of the preimages
  787. of the single elements of <imgs>.  <map> may be a multi valued mapping.
  788.  
  789. |    gap> PreImages( p4, [ (), (5,6,7) ] );
  790.     [ (), (5,6,7), (2,4), (2,4)(5,6,7), (1,2)(3,4), (1,2)(3,4)(5,6,7), 
  791.       (1,2,3,4), (1,2,3,4)(5,6,7), (1,3), (1,3)(5,6,7), (1,3)(2,4), 
  792.       (1,3)(2,4)(5,6,7), (1,4,3,2), (1,4,3,2)(5,6,7), (1,4)(2,3), 
  793.       (1,4)(2,3)(5,6,7) ]
  794.     gap> PreImages( p5, [ (), (5,6,7) ] );
  795.     [ (), (5,7,6) ] |
  796.  
  797. 'PreImages' first checks in which form it is called.
  798.  
  799. In the first  case it calls  '<map>.operations.PreImagesElm( <map>, <img>
  800. )' and returns this value.
  801.  
  802. The default function called this  way is 'MappingOps.PreImagesElm', which
  803. runs  through all elements of  the source of <map>, if it is  finite, and
  804. returns the set of those that have <img> in  their images.   Look  in the
  805. index under  *PreImages*  to see  for  which  mappings  this  function is
  806. overlaid.
  807.  
  808. In the second case if calls '<map>.operations.PreImagesSet( <map>, <imgs>
  809. )' and returns this value.
  810.  
  811. The default function called this way is 'MappingOps.PreImagesSet',  which
  812. returns the union of the preimages of all the elements of the set <imgs>.
  813. Look in  the index  under *PreImages*  to  see  for which  mappings  this
  814. function is overlaid.
  815.  
  816. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  817. \Section{PreImagesRepresentative}
  818.  
  819. 'PreImagesRepresentative( <map>, <img> )'
  820.  
  821. 'PreImagesRepresentative' returns   an representative   of  the  set   of
  822. preimages of <img> under <map>, i.e., a  single  element <elm>, such that
  823. '<img> in Images( <map>, <elm> )' (see "Images").
  824.  
  825. |    gap> g := Group( (1,2,3,4), (2,4), (5,6,7) );;  g.name := "g";;
  826.     gap> p4 := MappingByFunction( g, g, x -> x^4 );
  827.     MappingByFunction( g, g, function ( x )
  828.         return x ^ 4;
  829.     end )
  830.     gap> PreImagesRepresentative( p4, (5,6,7) );
  831.     (5,6,7)
  832.     gap> p5 := MappingByFunction( g, g, x -> x^5 );
  833.     MappingByFunction( g, g, function ( x )
  834.         return x ^ 5;
  835.     end )
  836.     gap> PreImagesRepresentative( p5, (2,4)(5,6,7) );
  837.     (2,4)(5,7,6) |
  838.  
  839. 'PreImagesRepresentative' calls \\
  840. '<map>.operations.PreImagesRepresentative( <map>, <img> )'
  841. and returns this value.
  842.  
  843. The       default      function       called      this       way       is
  844. 'MappingOps.PreImagesRepresentative',  which  calls  'PreImages(   <map>,
  845. <img>  )' and returns  the first element in this  set.  Look in the index
  846. under  *PreImagesRepresentative* to  see for which mappings this function
  847. is overlaid.
  848.  
  849. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  850. \Section{CompositionMapping}
  851.  
  852. 'CompositionMapping( <map1>.. )'
  853.  
  854. 'CompositionMapping' returns  the  composition  of  the  mappings <map1>,
  855. <map2>,  etc.  where  the range  of each mapping must be a subset of  the
  856. source of the  previous  mapping.  The mappings need not be single valued
  857. mappings, i.e., multi valued mappings are allowed.
  858.  
  859. The composition of <map1> and <map2> is the mapping  <map> that maps each
  860. element <elm> of the source of <map2> to 'Images( <map1>, Images( <map2>,
  861. <elm>  ) )'.  If <map1>  and <map2> are single valued  mappings this  can
  862. also be expressed as '<map2> \*\ <map1>' (see "Operations for Mappings").
  863. Note the reversed operands.
  864.  
  865. |    gap> g := Group( (1,2,3,4), (2,4), (5,6,7) );;  g.name := "g";;
  866.     gap> p4 := MappingByFunction( g, g, x -> x^4 );
  867.     MappingByFunction( g, g, function ( x )
  868.         return x ^ 4;
  869.     end )
  870.     gap> p5 := MappingByFunction( g, g, x -> x^5 );
  871.     MappingByFunction( g, g, function ( x )
  872.         return x ^ 5;
  873.     end )
  874.     gap> p20 := CompositionMapping( p4, p5 );
  875.     CompositionMapping( MappingByFunction( g, g, function ( x )
  876.         return x ^ 4;
  877.     end ), MappingByFunction( g, g, function ( x )
  878.         return x ^ 5;
  879.     end ) )
  880.     gap> (2,4)(5,6,7) ^ p20;
  881.     (5,7,6) |
  882.  
  883. 'CompositionMapping' calls \\
  884. '<map2>.operations.CompositionMapping( <map1>, <map2> )'
  885. and returns this value.
  886.  
  887. The default function called this way is  'MappingOps.CompositionMapping',
  888. which  constructs a new mapping <com>.  This new mapping remembers <map1>
  889. and <map2>  as its factors in '<com>.map1' and '<com>.map2' and delegates
  890. everything  to  them.   For example to compute  'Images( <com>, <elm> )',
  891. '<com>.operations.ImagesElm'   calls    'Images(   <com>.map1,    Images(
  892. <com>.map2, <elm> ) )'.  Look in the index  under *CompositionMapping* to
  893. see for which mappings this function is overlaid.
  894.  
  895. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  896. \Section{PowerMapping}
  897.  
  898. 'PowerMapping( <map>, <n> )'
  899.  
  900. 'PowerMapping' returns the <n>-th power of the mapping <map>.  <map> must
  901. be a  mapping whose  range  is  a subset of its  source.  <n>  must  be a
  902. nonnegative integer.  <map> may be a multi valued mapping.
  903.  
  904. |    gap> g := Group( (1,2,3,4), (2,4), (5,6,7) );;  g.name := "g";;
  905.     gap> p4 := MappingByFunction( g, g, x -> x^4 );
  906.     MappingByFunction( g, g, function ( x )
  907.         return x ^ 4;
  908.     end )
  909.     gap> p16 := p4 ^ 2;
  910.     CompositionMapping( CompositionMapping( IdentityMapping( g ),
  911.     MappingByFunction( g, g, function ( x )
  912.         return x ^ 4;
  913.     end ) ), CompositionMapping( IdentityMapping( g ),
  914.     MappingByFunction( g, g, function ( x )
  915.         return x ^ 4;
  916.     end ) ) )
  917.     gap> p16 = MappingByFunction( g, g, x -> x^16 );
  918.     true |
  919.  
  920. 'PowerMapping' calls  '<map>.operations.PowerMapping( <map>,  <n>  )' and
  921. returns this value.
  922.  
  923. The default function called this way  is 'MappingOps.PowerMapping', which
  924. computes the power using a binary powering algorithm,  'IdentityMapping',
  925. and  'CompositionMapping'.  This  function  is  seldom overlaid,  because
  926. 'CompositionMapping' does the interesting work.
  927.  
  928. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  929. \Section{InverseMapping}
  930.  
  931. 'InverseMapping( <map> )'
  932.  
  933. 'InverseMapping' returns the inverse mapping of  the  mapping <map>.  The
  934. inverse mapping  <inv>  is  a  mapping  with source  '<map>.range', range
  935. '<map>.source', such that each element <elm> of its source  is  mapped to
  936. the  set 'PreImages( <map>, <elm> )'  (see "PreImages").  <map> may  be a
  937. multi valued mapping.
  938.  
  939. |    gap> g := Group( (1,2,3,4), (2,4), (5,6,7) );;  g.name := "g";;
  940.     gap> p4 := MappingByFunction( g, g, x -> x^4 );
  941.     MappingByFunction( g, g, function ( x )
  942.         return x ^ 4;
  943.     end )
  944.     gap> i4 := InverseMapping( p4 );
  945.     InverseMapping( MappingByFunction( g, g, function ( x )
  946.         return x ^ 4;
  947.     end ) )
  948.     gap> Images( i4, () );
  949.     [ (), (2,4), (1,2)(3,4), (1,2,3,4), (1,3), (1,3)(2,4), (1,4,3,2),
  950.       (1,4)(2,3) ] |
  951.  
  952. 'InverseMapping'  first tests   if  the  field '<map>.inverseMapping'  is
  953. bound.  If the field is bound, it  returns its value.  Otherwise it calls
  954. '<map>.operations.InverseMapping( <map> )',  remembers the returned value
  955. in '<map>.inverseMapping', and returns it.
  956.  
  957. The default function   called  this  way is  'MappingOps.InverseMapping',
  958. which constructs a new  mapping <inv>.   This new mapping remembers <map>
  959. as its    own inverse mapping   in '<inv>.inverseMapping'   and delegates
  960. everything to  it.   For  example  to  compute  'Image( <inv>,  <elm> )',
  961. '<inv>.operations.ImageElm' calls 'PreImage(<inv>.inverseMapping,<elm>)'.
  962. Special types of mappings will  overlay this  default function with  more
  963. efficient functions.
  964.  
  965. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  966. \Section{IdentityMapping}
  967.  
  968. 'IdentityMapping( <D> )'
  969.  
  970. 'IdentityMapping' returns the identity mapping on the domain <D>.
  971.  
  972. |    gap> g := Group( (1,2,3,4), (2,4), (5,6,7) );;  g.name := "g";;
  973.     gap> i := IdentityMapping( g );
  974.     IdentityMapping( g )
  975.     gap> (1,2,3,4) ^ i;
  976.     (1,2,3,4)
  977.     gap> IsBijection( i );
  978.     true |
  979.  
  980. 'IdentityMapping'  calls   '<D>.operations.IdentityMapping(  <D>  )'  and
  981. returns this value.
  982.  
  983. The functions usually called  this way  are 'GroupOps.IdentityMapping' if
  984. the domain  <D> is a group and  'FieldOps.IdentityMapping'  if the domain
  985. <D> is a field.
  986.  
  987. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  988. \Section{MappingByFunction}
  989.  
  990. 'MappingByFunction( <D>, <E>, <fun> )'
  991.  
  992. 'MappingByFunction' returns a mapping <map> with source <D> and range <E>
  993. such that each element <d> of <D> is mapped to the element  '<fun>(<d>)',
  994. where <fun> is a {\GAP} function.
  995.  
  996. |    gap> g := Group( (1,2,3,4), (1,2) );;  g.name := "g";;
  997.     gap> m := MappingByFunction( g, g, x -> x^2 );
  998.     MappingByFunction( g, g, function ( x )
  999.         return x ^ 2;
  1000.     end )
  1001.     gap> (1,2,3) ^ m;
  1002.     (1,3,2)
  1003.     gap> IsHomomorphism( m );
  1004.     false |
  1005.  
  1006. 'MappingByFunction'  constructs  the mapping  in  the obvious  way.   For
  1007. example the  image of  an  element  under  <map> is  simply  computed  by
  1008. applying <fun> to the element.
  1009.  
  1010. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1011. \Section{Mapping Records}
  1012.  
  1013. A mapping <map> is represented by a record with the following components
  1014.  
  1015. 'isGeneralMapping': \\
  1016.         always 'true', indicating that this is a general mapping.
  1017.  
  1018. 'source': \\
  1019.         the  source of   the mapping,   i.e.,   the set  of   elements to
  1020.         which the mapping can be applied.
  1021.  
  1022. 'range': \\
  1023.         the   range   of the mapping,  i.e.,  a  set in   which all value
  1024.         of the mapping lie.
  1025.  
  1026. The following entries are optional.  The functions with the corresponding
  1027. names will generally  test if they  are present.  If they are  then their
  1028. value  is  simply returned.   Otherwise the  functions  will  perform the
  1029. computation and add those fields to those record for the next time.
  1030.  
  1031. 'isMapping': \\
  1032.         'true' if <map> is a single valued mapping and 'false' otherwise.
  1033.  
  1034. 'isInjective' \\
  1035. 'isSurjective' \\
  1036. 'isBijection' \\
  1037. 'isHomomorphism' \\
  1038. 'isMonomorphism' \\
  1039. 'isEpimorphism' \\
  1040. 'isIsomorphism' \\
  1041. 'isEndomorphism' \\
  1042. 'isAutomorphism': \\
  1043.         'true' if  <map>  has  the  corresponding  property  and  'false'
  1044.         otherwise.
  1045.  
  1046. 'preImage': \\
  1047.         the subset  of  '<map>.source'   of   elements   <pre>  that  are
  1048.         actually mapped  to at   least  one   element, i.e.,   for  which
  1049.         'Images( <map>, <pre> )' is nonempty.
  1050.  
  1051. 'image': \\
  1052.         the  subset   of  '<map>.range'  of    the elements <img>    that
  1053.         are   actually  values of     the  mapping,   i.e.,   for   which
  1054.         'PreImages( <map>, <img> )' is nonempty.
  1055.  
  1056. 'inverseMapping': \\
  1057.         the    inverse  mapping  of  <map>.  This  is    a   mapping from
  1058.         '<map>.range'  to    '<map>.source'  that    maps  each   element
  1059.         <img> to the set 'PreImages( <map>, <img> )'.
  1060.  
  1061. The following entry is optional.  It must be bound only  if  the  inverse
  1062. of <map> is indeed a single valued mapping.
  1063.  
  1064. 'inverseFunction': \\
  1065.         the inverse function of <map>.
  1066.  
  1067. The  following entry is  optional.  It must be  bound only  if <map> is a
  1068. homomorphism.
  1069.  
  1070. 'kernel': \\
  1071.         the  elements    of '<map>.source'  that   are  mapped   to   the
  1072.         identity element of '<map>.range'.
  1073.  
  1074. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1075. %%
  1076. %E  Emacs . . . . . . . . . . . . . . . . . . . . . local Emacs variables
  1077. %%
  1078. %%  Local Variables:
  1079. %%  mode:               outline
  1080. %%  outline-regexp:     "\\\\Chapter\\|\\\\Section"
  1081. %%  fill-column:        73
  1082. %%  eval:               (hide-body)
  1083. %%  End:
  1084. %%
  1085.  
  1086.  
  1087.  
  1088.