Prove that two vectors are collinear given $x_iy_j=x_jy_i$ 
Given two non-zero vectors
  $$
\mathbf{x}=(x_1,\cdots,x_n),\quad\mathbf{y}=(y_1,\cdots,y_n),\quad
$$
  and the conditions
  $$
\forall i,j \quad x_iy_j=x_jy_i.
$$
  How do I derive that there is a non-zero $r$ such that
  $$
\mathbf{x} = r \mathbf{y}\quad ?
$$

I can work out the case $n=2$ by cases. wlog $x_1\ne 0$ ($\mathbf{x}\ne 0$ thus one of the components is non-zero)


*

*$y_2=0$


*

*$y_1=0$, contradiction with $\mathbf{y}\ne 0$ 

*$y_1\ne 0$


*

*$x_2=0$, then $(x_1,0)=\frac{x_1}{y_1}(y_1,0)$

*$x_2\ne 0$, contradiction with $x_1y_2=x_2y_1$



*$y_2\ne 0$, then $(x_1,x_2)=\frac{x_2}{y_2}(y_1,y_2)$
I think that this proof is correct but not nice. In any case it get complex with growing $n$ and I do not see how to set up an induction proof.
Is there a nice proof valid for any $n$.
 A: In your proof for $n=2$, the distinction whether $x_2 = 0$ or $x_2 \ne 0$ is not necessary. You have
$$
 (x_1,x_2)=\frac{x_1}{y_1}(y_1,y_2) \text{ if } y_1 \ne 0
$$
and
$$
 (x_1,x_2)=\frac{x_2}{y_2}(y_1,y_2) \text{ if } y_2 \ne 0 \, .
$$
This argument can be extended to arbitrary dimensions. Note that the conclusion holds even if one or both vectors are zero.

Proof (sketch) for arbitrary $n$:
If $\mathbf{y}=(0,\ldots,0)$ then $\mathbf{y} = 0 \mathbf{x}$ and the vectors are collinear.
Otherwise pick one index $i$ with $y_i \ne 0$, define $r = \frac{x_i}{y_i}$, and then show that $\mathbf{x} = r \mathbf{y}$.

Or in a more symmetric fashion: If $\mathbf{x} = \mathbf{y} = (0,\ldots,0)$ then the vectors are trivially collinear. 
Otherwise pick one index $i$ with $(x_i, y_i) \ne (0, 0)$, and show that $y_i \mathbf{x} - x_i \mathbf{y} = 0$.
A: If $x_j \ne 0$, then $$\frac{x_i}{x_j}=\frac{y_i}{y_j} = \alpha_{ij}$$.
Let $p$ be the first index where $x_p \ne 0$.
$$x_1 =\cdots =x_{p-1} = 0 = y_1 =\cdots =y_{p-1}$$
Loop from $p$ to $n$, $$x_j = \alpha_{pj} x_p$$ and $$y_j=\alpha_{pj} y_p$$ so $$r=\frac{y_p}{x_p}.$$
