Function Repository Resource:

AbstractFunctor

Source Notebook

Make an abstract model of a functor (i.e. a homomorphism between abstract categories)

Contributed by: Jonathan Gorard

ResourceFunction["AbstractFunctor"][cat,mapob,maparr,newob,newarr,comp,id,eqob,eqmor]

makes an abstract functor whose domain is the abstract category cat, using the association of mappings between objects mapob, the association of mappings between arrows maparr, the list of newly-created objects newob, the association of newly-created arrows newarr, the new composition symbol comp, the new identity symbol id, the list of new object equivalences eqob and the list of new morphism equivalences eqmor.

ResourceFunction["AbstractFunctor"][func[cat]]

makes an abstract functor by applying the function func to every object and every morphism in the abstract category cat.

ResourceFunction["AbstractFunctor"][False,]

makes a contravariant version of the specified abstract functor.

ResourceFunction["AbstractFunctor"][assoc]

makes an abstract functor using the association of covariance/contravariance flag, initial abstract category, object mappings, arrow mappings, new objects, new arrows, new composition symbol, new identity symbol, new object equivalences and new morphism equivalences assoc.

ResourceFunction["AbstractFunctor"][ResourceFunction["AbstractFunctor"][],comp,id,eqob,eqmor]

makes a new abstract functor from an old functor by imposing new composition symbol comp, new identity symbol id, new object equivalences eqob and new morphism equivalences eqmor.

ResourceFunction["AbstractFunctor"][][AbstractCategory[]]

applies an abstract functor to the specified abstract category.

Details and Options

