Category of Categories

Categories itself with functors as morphisms form a category Cat. So the data structure of CapCategorys is designed to be objects in a category. This category is implemented in CapCat. For every category, the corresponding object in Cat can be obtained via AsCatObject. The implemetation of the category of categories offers a data structure for functors. Those are implemented as morphisms in this category, so functors can be handled like morphisms in a category. Also convenience functions to install functors as methods are implemented (in order to avoid ApplyFunctor).
The Category Cat This variable stores the category of categories. Every category object is constructed as an object in this category, so Cat is constructed when loading the package.
Categories true or false The GAP category of CAP categories seen as object in Cat. true or false The GAP category of functors. true or false The GAP category of natural transformations.
Constructors Given a CAP category C, this method returns the corresponding object in Cat. For technical reasons, the filter IsCapCategory must not imply the filter IsCapCategoryObject. For example, if InitialObject is applied to an object, it returns the initial object of its category. If it is applied to a category, it returns the initial object of the category. If a CAP category would be a category object itself, this would be ambiguous. So categories must be wrapped in a CatObject to be an object in Cat. This method returns the wrapper object. The category can be reobtained by AsCapCategory. For an object C in Cat, this method returns the underlying CAP category. This method is inverse to AsCatObject, i.e. AsCapCategory( AsCatObject( A ) ) = A.
Functors Functors are morphisms in Cat, thus they have source and target which are categories. A multivariate functor can be constructed via a product category as source, a presheaf is constructed via the opposite category as source. However, the user can explicitly decide the arity of a functor (which will only have technical implications). Thus, it is for example possible to consider a functor A \times B \rightarrow C either as a unary functor with source category A \times B or as a binary functor. Moreover, an object and a morphism function can be added to a functor, to apply it to objects or morphisms in the source category. These methods construct a unary CAP functor. The first argument is a string for the functor's name. A and B are the source and target of the functor, and they can be given as objects in CapCat or as a CAP-category.

These methods construct a possible multivariate CAP functor. The first argument is a string for the functor's name. The second argument is a list encoding the input signature of the functor. It can be given as a list of pairs [ [ A_1, b_1 ], \dots, [ A_n, b_n ] ] where a pair consists of a category A_i (given as an object in CapCat or as a CAP-category) and a boolean b_i for i = 1, \dots, n. Instead of a pair [ A_i, b_i ], you can also give simply A_i, which will be interpreted as the pair [ A_i, \mathtt{false} ]. The third argument is the target B of the functor, and it can be given as an object in CapCat or as a CAP-category. The output is a functor with source given by the product category D_1 \times ... \times D_n, where D_i = A_i if b_i = \mathtt{false}, and D_i = A_i^{\mathrm{op}} otherwise.

The argument is a functor F. The output is its source as CAP category. The argument is a functor F. The output is its range as CAP category. This operation adds a function f to the functor F which can then be applied to objects in the source. The given function f has to take arguments according to the InputSignature of F, i.e., if the input signature is given by [ [A_1, b_1], \dots, [A_n,b_n] ], then f must take n arguments, where the i-th argument is an object in the category A_i (the boolean b_i is ignored). The function should return an object in the range of the functor, except when the automatic call of AddObject was enabled via EnableAddForCategoricalOperations. In this case the output only has to be a GAP object in IsAttributeStoringRep, which will be automatically added as an object to the range of the functor. a GAP operation The argument is a functor F. The output is the GAP operation realizing the action of F on objects. This operation adds a function f to the functor F which can then be applied to morphisms in the source. The given function f has to take as its first argument an object s that is equal (via IsEqualForObjects) to the source of the result of applying F to the input morphisms. The next arguments of f have to morphisms according to the InputSignature of F, i.e., if the input signature is given by [ [A_1, b_1], \dots, [A_n,b_n] ], then f must take n arguments, where the i-th argument is a morphism in the category A_i (the boolean b_i is ignored). The last argument of f must be an object r that is equal (via IsEqualForObjects) to the range of the result of applying F to the input morphisms. The function should return a morphism in the range of the functor, except when the automatic call of AddMorphism was enabled via EnableAddForCategoricalOperations. In this case the output only has to be a GAP object in IsAttributeStoringRep (with attributes Source and Range containing also GAP objects in IsAttributeStoringRep), which will be automatically added as a morphism to the range of the functor. a GAP operation The argument is a functor F. The output is the GAP operation realizing the action of F on morphisms. IsCapCategoryCell Applies the functor func either to an object or morphism A in the source of func or to objects or morphisms belonging to the categories in the input signature of func. IsList The argument is a functor F. The output is a list of pairs [ [ A_1, b_1 ], \dots, [ A_n, b_n ] ] where a pair consists of a CAP-category A_i and a boolean b_i for i = 1, \dots, n. The source of F is given by the product category D_1 \times ... \times D_n, where D_i = A_i if b_i = \mathtt{false}, and D_i = A_i^{\mathrm{op}} otherwise. nothing The arguments are a functor F and a string s. To simplify the description of this operation, we let [ [ A_1, b_1 ], \dots, [ A_n, b_n ] ] denote the input signature of F. This method tries to install 3 operations: an operation \omega_1 with the name s, an operation \omega_2 with the name s\mathtt{OnObjects}, and an operation \omega_3 with the name s\mathtt{OnMorphisms}. The operation \omega_1 takes as input either n- objects/morphisms in A_i or a single object/morphism in the source of F, and outputs the result of applying F to this input. \omega_2 and \omega_3 are the corresponding variants for objects or morphisms only. This function can only be called once for each functor, every further call will be ignored. a functor Returns the identity functor of the category cat viewed as an object in the category of categories. a functor Returns the endofunctor of the category cat with zero which maps each (object isomorphic to the) zero object to ZeroObject(cat) and to itself otherwise. This functor is equivalent to the identity functor. a natural transformation Returns the natural isomorphism from the identity functor to FunctorCanonicalizeZeroObjects(cat). a functor Returns the endofunctor of the category cat with zero which maps each object to itself, each morphism \phi to itself, unless it is congruent to the zero morphism; in this case it is mapped to ZeroMorphism(Source(\phi), Range(\phi)). This functor is equivalent to the identity functor. a natural transformation Returns the natural isomorphism from the identity functor to FunctorCanonicalizeZeroMorphisms(cat).
Natural transformations Natural transformations form the 2-cells of Cat. As such, it is possible to compose them vertically and horizontally, see Section . a string As every functor, every natural transformation has a name attribute. It has to be a string and will be set by the Constructor. a natural transformation Constructs a natural transformation between the functors F:A \rightarrow B and G:A \rightarrow B. The string name is optional, and, if not given, set automatically from the names of the functors Adds the function (or list of functions) func to the natural transformation N. The function or each function in the list should take three arguments. If N: F \rightarrow G, the arguments should be F(A), A, G(A). The ouptput should be a morphism, F(A) \rightarrow G(A). a morphism Given a natural transformation N:F \rightarrow G and an object A, this function should return the morphism F(A) \rightarrow G(A), corresponding to N. Installs the natural transformation N as operation with the name name. Argument for this operation is an object, output is a morphism. a natural transformation Computes the horizontal composition of the natural transformation N and the functor F. a natural transformation Computes the horizontal composition of the functor F and the natural transformation N.