The Cauchy-Schwarz inequality says that
$$|\langle v, w \rangle| \leq \|v\| \|w\|\tag{1}$$ for vectors $v, w$ in a complex Hilbert space.
By exploiting the obvious inequality
$$\|v-w\|^2 \geq 0\tag{2}$$
and expanding everything out, one gets the weaker inequality $$ \hbox{Re} \langle v, w \rangle \leq \frac{1}{2} \|v\|^2 + \frac{1}{2} \|w\|^2. \tag{3} $$ Now (3) is weaker than (1). Firstly, observe that the phase rotation symmetry $v \mapsto e^{i\theta} v$ preserves the RHS of (3) but not the LHS. We exploit this by replacing $v$ by $e^{i\theta} v$ in (3) for some phase $\theta$ to be chosen later, to obtain $$ \hbox{Re} e^{i\theta} \langle v, w \rangle \leq \frac{1}{2} \|v\|^2 + \frac{1}{2} \|w\|^2. $$ By choosing $e^{i\theta}$ to cancel the phase of $\langle v, w \rangle$, we obtain $$ |\langle v, w \rangle| \leq \frac{1}{2} \|v\|^2 + \frac{1}{2} \|w\|^2 \tag{4} $$ This is closer to (1); we have fixed the left-hand side, but the right-hand side is still too weak. But we can amplify further, by exploiting an imbalance in a different symmetry, namely the homogenisation symmetry $(v,w) \mapsto (\lambda v, \frac{1}{\lambda} w)$ for a scalar $\lambda > 0$, which preserves the left-hand side but not the right. Inserting this transform into (4) we conclude that $$ |\langle v, w \rangle| \leq \frac{\lambda^2}{2} \|v\|^2 + \frac{1}{2\lambda^2} \|w\|^2 $$ where $\lambda > 0$ is at our disposal to choose. We can optimise in $\lambda$ by minimising the right-hand side, and indeed one easily sees that the minimum (or infimum, if one of $v$ and $w$ vanishes) is $\|v\| \|w\|$ (which is achieved when $\lambda = \sqrt{\|w\|/\|v\|}$ when $v,w$ are non-zero, or in an asymptotic limit $\lambda \to 0$ or $\lambda \to \infty$ in the degenerate cases), and so we have amplified our way to the Cauchy-Schwarz inequality (1).
The above is a proof of the Cauchy-Schwarz inequality from one of Terry Tao's expository articles.
In Folland's Real Analysis, a similar construction is given, which also proves the condition when the equality in (1) is true:
Here is my question:
following Tao's argument, can one prove that the equality in (1) is true only when $v,w$ are linearly dependent?