A functor between two categories is a mapping that associates every object in the domain category to a corresponding object in the codomain category, as well as every morphism in the domain category to a corresponding morphism in the codomain category, in such a way that the sources and targets of morphisms are respected by this map, identity morphisms on objects in the domain category are mapped to the identity morphisms on the corresponding objects in the codomain category, and compositions of morphisms in the domain category are mapped to compositions of the corresponding morphisms in the codomain category. In this way, a functor can be thought of as a homomorphism between categories (in that it generalizes the standard algebraic notion of homomorphism between monoids, groups, rings, etc. to the case of categories containing more than one object).
A map between categories that preserves the composition and identity conditions is often referred to as possessing the property of functoriality.
Though the definition given above applies to the case of covariant functors, there are also contravariant functors which have the effect of swapping the sources and targets of morphisms around and reversing the direction of composition. Contravariant functors may therefore be thought of as covariant functors defined over the dual/opposite category.
Functors capture many familiar constructions from mathematics such as presheaves (contravariant functors from the category of open sets in a topological space to the category of sets), power sets (covariant or contravariant functors from the category of sets to itself), dual vector spaces (contravariant functors from the category of vector spaces over a fixed field to itself), fundamental groups (covariant functors from the category of pointed topological spaces to the category of groups), group actions (covariant functors from a single-object groupoid to the category of sets), group representations (covariant functors from a single-object groupoid to the category of vector spaces), tensor products (covariant two-argument functors from the category of vector spaces to itself), tangent/cotangent bundles (covariant/contravariant functors from the category of differentiable manifolds to the category of vector bundles), etc., and generalize them to arbitrary categories. Indeed, every category-theoretic diagram can be thought of as a covariant functor from some (usually finite) index category to an arbitrary category.
An abstract presentation of a functor can therefore be given in terms of an initial abstract category (the domain), collections of mappings between objects and arrows in the underlying abstract quiver, collections of new objects and arrows to add to the codomain category, a new composition symbol and a new identity symbol for the codomain category, and collections of new relations between objects and morphisms (effectively specifying which objects and morphisms in the codomain category may be treated as equivalent).
ResourceFunction["AbstractFunctor"] supports the specification of abstract functors either by an initial abstract category together with eight lists/associations/symbols (an association of mappings between objects mapob, an association of mappings between arrows maparr, a list of new objects newob, an association of new arrows newarr, a new composition symbol comp, a new identity symbol id, a list of new object equivalences eqob and a list of new morphism equivalences eqmor), by an arbitrary function func (applied to a specified initial abstract category) or by an explicit association of the form <|"Covariant"cov,"Category"cat,"ObjectMappings"mapob,"ArrowMappings"maparr,"NewObjects"newob,"NewArrows"newarr,"NewCompositionSymbol"comp,"NewIdentitySymbol"id,"ObjectEquivalences"eqob,"MorphismEquivalences"eqmor|>.
An abstract category object can be generated using the resource function AbstractCategory.
Where specified, the new composition symbol comp should be a binary operator and the new identity symbol id should be a unary operator.
When specifying an abstract functor by a collection of lists/associations/symbols, ResourceFunction["AbstractFunctor"] allows one to omit either the association of object mappings, the association of arrow mappings, the list of new objects, the association of new arrows, the new composition symbol, the new identity symbol, the list of new object equivalences or the list of new morphism equivalences (or some combination of the above). When the object mappings association is omitted, every object in the domain category is assumed to map to itself; likewise, when the arrow mappings association is omitted, every arrow in the underlying quiver of the domain category is assumed to map to itself. When the list of new objects or the association of new arrows is omitted, they are assumed to be empty (i.e. no new objects/arrows are created). When the new composition or identity symbol is omitted, they are assumed to be the same as the composition and identity symbols in the domain category. When lists of either new object equivalences or new morphism equivalences are omitted, they are assumed to be empty (i.e. no new equivalences between objects/morphisms are imposed in the codomain category).
Note that abstract functor specifies mappings at the level of arrows in the underlying abstract quiver, rather than mappings between the morphisms of the categories themselves; this is because the specification of mappings between the underlying arrows is sufficient to determine the functor fully, since all other mappings between morphisms can subsequently be deduced from the properties of composition and identity in the underlying category (which are necessarily preserved by virtue of functoriality).
By default, all object and morphism equivalences in the domain category will be respected by the application of an abstract functor (i.e. the equivalences between objects and morphisms in the domain category will be mapped to equivalences between the corresponding objects and morphisms in the codomain category, together with any new equivalences imposed by the abstract functor itself).
The codomain category may be strictly larger (if sufficiently many new objects and new arrows are introduced), strictly smaller (if sufficiently many new equivalences between objects and morphisms are introduced), or the same size as the domain category.
If the function succeeds in constructing the specified abstract functor, it will return an ResourceFunction["AbstractFunctor"] expression.
ResourceFunction["AbstractFunctor"] expressions can be applied directly to AbstractCategory expressions, in which case a new AbstractCategory expression will be created by applying the specified object and arrow mappings, creating the specified new objects and arrows, introducing the specified composition and identity symbols and imposing the specified object and morphism equivalences to the old AbstractCategory. When the input AbstractCategory is the domain category of the ResourceFunction["AbstractFunctor"], then this will simply return the corresponding codomain category.
In ResourceFunction["AbstractFunctor"], the following properties are supported:
"ObjectCount"number of objects in the domain category vs. the codomain category of the abstract functor
"MorphismCount"number of morphisms in the domain category vs. the codomain category of the abstract functor
"ObjectEquivalences"list of equivalences between objects in the codomain category imposed by the abstract functor
"ObjectEquivalenceCount"number of equivalences between objects in the codomain category imposed by the abstract functor
"MorphismEquivalences"list of equivalences between morphisms in the codomain category imposed by the abstract functor
"MorphismEquivalenceCount"number of equivalences between morphisms in the codomain category imposed by the abstract functor
"ReducedObjectCount"number of objects in the domain category vs. the codomain category of the abstract functor modulo all object equivalences
"ReducedMorphismCount"number of morphisms in the domain category vs. the codomain category of the abstract functor modulo all morphism/object equivalences
"CompositionSymbol"symbol used to denote morphism composition in the domain category vs. the codomain category (should be a binary operator in both cases)
"IdentitySymbol"symbol used to denote identity morphisms on objects in the domain category vs. the codomain category (should be a unary operator in both cases)
"NewObjects"list of new objects in the codomain category that have no counterpart in the domain category of the abstract functor
"NewObjectCount"number of new objects in the codomain category that have no counterpart in the domain category of the abstract functor
"ReducedNewObjects"list of new objects in the codomain category that have no counterpart in the domain category of the abstract functor, modulo all object equivalences
"ReducedNewObjectCount"number of new objects in the codomain category that have no counterpart in the domain category of the abstract functor, modulo all object equivalences
"NewArrows"association of new arrows in the underlying quiver of the codomain category that have no counterpart in the underlying quiver of the domain category of the abstract functor
"NewArrowCount"number of new arrows in the underlying quiver of the codomain category that have no counterpart in the underlying quiver of the domain category of the abstract functor
"NewMorphisms"association of new morphisms in the codomain category that have no counterpart in the domain category of the abstract functor
"NewMorphismCount"number of new morphisms in the codomain category that have no counterpart in the domain category of the abstract functor
"ReducedNewMorphisms"association of new morphisms in the codomain category that have no counterpart in the domain category of the abstract functor, modulo all morphism/object equivalences
"ReducedNewMorphismCount"number of new morphisms in the codomain category that have no counterpart in the domain category of the abstract functor, modulo all morphism/object equivalences
"ObjectMappings"association of mappings between objects in the domain category and corresponding objects in the codomain category of the abstract functor
"ObjectMappingCount"number of mappings between objects in the domain category and corresponding objects in the codomain category of the abstract functor
"ReducedObjectMappings"association of mappings between objects in the domain category and corresponding objects in the codomain category of the abstract functor, modulo all object equivalences
"ReducedObjectMappingCount"number of mappings between objects in the domain category and corresponding objects in the codomain category of the abstract functor, modulo all object equivalences
"ArrowMappings"association of mappings between arrows in the underlying quiver of the domain category and corresponding arrows in the underlying quiver of the codomain category of the abstract functor
"ArrowMappingCount"number of mappings between arrows in the underlying quiver of the domain category and corresponding arrows in the underlying quiver of the codomain category of the abstract functor
"MorphismMappings"association of mappings between morphisms in the domain category and corresponding morphisms in the codomain category of the abstract functor
"MorphismMappingCount"number of mappings between morphisms in the domain category and corresponding morphisms in the codomain category of the abstract functor
"ReducedMorphismMappings"association of mappings between morphisms in the domain category and corresponding morphisms in the codomain category of the abstract functor, modulo all morphism/object equivalences
"ReducedMorphismMappingCount"number of mappings between morphisms in the domain category and corresponding morphisms in the codomain category of the abstract functor, modulo all morphism/object equivalences
"DomainCategory"domain of the abstract functor, represented as an abstract category
"CodomainCategory"codomain of the abstract functor, represented as an abstract category
"EndofunctorQ"whether the abstract functor is an endofunctor (i.e. a functor from an abstract category to itself)
"IdentityFunctorQ"whether the abstract functor is an identity functor (i.e. an endofunctor that maps every object to itself and every morphism to itself)
"ConstantFunctorQ"whether the abstract functor is a constant functor/selection functor (i.e. a functor mapping every object to some fixed object in the codomain category, and every morphism to the identity morphism on that fixed object)
"FullFunctorQ"whether the abstract functor is full (i.e. a surjective function mapping sets of morphisms between pairs of objects in the domain category to corresponding sets of morphisms between corresponding pairs of objects in the codomain category)
"FaithfulFunctorQ"whether the abstract functor is faithful (i.e. an injective function mapping sets of morphisms betwen pairs of objects in the domain category to corresponding sets of morphisms between corresponding pairs of objects in the codomain category)
"FullyFaithfulFunctorQ"whether the abstract functor is fully faithful (i.e. a bijective function mapping sets of morphisms between pairs of objects in the domain category to corresponding sets of morphisms between corresponding pairs of objects in the codomain category)
"InjectiveOnObjectsQ"whether the abstract functor is injective on objects (i.e. an injective function mapping the object set of the domain category to the object set of the codomain category)
"EssentiallyInjectiveFunctorQ"whether the abstract functor is essentially injective on objects (i.e. an injective function up to isomorphism mapping the object set of the domain category to the object set of the codomain category)
"SurjectiveOnObjectsQ"whether the abstract functor is surjective on objects (i.e. a surjective function mapping the object set of the domain category to the object set of the codomain category)
"EssentiallySurjectiveFunctorQ"whether the abstract functor is essentially surjective on objects (i.e. a surjective function up to isomorphism mapping the object set of the domain category to the object set of the codomain category)
"BijectiveOnObjectsQ"whether the abstract functor is bijective on objects (i.e. a bijective function mapping the object set of the domain category to the object set of the codomain category)
"EssentiallyBijectiveFunctorQ"whether the abstract functor is essentially bijective on objects (i.e. a bijective function up to isomorphism mapping the object set of the domain category to the object set of the codomain category)
"ConservativeFunctorQ"whether the abstract functor is conservative (i.e. a morphism in the codomain category being an isomorphism implies that the corresponding morphism in the domain category is also an isomorphism)
"EquivalenceFunctorQ"whether the abstract functor yields an equivalence of categories (i.e. the functor is fully faithful and essentially surjective)
"FiberCategories"association of fibers/fiber categories for each object in the codomain category of the abstract functor (i.e. objects/morphisms in the domain category that project onto the specified object/identity morphism in the codomain category)
"ReducedFiberCategories"association of fibers/fiber categories for each object in the codomain category of the abstract functor (i.e. objects/morphisms in the domain category that project onto the specified object/identity morphism in the codomain category), modulo all morphism/object equivalences
"DiscreteFibrationQ"whether the abstract functor corresponds to a discrete fibration (a special case of a Grothendieck fibration)
"InclusionFunctorQ"whether the abstract functor corresponds to an inclusion functor for a subcategory (i.e. whether the objects/morphisms in the domain category form a subset of the objects/morphisms in the codomain category)
"FullInclusionFunctorQ"whether the abstract functor corresponds to a full inclusion functor for a subcategory (i.e. an inclusion functor that is also a full functor)
"EmbeddingFunctorQ"whether the abstract functor corresponds to an embedding functor (i.e. a functor that is both faithful and injective on objects)
"FullEmbeddingFunctorQ"whether the abstract functor corresponds to a full embedding functor (i.e. a functor that is both fully faithful and injective on objects)
"SwapVariance"returns a contravariant version of the abstract functor if it was originally covariant (and likewise a covariant version if it was originally contravariant)
"CovariantFunctorQ"whether the abstract functor is covariant (i.e. preserves the sources/targets of morphisms and the direction of morphism composition)
"ContravariantFunctorQ"whether the abstract functor is contravariant (i.e. swaps the sources/targets of morphisms and reverses the direction of morphism composition)
"FullLabeledGraph"abstract functor represented as a map between directed graphs with labels on the morphisms
"FullUnlabeledGraph"abstract functor represented as a map between directed graphs with no labels on the morphisms
"ReducedLabeledGraph"abstract functor represented as a map between directed graphs, modulo the lists of morphism/object equivalences, with labels on the morphisms
"ReducedUnlabeledGraph"abstract functor represented as a map between directed graphs, modulo the lists of morphism/object equivalences, with no labels on the morphisms
"SimpleLabeledGraph"abstract functor represented as a map between directed graphs, with self-loops and multiedges removed, with labels on the morphisms
"SimpleUnlabeledGraph"abstract functor represented as a map between directed graphs, with self-loops and multiedges removed, with no labels on the morphisms
"ReducedSimpleLabeledGraph"abstract functor represented as a map between directed graphs, with self-loops and multiedges removed, modulo the lists of morphism/object equivalences, with labels on the morphisms
"ReducedSimpleUnlabeledGraph"abstract functor represented as a map between directed graphs, with self-loops and multiedges removed, modulo the lists of morphism/object equivalences, with no labels on the morphisms
"AssociationForm"abstract functor represented as an association of covariance/contravariance flag, initial abstract category, object mappings, arrow mappings, new objects, new arrows, new composition symbol, new identity symbol, new object equivalences and new morphism equivalences
"Properties"list of properties

