# Continuity with Hausdorff metric

For a metric space $E$, let $\mathcal{H}(E)$ be the metric space consisting of the set of nonempty compact subsets of $E$ and the Hausdorff metric. Consider the following two statements.

1. Let $X$ and $Z$ be topological spaces and let $Y$ be a compact metric space. Let $f : X \times Y \rightarrow Z$ be a continuous map. Let the map $g : Y \times Z \rightarrow \mathcal{H}(X)$ be given by $g(y,z) = (f(y,\cdot))^{-1}(z) = \{ x \in X : f(x,y) = z \}$. The map $g$ is continuous.

2. The maps $\min : \mathcal{H}(\mathbb{R}) \rightarrow \mathbb{R}$ and $\max : \mathcal{H}(\mathbb{R}) \rightarrow \mathbb{R}$ are continuous.

I am looking for references to literature where these statements (which do sound true) can be found. Much thanks in advance.

I made question 1 more general than I needed it to be, and in the process introduced a few mistakes, which Alex Becker and Robert Israel helped me see. I am reformulating statement 1 as follows.

Let $X$ be a compact metric space and $Y$ and $Z$ be topological spaces. Let $f : X \times Y \rightarrow Z$ be a continuous map. Let the map $g : Y \times Z \rightarrow \mathcal{P}(X)$ be given by $g(y,z) = (f(\cdot,y))^{-1}(z) = \{ x \in X : f(x,y) = z \}$. Let $z \in Z$ such that $g(y,z) \neq \varnothing$ for all $y \in Y$. The map $g(\cdot,z) : Y \rightarrow \mathcal{H}(X)$ is (well-defined and) continuous.

I probably need the spaces $X$, $Y$, $Z$ not to have pathologies, e.g. multiple connected components; maybe just convex in Euclidean space to get started.

An intuition for this problem is as follow. Consider that $f(x,y) = z$ is a solvable equation where $z$ is fixed, $y$ is a parameter ranging over $Y$, and $x$ is the unknown. I would like to say that the solution set, i.e. $g(y,z)$, depends continuously on the parameter $y$.

1. Is false. Consider $Y = Z = [0,1]$, $X = [0,1] \cup \{2\}$ and $$f(x,y) = \begin{cases} y & \mbox{if }x = 2 \\ x & \mbox{otherwise}\end{cases}$$ Then $g(y,z) = \{x: f(x,y) = z\}$ is either $\{2,z\}$ if $y=z$ or $\{z\}$ if not, and this is not continuous.
2. is quite easy, because $|\min(A) - \min(B)| \le \mbox{dist}(A,B)$, but I don't have a reference to give you.
EDIT: if you want a counterexample where $X$, $Y$, $Z$ are convex sets in Euclidean space, take all three to be $[-1,1]$ with $f(x,y) = x + y - 3 x^3$. Then, for example, $g(2/9,0) = \{-1/3,2/3\}$, but $g(y,0) \subset [0,1]$ for $y > 2/9$.
1. Seems to be false. For example, let $X=Z=\mathbb R, Y=[0,1]$ and let $f$ be the zero map. Then for any $y\in [0,1]$ we have that $g(y,0)\notin \mathcal H(\mathbb R)$ so $g$ is not even defined. If you object to this example, then letting $f(x,y)=xy$ and $X=[0,1]$ we get that $g(0,0)=[0,1]$ but $g(y,z)=\{z/y\}$ for all other $y\in [0,1]$, so this is clearly not continuous.
2. I do not think you need a reference for this, since $|min(A)-min(B)|$ and $|max(A)-max(B)|$ are clearly lower bounds for the Hausdorff distance between $A$ and $B$.