<h3>5 <span class="Heading">Category of Categories</span></h3>
<p>Categories itself with functors as morphisms form a category Cat. So the data structure of <code class="code">CapCategory</code>s is designed to be objects in a category. This category is implemented in <code class="code">CapCat</code>. For every category, the corresponding object in Cat can be obtained via <code class="code">AsCatObject</code>. 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 <code class="code">ApplyFunctor</code>).</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ CapCat</code></td><td class="tdright">( global variable )</td></tr></table></div>
<p>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.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ AsCatObject</code>( <var class="Arg">C</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>Given a CAP category <span class="Math">C</span>, this method returns the corresponding objectin Cat. For technical reasons, the filter <code class="code">IsCapCategory</code> must not imply the filter <code class="code">IsCapCategoryObject</code>. For example, if <code class="code">InitialObject</code> 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 <codeclass="code">AsCapCategory</code>.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ AsCapCategory</code>( <var class="Arg">C</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>For an object <span class="Math">C</span> in Cat, this method returns the underlying CAP category. This method is inverse to <code class="code">AsCatObject</code>, i.e. AsCapCategory( AsCatObject( A ) ) = A.</p>
<p>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 <span class="Math">A \times B \rightarrow C</span> either as a unary functor with source category <span class="Math">A \times B</span> 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.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ CapFunctor</code>( <var class="Arg">name</var>, <var class="Arg">A</var>, <var class="Arg">B</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ CapFunctor</code>( <var class="Arg">name</var>, <var class="Arg">A</var>, <var class="Arg">B</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ CapFunctor</code>( <var class="Arg">name</var>, <var class="Arg">A</var>, <var class="Arg">B</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ CapFunctor</code>( <var class="Arg">name</var>, <var class="Arg">A</var>, <var class="Arg">B</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>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.
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ CapFunctor</code>( <var class="Arg">name</var>, <var class="Arg">list</var>, <var class="Arg">B</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ CapFunctor</code>( <var class="Arg">name</var>, <var class="Arg">list</var>, <var class="Arg">B</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>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.
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ SourceOfFunctor</code>( <var class="Arg">F</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>The argument is a functor <span class="Math">F</span>. The output is its source as CAP category.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ RangeOfFunctor</code>( <var class="Arg">F</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>The argument is a functor <span class="Math">F</span>. The output is its range as CAP category.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ AddObjectFunction</code>( <var class="Arg">F</var>, <var class="Arg">f</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>This operation adds a function <span class="Math">f</span> to the functor <span class="Math">F</span> which can then be applied to objects in the source. The given function <span class="Math">f</span> has to take arguments according to the <code class="code">InputSignature</code> of <span class="Math">F</span>, i.e., if the input signature is given by <span class="Math">[ [A_1, b_1], \dots, [A_n,b_n] ]</span>, then <span class="Math">f</span> must take <span class="Math">n</span> arguments, where the <span class="Math">i</span>-th argument is an object in the category <span class="Math">A_i</span> (the boolean <span class="Math">b_i</span> is ignored). The function should return an object in the range of the functor, except when the automatic call of <code class="code">AddObject</code> was enabled via <code class="code">EnableAddForCategoricalOperations</code>. In this case the output only has to be a GAP object in <code class="code">IsAttributeStoringRep</code>, which will be automatically added as an object to the range of the functor.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ FunctorObjectOperation</code>( <var class="Arg">F</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>Returns: a GAP operation</p>
<p>The argument is a functor <span class="Math">F</span>. The output is the GAP operation realizing the action of <span class="Math">F</span> on objects.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ AddMorphismFunction</code>( <var class="Arg">F</var>, <var class="Arg">f</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>This operation adds a function <span class="Math">f</span> to the functor <span class="Math">F</span> which can then be applied to morphisms in the source. The given function <span class="Math">f</span> has to take as its first argument an object <span class="Math">s</span> that is equal (via <code class="code">IsEqualForObjects</code>) to the source of the result of applying <span class="Math">F</span> to the input morphisms. The next arguments of <span class="Math">f</span> have to morphisms according to the <code class="code">InputSignature</code> of <span class="Math">F</span>, i.e., if the input signature is given by <span class="Math">[ [A_1, b_1], \dots, [A_n,b_n] ]</span>, then <span class="Math">f</span> must take <span class="Math">n</span> arguments, where the <span class="Math">i</span>-th argument is a morphism in the category <span class="Math">A_i</span> (the boolean <span class="Math">b_i</span> is ignored). The last argument of <span class="Math">f</span> must be an object <span class="Math">r</span> that is equal (via <code class="code">IsEqualForObjects</code>) to the range of the result of applying <span class="Math">F</span> to the input morphisms. The function should return a morphism in the range of the functor, except when the automatic call of <code class="code">AddMorphism</code> was enabled via <code class="code">EnableAddForCategoricalOperations</code>. In this case the output only has to be a GAP object in <code class="code">IsAttributeStoringRep</code> (with attributes <code class="code">Source</code> and <code class="code">Range</code> containing also GAP objects in <code class="code">IsAttributeStoringRep</code>), which will be automatically added as a morphism to the range of the functor.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ FunctorMorphismOperation</code>( <var class="Arg">F</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>Returns: a GAP operation</p>
<p>The argument is a functor <span class="Math">F</span>. The output is the GAP operation realizing the action of <span class="Math">F</span> on morphisms.</p>
<p>The argument is a functor <span class="Math">F</span>. The output is a list of pairs <span class="Math">[ [ A_1, b_1 ], \dots, [ A_n, b_n ] ]</span> where a pair consists of a CAP-category <span class="Math">A_i</span> and a boolean <span class="Math">b_i</span> for <span class="Math">i = 1, \dots, n</span>. The source of <span class="Math">F</span> is given by the product category <span class="Math">D_1 \times ... \times D_n</span>, where <span class="Math">D_i = A_i</span> if <span class="Math">b_i = \mathtt{false}</span>, and <span class="Math">D_i = A_i^{\mathrm{op}}</span> otherwise.</p>
<p>The arguments are a functor <span class="Math">F</span> and a string <span class="Math">s</span>. To simplify the description of this operation, we let <span class="Math">[ [ A_1, b_1 ], \dots, [ A_n, b_n ] ]</span> denote the input signature of <span class="Math">F</span>. This method tries to install <span class="Math">3</span> operations: an operation <span class="Math">\omega_1</span> with the name <span class="Math">s</span>, an operation <span class="Math">\omega_2</span> with the name <span class="Math">s\mathtt{OnObjects}</span>, and an operation <span class="Math">\omega_3</span> with the name <span class="Math">s\mathtt{OnMorphisms}</span>. The operation <span class="Math">\omega_1</span> takes as input either <span class="Math">n</span>- objects/morphisms in <span class="Math">A_i</span> or a single object/morphism in the source of <span class="Math">F</span>, and outputs the result of applying <span class="Math">F</span> to this input. <span class="Math">\omega_2</span> and <span class="Math">\omega_3</span> 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.</p>
<p>Returns the endofunctor of the category <var class="Arg">cat</var> with zero which maps each (object isomorphic to the) zero object to <code class="code">ZeroObject</code>(<var class="Arg">cat</var>) and to itself otherwise. This functor is equivalent to the identity functor.</p>
<p>Returns the natural isomorphism from the identity functor to <code class="code">FunctorCanonicalizeZeroObjects</code>(<var class="Arg">cat</var>).</p>
<p>Returns the endofunctor of the category <var class="Arg">cat</var> with zero which maps each object to itself, each morphism <span class="SimpleMath">ϕ</span> to itself, unless it is congruent to the zero morphism; in this case it is mapped to <code class="code">ZeroMorphism</code>(<code class="code">Source</code>(<span class="SimpleMath">ϕ</span>), <code class="code">Range</code>(<span class="SimpleMath">ϕ</span>)). This functor is equivalent to the identity functor.</p>
<p>Returns the natural isomorphism from the identity functor to <code class="code">FunctorCanonicalizeZeroMorphisms</code>(<var class="Arg">cat</var>).</p>
<p>Natural transformations form the <span class="Math">2</span>-cells of Cat. As such, it is possible to compose them vertically and horizontally, see Section <a href="chap4.html#X7B780EDB7E466121"><span class="RefLink">4.3</span></a>.</p>
<p>Constructs a natural transformation between the functors <var class="Arg">F</var><span class="Math">:A \rightarrow B</span> and <var class="Arg">G</var><span class="Math">:A \rightarrow B</span>. The string <var class="Arg">name</var> is optional, and, if not given, set automatically from the names of the functors</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ AddNaturalTransformationFunction</code>( <var class="Arg">N</var>, <var class="Arg">func</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Adds the function <var class="Arg">func</var> to the natural transformation <var class="Arg">N</var>. The function should take three arguments. If <span class="Math">N: F \rightarrow G</span>, the arguments should be <span class="Math">F(A), A, G(A)</span>. The ouptput should be a morphism, <span class="Math">F(A) \rightarrow G(A)</span>.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ ApplyNaturalTransformation</code>( <var class="Arg">N</var>, <var class="Arg">A</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Returns: a morphism</p>
<p>Given a natural transformation <var class="Arg">N</var><span class="Math">:F \rightarrow G</span> and an object <var class="Arg">A</var>, this function should return the morphism <span class="Math">F(A) \rightarrow G(A)</span>, corresponding to <var class="Arg">N</var>.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ InstallNaturalTransformation</code>( <var class="Arg">N</var>, <var class="Arg">name</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Installs the natural transformation <var class="Arg">N</var> as operation with the name <var class="Arg">name</var>. Argument for this operation is an object, output is a morphism.</p>
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.