Examples

Basic Examples (6) 

Construct a simple abstract functor from an abstract category and a pair of associations designating object/arrow mappings:

In[1]:=
category = ResourceFunction["AbstractCategory"][<|f -> {X, Y}, g -> {Y, Z}|>]
Out[1]=
In[2]:=
functor = ResourceFunction["AbstractFunctor"][
  category, <|X -> \[FormalCapitalA], Y -> \[FormalCapitalB], Z -> \[FormalCapitalC]|>, <|f -> i, g -> j|>]
Out[2]=

Show the full directed graphs with labels on the morphisms:

In[3]:=
functor["FullLabeledGraph"]
Out[3]=

Show the full directed graphs without labels on the morphisms:

In[4]:=
functor["FullUnlabeledGraph"]
Out[4]=

Show the association of object mappings:

In[5]:=
functor["ObjectMappings"]
Out[5]=

Show the association of morphism mappings:

In[6]:=
functor["MorphismMappings"]
Out[6]=

Construct the same abstract category, but now with an equivalence imposed between objects X and Y and morphisms gf and g:

In[7]:=
category2 = ResourceFunction["AbstractCategory"][<|f -> {X, Y}, g -> {Y, Z}|>, {X == Y}, {CircleDot[g, f] == g}]
Out[7]=

Construct an abstract functor from this new abstract category, with a new object U, with a new arrow k between objects C and U, with new composition and identity symbols and ─, and with an equivalence imposed between morphisms i and :

In[8]:=
functor2 = ResourceFunction["AbstractFunctor"][
  category2, <|X -> \[FormalCapitalA], Y -> \[FormalCapitalB], Z -> \[FormalCapitalC]|>, <|f -> i, g -> j|>, {U}, <|
   k -> {\[FormalCapitalC], U}|>, CircleTimes, OverBar, {}, {i == OverBar[\[FormalCapitalB]]}]
Out[8]=

Show the reduced directed graphs, with all equivalences between objects and morphisms imposed and with labels on the morphisms:

In[9]:=
functor2["ReducedLabeledGraph"]
Out[9]=

Show the reduced directed graphs without labels on the morphisms:

In[10]:=
functor2["ReducedUnlabeledGraph"]
Out[10]=

Show the association of object mappings, with all equivalences between objects imposed:

In[11]:=
functor2["ReducedObjectMappings"]
Out[11]=

Show the association of morphism mappings, with all equivalences between objects and morphisms imposed:

In[12]:=
functor2["ReducedMorphismMappings"]
Out[12]=

Show the list of equivalences between objects:

In[13]:=
functor2["ObjectEquivalences"]
Out[13]=

Show the list of equivalences between morphisms:

In[14]:=
functor2["MorphismEquivalences"]
Out[14]=

Show the domain and codomain categories:

In[15]:=
functor2["DomainCategory"]
Out[15]=
In[16]:=
functor2["CodomainCategory"]
Out[16]=

Show the association form of the abstract functor:

In[17]:=
functor2["AssociationForm"]
Out[17]=

