Two vectors $v,w \in V$ in a vector space $V$ with a scalar product $\langle \cdot,\cdot\rangle $ (we assume that $\langle v,w\rangle =\langle w,v\rangle $) are defined to be orthogonal if the scalar product $\langle v,w\rangle =0$. Lets suppose we have a normed vectorspace where the norm is defined with our scalar product in the following way
$$ \|x\|:= \sqrt{\langle x,x\rangle } \label{1}\tag{1}$$ It is easy to prove that $$\|v-w\|^2=\|v\|^2+\|w\|^ 2 \iff \langle v,w\rangle =0 \label{2}\tag{2}$$ if the norm is defined like in (\ref{1}).
To prove it in the one direction:
$"\Rightarrow"$ we start with $$\|v-w\|^2=\|v\|^2+\|w\|^ 2$$ lets use (\ref{1}) and substitute the norm $$ \langle v-w,v-w\rangle =\langle v,v\rangle +\langle w,w\rangle $$ $$ \langle v,v-w\rangle -\langle w,v-w\rangle =\langle v,v\rangle +\langle w,w\rangle $$ $$ \langle v,v\rangle -\langle v,w\rangle -(-\langle w,w\rangle +\langle w,v\rangle )=\langle v,v\rangle +\langle w,w\rangle $$ $$ \langle v,v\rangle -2\langle v,w\rangle +\langle w,w\rangle = \langle v,v\rangle +\langle w,w\rangle $$ when we substract $\langle v,v\rangle $ and $\langle w,w\rangle $ from both side and divide by $-2$ there is left $$\langle v,w\rangle =0$$
$"\Leftarrow"$ the other way of the equivalence we prove it by contradiction suppose: $$\|v-w\|^2 \neq \|v\|^2+\|w\|^ 2-2\langle v,w\rangle $$ Then lets substitute the norm with the scalar product we get: $$\langle v,v\rangle +\langle w,w\rangle -2\langle v,w\rangle \neq \langle v,v\rangle +\langle w,w\rangle -2\langle v,w\rangle $$ so this is wrong so $$\|v-w\|^2 = \|v\|^2+\|w\|^ 2-2\langle v,w\rangle $$ is true. Since we supposed that also $\langle v,w\rangle =0$ is true then also $$\|v-w\|^2=\|v\|^2+\|w\|^2$$ is true. So the the equivalence (\ref{2}) is proven.
My question is now why use scalar product to define orthogonality? A vector space not necessarily needs a scalar product for orthogonality. One could also define orthogonality by saying two vectors are considered to be orthogonal if the equation $\|v-w\|^2=\|v\|^2+\|w\|^ 2$ holds.
We could define the concept orthogonality even more general for a metric space $(X,d)$.
With $x,y \in X$ while $X$ should be at least an unital magma with $0$ as the neutral element. So we would say $x,y$ are orthogonal when $$d(x,y)^2=d(0,x)^2+d(0,y)^2$$ Or is there a general problem with it?