If $(X,d)$ is a metric space, is $X^{m+1}\to\{1,...,m\}, (x,x_1,...,x_m)\mapsto\min(\operatorname{argmin}_{k\in\{1,...,m\}}d(x,x_k))$ measurable? Given a a metric space $(X,d)$ and $m\in\mathbb{N}$, equip $X\times X^m$ with the product Borel $\sigma$-algebra and $\{1,...,m\}$ with the $\sigma$-algebra $2^{\{1,...,m\}}$.
Is the map $$X\times X^m\to\{1,...,m\}, (x,x_1,...,x_m)\mapsto\min\left(\operatorname{argmin}_{k\in\{1,...,m\}}d(x,x_k)\right)$$ measurable?

Hint: Express the preimage of each $k$ as a countable intersection of the sets of the form $A_{n,i}=\{(x,x_1,\ldots,x_m)\mid d(x,x_i)\leq n^{-1}\}$, $B_{n,i}=\{(x,x_1,\ldots,x_m)\mid d(x,x_i)\geq n^{-1}\}$ and $C_{n,i}=\{(x,x_1,\ldots,x_m)\mid d(x,x_i)> n^{-1}\}$.
