All sheaf topoi have [W-types](http://ncatlab.org/nlab/show/W-type) and in fact there's an explicit construction given by [Benno van den Berg & Ieke Moerdijk](http://www.phil.cmu.edu/projects/ast/Papers/vdBM_Wtypes.pdf), but the construction is quite involved.


I would like to know whether the inverse image part of a geometric morphism always preserves W-types for more general reasons or pointers to references detailing the conditions on functors so they preserve W-types.


Inverse image functors always preserve the natural numbers object, which is a particular kind of W-type, but the proof of this fact is very specific to the NNO so this might suggest that they don't all preserve W-types, but I have not found anything about this stated anywhere.



W-types and inverse image functor
We have a canonical map in one direction, namely $f^\*(W(p)) \to W(f^\*(p))$, but this map can fail to be an isomorphism. Here is an explicit counterexample.


Let $X$ be the set of countably-brancing trees, so $X = W(p)$ where $p : \mathbb{N} \to \mathbf{2}$ is a constant map. A tree is either a leaf or a node with countably many children.


Let $f$ be the canonical geometric morphism from the classifying topos $\mathcal{E}$ of enumerations of $X$ to $\mathrm{Set}$. (Incidentally, $f$ is surjective and open.)


As the definition of $p$ uses only geometric constructions, $f^\*(p)$ is again a constant map $\mathbb{N} \to \mathbf{2}$. So $W(f^\*(p))$ is again the set of countably-branching trees, just in $\mathcal{E}$ instead of $\mathrm{Set}$.


But $f^\*(X)$ does not coincide with $W(f^\*(p))$: As internally in $\mathcal{E}$ there is an enumeration of all elements of $f^\*(X)$, we can build a certrain tree, an element of $f^\*(X)$, which has all elements of $f^\*(X)$ as children. Hence $f^\*(X)$ contains an infinite path and is thus not well-founded.


