Is "open subfunctor" transitive? In topological spaces if $U \subseteq V \subseteq X$ with $U$ open in $V$ and $V$ open in $X$ then $U$ open in $X$.  My question is, is this true if we are instead talking about open subfunctors?
Recall that in the functorial approach to algebraic geometry we look at functors from the category of commutative rings to the category of sets.  If $A$ is a ring and $\mathfrak a \leq A$ an ideal then we define
$$\mathrm{Spec} \ A = \hom(A, -)$$
$$D(\mathfrak a) = \{f \in \hom(A, -) \ | \ f(\mathfrak a) \ \text{generates the unit ideal}\}$$
and then a subfunctor $U \subseteq X$ is open if for all maps of the form $\phi\colon\mathrm{Spec} \ A \to X$ we have $\phi^{-1}(U) = D(\mathfrak a)$ for some ideal $\mathfrak a$.
One can easily prove that the open subfunctors of $\mathrm{Spec} \ A$ are exactly the subfunctors of the form $D(\mathfrak a)$ for some ideal $\mathfrak a$.  I think the above statement is equivalent to the statement that the open subfunctors of $D(\mathfrak a)$ are all of the form $D(\mathfrak b)$ as well so it suffices to just prove the affine case, but even there I'm not sure how to proceed.
A lot of what I've read about the functorial approach seems to take this fact for granted, by taking an affine open cover $\{V_i\}$ of a scheme $X$ and then working with open subsets $U \subseteq V_i$ as if they are open in $X$.  So it seems like this really should be true, cause I doubt all the literature in the field is broken, and I figured the proof should be easy but I'm stuck...
 A: I think it should work as follows. One of the key ideas is that it necessarily involves carefully considering the geometry of affine schemes.
