# Proof of the universal property of a coherent topology

Suppose $X$ is a topological space whose topology is coherent with a family $\mathcal{B}$ of subspaces. The universal property of coherence is this:

If $Y$ is another topological space, then a map $f : X \to Y$ is continuous if and only if $f|_{B}$ is continuous for every $B \in \mathcal{B}$.

I'm attempting to prove this

My Attempted Proof:

Suppose $f : X \to Y$ is continuous then $f|_{B}$ is trivially continuous by restricting the domain of $X$ to $B$.

Now suppose $f|_{B}$ is continuous for every $B \in \mathcal{B}$. Choose $B \in \mathcal{B}$ and observe that for every open $V$ in $Y$ we have $f|_{B}^{-1}[V]$ to be open in $B$ and since $B$ is a subspace of $X$ we thus have $f|_{B}^{-1}[V] = U_B \cap B$ for some open set $U_B$ in $X$.

Now pick an open $V$ in $Y$ and note that $\bigcup_{B \in \mathcal{B}} B = X$ and that $f|_{B}^{-1}[V] = \{x \in B \ | \ f(x) \in V\}$ then $$\bigcup_{B \in \mathcal{B}} f|_{B}^{-1}[V] = \bigcup_{B \in \mathcal{B}} \left(U_B \cap B\right) = U \cap X = U = \{x \in \bigcup_{B \in \mathcal{B}} B = X \ | \ f(x) \in V\} = f^{-1}[V]$$ where $U = \bigcup_{B \in \mathcal{B}} U_B$. Hence $f^{-1}[V]$ is open in $X$ and $f : X \to Y$ is continuous. $\square$

I think this proof is probably incorrect as I have not used the definition of coherence in this proof, (my error is probably a set-theoretic issue).

Is this proof correct or incorrect? If it is incorrect, could someone provide a proof of the definition of the quoted property?

Hence $f^{-1}[V]$ is open in $X$
That's the problematic statement. Normally each $f^{-1}_{|B}[V]$ is open in $B$, not in $X$. Thus the union does not have to be open in $X$. And none of your set equalities implies that.
It is open precisely because the topology is coherent with $\mathcal{B}$. The argument is very simple:
$$f^{-1}[V]\cap B=f^{-1}_{|B}[V]$$
The right side is open in $B$ for every $B\in\mathcal{B}$ and thus (by the definition of coherent topology) $f^{-1}[V]$ is open in $X$.