This logic is not by any means set in stone. What’s here is simply the most recent incarnation (or, more accurately, the most recent incarnation that I’ve managed to write up) of my evolving ideas about “the internal language of a 2-category.” Any suggestions for improvement, especially from people more familiar than I with ordinary logic and type theory, would be greatly appreciated.
As adumbrated at categorified logic, the logic we use will be a logic of dependent types. We will have three different sorts of types, which we call 1-types (categories), 0-types (sets), and (-1)-types (propositions). We could include (0,1)-types (posets) and (1,0)-types (groupoids) as well, but these rarely seem as important as the other three; thus we will just identify posets and groupoids with particular categories.
In 1-categorical logic, it is often possible to avoid dependent types, but in 2-categorical logic they seem to play a more important role. For one thing, there seems no way to construct exponentials in a 2-category from “higher-order structure” the way that exponentials can be constructed from power objects in a 1-topos; thus we need to incorporate them into the type theory. Additionally, the use of dependent types allows us to restrict the language in categorically sensible ways.
A basic tenet of higher category theory is that if is an -category and then is an -category. For us, this means that if is an -type and then we have a dependent -type . For instance, if , then is a 0-type: the type of arrows from to . And if , then is a (-1)-type; in other words, a proposition, which we of course interpret as the assertion . (If , it would instead be the assertion .) So equality is a special case of the formation of hom-types.
In particular, note that equality is only defined between elements of a 0-type. Thus, our language doesn’t even have the terminology to speak about equality between objects of a 1-type (category), only equality between elements of a 0-type (such as arrows in a category). This is also known as the “Speak No Evil” approach to category theory.
But if thought corrupts language, language can also corrupt thought. – George Orwell
Of course, these arrow-types are notably similar to the equality types in many versions of traditional Martin-Lof dependent type theory. In fact, it is well-known by now that equality types can be usefully interpreted in categories of groupoids or in homotopical categories. (Hoffman-Striecher, “The groupoid interpretation of type theory”; Awodey-Warren, “Homotopy theoretic models of identity types”.) Of course, the main difference is that arrow-types are (in general) directional. Later on we will construct “iso-types” as subtypes of , which have some of the same properties as equality types.
We will allow ourselves to treat an -type as an -type for any . When this corresponds to replacing a proposition by the set . When it corresponds to treating a set as a discrete category. Of course, when we do this we include as an axiom that the resulting -type is truncated in an appropriate way: is a subobject of , and a discrete category is in fact discrete.
Treating -types on an equal footing for all , we can say that our theories will consist only of two sorts of judgements:
In each case is a context, such as , which declares the variables that occur in the rest of the judgement. Each type occurring in can depend on the variables occurring before it; thus we can have but not . We insist that the variables in occur in descending hierarchical order; thus we have first a list of 1-type variables, then a list of 0-type variables, and then a list of (-1)-type variables. If necessary we may separate the different parts of the context by vertical bars, so that .
To keep things looking familiar, we will write instead of . And since any two inhabitants of a (-1)-type are indistinguishable, we will generally write merely instead of when is a (-1)-type (a proposition). For the same reason, there can be no interesting dependence of a (-1)-type on another (-1)-type, so we omit (-1)-types from the declarations of other (-1)-types. Thus, written out in more detail, we actually have six different sorts of judgements:
| 1-type declaration | |
| 1-term declaration | |
| 0-type declaration | |
| 0-term declaration | |
| (-1)-type declaration, aka proposition declaration | |
| (-1)-term declaration, aka logical sequent |
Note that in a logical sequent, is a list of propositions; thus a logical sequent ends with something of the form which of course has the usual meaning that together imply .
A final difference between our language and most common dependently typed languages is that we introduce variables with variances. In the standard categorical interpretation of a context such as , the type that depends on a variable is interpreted by an object of a slice category ; the intuition being that for each the type is the fiber over of the map . However, in 2-category the fibrational slices are often more important than ordinary slices, but incorporating fibrational slices necessitates some way of keeping track of which morphisms are fibrations and which are opfibrations.
Thus, we formally define a 1-context to be a finite list
of variable declarations, such that:
For each , the judgement
is derivable.
Each is either , , or .
If , then for all .
We will often omit the superscript s. We then define a 0-context to be a 1-context together with a finite list
of variable declarations, such that for each , the judgement
is derivable, and a (-1)-context to be a 0-context together with a finite list
of propositions, such that for each , the judgement
is derivable.
Note that any sort of context can be empty. The rules for forming judgements will ensure that free variables can only occur to the right of where in the context they are declared. Whenever we write a context it is assumed that there is no duplication of variables; this results in implicit hypotheses on the derivation rules.
The intended interpretation of these contexts is as follows. A context indicates that everything to its right takes place in the opfibrational slice . Likewise, indicates that everything to its right takes place in , while indicates that everything to its right takes place in the ordinary slice 2-category . Recalling the theorems about iterated fibrations, a context such as indicates that we work in , while indicates working in the two-sided fibrational slice . Note that the variance label goes on the base of the fibration.
Once we are past the first , then we assume to be working only in the 1-category of discrete objects. After this point, the interpretation of 0-contexts is just as usual: a declaration , where is a 0-type, means working in the slice 1-category of discrete objects over . Similarly, once we pass the second , we are now working in a poset of subterminals, and a declaration means we assume that is true (which amounts to working in the slice poset over ). For example, a context such as
means working in .
We say that a context is fibrational if no (in its 1-context section) is equal to . Since fibrational slices inherit more good behavior than ordinary slices, some of the rules below will require only fibrational contexts. (However, some rules will also inexorably take us out of fibrational contexts.) We write to mean that is a fibrational context, and if is any context, we write for the context obtained from by dropping all variances (changing all to ).
The reason we write and instead of and is that a judgement written like looks as though we are defining a contravariant functor from to , whereas the fibrational variances only affect the types defined in a given context, not the terms.
Finally, a theory consists of some collection of axiomatic judgements of each type, with the restriction that axiomatic 1-type and 0-type declarations only occur in fibrational contexts. (This restriction will only be necessary when we come to construct a syntactic 2-category?.) There is a subtlety in that the contexts of the judgements in a theory must be well-formed, which involves an assertion about derivability in the theory itself, but the resolution of this presents no new difficulties over ordinary dependent type theory.
As is usual in type theories, we write
to mean that from the judgements and , we can deduce the judgement . We write for the right-hand side of an arbitrary judgement of any sort. We write for the result of substituting the term for the variable in , and we do the same for contexts.
We will write or in a context appearing in the conclusion of a rule to mean that if the context to the left of this variable is fibrational, then we may have or , respectively, but otherwise we have merely .
(The rules that follow have not been updated to treat 1-types and 0-types separately.)
In the contraction rule, note that the two s in must be the same.
The exchange rule has the extra restriction that cannot occur freely in the type . Finally we have:
Note that cannot be fibrational in the context .
Likewise, note that cannot be fibrational if we want to compose along it, although and can be.
Functoriality is probably the most subtle of the rules for arrow types. The idea is that a term declaration of the form describes a morphism in the ambient 2-category from the object representing the context to the object representing the term . But morphisms in a 2-category act like functors in the internal logic, and functors act on arrows as well as objects.
By the way, the term does not indicate any actual substitution of for (which would be nonsensical since they have different types). Rather, it is a decoration which converts the term with free variable into a term with free variable . In particular is free in while is no longer free.
There are the usual reflexivity, symmetry, transitivity, and substitution rules for equality. We also have associativity and unitality rules for composition:
And functoriality and naturality rules for arrow-types:
The idea of the naturality rule is that a term represents a 2-cell between the morphisms represented by and , which should be a natural transformation in the internal logic.
We also assert that arrow-types are discrete, by saying that they are posetal and their order relation is symmetric.
The rules for the unit type are fairly straightforward; they simply express that it is a 2-categorical terminal object.
We now have rules relating elements and arrows in sum types to those in the base, which essentially express the factorization properties of fibrations.
Note that is a term with free variable , so it is automatically functorial and acts on arrows as well as elements.
(Add a factorization axiom)
Of course, we have the analogous sums for opfibrations:
We trust the reader to write down the dual rules dealing with and opcartesian arrows.
Note that all fibrational context is lost when we pass to subobject types. Of course, this is because a subobject of a fibration need not be a fibration. The next set of rules say that is true of if and only if factors through .
We also have also rules expressing that is a full subobject of .
The naturality properties of and would come for free from the naturality rule, above, except that is not an ordinary term (it is only defined if is a term such that ) so that that rule doesn’t apply.
We have the usual introduction and elimination rules for the logical connectives. For example, for we have
The analogous rules for are all standard. The following rules for quantifiers are also standard, bearing in mind that as usual, in a dependently typed logic, we can only introduce quantifiers over the last variable in the context.
( must not occur free in in the above rule)
( must not appear free in or in the above rule.)