TITLE: Is this proof that the vectors are colinear correct?
QUESTION [6 upvotes]: I was solving the following exercise: "Let $x,y \in \mathbb{R}^n$ be nonzero such that if $z$ is orthogonal to $x$ then $z$ is orthogonal to $y$. Prove that $x$ and $y$ are colinear".
My idea was: since $x$ is nonzero, we know that we can write $y =\alpha x + z$ where $z$ is orthogonal to $x$. But, by hypothesis, being orthogonal to $x$ implies being orthogonal to $y$, so that taking the inner product on both sides with $z$ we have:
$$\left\langle y,z \right\rangle=\alpha\left\langle x,z \right\rangle + \left\langle z,z \right\rangle = 0,$$
but since $\left\langle x,z\right\rangle = 0$ this implies $|z|^2 = 0$ so that by properties of norm, we must have $z = 0$ proving that $y = \alpha x$.
Is this proof ok? I felt it was too easy to prove it and the answer in the book is a little different, so I thought there might be some error in this thought.
Thanks very much in advance!

REPLY [2 votes]: Your proof looks good to me!
Incidentally, an easier way might be to note that $$\langle x \rangle ^{\perp} = \langle y \rangle ^{\perp} \Rightarrow \left( \langle x \rangle ^{\perp} \right)^\perp = \langle x \rangle = \left( \langle y \rangle ^{\perp} \right)^\perp =  \langle y \rangle, $$ where $\langle x \rangle$ is the subspace generated by $x$.  But some of these things might not have been proven in your book yet...