  
  [1X10 [33X[0;0YLimits and Colimits[133X[101X
  
  [33X[0;0YThis  section  describes  the  support  for  limits and colimits in CAP. All
  notions  defined  in the following are considered with regard to limits, not
  colimits,  except if explicitly stated otherwise. In particular, the diagram
  specification specifies a diagram over which the limit is taken. The colimit
  in turn is taken over the opposite diagram.[133X
  
  
  [1X10.1 [33X[0;0YSpecification of Limits and Colimits[133X[101X
  
  [33X[0;0YA record specifying a limit in CAP has the following entries:[133X
  
  [30X    [33X[0;6Yobject_specification: see below[133X
  
  [30X    [33X[0;6Ymorphism_specifiation: see below[133X
  
  [30X    [33X[0;6Ylimit_object_name:  the name of the method returning the limit object,
        e.g. [10XDirectProduct[110X or [10XKernelObject[110X[133X
  
  [30X    [33X[0;6Ylimit_projection_name (optional): the name of the method returning the
        projection(s)       from       the       limit       object,      e.g.
        [10XProjectionInFactorOfDirectProduct[110X   or  [10XKernelEmbedding[110X.  Defaults  to
        [10XConcatenation( "ProjectionInFactorOf", limit_object_name )[110X.[133X
  
  [30X    [33X[0;6Ylimit_universal_morphism_name  (optional):  the  name  of  the  method
        returning   the   universal  morphism  into  the  limit  object,  e.g.
        [10XUniversalMorphismIntoDirectProduct[110X    or   [10XKernelLift[110X.   Defaults   to
        [10XConcatenation( "UniversalMorphismInto", limit_object_name )[110X.[133X
  
  [30X    [33X[0;6Ycolimit_object_name:  the  name  of  the  method returning the colimit
        object, e.g. [10XCoproduct[110X or [10XCokernelObject[110X[133X
  
  [30X    [33X[0;6Ycolimit_injection_name  (optional):  the  name of the method returning
        the     injection(s)     into     the     colimit     object,     e.g.
        [10XInjectionOfCofactorOfCoproduct[110X   or  [10XCokernelProjection[110X.  Defaults  to
        [10XConcatenation( "InjectionOfCofactorOf", colimit_object_name )[110X.[133X
  
  [30X    [33X[0;6Ycolimit_universal_morphism_name  (optional):  the  name  of the method
        returning  the  universal  morphism  from  the  colimit  object,  e.g.
        [10XUniversalMorphismFromCoproduct[110X    or   [10XCokernelColift[110X.   Defaults   to
        [10XConcatenation( "UniversalMorphismFrom", colimit_object_name )[110X.[133X
  
  [33X[0;0Ylimit_object_name   and  colimit_object_name  can  be  the  same,  e.g.  for
  [10XDirectSum[110X or [10XZeroObject[110X.[133X
  
  [33X[0;0YThe  object_specification  and  morphism_specification  together specify the
  shape  of  the  diagram  defining  the  limit  or colimit. The syntax is the
  following:[133X
  
  [30X    [33X[0;6Yobject_specification   is   a   list  of  strings.  Only  the  strings
        "fixedobject"  and  "varobject"  are  allowed  as entries of the list.
        These are called "types" in the following.[133X
  
  [30X    [33X[0;6Ymorphism_specification is a list of triples. The first and third entry
        of  a  triple  are integers greater or equal to 1 and less or equal to
        [10XLength(  object_specification  )[110X.  The  second  entry  is  one  of the
        following  strings:  "fixedmorphism",  "varmorphism",  "zeromorphism".
        This entry is called "type" in the following.[133X
  
  [33X[0;0YSemantics is given as follows:[133X
  
  [30X    [33X[0;6YThe type "fixedobject" specifies a single object. The type "varobject"
        specifies arbitrarily many objects.[133X
  
  [30X    [33X[0;6YThe first and the third entry of a triple specify the source and range
        of  a  morphism  (or  multiple  morphisms)  encoded by the position in
        object_specification  respectively. The type "fixedmorphism" specifies
        a  single morphism. In this case, source and range can only be of type
        "fixedobject",   not  of  type  "varobject".  The  type  "varmorphism"
        specifies  arbitrarily  many  morphisms.  In  this case, if the source
        (resp. range) is of type "fixedobject" all the morphisms must have the
        same  source  (resp.  range).  On  the  contrary, if the source (resp.
        range)  is  of the type "varobject", the objects correspond one-to-one
        to   the   sources   (resp.   ranges)   of  the  morphisms.  The  type
        "zeromorphism" is currently ignored but will be endowed with semantics
        in the future.[133X
  
  [33X[0;0YFor  example,  a FiberProduct diagram consists of arbitrarily many morphisms
  which  have  arbitrary  sources  but  the  same  common  range.  This can be
  expressed as follows:[133X
  
  [4X[32X  Code  [32X[104X
    [4Xrec([104X
    [4X  object_specification := [ "fixedobject", "varobject" ],[104X
    [4X  morphism_specification := [ [ 2, "varmorphism", 1 ] ],[104X
    [4X  limit_object_name := "FiberProduct",[104X
    [4X  colimit_object_name := "Pushout",[104X
    [4X)[104X
  [4X[32X[104X
  
  [33X[0;0YNote  that  not  all  diagrams  which  can  be  expressed with the above are
  actually  supported.  For now, at most one unbound object (see below for the
  definition of "unbound") may be of type "varobject", and if there is such an
  unbound object it must be the last one among the unbound objects. Similarly,
  at  most  one unbound morphism may be of type "varmorphism", and if there is
  such  an  unbound  morphism  it  must  be  the  last  one  among the unbound
  morphisms.[133X
  
  
  [1X10.2 [33X[0;0YEnhancing Limit Specifications[133X[101X
  
  [33X[0;0YThe  function CAP_INTERNAL_ENHANCE_NAME_RECORD_LIMITS takes a list of limits
  (given  by  records  as  explained  above),  and  computes  some  additional
  properties.  For  example,  the number of so-called unbound objects, unbound
  morphisms  and  (non-)targets is computed. The term "unbound" signifies that
  for  creating  a  concrete  diagram,  these  objects or morphisms have to be
  specified by the user because they cannot be derived by CAP:[133X
  
  [30X    [33X[0;6YUnbound morphisms are the triples which are of type "fixedmorphism" or
        "varmorphism".[133X
  
  [30X    [33X[0;6YUnbound  objects  are  the objects which are not source or range of an
        unbound morphism.[133X
  
  [33X[0;0YFinally,  targets  are  the  objects  which are not the range of a morphism.
  These are of interest for the following reason: for limits, only projections
  into  targets  are  relevant  because the projections into other objects can
  simply be computed by composition. Similarly, one only has to give morphisms
  into these targets to compute a universal morphism.[133X
  
  [33X[0;0YThe  number  of  unbound  objects,  unbound  morphisms  and (non-)targets is
  expressed by the integers 0, 1 and 2:[133X
  
  [30X    [33X[0;6Y0: no such object/morphism/target exists[133X
  
  [30X    [33X[0;6Y1:  there  exists exactly one such object/target of type "fixedobject"
        respectively exactly one such morphism of type "fixedmorphism"[133X
  
  [30X    [33X[0;6Y2: else[133X
  
  
  [1X10.3 [33X[0;0YFunctions[133X[101X
  
  [1X10.3-1 CAP_INTERNAL_GENERATE_CONVENIENCE_METHODS_FOR_LIMITS[101X
  
  [33X[1;0Y[29X[2XCAP_INTERNAL_GENERATE_CONVENIENCE_METHODS_FOR_LIMITS[102X( [3Xpackage_name[103X, [3Xmethod_name_record[103X, [3Xlimits[103X ) [32X function[133X
  
  [33X[0;0YThis  function  takes  a  package  name,  a method name record and a list of
  enhanced  limits,  and  generates  convenience  methods  for the limits as a
  string  of  GAP  code.  The  result  is  compared to the content of the file
  [3Xpackage_name[103X[10X/gap/LimitConvenienceOutput.gi[110X.  If  a  difference  is  found, a
  warning  is  raised  and the generated string is written to a temporary file
  for manual inspection.[133X
  
  [1X10.3-2 CAP_INTERNAL_VALIDATE_LIMITS_IN_NAME_RECORD[101X
  
  [33X[1;0Y[29X[2XCAP_INTERNAL_VALIDATE_LIMITS_IN_NAME_RECORD[102X( [3Xmethod_name_record[103X, [3Xlimits[103X ) [32X function[133X
  
  [33X[0;0YThis  function takes a method name record and a list of enhanced limits, and
  validates  the  entries  of  the  method  name  record.  Prefunctions,  full
  prefunctions and postfunctions are excluded from the validation.[133X
  