Construct an abstract functor from a simple abstract category to itself that swaps two of the arrows (g1 and g2) around:

In[18]:=
category = ResourceFunction["AbstractCategory"][<|f -> {X, Y}, g1 -> {Y, Z}, g2 -> {Y, Z}, h -> {Z, W}|>]
Out[18]=
In[19]:=
functor = ResourceFunction["AbstractFunctor"][
  category, <||>, <|g1 -> g2, g2 -> g1|>]
Out[19]=
In[20]:=
functor["FullLabeledGraph"]
Out[20]=

Show that the functor is an endofunctor (a functor from a category to itself):

In[21]:=
functor["EndofunctorQ"]
Out[21]=

Show that the functor is not an identity functor (it does not map every object to itself and every morphism to itself):

In[22]:=
functor["IdentityFunctorQ"]
Out[22]=
In[23]:=
functor["MorphismMappings"]
Out[23]=

Return a contravariant version of the same abstract functor (in which the sources and targets of morphisms are swapped):

In[24]:=
functor2 = functor["SwapVariance"]
Out[24]=
In[25]:=
functor2["CovariantFunctorQ"]
Out[25]=
In[26]:=
functor2["ContravariantFunctorQ"]
Out[26]=

Show that the direction of morphism composition is reversed:

In[27]:=
functor2["FullLabeledGraph"]
Out[27]=
In[28]:=
functor2["MorphismMappings"]
Out[28]=

Construct a contravariant identity functor on a more complicated abstract category:

In[29]:=
category = ResourceFunction["AbstractCategory"][<|f -> {X, Y}, g1 -> {Y, Z}, g2 -> {Y, Z}, h -> {Y, U}, i -> {Y, V}|>]
Out[29]=
In[30]:=
functor = ResourceFunction["AbstractFunctor"][False, category]
Out[30]=
In[31]:=
functor["FullLabeledGraph"]
Out[31]=

Show that the functor is both an endofunctor and an identity functor:

In[32]:=
functor["EndofunctorQ"]
Out[32]=
In[33]:=
functor["IdentityFunctorQ"]
Out[33]=

Show that the functor is full, faithful and fully faithful (i.e. it is surjective, injective and therefore bijective as a function on sets of morphisms between pairs of objects):

In[34]:=
functor["FullFunctorQ"]
Out[34]=
In[35]:=
functor["FaithfulFunctorQ"]
Out[35]=
In[36]:=
functor["FullyFaithfulFunctorQ"]
Out[36]=

Construct a new contravariant functor that creates a new arrow (g3) between objects Z and Y:

In[37]:=
functor2 = ResourceFunction["AbstractFunctor"][False, category, <||>, <||>, {}, <|g3 -> {Z, Y}|>]
Out[37]=
In[38]:=
functor2["FullLabeledGraph"]
Out[38]=

Show the association of new morphisms:

In[39]:=
functor2["NewMorphisms"]
Out[39]=

Show that the functor is no longer full nor fully faithful, though it is still faithful (since it is now an injective, though not surjective, function on sets of morphisms between pairs of objects):

In[40]:=
functor2["FullFunctorQ"]
Out[40]=
In[41]:=
functor2["FaithfulFunctorQ"]
Out[41]=
In[42]:=
functor2["FullyFaithfulFunctorQ"]
Out[42]=

Construct a new contravariant functor that imposes an equivalence between morphisms g1 and g2 in the codomain category:

In[43]:=
functor3 = ResourceFunction["AbstractFunctor"][False, category, <||>, <||>, {}, <||>, {}, {g1 == g2}]
Out[43]=
In[44]:=
functor3["ReducedLabeledGraph"]
Out[44]=

Show that the functor is no longer faithful nor fully faithful, though it is still full (since it is now a surjective, though not injective, function on sets of morphisms between pairs of objects):

In[45]:=
functor3["FullFunctorQ"]
Out[45]=
In[46]:=
functor3["FaithfulFunctorQ"]
Out[46]=
In[47]:=
functor3["FullyFaithfulFunctorQ"]
Out[47]=

Construct a simple abstract functor from an abstract category representing a span of (mono)morphisms:

In[48]:=
category = ResourceFunction["AbstractCategory"][<|f -> {X, Y}, g -> {X, Z}|>]
Out[48]=
In[49]:=
functor = ResourceFunction["AbstractFunctor"][
  category, <|X -> U, Y -> V, Z -> W|>, <||>]
Out[49]=
In[50]:=
functor["FullLabeledGraph"]
Out[50]=

Show that this functor is injective, surjective and bijective as a function on the sets of objects:

In[51]:=
functor["InjectiveOnObjectsQ"]
Out[51]=
In[52]:=
functor["SurjectiveOnObjectsQ"]
Out[52]=
In[53]:=
functor["BijectiveOnObjectsQ"]
Out[53]=

Construct a new abstract functor that introduces new objects X and Y:

In[54]:=
functor2 = ResourceFunction["AbstractFunctor"][
  category, <|X -> U, Y -> V, Z -> W|>, <||>, {X, Y}, <||>]
Out[54]=
In[55]:=
functor2["ReducedLabeledGraph"]
Out[55]=

Show that the functor is no longer surjective nor bijective as a function on the sets of objects, though it is still injective:

In[56]:=
functor2["InjectiveOnObjectsQ"]
Out[56]=
In[57]:=
functor2["SurjectiveOnObjectsQ"]
Out[57]=
In[58]:=
functor2["BijectiveOnObjectsQ"]
Out[58]=

Show that by introducing isomorphisms between objects X and W and objects Y and V in the codomain category, the functor can nevertheless be made essentially surjective on objects:

In[59]:=
functor3 = ResourceFunction["AbstractFunctor"][
  category, <|X -> U, Y -> V, Z -> W|>, <||>, {X, Y}, <|j -> {X, W}, j2 -> {W, X}, k -> {Y, V}, k2 -> {V, Y}|>, {}, {CircleDot[j, j2] == OverTilde[W], CircleDot[j2, j] == OverTilde[X], CircleDot[k, k2] == OverTilde[V],
    CircleDot[k2, k] == OverTilde[Y]}]
Out[59]=
In[60]:=
functor3["ReducedLabeledGraph"]
Out[60]=
In[61]:=
functor3["EssentiallySurjectiveFunctorQ"]
Out[61]=

Even though it is still not strictly surjective on objects:

