# Restriction of a continuous function to a compact subspace in one of its multiplicands.

I was practicing for a qualifying exam and came across this bugger. Let me know your thoughts.

Question: Let $X, Y, Z$ be topological spaces, and let $f: X \times Y \to Z$ be a continuous function. If $U \subset Z$ is open, and $K \subset Y$ is compact, show that $$\{ x \in X | f(x,y) \in U \mbox{ for all } y \in K \}$$ is open in $X$.

Give an example to show that the condition that $K$ be compact cannot be removed.

My thoughts so far: If we restrict the domain of $f$, by saying $\tilde{f}:X \times K \to Z$ sends $(x,y) \to f(x,y)$, then this map remains continuous. Then we wish to look at the set of $x$ such that holding $x$ fixed yields a constant function in $y$, and show that this is open. Since $K$ is compact, any open covering has a finite subcovering... I'm not too sure where to go from here...

Any help would be much appreciated :)

-

Let us call the set in question $A$.
If $x \in A$, then for each $y \in K$ there is an open rectangle $U_y \times V_y$ in $X \times Y$ containing $(x,y)$ such that $f [ U_y \times V_y ] \subseteq U$. By compactness of $K$ there are $y_1 , \ldots , y_n \in K$ such that $V_{y_1} \cup \cdots \cup V_{y_n} \supseteq K$. Consider now $W = U_{y_1} \cap \cdots \cap U_{y_n}$. Clearly $W$ is an open neighbourhood of $x$. Given any $x^\prime \in W$ and any $y \in K$ we have that there is an $i \leq n$ such that $y \in V_{y_i}$, and so $(x^\prime , y ) \in U_{y_i} \times V_{y_i}$, thus $f ( x^\prime, y ) \in U$. Therefore $W \subseteq A$, and so $A$ is open.
For an example to show that compactness of $K$ is required, consider mutliplication $\mathbb{R} \times \mathbb{R} \to \mathbb{R}$. Let $U = (-1,1)$, and suppose $B \subseteq \mathbb{R}$ has no upper bound. Letting $$A = \{ x \in \mathbb{R} : ( \forall y \in B ) ( | xy | < 1 ) \},$$ note that clearly $0 \in A$. However, if $x \neq 0$, since $B$ has no upper bound there is a $y > | \frac{1}{x} |$ in $B$, so $| xy | > 1$, meaning that $x \notin A$. Thus $A = \{ 0 \}$, and is not open.