Definition D1
For sequences a₁, …, aₙ and b₁, …, bₙ, set A = Σaᵢ², B = Σbᵢ², P = Σaᵢbᵢ.
Proof.
(1)Σaᵢ denotes a₁ + ⋯ + aₙ, u − v denotes u + (−v), and u ≤ v denotes u < v or u = v.convention
(2)A and B are sums of squares, hence non-negative.A13, A19
∎
Definition D2
For data pairs (xᵢ, yᵢ), let dᵢ = xᵢ − x̄, eᵢ = yᵢ − ȳ and set aᵢ = dᵢ, bᵢ = eᵢ. When 0 < A and 0 < B, the quantity r = P(√(AB))⁻¹ is called the correlation coefficient.
Proof.
(1)Since 0 < A and 0 < B, 0 < ABassumption, A21
(2)Therefore √(AB) exists with 0 < √(AB), (√(AB))² = AB, and (√(AB))⁻¹ exists as well.(1), A28, A9, A23
∎
Lemma L1
Setting q(t) = Σ(aᵢt + bᵢ)² gives q(t) = A t² + 2P t + B, and 0 ≤ q(t) for all t.
Proof.
(1)(aᵢt + bᵢ)² = aᵢ²t² + 2(aᵢbᵢ)t + bᵢ²A10, A6, A7
(2)Summing all terms: q(t) = Σ(aᵢ²t²) + Σ(2(aᵢbᵢ)t) + Σbᵢ²(1), A11
(3)Σ(aᵢ²t²) = t²Σaᵢ² = A t² and Σ(2(aᵢbᵢ)t) = 2t Σaᵢbᵢ = 2P tA12, A6, A7, D1
(4)Therefore q(t) = A t² + 2P t + B(2), (3), D1
(5)Each term (aᵢt + bᵢ)² is non-negative, and a sum of non-negative quantities is non-negative, so 0 ≤ q(t)A13, A19
∎
Theorem T1
If 0 < A, then P² ≤ AB
Proof.
(1)Set D = (2P)² − 4AB.convention
(2)Suppose 0 < D.assumption
(3)Since 0 < A and 0 < D, there exist α, β with α < β such that q(t) = A(t − α)(t − β)assumption, (2), L1, A16
(4)By density there is a t₁ with α < t₁ < β.(3), A25
(5)Adding −α and −β to both sides respectively gives 0 < t₁ − α and t₁ − β < 0(4), A18, A1, A2, A3, A4
(6)Since 0 < A and 0 < t₁ − α, 0 < A(t₁ − α)assumption, (5), A21
(7)Since t₁ − β < 0, q(t₁) = A(t₁ − α)(t₁ − β) < 0(3), (5), (6), A22, A6
(8)But by L1, 0 ≤ q(t₁), contradicting trichotomy.(7), L1, A23
(9)Therefore 0 < D fails, and D ≤ 0(8), A23
(10)Since (2P)² = 4P², we have 4P² − 4AB ≤ 0, and adding 4AB to both sides gives 4P² ≤ 4AB(1), (9), A10, A6, A7, A17, A1, A2, A3, A4, N
(11)Adding 1 to 0 < 1 repeatedly gives 0 < 4, so cancelling 4 yields P² ≤ AB(10), A26, A18, A24, A20
∎
Theorem T2
Suppose 0 < A. Then P² = AB holds if and only if there is a k with bᵢ = k aᵢ for all i.
Proof.
(1)First suppose P² = AB.assumption
(2)Since 0 < A, A ≠ 0 and A⁻¹ exists. Set t₀ = −(P A⁻¹).assumption, A23, A9
(3)q(t₀) = A t₀² + 2P t₀ + B = P²A⁻¹ − 2P²A⁻¹ + B = B − P²A⁻¹L1, (2), A6, A7, A8, A9, A30, A32, A1, A2, A3, A4
(4)Since P² = AB, P²A⁻¹ = (AB)A⁻¹ = B, and hence q(t₀) = B − B = 0(1), (3), A6, A7, A9, A8, A4
(5)q(t₀) = Σ(aᵢt₀ + bᵢ)², and each term is non-negative.L1, A13
(6)A sum of non-negative terms equal to 0 forces every term to be 0.(4), (5), A15
(7)The square of a nonzero quantity is positive, so by trichotomy aᵢt₀ + bᵢ = 0(6), A14, A23
(8)Adding −(aᵢt₀) to both sides gives bᵢ = (−t₀)aᵢ, so setting k = −t₀ = P A⁻¹ suffices.(7), (2), A1, A2, A3, A4, A32, A7
(9)Conversely, suppose bᵢ = k aᵢ for all i.assumption
(10)P = Σaᵢ(k aᵢ) = k Σaᵢ² = kA(9), D1, A6, A7, A12
(11)B = Σ(k aᵢ)² = k² Σaᵢ² = k²A(9), D1, A6, A7, A12
(12)P² = (kA)² = k²A² = A(k²A) = AB(10), (11), A6, A7
(13)Therefore the two conditions are equivalent.(8), (12)
∎
Theorem T3
If 0 < A and 0 < B, then −1 ≤ r ≤ 1
Proof.
(1)Since r = P(√(AB))⁻¹ and (√(AB))² = AB, r² = P²(AB)⁻¹D2, A6, A7, A9, A28
(2)By T1, P² ≤ AB, and since 0 < AB, 0 < (AB)⁻¹T1, D2, A27
(3)Multiplying both sides by (AB)⁻¹ gives r² = P²(AB)⁻¹ ≤ (AB)(AB)⁻¹ = 1(1), (2), A20, A9
(4)Adding −r² to both sides gives 0 ≤ 1 − r², and since (1 − r)(1 + r) = 1 − r², we get 0 ≤ (1 − r)(1 + r)(3), A17, A5, A7, A10, A1, A2, A3, A4
(5)Suppose 1 < r. Adding −r to both sides gives 1 − r < 0assumption, A18, A1, A2, A3, A4
(6)Since 0 < 1 and 1 < r, we have 0 < r, and adding 1 to both sides gives 1 < 1 + r, so 0 < 1 + r(5), A26, A24, A18, A2, A3
(7)Then (1 − r)(1 + r) < 0, contradicting (4).(4), (5), (6), A22, A7, A23
(8)Suppose r < −1. Adding 1 to both sides gives 1 + r < 0assumption, A18, A2, A3, A4
(9)Adding −r to both sides also gives 0 < −1 − r, and since 0 < 2, 2 < 2 + (−1 − r) = 1 − r, hence 0 < 1 − r(8), A18, A26, A24, A1, A2, A3, A4
(10)Then (1 − r)(1 + r) < 0, again contradicting (4).(4), (8), (9), A22, A7, A23
(11)By trichotomy neither 1 < r nor r < −1 holds, so −1 ≤ r ≤ 1(7), (10), A23
∎
Corollary C
r = 1 or r = −1 holds if and only if all the points lie on a single line.
Proof.
(1)Since r² = P²(AB)⁻¹, r² = 1 is equivalent to P² = AB.D2, A28, A9, A6, A7, E
(2)If r² = 1, then (r − 1)(r + 1) = r² − 1 = 0, so r = 1 or r = −1(1), A5, A10, A1, A2, A3, A4, A31
(3)Conversely, if r = 1 or r = −1, then r² = 1.A30, A8, N
(4)Therefore r = ±1 is equivalent to P² = AB, and by T2 this is equivalent to the existence of a k with eᵢ = k dᵢ.(1), (2), (3), T2
(5)eᵢ = k dᵢ means yᵢ − ȳ = k(xᵢ − x̄), that is, yᵢ = k xᵢ + (ȳ − k x̄), so all the points lie on one line.(4), D2, A5, A32, A1, A2, A3, A4
(6)B = k²A and 0 < B, so k ≠ 0. That is, this line is not horizontal.T2, D2, A23
(7)If 0 < k, then 0 < kA and AB = (kA)², so √(AB) = kA and r = kA(kA)⁻¹ = 1(6), T2, A21, A29, A9, A6, A7
(8)If k < 0, then kA < 0 and (kA)² = (−(kA))², so √(AB) = −(kA) and r = kA(−(kA))⁻¹ = −1(6), T2, A22, A30, A29, A9, A32, A8
(9)Consider the data x = 1, 2, 3, 4, 5 and y = 7, 5, 3, 1, −1. Since x̄ = 3, ȳ = 3, we get dᵢ = −2, −1, 0, 1, 2 and eᵢ = 4, 2, 0, −2, −4.D2, N
(10)A = 10, B = 40, P = −20, so P² = 400 = AB, and √400 = 20, so r = −20 × 20⁻¹ = −1(9), D1, D2, A28, A9, N
(11)Indeed eᵢ = −2dᵢ and yᵢ = −2xᵢ + 9, so the five points lie on one line.(9), N
(12)Changing the data to y = 1, 2, 3, 5, 4 gives eᵢ = −2, −1, 0, 2, 1 and A = 10, B = 10, P = 9, so P² = 81 < 100 = ABD1, D2, N
(13)Here the fourth point demands k = 2 and the fifth point demands k = 0.5, so there is no k with eᵢ = k dᵢ and equality does not hold.(12), T2, N
(14)So −1 ≤ r ≤ 1 is given by the inequality, and the endpoints ±1 are given by the equality condition. |r| = 1 means not that the relationship is strongest, but that the data lie exactly on one line.T3, (5), (10), (13)
∎