In[62]:=
functor3["SurjectiveOnObjectsQ"]
Out[62]=

Likewise, we can construct a new functor that imposes an equivalence between objects U and V in the codomain category:

In[63]:=
functor4 = ResourceFunction["AbstractFunctor"][
  category, <|X -> U, Y -> V, Z -> W|>, <||>, {}, <||>, {U == V}, {}]
Out[63]=
In[64]:=
functor4["ReducedLabeledGraph"]
Out[64]=

Show that the functor is no longer injective nor bijective as a function on the sets of objects, though it is still surjective:

In[65]:=
functor4["InjectiveOnObjectsQ"]
Out[65]=
In[66]:=
functor4["SurjectiveOnObjectsQ"]
Out[66]=
In[67]:=
functor4["BijectiveOnObjectsQ"]
Out[67]=

Show that by introducing an isomorphism between objects X and Y in the domain category, the functor can nevertheless be made essentially injective on objects:

In[68]:=
category2 = ResourceFunction["AbstractCategory"][<|f -> {X, Y}, g -> {X, Z}, f2 -> {Y, X}|>, {}, {CircleDot[f, f2] == OverTilde[Y], CircleDot[f2, f] == OverTilde[X]}]
Out[68]=
In[69]:=
functor5 = ResourceFunction["AbstractFunctor"][
  category2, <|X -> U, Y -> V, Z -> W|>, <||>, {}, <||>, {U == V}, {}]
Out[69]=
In[70]:=
functor5["ReducedLabeledGraph"]
Out[70]=
In[71]:=
functor5["EssentiallyInjectiveFunctorQ"]
Out[71]=

Even though it is still not strictly injective on objects:

In[72]:=
functor5["InjectiveOnObjectsQ"]
Out[72]=

Show the list of equivalences between morphisms:

In[73]:=
functor5["MorphismEquivalences"]
Out[73]=

Construct an abstract functor that adds two new objects (W and U) and three new arrows (h, i and g2) to a simple abstract category:

In[74]:=
category = ResourceFunction["AbstractCategory"][<|f -> {X, Y}, g -> {Y, Z}|>]
Out[74]=
In[75]:=
functor = ResourceFunction["AbstractFunctor"][
  category, <||>, <||>, {W, U}, <|h -> {Z, W}, i -> {U, X}, g2 -> {Y, Z}|>, {}, {}]
Out[75]=
In[76]:=
functor["FullLabeledGraph"]
Out[76]=

Show that the functor is an inclusion functor (i.e. the domain is a subcategory of the codomain), but not a full inclusion functor (since it is not a full functor):

In[77]:=
functor["InclusionFunctorQ"]
Out[77]=
In[78]:=
functor["FullInclusionFunctorQ"]
Out[78]=

Similarly, show that the functor is an embedding functor (i.e. it is both faithful and injective on objects), but not a full embedding functor (i.e. it is not fully faithful and injective on objects):

In[79]:=
functor["EmbeddingFunctorQ"]
Out[79]=
In[80]:=
functor["FullEmbeddingFunctorQ"]
Out[80]=

Show that the functor does not yield an equivalence of categories (i.e. it is not fully faithful and essentially surjective):

In[81]:=
functor["EquivalenceFunctorQ"]
Out[81]=

Apply the abstract functor to the original abstract category (thus yielding the codomain category):

In[82]:=
functor[category]
Out[82]=

Apply the abstract functor to a larger abstract category (in which case it acts as an abstract functor on the relevant subcategory):

In[83]:=
functor[ResourceFunction["AbstractCategory"][<|f -> {X, Y}, g -> {Y, Z}, f2 -> {X, Q}, f3 -> {Y, P}|>]]
Out[83]=

Construct an abstract functor that projects certain collections of objects in the domain category to single objects in the codomain category, and certain collections of morphisms in the domain category to identity morphisms in the codomain category (i.e. a simple fibration):

In[84]:=
category = ResourceFunction["AbstractCategory"][<|f -> {X, Y}, g -> {Y, Z}, h -> {Z, W}, i -> {W, U}|>]
Out[84]=
In[85]:=
functor = ResourceFunction["AbstractFunctor"][
  category, <||>, <||>, {}, <||>, {X == Y, W == U, Z == W}, {i == OverTilde[U], f == OverTilde[Y], h == OverTilde[U], CircleDot[OverTilde[U], OverTilde[U]] == OverTilde[U]}]
Out[85]=
In[86]:=
functor["ReducedLabeledGraph"]
Out[86]=

Show the association of fibers/fiber categories for each object in codomain category (i.e. show, for each object in the codomain category, which objects/morphisms in the domain category map to that object/its identity morphism in the codomain category):

In[87]:=
functor["FiberCategories"]
Out[87]=

Show the association of fibers/fiber categories for each object in the codomain category, with all equivalences between objects and morphisms imposed:

In[88]:=
functor["ReducedFiberCategories"]
Out[88]=

Show the graph form of the fiber associated to the object U in the codomain category:

In[89]:=
functor["ReducedFiberCategories"][U]["FullLabeledGraph"]
Out[89]=

Show that the fibration is not discrete:

In[90]:=
functor["DiscreteFibrationQ"]
Out[90]=

Show that the functor is not constant (i.e. it does not map all objects in the domain category to a single object in the codomain category, and all morphisms in the domain category to the identity morphism on that object in the codomain category):

In[91]:=
functor["ConstantFunctorQ"]
Out[91]=

Show that the functor is nevertheless conservative (i.e. a morphism in the codomain category being an isomorphism necessarily implies that the corresponding morphism in the domain category is an isomorphism):

In[92]:=
functor["ConservativeFunctorQ"]
Out[92]=

Show the association of morphism mappings, with all equivalences between objects and morphisms imposed:

In[93]:=
functor["ReducedMorphismMappings"]
Out[93]=

Scope (3) 

Abstract functors can be constructed directly by applying a function symbol (e.g. F) to an abstract category object:

In[94]:=
category = ResourceFunction["AbstractCategory"][<|f -> {X, Y}, g -> {Y, Z}, h -> {Z, W}|>]
Out[94]=
In[95]:=
functor = ResourceFunction["AbstractFunctor"][\[FormalCapitalF][category]]
Out[95]=
In[96]:=
functor["FullLabeledGraph"]
Out[96]=
In[97]:=
functor["MorphismMappings"]
Out[97]=

