This is part 2 in a series. See the previous part about internal languages for (non-indexed) monoidal categories. The main application I have in mind – enriching in indexed monoidal categories – is covered in the next post.
As Jean Bénabou pointed out in Fibered Categories and the Foundations of Naive Category Theory (PDF)
notions of “families of objects/arrows” are ubiquitous and fundamental in category theory. One of the more noticeable places early
on is in the definition of a natural transformation as a family of arrows. However, even in the definition of category, identities and
compositions are families of functions, or, in the enriched case, arrows of
My motivations here are not foundational but leaving the notion of “family” entirely meta-theoretical means not being able to talk about it except in the semantics. Bénabou’s comment suggests that at the semantic level we want not just a monoidal category, but a fibration of monoidal categories1. At the syntactic level, it suggests that there should be a built-in notion of “family” in our language. We accomplish both of these goals by formulating the internal language of an indexed monoidal category.
As a benefit, we can generalize to other notions of “family” than set-indexed families. We’ll clearly be able to formulate
the notion of an enriched category. It’s also clear that we’ll be able to formulate
the notion of an indexed category. Of course, we’ll also be able to formulate
the notion of a category that is both enriched and indexed which includes the important special case of an internal category.
We can also consider cases with trivial indexing which, in the unenriched case, will give us monoids, and in the
Following Shulman’s Enriched indexed categories, let
The two main examples are:
This builds on the internal language of a monoidal category described in the previous post. We’ll again have linear types and linear
terms which will be interpreted into objects and arrows in the fiber categories. To indicate the dependence on the indexing,
we’ll use two contexts:
Since each fiber category is monoidal, we’ll have all the rules from before just with an extra
The only really new rule is the rule that allows us to move linear types and terms from one index context to another, i.e. the rule that
would correspond to applying a reindexing functor. I call this rule Reindex and, like Cut, it will be witnessed by
substitution. Like Cut, it will also be a rule which we can eliminate. At the semantic level, this elimination corresponds
to the fact that to understand the interpretation of any particular (linear) term, we can first reindex everything, i.e. all
the interpretations of all subterms, into the same fiber category and then we can work entirely within that one fiber category.
The Reindex rule is:
By representing reindexing by syntactic substitution, we’re requiring the semantics of (linear) type and term formation operations to be respected by reindexing functors. This is exactly the right thing to do as the appropriate notion of, say, indexed coproducts, which would correspond to sum types, is coproducts in each fiber category which are preserved by reindexing functors.
Below I provide a listing of rules and equations.
None of this section is necessary for anything else.
This notion of (linear) types and terms being indexed by other types and terms is reminiscent of parametric types or dependent types. The machinery of indexed/fibered categories is also commonly used in the categorical semantics of parameterized and dependent types. However, there are important differences between those cases and our case.
In the case of parameterized types, we have types and terms that depend on other types. In this case, we have kinds, which are “types
of types”, which classify types which in turn classify terms. If we try to set up an analogy to our situation, index types would
correspond to kinds and index terms would correspond to types. The most natural thing to continue would be to have linear terms
correspond to terms, but we start to see the problem. Linear terms are classified by linear types, but linear types are not
index terms. They don’t even induce index terms. In the categorical semantics of parameterized types, this identification of
types with (certain) expressions classified by kinds is handled by the notion of a generic object. A generic object corresponds
to the kind *
). The assumption of a generic object is a rather strong assumption and one
that none of our example indexed monoidal categories support in general.
A similar issue occurs when we try to make an analogy to dependent types. The defining feature of a dependent type system
is that types can depend on terms. The problem with such a potential analogy is that linear types and terms do not induce
index types and terms. A nice way to model the semantics of dependent types is the notion of a comprehension category.
This, however, is additional structure beyond what we are given by an indexed monoidal category. However, comprehension
categories will implicitly come up later when we talk about adding
As before, I did not write the usual laws for equality (reflexivity and indiscernability of identicals) but they also should be included.
See the discussion in the previous part about the commuting conversion (
A theory in this language is free to introduce additional index types, operations on indexes, linear types, and linear operations.
Fix an
Associators for the semantic
IxAx is witnessed by identity, and IxCut by composition in
As with the index derivations, Ax is witnessed by the identity, in this case in
Roughly speaking, Reindex is witnessed by
The solution is that we essentially use a normal form where we eliminate the uses of Reindex. These normal form derivations
will be reached by rewrites such as:
Semantically, this is witnessed by the strong monoidal structure,
i.e.
As the previous post alludes, monoidal structure is more than we need. If we pursue the generalizations described there in this indexed context, we eventually end up at augmented virtual double categories or virtual equipment.↩︎
The terminology here is a mess. Leinster calls strong monoidal functors “weak”. “Strong” also refers to tensorial strength, and it’s quite possible to have a “strong lax monoidal functor”. (In fact, this is what applicative functors are usually described as, though a strong lax closed functor would be a more direct connection.) Or the functors we’re talking about which are not-strong strong monoidal functors…↩︎