  
  [1X2 [33X[0;0YMinimal and Canonical Images[133X[101X
  
  [33X[0;0YGiven  a  group  G  and  action  A,  the minimal image of an object O is the
  smallest image of O under any element of G, under the action A.[133X
  
  [33X[0;0YAs  a  more  concrete  example, let us consider the minimal image of the set
  [2,3,5,7] under a group G.[133X
  
  [33X[0;0YWe can calculate all the images of our set under G, then choose the smallest
  one.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XG := Group((1,2,3)(4,5,6)(7,8,9),(1,4,7)(2,5,8)(3,6,9));;[127X[104X
    [4X[25Xgap>[125X [27XList(G, g -> OnSets([2,3,5,7], g) );[127X[104X
    [4X[28X[ [ 2, 3, 5, 7 ], [ 1, 2, 4, 9 ], [ 1, 3, 6, 8 ], [ 2, 4, 8, 9 ],[128X[104X
    [4X[28X  [ 1, 6, 7, 8 ], [ 3, 5, 7, 9 ], [ 1, 5, 6, 8 ], [ 3, 4, 5, 7 ],[128X[104X
    [4X[28X  [ 2, 4, 6, 9 ] ][128X[104X
    [4X[25Xgap>[125X [27XMinimum(List(G, g -> OnSets([2,3,5,7], g) ) );[127X[104X
    [4X[28X[ 1, 2, 4, 9 ][128X[104X
  [4X[32X[104X
  
  [33X[0;0YThis  is  very inefficient, as it requires enumerating all members of G. The
  images  package  produces  a function MinimalImage, which performs this same
  operation more efficiently.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XLoadPackage("images", false);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XMinimalImage(G, [2,3,5,7], OnSets);[127X[104X
    [4X[28X[ 1, 2, 4, 9 ][128X[104X
  [4X[32X[104X
  
  [33X[0;0YThe   most  common  use  of  MinimalImage  is  to  categorise  objects  into
  equivalence  classes. This next example shows [2,3,5,7] and [1,6,7,8] are in
  the same orbit, while [3,5,7,8] is in a different orbit.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XMinimalImage(G, [2,3,5,7], OnSets);[127X[104X
    [4X[28X[ 1, 2, 4, 9 ][128X[104X
    [4X[25Xgap>[125X [27XMinimalImage(G, [1,6,7,8], OnSets);[127X[104X
    [4X[28X[ 1, 2, 4, 9 ][128X[104X
    [4X[25Xgap>[125X [27XMinimalImage(G, [3,5,7,8], OnSets);[127X[104X
    [4X[28X[ 1, 2, 6, 8 ][128X[104X
  [4X[32X[104X
  
  [33X[0;0YIn this situation, we do not really need the minimal image, just a method of
  telling if two sets are in the same equivalence class.[133X
  
  [33X[0;0YMotivated     by     this,    this    package    provides    CanonicalImage.
  CanonicalImage(G,O,A)  returns  some image of O by an element of G under the
  action  A,  guaranteeing that if two objects O1 and O2 are in the same orbit
  of  G  then  CanonicalImage(G,O1,A)  =  CanonicalImage(G,O2,A). However, the
  canonical  image is not "minimal" under any sensible ordering. The advantage
  of  CanonicalImage  is  that  it  is much faster than MinimalImage, often by
  orders of magnitude.[133X
  
  [33X[0;0Y[12XWARNING:[112X The value of MinimalImage will remain identical between versions of
  GAP and the Images package, unless bugs are discovered. This is NOT true for
  CanonicalImage.[133X
  
  
  [1X2.1 [33X[0;0YFunction documentation[133X[101X
  
  [1X2.1-1 MinimalImage[101X
  
  [33X[1;0Y[29X[2XMinimalImage[102X( [3XG[103X, [3Xpnt[103X[, [3Xact[103X][, [3XConfig[103X] ) [32X function[133X
  [33X[1;0Y[29X[2XIsMinimalImage[102X( [3XG[103X, [3Xpnt[103X[, [3Xact[103X][, [3XConfig[103X] ) [32X function[133X
  [33X[1;0Y[29X[2XMinimalImagePerm[102X( [3XG[103X, [3Xpnt[103X[, [3Xact[103X][, [3XConfig[103X] ) [32X function[133X
  
  [33X[0;0Y[2XMinimalImage[102X   returns   the  minimal  image  of  [3Xpnt[103X  under  the  group  [3XG[103X.
  [2XIsMinimalImage[102X  returns a boolean which is [9Xtrue[109X if [2XMinimalImage[102X would return
  [3Xpnt[103X (so the value is it's own minimal image).[133X
  
  [33X[0;0Y[2XMinimalImagePerm[102X  returns  the  permutation  which  maps  [3Xpnt[103X to its minimal
  image.[133X
  
  [33X[0;0YThe  option  [3XConfig[103X  defines  a  number of advanced configuration   options,
  which are described in 'ImagesAdvancedConfig'.[133X
  
  [1X2.1-2 IsMinimalImageLessThan[101X
  
  [33X[1;0Y[29X[2XIsMinimalImageLessThan[102X( [3XG[103X, [3XA[103X, [3XB[103X[, [3Xact[103X][, [3Xconfig[103X] ) [32X function[133X
  
  [33X[0;0Y[2XIsMinimalImageLessThan[102X checks if the minimal image of [3XA[103X under the group [3XG[103X is
  smaller than [3XB[103X.[133X
  
  [33X[0;0YIt  returns  MinImage.Smaller,  MinImage.Equal  or  MinImage.Larger,  if the
  minimal image of [3XA[103X is smaller, equal or larger than [3XB[103X.[133X
  
  [33X[0;0YThe  option  [3XConfig[103X  defines  a  number of advanced configuration   options,
  which are described in 'ImagesAdvancedConfig'.[133X
  
  [1X2.1-3 CanonicalImage[101X
  
  [33X[1;0Y[29X[2XCanonicalImage[102X( [3XG[103X[, [3Xpnt[103X][, [3Xact[103X][, [3XConfig[103X] ) [32X function[133X
  [33X[1;0Y[29X[2XIsCanonicalImage[102X( [3XG[103X[, [3Xpnt[103X][, [3Xact[103X][, [3XConfig[103X] ) [32X function[133X
  [33X[1;0Y[29X[2XCanonicalImagePerm[102X( [3XG[103X[, [3Xpnt[103X][, [3Xact[103X][, [3XConfig[103X] ) [32X function[133X
  
  [33X[0;0Y[2XCanonicalImage[102X  returns  a  canonical  image  of  [3Xpnt[103X  under  the  group  [3XG[103X.
  [2XIsCanonicalImage[102X  returns  a  boolean  which is [9Xtrue[109X if [2XCanonicalImage[102X would
  return [3Xpnt[103X (so the value is it's own minimal image).[133X
  
  [33X[0;0Y[2XCanonicalImagePerm[102X  returns  the  permutation  which maps [3Xpnt[103X to its minimal
  image.[133X
  
  [33X[0;0YBy  default,  these  functions  use  the  fastest  algorithm for calculating
  canonical images, which is often changed in new versions of the package. The
  option  [3XConfig[103X  defines  a number of advanced configuration   options, which
  are described in 'ImagesAdvancedConfig'. These include the ability to choose
  the canonicalising algorithm used.[133X
  
  [1X2.1-4 ImagesAdvancedConfig[101X
  
  [33X[1;0Y[29X[2XImagesAdvancedConfig[102X[32X global variable[133X
  
  [33X[0;0YThis   section   describes  the  advanced  configuration  options  for  both
  [2XMinimalImage[102X  ([14X2.1-1[114X)  and  [2XCanonicalImage[102X  ([14X2.1-3[114X).  Assume  we have called
  [2XMinimalImage[102X ([14X2.1-1[114X) or [2XCanonicalImage[102X ([14X2.1-3[114X) with arguments (G,O,A).[133X
  
  [8X[10Xorder[110X[8X[108X
        [33X[0;6YThe  search  ordering  used  while  building the image. There are many
        configuration  options  available.  We  shall list here just the three
        most  useful  ones. A full list is in the paper "Minimal and Canonical
        Images" by the authors of this package.[133X
  
        [8X[10XCanonicalConfig_Minimum[110X[8X[108X
              [33X[0;12YLexicographically smallest set -- same as using MinimalImage.[133X
  
        [8X[10X"CanonicalConfig_FixedMinOrbit[110X[8X[108X
              [33X[0;12YLexicographically   smallest  set  under  the  ordering  of  the
              integers given by the MinOrbitPerm function.[133X
  
        [8X[10XCanonicalConfig_RareRatioOrbitFixPlusMin[110X[8X[108X
              [33X[0;12YThe current best algorithm (default)[133X
  
  [8X[10Xstabilizer[110X[8X[108X
        [33X[0;6YThe  group [2XStabilizer[102X ([14X???Stabilizer???[114X)(G,O,A), or a subgroup of this
        group.  If  this group is large, it is more efficient to pre-calculate
        it.  Default  behaviour  is  to calculate the group, pass Group(()) to
        disable  this behaviour. This is not checked, and passing an incorrect
        group will produce incorrect answers.[133X
  
  [8X[10XdisableStabilizerCheck[110X[8X (default [9Xfalse[109X)[108X
        [33X[0;6YBy default, during search we perform cheap checks to try to find extra
        elements of the stabilizer. Pass true to disable this check, this will
        make  the  algorithm  MUCH  slower  if  the  stabilizer  argument is a
        subgroup.[133X
  
  [8X[10XgetStab[110X[8X (default [9Xfalse[109X)([108X
        [33X[0;6YReturn  the  calculated value of [2XStabilizer[102X ([14X???Stabilizer???[114X)(G,O,A).
        This may return a subgroup rather than the whole stabilizer.[133X
  