If AbstractFunctor is given only an abstract category object, then its default behavior is to construct an identity functor on that category:

In[98]:=
category = ResourceFunction["AbstractCategory"][<|f -> {X, Y}, g -> {Y, Z}, h -> {Z, W}|>]
Out[98]=
In[99]:=
functor = ResourceFunction["AbstractFunctor"][category]
Out[99]=
In[100]:=
functor["FullLabeledGraph"]
Out[100]=
In[101]:=
functor["MorphismMappings"]
Out[101]=

Additional arguments can be used to specify object and arrow mappings:

In[102]:=
functor2 = ResourceFunction["AbstractFunctor"][
  category, <|X -> A, Y -> B|>, <|f -> F, g -> G|>]
Out[102]=
In[103]:=
functor2["FullLabeledGraph"]
Out[103]=
In[104]:=
functor2["MorphismMappings"]
Out[104]=

Further arguments can be used to specify new objects and new arrows that are introduced by the functor:

In[105]:=
functor3 = ResourceFunction["AbstractFunctor"][
  category, <|X -> A, Y -> B|>, <|f -> F, g -> G|>, {U, V}, <|
   i -> {U, V}|>]
Out[105]=
In[106]:=
functor3["FullLabeledGraph"]
Out[106]=
In[107]:=
functor3["NewObjects"]
Out[107]=
In[108]:=
functor3["NewMorphisms"]
Out[108]=

Further arguments can be used to specify new composition and identity symbols for the codomain category:

In[109]:=
functor4 = ResourceFunction["AbstractFunctor"][
  category, <|X -> A, Y -> B|>, <|f -> F, g -> G|>, {U, V}, <|
   i -> {U, V}|>, CircleTimes, OverBar]
Out[109]=
In[110]:=
functor4["FullLabeledGraph"]
Out[110]=
In[111]:=
functor4["CompositionSymbol"]
Out[111]=
In[112]:=
functor4["IdentitySymbol"]
Out[112]=

Further arguments can finally be used to specify new equivalences between objects and morphisms in the codomain category:

In[113]:=
functor5 = ResourceFunction["AbstractFunctor"][
  category, <|X -> A, Y -> B|>, <|f -> F, g -> G|>, {U, V}, <|
   i -> {U, V}|>, CircleTimes, OverBar, {Z == W}, {CircleTimes[G, F] == CircleTimes[CircleTimes[h, G], F]}]
Out[113]=
In[114]:=
functor5["ReducedLabeledGraph"]
Out[114]=
In[115]:=
functor5["ReducedMorphismMappings"]
Out[115]=

If the new composition and identity symbols are omitted, they are assumed to be the same as for the domain category:

In[116]:=
functor6 = ResourceFunction["AbstractFunctor"][
  category, <|X -> A, Y -> B|>, <|f -> F, g -> G|>, {U, V}, <|
   i -> {U, V}|>, {Z == W}, {CircleDot[G, F] == CircleDot[CircleDot[h, G], F]}]
Out[116]=
In[117]:=
functor6["ReducedLabeledGraph"]
Out[117]=

New composition and identity symbols can be specified for any existing abstract functor:

In[118]:=
functor7 = ResourceFunction["AbstractFunctor"][functor6, CirclePlus, OverHat]
Out[118]=
In[119]:=
functor7["ReducedLabeledGraph"]
Out[119]=

Likewise for new object and morphism equivalences:

In[120]:=
functor8 = ResourceFunction["AbstractFunctor"][
  functor6, {Z == W, U == V}, {CircleDot[G, F] == CircleDot[CircleDot[h, G], F], i == OverTilde[V]}]
Out[120]=
In[121]:=
functor8["ReducedLabeledGraph"]
Out[121]=

All four properties (new composition symbol, new identity symbol, new object equivalences and new morphism equivalences) may be specified simultaneously:

In[122]:=
functor9 = ResourceFunction["AbstractFunctor"][functor6, CirclePlus, OverHat, {Z == W, U == V}, {CirclePlus[G, F] == CirclePlus[CirclePlus[h, G], F], i == OverHat[V]}]
Out[122]=
In[123]:=
functor9["ReducedLabeledGraph"]
Out[123]=

The optional first argument to AbstractFunctor specifies whether the functor is covariant (True) or contravariant (False):

In[124]:=
functor10 = ResourceFunction["AbstractFunctor"][False, category, <|X -> A, Y -> B|>, <|f -> F, g -> G|>, {U, V}, <|
   i -> {V, U}|>, {Z == W}, {CircleDot[CircleDot[F, G], h] == CircleDot[F, G]}]
Out[124]=
In[125]:=
functor10["ReducedLabeledGraph"]
Out[125]=
In[126]:=
functor10["ReducedMorphismMappings"]
Out[126]=

From an explicit association:

In[127]:=
functor11 = ResourceFunction[
  "AbstractFunctor"][<|"Covariant" -> False, "Category" -> category, "ObjectMappings" -> <|X -> A, Y -> B|>, "ArrowMappings" -> <|f -> F, g -> G|>, "NewObjects" -> {U, V}, "NewArrows" -> <|i -> {V, U}|>, "NewCompositionSymbol" -> CircleDot, "NewIdentitySymbol" -> OverTilde, "ObjectEquivalences" -> {Z == W},
    "MorphismEquivalences" -> {CircleDot[CircleDot[F, G], h] == CircleDot[F, G]}|>]
Out[127]=
In[128]:=
functor11["ReducedLabeledGraph"]
Out[128]=

Construct an abstract functor from an abstract category and an association of object/arrow mappings, lists/associations of new objects/arrows, new composition/identity symbols and lists of new object/morphism equivalences:

In[129]:=
category = ResourceFunction["AbstractCategory"][<|f -> {X, Y}, g -> {Y, Z}, h -> {Y, W}, i -> {Z, U}, j -> {Z, W}|>, {U == W}, {CircleDot[i, g] == h, CircleDot[j, g] == h}]
Out[129]=
In[130]:=
functor = ResourceFunction["AbstractFunctor"][
  category, <|X -> A, Y -> B|>, <|f -> F, g -> G|>, {Q, V}, <|
   k -> {Q, V}, l -> {Z, Q}|>, CircleTimes, OverBar, {Q == V}, {CircleTimes[l, G] == CircleTimes[CircleTimes[k, l], G]}]
Out[130]=

Show the list of properties:

In[131]:=
functor["Properties"]
Out[131]=

