I've been reading through the extremely useful discussion of First-Order Categorial Logic that recently popped up over at The Diagonal Argument. But when I compare Baez and Weiss's construction to what's found over at the nLab, one striking difference is that where B&W build a covariant functor from FinSet (the category of finite sets with functions between them) to Bool (the category of boolean algebras) the nLab suggests hyperdoctrines will in general be contravariant functors.
Here are five ways I might explain this difference:
- B&W messed something up.
- the nLab folks have messed something up
- this is one of those weird facts that make classical logic funky, and it wouldn't matter if we used FinSet or FinSet$^{op}$, the result would be the same.
- B&W simplified some things, and this is one of the consequences of the simplification
- Something else entirely.
My question: which of these is to blame and, if it's number 5, can you elaborate at all? (2) seems unlikely, since all the publications cited by the nLab folks also assume contravariance. But I felt obligated to include it for completeness sake.
I'm sure Kevin's answer is correct, but here's some additional stuff to chew on from someone whose understanding of this is more about type theory and computer science.
I think the answer is that it's actually a hyperdoctrine on $\mathbf{FinSet}^{op}$. A reason this might be the case is that this category arises naturally when modelling variable binding, which is something you might want to study categorically in the fields above. The way you might go about this is as follows:
We want a category for talking about variables bound in a context. The variables will all just range over a single universe of discourse, rather than having possibly distinct types. So, we will accomplish this by taking a Cartesian category freely generated by one object $U$. $1$ is the empty context, $U$ is a 1-variable context, $U×U$ is a 2-variable context, and $U^n$ is an $n$-variable context. A map $U^m → U^n$ decomposes into $n$ projections from $U^m$, saying how each of the $n$ variables in the result is bound in the $U^m$ context. You can think of this like:
$$x_1, x_2, ..., x_n ⊢ x_i, x_j, x_j,...,x_k$$
expressing some kind of simultaneous substitution of variables with contraction, weakening and exchange. Now, presheaves on this category can be used for talking about algebras with variable binding.
But, consider what I mentioned about the maps. A map $f : U^m → U^n$ is equivalent to for each $i < n$ a specification of which projection $π_j : U^m → U$ is used. Another way to look at this is that we have a function $[n] → [m]$ specifying this information ($[n]$ being a finite set of size $n$). So, the context category we built is equivalent to $\mathbf{FinSet}^{op}$, and presheaves/hyperdoctrines on it are functors out of $\mathbf{FinSet}$.
If you want a more thorough explanation of the variable binding stuff, see here.