Is it always possible to map $n$ distinct vectors to $n$ distinct scalars? Recently while reading a paper I came across the claim that if we have $n$ distinct vectors $\vec{x}_i \in \mathbb{R}^d$ (they didn't clarify what they mean by 'distinct' but I assume it means no two vectors have all the same values) that it is always possible to select another vector $\vec{a} \in \mathbb{R}^d$ such that $i \neq j$ implies $\langle \vec{x}_i, \vec{a}\rangle \neq \langle \vec{x}_j, \vec{a}\rangle$, where $\langle \cdot , \cdot \rangle$ denotes the inner product (i.e., dot product). 
While I believe them that it's true, I can't figure out how to prove it for myself. Note that $n$ is finite, and that we know all $n$ vectors before we have to select $\vec{a}$.
 A: The idea is to consider the level sets of the function $f_{\vec{a}}:\mathbb{R}^d \rightarrow \mathbb{R}$ given by $f_{\vec{a}}(\vec{x}) = \langle \vec{x}, \vec{a}\rangle$.
The sets $A(\vec{a},t) = \{\vec{x} \in \mathbb{R}^d | \langle \vec{x}, \vec{a}\rangle = t, t \in \mathbb{R} \}$ are all affine subspaces of codimension $1$ orthogonal to $\vec{a}$. So in order to get the desired $\vec{a}$, you have to consider families of parallel codimension $1$ affine subspaces that avoid having any subset of those $n$ distinct vectors on one of those affine subspaces.
Having only finitely many vectors, this can always be done. Just consider the set $L = \{t(\vec{x}_i-\vec{x}_j) \in \mathbb{R}^d|t \in \mathbb{R}; i,j\in\{1,2,\dots,n\} \}$ of forbidden directions. The vector $\vec{a}$ cannot be orthogonal to any of those lines. Therefore, it is in the intersection of finitely many dense open sets, which can't be empty (you can see that this idea works even if you have countably many vectors $\{\vec{x_i},i\in\mathbb{N}\}$).
A: Set $\vec{a} = (a_1,\dots,a_d)$ and consider the function $f \colon \mathbb{R}^d \rightarrow \mathbb{R}$ given by
$$ f(\vec{a}) = f(a_1,\dots,a_d) := \prod_{i \neq j} \left( \left< \vec{x}_i, \vec{a} \right> - \left< \vec{x}_j, \vec{a} \right> \right) = \prod_{i \neq j} \left< \vec{x}_i - \vec{x}_j, \vec{a} \right>. $$
This is a polynomial function in $a_1,\dots,a_d$ and you are looking for $\vec{a} \in \mathbb{R}^d$ such that $f(\vec{a}) \neq 0$. By assumption, for $i \neq j$ the function $\vec{a} \mapsto \left< \vec{x}_i - \vec{x}_j, \vec{a} \right>$ is a non-zero linear polynomial. Hence $f$ is a non-zero polynomial (being the product of non-zero polynomials) and so we can find (even infinitely many) $\vec{a}$ with $f(\vec{a}) \neq 0$.
A: For any pair of distinct vectors $x_i \not= x_j \in \mathbb{R}^d$, the probability that $\langle x_i, a\rangle = \langle x_j, a\rangle$ for a uniformly random $a \in \mathbb{R}^d$ on the unit sphere is $0$.
You can see that this is true intuitively by recalling the relationship between the dot product and the angle between two vectors.  It can be proved formally by integrating over the unit sphere.  
Thus, you can choose a uniformly random vector $a$ on the unit sphere and it will work with probability $1$.