Show the number of objects in the domain category vs. the codomain category of the abstract functor:

In[132]:=
functor["ObjectCount"]
Out[132]=

Show the number of morphisms in the domain category vs. the codomain category of the abstract functor:

In[133]:=
functor["MorphismCount"]
Out[133]=

Show the list of equivalences between objects in the codomain category of the abstract functor:

In[134]:=
functor["ObjectEquivalences"]
Out[134]=

Show the number of equivalences between objects in the codomain category of the abstract functor:

In[135]:=
functor["ObjectEquivalenceCount"]
Out[135]=

Show the list of equivalences between morphisms in the codomain category of the abstract functor:

In[136]:=
functor["MorphismEquivalences"]
Out[136]=

Show the number of equivalences between morphisms in the codomain category of the abstract functor:

In[137]:=
functor["MorphismEquivalenceCount"]
Out[137]=

Show the number of reduced objects (modded out by all object equivalences) in the domain category vs. the codomain category of the abstract functor:

In[138]:=
functor["ReducedObjectCount"]
Out[138]=

Show the number of reduced morphisms (modded out by all object and morphism equivalences) in the domain category vs. the codomain category of the abstract functor:

In[139]:=
functor["ReducedMorphismCount"]
Out[139]=

Show the (binary) symbol used to denote morphism composition in the domain category vs. the codomain category of the abstract functor:

In[140]:=
functor["CompositionSymbol"]
Out[140]=

Show the (unary) symbol used to denote identity morphisms on objects in the domain category vs. the codomain category of the abstract functor:

In[141]:=
functor["IdentitySymbol"]
Out[141]=

Show the list of new objects in the codomain category that have no counterpart in the domain category of the abstract functor:

In[142]:=
functor["NewObjects"]
Out[142]=

Show the number of new objects in the codomain category that have no counterpart in the domain category of the abstract functor:

In[143]:=
functor["NewObjectCount"]
Out[143]=

Show the reduced list of new objects (modded out by all object equivalences) in the codomain category that have no counterpart in the domain category of the abstract functor:

In[144]:=
functor["ReducedNewObjects"]
Out[144]=

Show the number of reduced new objects (modded out by all object equivalences) in the codomain category that have no counterpart in the domain category of the abstract functor:

In[145]:=
functor["ReducedNewObjectCount"]
Out[145]=

Show the association of new morphisms in the codomain category that have no counterpart in the domain category of the abstract functor:

In[146]:=
functor["NewMorphisms"]
Out[146]=

Show the number of new morphisms in the codomain category that have no counterpart in the domain category of the abstract functor:

In[147]:=
functor["NewMorphismCount"]
Out[147]=

Show the reduced association of new morphisms (modded out by all object and morphism equivalences) in the codomain category that have no counterpart in the domain category of the abstract functor:

In[148]:=
functor["ReducedNewMorphisms"]
Out[148]=

Show the number of reduced new morphisms (modded out by all object and morphism equivalences) in the codomain category that have no counterpart in the domain category of the abstract functor:

In[149]:=
functor["ReducedNewMorphismCount"]
Out[149]=

Show the association of mappings between objects in the domain category and corresponding objects in the codomain category of the abstract functor:

In[150]:=
functor["ObjectMappings"]
Out[150]=

Show the number of mappings between objects in the domain category and corresponding objects in the codomain category of the abstract functor:

In[151]:=
functor["ObjectMappingCount"]
Out[151]=

Show the reduced association of mappings (modded out by all object equivalences) between objects in the domain category and corresponding objects in the codomain category of the abstract functor:

In[152]:=
functor["ReducedObjectMappings"]
Out[152]=

Show the number of reduced mappings (modded out by all object equivalences) between objects in the domain category and corresponding objects in the codomain category of the abstract functor:

In[153]:=
functor["ReducedObjectMappingCount"]
Out[153]=

Show the association of mappings between arrows in the underlying quiver of the domain category and corresponding arrows in the underlying quiver of the codomain category of the abstract functor:

In[154]:=
functor["ArrowMappings"]
Out[154]=

Show the number of mappings between arrows in the underlying quiver of the domain category and corresponding arrows in the underlying quiver of the codomain category of the abstract functor:

In[155]:=
functor["ArrowMappingCount"]
Out[155]=

Show the association of mappings between morphisms in the domain category and corresponding morphisms in the codomain category of the abstract functor:

In[156]:=
functor["MorphismMappings"]
Out[156]=

Show the number of mappings between morphisms in the domain category and corresponding morphisms in the codomain category of the abstract functor:

In[157]:=
functor["MorphismMappingCount"]
Out[157]=

Show the reduced association of mappings (modded out by all object and morphism equivalences) between morphisms in the domain category and corresponding morphisms in the codomain category of the abstract functor:

In[158]:=
functor["ReducedMorphismMappings"]
Out[158]=

Show the number of reduced mappings (modded out by all object and morphism equivalences) between morphisms in the domain category and corresponding morphisms in the codomain category of the abstract functor:

In[159]:=
functor["ReducedMorphismMappingCount"]
Out[159]=

Show the domain of the abstract functor (represented as an abstract category):

In[160]:=
functor["DomainCategory"]
Out[160]=

Show the codomain of the abstract functor (represented as an abstract category):

In[161]:=
functor["CodomainCategory"]
Out[161]=

Determine whether the abstract functor is an endofunctor (i.e. a functor from an abstract category to itself):

In[162]:=
functor["EndofunctorQ"]
Out[162]=

Determine whether the abstract functor is an identity functor (i.e. an endofunctor that maps every object and every morphism to itself):

In[163]:=
functor["IdentityFunctorQ"]
Out[163]=

Determine whether the abstract functor is a constant functor/selection functor (i.e. a functor mapping every object to some fixed object in the codomain category, and every morphism to the identity morphism on that fixed object):

In[164]:=
functor["ConstantFunctorQ"]
Out[164]=

Determine whether the abstract functor is a full functor (i.e. a surjective function mapping sets of morphisms between pairs of objects in the domain category to corresponding sets of morphisms between corresponding pairs of objects in the codomain category):

In[165]:=
functor["FullFunctorQ"]
Out[165]=

Determine whether the abstract functor is a faithful functor (i.e. an injective function mapping sets of morphism between pairs of objects in the domain category to corresponding sets of morphisms between corresponding pairs of objects in the codomain category):

