How can I prove that the simple function gn that is defined below is Borel measurable?
Given: let $E$ be a normed space and let $X$ be a measurable space and let $f:X \rightarrow E$ is strongly measurable, (so, we may assume that $f(X)$ has the countable dense set $D=\{y\_1, y\_2, \ldots\}$) 

For each $x \in X$ and $n \in N$, define $A\_n(x)$ by
$A\_n(x)=\{y\_j : j\leq n,\|y\_j\|\leq\|f(x)\|\}$
Define $B\_n(x)=\{y\_j \in A\_n(x): \|f(x)-y\_j\|= d(f(x),A\_n(x))\}$

For each $n\geq1$, define $g\_n(x)=y\_k$, where $k= \min\{j :y\_j \in B\_n(x)\}$
my question is: how can I prove that the simple function $g\_n$ is Borel measurable?