If $V \to U \to X$ are open subfunctors, then take a map $h_A \to X$ for some ring $A$. The pullback $U_A = h_A \times_X U \to h_A$ can be assumed to be the map $h_{A,I} \to h_A$ for an ideal $I$ in $A$, where $$h_{A,I}(R) = \{\phi: A \to R : \phi(I)R = R\}.$$ We have a commutative diagram
$$
\require{AMScd}\begin{CD}
h_{A,I} @>>> U \\
@VVV @VVV \\
h_A @>>> X
\end{CD}$$
Now, motivated by the fact that $D(I)$ is covered by the collection $\{D(f)\}_{f \in I}$, we will consider the affine schemes $h_{A,(f)} \cong h_{A_f}$ (localization at the element $f \in I$).
There is a natural inclusion $h_{A_f} \to h_{A,I}$ for all $f \in I$, given by the fact that if $\phi(f)R = R$, then $\phi(I)R = R$. So we can consider the diagram
$$
\require{AMScd}\begin{CD}
h_{A,J_f} @>>> h_{A,I} \times_U V @>>> V \\
@VVV @VVV @VVV \\
h_{A_f} @>>> h_{A,I} @>>> U \\
@. @VVV @VVV \\
@. h_A @>>> X
\end{CD}$$
where the $J_f$ come from the fact that $V \to U$ is an open subfunctor using the map $h_{A_f} \to h_{A,I} \to U$, then pulling back the resulting ideal in $A_f$ to $A$. This tells us that for any morphism $\phi: A \to R$, we have $$\phi(J_f)R = R \Longleftrightarrow \phi(f)R = R, X(\phi)(u) \in V(R)$$ where $u$ is the universal element in $X(A)$ for the morphism $h_A \to X$.
Now note that $$(h_{A,I} \times_U V)(R) = \{\phi: A \to R : \phi(I)R = R, X(\phi)(u) \in V(R)\}.$$ Note further that $$h_{A,J_i}(R) = \{\phi: A \to R : \phi(f)R = R, X(\phi)(u) \in V(R)\}.$$
Define $J = \bigcup J_i$ (sum of ideals). Then I think you want to show that $h_{A,I} \times_U V \cong h_{A,J}$, which will finish the proof. This is the same as showing that $$\phi(J)R = R \Longleftrightarrow \phi(I)R = R, X(\phi)(u) \in V(R).$$ To do this, you first show that it's true when $R=K$ is a field: this is essentially because $\phi(I)K = K$ is the same as $\phi(I) \neq 0$, and the fact that $h_{A,I} \times_U V$ is covered by the $h_{A,J_f}$, which follows from the fact that $\{h_{A_f}\}$ covers $h_{A,I}$ (in the sense of Demazure and Gabriel, which can be verified directly) Check this.
So $(h_{A,I} \times_U V)|_{Fields} \cong h_{A,J}|_{Fields}$. Demazure and Gabriel prove in Prop. 4.12 in their first section of the first chapter that open subfunctors of a functor $F$ are in bijection with open subsets of $|F|$. Since the underlying set of the geometric realization only depends on the restriction of $F$ to fields, and since $h_{A,J} \to h_A$ is an open subfunctor, we see that the underlying set of $|h_{A,I} \times_U V|$ is open in $|h_A| (=Spec(A))$ (in fact it's $D(J)$). But then, you can use Prop 4.12 in I,i in Demazure and Gabriel's book (English version), which shows that there's a bijection between the open subfunctors of a functor $F$ and the open subsets of $|F|$, which forces the isomorphism.
You can check that the proof of this proposition doesn't assume the result you want to show.
A: $\require{AMScd}$Here is an attempt at a self-contained proof. I'll use the notation from Ashwin Iyengar's answer, so $h_A$ instead of $\operatorname{Spec}A$ and $h_{A,I}$ instead of $D(I).$ But I'll write their $J_f$ as $J^f$ to emphasize that it is not a priori a localization of anything.
As mentioned in the question, it suffices to show that every open subfunctor of $h_{A,I}$ is of the form $h_{A,J}.$
As a general point, we can take $I$ to be radical: $f(I)$ generates the unit ideal if and only if $f(\mathrm{rad}(I))$ generates the unit ideal. (The $I$ in $h_{A,I}$ is then unique, because Zariski opens in $\operatorname{Spec} A$ correspond bijectively to radical ideals.)
For each $f\in I$ there is a pullback
$$
\begin{CD}
h_{A,J^f} @>>> h_{A_f} \\
@VVV @VVV \\
U @>>> h_{A,I}
\end{CD}$$
and we want to show that in fact $U=h_{A,J}$ with $J$ now defined as the radical of the ideal sum $\bigcup_{f\in I} J^f.$
So, consider any $\eta:A\to B$ in $h_{A,I}(B).$ The goal is to show that $\eta$ is in $U(B)$ if and only if it is in $h_{A,J}(B).$ There is a pullback
$$
\begin{CD}
h_{B,b} @>>> h_B \\
@VVV @VVV h(\eta) \\
U @>>> h_{A,I}
\end{CD}$$
with $b$ a radical ideal of $B.$ For any $f\in I,$ let $\eta_f:A_f\to B_{\eta(f)}$ be the localization of $\eta$ by inverting $f,$ and let $\pi^A_f:A\to A_f$ and $\pi^B_{\eta(f)}:B\to B_f$ denote the natural maps. Note:


*

*$\eta=1_B\circ \eta\in U(B)$ $\iff$ $b=B$

*$\eta\in h_{A,J}(B)$ $\iff$ $\eta(J)B=B.$

*$\pi^B_{\eta(f)}\circ\eta\in U(B_f)$ $\iff$ $\pi^B_{\eta(f)}(b)B_f=B_f$ $\iff$ $f\in b$

*$\eta_f\circ \pi^A_f\in U(B_f)$ $\iff$ $\eta_f(J_f)B_f=B_f$ $\iff$ $f\in \mathrm{rad}(\eta(J_f)B)$

*$\pi^B_{\eta(f)}\circ\eta=\eta_f\circ \pi^A_f,$ so the condition in 3 and 4 are equivalent


Suppose $b=B.$ Since we took $\eta$ from $h_{A,I}(B),$ we have $\eta(I)B=B,$ which gives a finite sum $\sum_i\eta(f_i)b_i=1$ with $f_i\in I$ and $b_i\in B.$ Each index $i$ satisfies $\eta(f_i)\in B=b$ and hence $\eta(f_i)\in\mathrm{rad}(\eta(J_f)B),$ which gives $\eta(J)B=B.$
Conversely, if $\eta(J)B=B,$ there is a finite sum $\sum_i \eta(f_i)b_i=1$ where each $f_i$ lies in some $J^f,$ and $b_i\in B.$ We get $\eta(f_i)\in b$ for each $i$ and hence $b=B.$
Since $\eta\in h_{A,I}(B)$ was arbitrary and $U(B),h_{A,J}(B)\subseteq h_{A,I}(B),$ we have shown that $U(B)=h_{A,J}(B)$ for each $B.$
A: Let $O \subseteq \operatorname{Spec}(A)$ be an open subfunctor, and let $U \subseteq O$ be open. We will show that $U$ is open in $\operatorname{Spec}(A)$.
To begin with, we restrict to the case $O = D(f)$ for some $f \in A$. Since $O \cong \operatorname{Spec}(A_f)$ is affine, $U$ must be given by an ideal of $A_f$ which can be pulled back to an ideal $\mathfrak{b} \subseteq A$. Now it is easy to check that $U = D(\mathfrak{b} \cdot f)$ is open in $\operatorname{Spec}(A)$.
Now let's consider the general case. We have $O = D(\mathfrak{a})$ for some ideal $\mathfrak{a}$ of $A$. For any $f \in \mathfrak{a}$ we have already shown that $U \cap D(f)$ (being open in $D(f)$) is open in $\operatorname{Spec}(A)$, so we can form the supremum $U' = \bigvee_{f \in \mathfrak{a}} (U \cap D(f))$ of open subfunctors of $\operatorname{Spec}(A)$ ($U'$ is open in $\operatorname{Spec}(A)$ by definition). Since $U' \cap O$ is open in $\operatorname{Spec}(A)$ again, we conclude $U' \subseteq O$ and we consider $U'$ as an open subfunctor of $O$. Since $U$ and $U'$ agree on all fields, and since open subfunctors are uniquely determined by their action on fields, we conclude that $U = U'$ is open in $\operatorname{Spec}(A)$. $\square$
