Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
| Download
GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
Project: cocalc-sagemath-dev-slelievre
Views: 4183461[1X2 [33X[0;0YCategory of Categories[133X[101X23[33X[0;0YCategories itself with functors as morphisms form a category. So the data4structure of [10XCapCategory[110Xs is designed to be objects in a category. This5category is implemented in [10XCapCat[110X. For every category, the corresponding6object in Cat can be obtained via [10XAsCatObject[110X. The implemetation of the7category of categories offers a data structure for functors. Those are8implemented as morphisms in this category, so functors can be handled like9morphisms in a category. Also convenience functions to install functors as10methods are implemented (in order to avoid [10XApplyFunctor[110X).[133X111213[1X2.1 [33X[0;0YThe Category Cat[133X[101X1415[1X2.1-1 CapCat[101X1617[29X[2XCapCat[102X[32X global variable1819[33X[0;0YThis variable stores the category of categories. Every category object is20constructed as an object in this category, so Cat is constructed when21loading the package.[133X222324[1X2.2 [33X[0;0YCategories[133X[101X2526[1X2.2-1 IsCapCategoryAsCatObject[101X2728[29X[2XIsCapCategoryAsCatObject[102X( [3Xobject[103X ) [32X filter29[6XReturns:[106X [33X[0;10Y[10Xtrue[110X or [10Xfalse[110X[133X3031[33X[0;0YThe GAP category of CAP categories seen as object in Cat.[133X3233[1X2.2-2 IsCapFunctor[101X3435[29X[2XIsCapFunctor[102X( [3Xobject[103X ) [32X filter36[6XReturns:[106X [33X[0;10Y[10Xtrue[110X or [10Xfalse[110X[133X3738[33X[0;0YThe GAP category of functors.[133X3940[1X2.2-3 IsCapNaturalTransformation[101X4142[29X[2XIsCapNaturalTransformation[102X( [3Xobject[103X ) [32X filter43[6XReturns:[106X [33X[0;10Y[10Xtrue[110X or [10Xfalse[110X[133X4445[33X[0;0YThe GAP category of natural transformations.[133X464748[1X2.3 [33X[0;0YConstructors[133X[101X4950[1X2.3-1 AsCatObject[101X5152[29X[2XAsCatObject[102X( [3XC[103X ) [32X attribute5354[33X[0;0YGiven a CAP category [23XC[123X, this method returns the corresponding object in Cat.55For technical reasons, the filter [10XIsCapCategory[110X must not imply the filter56[10XIsCapCategoryObject[110X. For example, if [10XInitialObject[110X is applied to an object,57it returns the initial object of its category. If it is applied to a58category, it returns the initial object of the category. If a CAP category59would be a category object itself, this would be ambiguous. So categories60must be wrapped in a CatObject to be an object in Cat. This method returns61the wrapper object. The category can be reobtained by [10XAsCapCategory[110X.[133X6263[1X2.3-2 AsCapCategory[101X6465[29X[2XAsCapCategory[102X( [3XC[103X ) [32X attribute6667[33X[0;0YFor an object [23XC[123X in Cat, this method returns the underlying CAP category.68This method is inverse to [10XAsCatObject[110X, i.e. AsCapCategory( AsCatObject( A )69) = A.[133X707172[1X2.4 [33X[0;0YFunctors[133X[101X7374[33X[0;0YFunctors are morphisms in Cat, thus they have source and target which are75categories. A multivariate functor can be constructed via a product category76as source, a presheaf is constructed via the opposite category as source.77Moreover, an object and a morphism function can be added to a functor, to78apply it to objects or morphisms in the source category.[133X7980[1X2.4-1 CapFunctor[101X8182[29X[2XCapFunctor[102X( [3Xname[103X, [3XA[103X, [3XB[103X ) [32X operation83[29X[2XCapFunctor[102X( [3Xname[103X, [3XA[103X, [3XB[103X ) [32X operation84[29X[2XCapFunctor[102X( [3Xname[103X, [3XA[103X, [3XB[103X ) [32X operation85[29X[2XCapFunctor[102X( [3Xname[103X, [3XA[103X, [3XB[103X ) [32X operation86[29X[2XCapFunctor[102X( [3Xname[103X, [3XA[103X, [3XB[103X ) [32X operation87[29X[2XCapFunctor[102X( [3Xname[103X, [3XA[103X, [3XB[103X ) [32X operation8889[33X[0;0YThese methods construct a CAP functor, i.e. a morphism in Cat. Name should90be an unique name for the functor, it is also used when the functor is91installed as a method. [3XA[103X and [3XB[103X are source and target. Both can be given as92object in Cat or as category itself.[133X9394[1X2.4-2 AddObjectFunction[101X9596[29X[2XAddObjectFunction[102X( [3Xfunctor[103X, [3Xfunction[103X ) [32X operation9798[33X[0;0YThis operation adds a function to the functor which can then be applied to99objects in the source. The given function [3Xfunction[103X has to take one argument100which must be an object in the source category and should return a101CapCategoryObject. The object is automatically added to the range of the102functor when it is applied to the object.[133X103104[1X2.4-3 FunctorObjectOperation[101X105106[29X[2XFunctorObjectOperation[102X( [3XF[103X ) [32X attribute107[6XReturns:[106X [33X[0;10Ya GAP operation[133X108109[33X[0;0YThe argument is a functor [23XF[123X. The output is the GAP operation realizing the110action of [23XF[123X on objects.[133X111112[1X2.4-4 AddMorphismFunction[101X113114[29X[2XAddMorphismFunction[102X( [3Xfunctor[103X, [3Xfunction[103X ) [32X operation115116[33X[0;0YThis operation adds a function to the functor which can then be applied to117morphisms in the source. The given function [3Xfunction[103X has to take three118arguments [23XA, \tau, B[123X. When the funtor [3Xfunctor[103X is applied to the morphism119[23X\tau[123X, [23XA[123X is the result of [3Xfunctor[103X applied to the source of [23X\tau[123X, [23XB[123X is the120result of [3Xfunctor[103X applied to the range.[133X121122[1X2.4-5 FunctorMorphismOperation[101X123124[29X[2XFunctorMorphismOperation[102X( [3XF[103X ) [32X attribute125[6XReturns:[106X [33X[0;10Ya GAP operation[133X126127[33X[0;0YThe argument is a functor [23XF[123X. The output is the GAP operation realizing the128action of [23XF[123X on morphisms.[133X129130[1X2.4-6 ApplyFunctor[101X131132[29X[2XApplyFunctor[102X( [3Xfunc[103X, [3XA[103X ) [32X function133[6XReturns:[106X [33X[0;10YIsCapCategoryCell[133X134135[33X[0;0YApplies the functor [3Xfunc[103X to the object or morphism [3XA[103X.[133X136137[1X2.4-7 InstallFunctor[101X138139[29X[2XInstallFunctor[102X( [3Xfunctor[103X, [3Xmethod_name[103X ) [32X operation140141[33X[0;0YTODO[133X142143[1X2.4-8 IdentityFunctor[101X144145[29X[2XIdentityFunctor[102X( [3Xcategory[103X ) [32X attribute146[6XReturns:[106X [33X[0;10Ya functor[133X147148[33X[0;0YReturns the identity functor of the category [3Xcat[103X viewed as an object in the149category of categories.[133X150151[1X2.4-9 FunctorCanonicalizeZeroObjects[101X152153[29X[2XFunctorCanonicalizeZeroObjects[102X( [3Xcategory[103X ) [32X attribute154[6XReturns:[106X [33X[0;10Ya functor[133X155156[33X[0;0YReturns the endofunctor of the category [3Xcat[103X with zero which maps each157(object isomorphic to the) zero object to [10XZeroObject[110X([3Xcat[103X) and to itself158otherwise. This functor is equivalent to the identity functor.[133X159160[1X2.4-10 NaturalIsomorophismFromIdentityToCanonicalizeZeroObjects[101X161162[29X[2XNaturalIsomorophismFromIdentityToCanonicalizeZeroObjects[102X( [3Xcategory[103X ) [32X attribute163[6XReturns:[106X [33X[0;10Ya natural transformation[133X164165[33X[0;0YReturns the natural isomorphism from the identity functor to166[10XFunctorCanonicalizeZeroObjects[110X([3Xcat[103X).[133X167168[1X2.4-11 FunctorCanonicalizeZeroMorphisms[101X169170[29X[2XFunctorCanonicalizeZeroMorphisms[102X( [3Xcategory[103X ) [32X attribute171[6XReturns:[106X [33X[0;10Ya functor[133X172173[33X[0;0YReturns the endofunctor of the category [3Xcat[103X with zero which maps each object174to itself, each morphism [22Xϕ[122X to itself, unless it is congruent to the zero175morphism; in this case it is mapped to [10XZeroMorphism[110X([10XSource[110X([22Xϕ[122X), [10XRange[110X([22Xϕ[122X)).176This functor is equivalent to the identity functor.[133X177178[1X2.4-12 NaturalIsomorophismFromIdentityToCanonicalizeZeroMorphisms[101X179180[29X[2XNaturalIsomorophismFromIdentityToCanonicalizeZeroMorphisms[102X( [3Xcategory[103X ) [32X attribute181[6XReturns:[106X [33X[0;10Ya natural transformation[133X182183[33X[0;0YReturns the natural isomorphism from the identity functor to184[10XFunctorCanonicalizeZeroMorphisms[110X([3Xcat[103X).[133X185186187[1X2.5 [33X[0;0YNatural transformations[133X[101X188189[1X2.5-1 Name[101X190191[29X[2XName[102X( [3Xarg[103X ) [32X attribute192[6XReturns:[106X [33X[0;10Ya string[133X193194[33X[0;0YAs every functor, every natural transformation has a name attribute. It has195to be a string and will be set by the Constructor.[133X196197[1X2.5-2 NaturalTransformation[101X198199[29X[2XNaturalTransformation[102X( [[3Xname[103X, ][3XF[103X, [3XG[103X ) [32X operation200[6XReturns:[106X [33X[0;10Ya natural transformation[133X201202[33X[0;0YConstructs a natural transformation between the functors [3XF[103X[23X:A \rightarrow B[123X203and [3XG[103X[23X:A \rightarrow B[123X. The string [3Xname[103X is optional, and, if not given, set204automatically from the names of the functors[133X205206[1X2.5-3 AddNaturalTransformationFunction[101X207208[29X[2XAddNaturalTransformationFunction[102X( [3XN[103X, [3Xfunc[103X ) [32X operation209210[33X[0;0YAdds the function (or list of functions) [3Xfunc[103X to the natural transformation211[3XN[103X. The function or each function in the list should take three arguments. If212[23XN: F \rightarrow G[123X, the arguments should be [23XF(A), A, G(A)[123X. The ouptput213should be a morphism, [23XF(A) \rightarrow G(A)[123X.[133X214215[1X2.5-4 ApplyNaturalTransformation[101X216217[29X[2XApplyNaturalTransformation[102X( [3XN[103X, [3XA[103X ) [32X function218[6XReturns:[106X [33X[0;10Ya morphism[133X219220[33X[0;0YGiven a natural transformation [3XN[103X[23X:F \rightarrow G[123X and an object [3XA[103X, this221function should return the morphism [23XF(A) \rightarrow G(A)[123X, corresponding to222[3XN[103X.[133X223224[1X2.5-5 InstallNaturalTransformation[101X225226[29X[2XInstallNaturalTransformation[102X( [3XN[103X, [3Xname[103X ) [32X operation227228[33X[0;0YInstalls the natural transformation [3XN[103X as operation with the name [3Xname[103X.229Argument for this operation is an object, output is a morphism.[133X230231[1X2.5-6 HorizontalPreComposeNaturalTransformationWithFunctor[101X232233[29X[2XHorizontalPreComposeNaturalTransformationWithFunctor[102X( [3XN[103X, [3XF[103X ) [32X operation234[6XReturns:[106X [33X[0;10Ya natural transformation[133X235236[33X[0;0YComputes the horizontal composition of the natural transformation [3XN[103X and[133X237238[1X2.5-7 HorizontalPreComposeFunctorWithNaturalTransformation[101X239240[29X[2XHorizontalPreComposeFunctorWithNaturalTransformation[102X( [3XF[103X, [3XN[103X ) [32X operation241[6XReturns:[106X [33X[0;10Ya natural transformation[133X242243[33X[0;0YComputes the horizontal composition of the functor [3XF[103X and the natural244transformation [3XN[103X.[133X245246247248