In[166]:=
functor["FaithfulFunctorQ"]
Out[166]=

Determine whether the abstract functor is a fully faithful functor (i.e. a bijective function mapping sets of morphisms between pairs of objects in the domain category to corresponding sets of morphisms between corresponding pairs of objects in the codomain category):

In[167]:=
functor["FullyFaithfulFunctorQ"]
Out[167]=

Determine whether the abstract functor is injective on objects (i.e. an injective function mapping the set of objects in the domain category to the corresponding set of objects in the codomain category):

In[168]:=
functor["InjectiveOnObjectsQ"]
Out[168]=

Determine whether the abstract functor is an essentially injective functor (i.e. a function mapping the set of objects in the domain category to the corresponding set of objects in the codomain category that is injective up to isomorphism):

In[169]:=
functor["EssentiallyInjectiveFunctorQ"]
Out[169]=

Determine whether the abstract functor is surjective on objects (i.e. a surjective function mapping the set of objects in the domain category to the corresponding set of objects in the codomain category):

In[170]:=
functor["SurjectiveOnObjectsQ"]
Out[170]=

Determine whether the abstract functor is an essentially surjective functor (i.e. a function mapping the set of objects in the domain category to the corresponding set of objects in the codomain category that is surjective up to isomorphism):

In[171]:=
functor["EssentiallySurjectiveFunctorQ"]
Out[171]=

Determine whether the abstract functor is bijective on objects (i.e. a bijective function mapping the set of objects in the domain category to the corresponding set of objects in the codomain category):

In[172]:=
functor["BijectiveOnObjectsQ"]
Out[172]=

Determine whether the abstract functor is an essentially bijective functor (i.e. a function mapping the set of objects in the domain category to the corresponding set of objects in the codomain category that is bijective up to isomorphism):

In[173]:=
functor["EssentiallyBijectiveFunctorQ"]
Out[173]=

Determine whether the abstract functor is conservative (i.e. if a morphism in the codomain category is an isomorphism, then the corresponding morphism in the domain category is necessarily an isomorphism):

In[174]:=
functor["ConservativeFunctorQ"]
Out[174]=

Determine whether the abstract functor yields an equivalence of categories (i.e. a functor that is fully faithful and essentially surjective):

In[175]:=
functor["EquivalenceFunctorQ"]
Out[175]=

Compute the association of fibers/fiber categories for each object in the codomain category of the abstract functor (i.e. the objects/morphisms in the domain category that project onto a given object/identity morphism in the codomain category):

In[176]:=
functor["FiberCategories"]
Out[176]=

Compute the association of fibers/fiber categories for each object in the codomain category of the abstract functor (i.e. the objects/morphisms in the domain category that project onto a given object/identity morphism in the codomain category), modded out by all object and morphism equivalences:

In[177]:=
functor["ReducedFiberCategories"]
Out[177]=

Determine whether the abstract functor corresponds to a discrete fibration (i.e. a special case of a Grothendieck fibration in which the fibers are discrete categories):

In[178]:=
functor["DiscreteFibrationQ"]
Out[178]=

Determine whether the abstract functor corresponds to an inclusion functor for a subcategory (i.e. a functor for which the objects/morphisms in the domain category form a subset of the objects/morphisms in the codomain category):

In[179]:=
functor["InclusionFunctorQ"]
Out[179]=

Determine whether the abstract functor corresponds to a full inclusion functor for a subcategory (i.e. an inclusion functor that is also a full functor):

In[180]:=
functor["FullInclusionFunctorQ"]
Out[180]=

Determine whether the abstract functor is an embedding functor (i.e. a functor that is faithful and injective on objects):

In[181]:=
functor["EmbeddingFunctorQ"]
Out[181]=

Determine whether the abstract functor is a full embedding functor (i.e. a functor that is fully faithful and injective on objects):

In[182]:=
functor["FullEmbeddingFunctorQ"]
Out[182]=

Swap the variance of the abstract functor (i.e. return a contravariant version of the abstract functor if it was originally covariant, and likewise return a covariant version of the abstract functor if it was originally contravariant):

In[183]:=
functor["SwapVariance"]
Out[183]=

Determine whether the abstract functor is a covariant functor (i.e. a functor that preserves the source/target objects of morphisms and the direction of morphism composition):

In[184]:=
functor["CovariantFunctorQ"]
Out[184]=

Determine whether the abstract functor is a contravariant functor (i.e. a functor that swaps the source/target objects of morphisms and reverses the direction of morphism composition):

In[185]:=
functor["ContravariantFunctorQ"]
Out[185]=

Show the abstract functor represented as a map between full directed graphs with labels on the morphisms:

In[186]:=
functor["FullLabeledGraph"]
Out[186]=

Show the abstract functor represented as a map between full directed graphs without labels on the morphisms:

In[187]:=
functor["FullUnlabeledGraph"]
Out[187]=

Show the abstract functor represented as a map between reduced directed graphs, with all equivalences between objects and morphisms imposed and with labels on the morphisms:

In[188]:=
functor["ReducedLabeledGraph"]
Out[188]=

Show the abstract functor represented as a map between reduced directed graphs, with all equivalences between objects and morphisms imposed and without labels on the morphisms:

In[189]:=
functor["ReducedUnlabeledGraph"]
Out[189]=

Show the abstract functor represented as a map between simple directed graphs, with all self-loops and multiedges removed and with labels on the morphisms:

In[190]:=
functor["SimpleLabeledGraph"]
Out[190]=

Show the abstract functor represented as a map between simple directed graphs, with all self-loops and multiedges removed and without labels on the morphisms:

In[191]:=
functor["SimpleUnlabeledGraph"]
Out[191]=

Show the abstract functor represented as a map between reduced simple directed graphs, with all self-loops and multiedges removed, plus all object and morphism equivalences modded out and with labels on the morphisms:

In[192]:=
functor["ReducedSimpleLabeledGraph"]
Out[192]=

Show the abstract functor represented as a map between reduced simple directed graphs, with all self-loops and multiedges removed, plus all object and morphism equivalences modded out and without labels on the morphisms:

In[193]:=
functor["ReducedSimpleUnlabeledGraph"]
Out[193]=

Show the explicit association form of the functor:

In[194]:=
functor["AssociationForm"]
Out[194]=

Publisher

Jonathan Gorard

Version History

  • 1.0.0 – 09 May 2022

Source Metadata

Related Resources

License Information