# Partial proof for correlation coefficient formula?

I've been working to prove the formula for the correlation coefficient, since asking my last question yesterday (Meaning of denominator in correlation?). If this post in any way violates any guidelines, then please let me know.

So far, I've proved that the constant is 1 when $(X_i-\bar X)=(Y_i-\bar Y)$, and -1 when $-(X_i-\bar X)=(Y_i-\bar Y)$

What I want to do now, is to prove that for any other value, the denominator is larger than the numerator, making the constant smaller than 1, but larger than -1

That is to say that $\sum(X_i-\bar X)(Y_i-\bar Y) < \sqrt{\sum(X_i-\bar X)^2\sum(Y_i -\bar Y)^2}$

If we develop the numerator, we get:

$\sum(X_i-\bar X)(Y_i-\bar Y)$

$\sum X_iY_i-2n\bar X\bar Y + n\bar X\bar Y)$

$\sum X_iY_i-n\bar X\bar Y$

If we develop the denominator, we get:

$\sqrt{\sum(X_i-\bar X)^2\sum(Y_i -\bar Y)^2}$

$\sqrt{(\sum X_i^2-n\bar X)(\sum Y_i^2 -n\bar Y)}$

$\sqrt{(\sum X_i^2\sum Y_i^2 -n\bar Y\sum X_i^2 -n\bar X \sum Y_i^2 + n^2\bar X \bar Y}$

....Which is as far as I get. Put together:

$\sum X_iY_i-n\bar X\bar Y$ < $\sqrt{(\sum X_i^2\sum Y_i^2 -n\bar Y\sum X_i^2 -n\bar X \sum Y_i^2 + n^2\bar X \bar Y}$

Can we develop this in any meaningful way, and prove that the denominator is greater than the numerator?

You want to show: $\sum(X_i-\bar X)(Y_i-\bar Y) \leq\sqrt{\sum(X_i-\bar X)^2\sum(Y_i -\bar Y)^2}$
CS inequality gives us: $$\sum a_ib_i \leq\sqrt{\sum a_i^2\sum b_i^2},$$ here equality occurs if $a_i=c_1+c_2b_i$ $\forall i$, where $c_1,c_2\in R$. Take $a_i=(X_i-\bar X)$ and $b_i=(Y_i-\bar Y)$, then you are done.