A 2-category is Heyting if it is coherent and each pullback functor ${f}^{*}:\mathrm{Sub}(Y)\to \mathrm{Sub}(X)$ has a right adjoint ${\forall}_{f}$.
As in the 1-categorical case, this also ensures that each $\mathrm{Sub}(X)$ is a Heyting algebra and that each ${f}^{*}$ is a homomorphism of Heyting algebras. Moreover, the right adjoints ${\forall}_{f}$ satisfy the Beck-Chevalley condition for pullback squares, because the left adjoints ${\exists}_{f}$ do. This is just what is necessary for the internal interpretation of (finitary) first-order logic.
$\mathrm{Cat}$ is Heyting.
A 1-category is Heyting as a 2-category iff it is Heyting as a 1-category.
A (0,1)-category is Heyting iff it is a Heyting algebra.
Any well-powered infinitary-coherent 2-category is Heyting, by the adjoint functor theorem for posets. In particular, any Grothendieck 2-topos is Heyting.
Unlike in the 1-categorical case, there seems no reason why a coherent 2-category with exponentials must be Heyting. It does, however have adjoints to pullback along fibrations and opfibrations, and in particular along product projections, which is enough for some uses of universal quantification in the internal logic.
Clearly if $K$ is Heyting, so are ${K}^{\mathrm{co}}$, $\mathrm{gpd}(K)$, $\mathrm{pos}(K)$, $\mathrm{disc}(K)$, and $\mathrm{Sub}(1)$ (the Heyting algebra of subterminals).
Moreover, Heytingness is also preserved by fibrational slicing. First we show:
If $K$ is Heyting, then for any $X$ and any $A\in \mathrm{Opf}(X)$, ${\mathrm{Sub}}_{\mathrm{Opf}(X)}(A)$ is a coreflective sub-poset of ${\mathrm{Sub}}_{K}(A)$.
As proven here, ${\mathrm{Sub}}_{\mathrm{Opf}(X)}(A)$ is a full sub-poset of ${\mathrm{Sub}}_{K}(A)$. Moreover, it is easy to see that a ff $B\to A$ is in ${\mathrm{Sub}}_{\mathrm{Opf}(X)}(A)$ precisely when
In general, the first condition does not imply the second. It is also easy to check that these two conditions together are equivalent to saying that the composite
factors through $B\to A$, where $a$ is the action making $A$ into a fibration. Note that $B{\times}_{X}{X}^{2}$ is alternately written as ${p}^{*}B$, where $p:A{\times}_{X}{X}^{2}\to A$ is the projection onto the first factor. Therefore, $B$ is in ${\mathrm{Sub}}_{\mathrm{Opf}(X)}(A)$ just when ${\exists}_{p}{a}^{*}B\le B$, or equivalently when $B\le {\forall}_{a}{p}^{*}B$.
We claim that $B\mapsto {\forall}_{a}{p}^{*}B$ coreflects $\mathrm{Sub}(A)$ into ${\mathrm{Sub}}_{\mathrm{Opf}(X)}(A)$, and given the above, it suffices to verify that it is a comonad. First, let $i:A\to A{\times}_{X}{X}^{2}$ be the inclusion of identities; then $ai\cong 1$ and $pi\cong 1$, so we have
This gives the counit of the comonad. The comultiplication is a little more involved. First note that we have a pullback square
where $q$ denotes projection onto the first two factors. Thus, by the Beck-Chevalley condition, ${a}^{*}{\forall}_{p}={\forall}_{q}(a\times 1{)}^{*}$ and therefore
where $m:{X}^{2}{\times}_{X}{X}^{2}\to {X}^{2}$ is the “composition” morphism.
Let us write ${X}^{\to \to}$ for ${X}^{2}{\times}_{X}{X}^{2}$, the object of composable arrows in $X$, and write ${X}^{\stackrel{\nearrow}{\to}\to}$ for the power of $X$ with the category
Let $r:{X}^{\stackrel{\nearrow}{\to}\to}\to {X}^{\to \to}$ forget the “lonely” arrow, and let $c:{X}^{\to \to}\to {X}^{\stackrel{\nearrow}{\to}\to}$ make the lonely arrow into the composite of the other two. Then $rc\cong 1$, and moreover $p\prime q\prime c\cong 1\times m$, where $p\prime $ and $q\prime $ are $p$ and $q$ applied to the non-lonely arrows. Thus, we have
as desired. (Here we have used another Beck-Chevalley condition to move $r$ past $q\prime $ and $p\prime $, turning them into $p$ and $q$ and it into $p$.)
If $K$ is Heyting, so is each fibrational slice $\mathrm{Opf}(X)$ and $\mathrm{Fib}(X)$.
This follows from the adjoint lifting theorem for posets: for any $f:A\to B$ in $\mathrm{Opf}(X)$ we have a commutative square
where the vertical arrows are comonadic (inclusions of coreflective sub-posets) and the bottom horizontal arrow has a right adjoint; hence so does the top horizontal arrow.
We may naturally say that a coherent 2-category $K$ is Boolean if each $\mathrm{Sub}(X)$ is a Boolean algebra. As usual, this implies that $K$ is Heyting; we have ${\forall}_{f}=\neg {\exists}_{f}\neg $.
Note that a subobject and its complement in $\mathrm{Sub}(X)$ need not be “disjoint” in the sense introduced here; only their pullback, not their comma object, need be initial. Note also that unlike in the 1-categorical case, Booleanness is not stable under slicing; this fails already in the (1,2)-category $\mathrm{Pos}$ (though it holds in any (2,1)-category).