Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit a6633e5

Browse files
committed
feat(analysis/normed_space/inner_product): new versions of Cauchy-Schwarz equality case (#5586)
The existing version of the Cauchy-Schwarz equality case characterizes the pairs `x`, `y` with `abs ⟪x, y⟫ = ∥x∥ * ∥y∥`. This PR provides a characterization, with converse, of pairs satisfying `⟪x, y⟫ = ∥x∥ * ∥y∥`, and some consequences.
1 parent 1de608d commit a6633e5

File tree

3 files changed

+80
-2
lines changed

3 files changed

+80
-2
lines changed

src/analysis/normed_space/basic.lean

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,12 @@ begin
186186
rwa dist_eq_norm
187187
end
188188

189+
lemma norm_sub_eq_zero_iff {u v : α} : ∥u - v∥ = 0 ↔ u = v :=
190+
begin
191+
convert dist_eq_zero,
192+
rwa dist_eq_norm
193+
end
194+
189195
lemma norm_le_insert (u v : α) : ∥v∥ ≤ ∥u∥ + ∥u - v∥ :=
190196
calc ∥v∥ = ∥u - (u - v)∥ : by abel
191197
... ≤ ∥u∥ + ∥u - v∥ : norm_sub_le u _

src/analysis/normed_space/inner_product.lean

Lines changed: 62 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ Authors: Zhouhang Zhou, Sébastien Gouëzel, Frédéric Dupuis
66

77
import linear_algebra.bilinear_form
88
import linear_algebra.sesquilinear_form
9-
import analysis.special_functions.pow
109
import topology.metric_space.pi_Lp
1110
import data.complex.is_R_or_C
1211

@@ -725,6 +724,10 @@ end
725724
lemma abs_real_inner_le_norm (x y : F) : absR ⟪x, y⟫_ℝ ≤ ∥x∥ * ∥y∥ :=
726725
by { have h := @abs_inner_le_norm ℝ F _ _ x y, simpa using h }
727726

727+
/-- Cauchy–Schwarz inequality with norm -/
728+
lemma real_inner_le_norm (x y : F) : ⟪x, y⟫_ℝ ≤ ∥x∥ * ∥y∥ :=
729+
le_trans (le_abs_self _) (abs_real_inner_le_norm _ _)
730+
728731
include 𝕜
729732
lemma parallelogram_law_with_norm {x y : E} :
730733
∥x + y∥ * ∥x + y∥ + ∥x - y∥ * ∥x - y∥ = 2 * (∥x∥ * ∥x∥ + ∥y∥ * ∥y∥) :=
@@ -938,7 +941,7 @@ end
938941
/--
939942
If the inner product of two vectors is equal to the product of their norms, then the two vectors
940943
are multiples of each other. One form of the equality case for Cauchy-Schwarz.
941-
-/
944+
Compare `inner_eq_norm_mul_iff`, which takes the stronger hypothesis `⟪x, y⟫ = ∥x∥ * ∥y∥`. -/
942945
lemma abs_inner_eq_norm_iff (x y : E) (hx0 : x ≠ 0) (hy0 : y ≠ 0):
943946
abs ⟪x, y⟫ = ∥x∥ * ∥y∥ ↔ ∃ (r : 𝕜), r ≠ 0 ∧ y = r • x :=
944947
begin
@@ -1010,6 +1013,63 @@ begin
10101013
exact real_inner_div_norm_mul_norm_eq_neg_one_of_ne_zero_of_neg_mul hx hr }
10111014
end
10121015

1016+
/-- If the inner product of two vectors is equal to the product of their norms (i.e.,
1017+
`⟪x, y⟫ = ∥x∥ * ∥y∥`), then the two vectors are nonnegative real multiples of each other. One form
1018+
of the equality case for Cauchy-Schwarz.
1019+
Compare `abs_inner_eq_norm_iff`, which takes the weaker hypothesis `abs ⟪x, y⟫ = ∥x∥ * ∥y∥`. -/
1020+
lemma inner_eq_norm_mul_iff {x y : E} :
1021+
⟪x, y⟫ = (∥x∥ : 𝕜) * ∥y∥ ↔ (∥y∥ : 𝕜) • x = (∥x∥ : 𝕜) • y :=
1022+
begin
1023+
by_cases h : (x = 0 ∨ y = 0), -- WLOG `x` and `y` are nonzero
1024+
{ cases h; simp [h] },
1025+
calc ⟪x, y⟫ = (∥x∥ : 𝕜) * ∥y∥ ↔ ∥x∥ * ∥y∥ = re ⟪x, y⟫ :
1026+
begin
1027+
norm_cast,
1028+
split,
1029+
{ intros h',
1030+
simp [h'] },
1031+
{ have cauchy_schwarz := abs_inner_le_norm x y,
1032+
intros h',
1033+
rw h' at ⊢ cauchy_schwarz,
1034+
rwa re_eq_self_of_le }
1035+
end
1036+
... ↔ 2 * ∥x∥ * ∥y∥ * (∥x∥ * ∥y∥ - re ⟪x, y⟫) = 0 :
1037+
by simp [h, show (2:ℝ) ≠ 0, by norm_num, sub_eq_zero]
1038+
... ↔ ∥(∥y∥:𝕜) • x - (∥x∥:𝕜) • y∥ * ∥(∥y∥:𝕜) • x - (∥x∥:𝕜) • y∥ = 0 :
1039+
begin
1040+
simp only [norm_sub_mul_self, inner_smul_left, inner_smul_right, norm_smul, conj_of_real,
1041+
is_R_or_C.norm_eq_abs, abs_of_real, of_real_im, of_real_re, mul_re, abs_norm_eq_norm],
1042+
refine eq.congr _ rfl,
1043+
ring
1044+
end
1045+
... ↔ (∥y∥ : 𝕜) • x = (∥x∥ : 𝕜) • y : by simp [norm_sub_eq_zero_iff]
1046+
end
1047+
1048+
/-- If the inner product of two vectors is equal to the product of their norms (i.e.,
1049+
`⟪x, y⟫ = ∥x∥ * ∥y∥`), then the two vectors are nonnegative real multiples of each other. One form
1050+
of the equality case for Cauchy-Schwarz.
1051+
Compare `abs_inner_eq_norm_iff`, which takes the weaker hypothesis `abs ⟪x, y⟫ = ∥x∥ * ∥y∥`. -/
1052+
lemma inner_eq_norm_mul_iff_real {x y : F} : ⟪x, y⟫_ℝ = ∥x∥ * ∥y∥ ↔ ∥y∥ • x = ∥x∥ • y :=
1053+
inner_eq_norm_mul_iff
1054+
1055+
/-- If the inner product of two unit vectors is `1`, then the two vectors are equal. One form of
1056+
the equality case for Cauchy-Schwarz. -/
1057+
lemma inner_eq_norm_mul_iff_of_norm_one {x y : E} (hx : ∥x∥ = 1) (hy : ∥y∥ = 1) :
1058+
⟪x, y⟫ = 1 ↔ x = y :=
1059+
by { convert inner_eq_norm_mul_iff using 2; simp [hx, hy] }
1060+
1061+
lemma inner_lt_norm_mul_iff_real {x y : F} :
1062+
⟪x, y⟫_ℝ < ∥x∥ * ∥y∥ ↔ ∥y∥ • x ≠ ∥x∥ • y :=
1063+
calc ⟪x, y⟫_ℝ < ∥x∥ * ∥y∥
1064+
↔ ⟪x, y⟫_ℝ ≠ ∥x∥ * ∥y∥ : ⟨ne_of_lt, lt_of_le_of_ne (real_inner_le_norm _ _)⟩
1065+
... ↔ ∥y∥ • x ≠ ∥x∥ • y : not_congr inner_eq_norm_mul_iff_real
1066+
1067+
/-- If the inner product of two unit vectors is strictly less than `1`, then the two vectors are
1068+
distinct. One form of the equality case for Cauchy-Schwarz. -/
1069+
lemma inner_lt_one_iff_real_of_norm_one {x y : F} (hx : ∥x∥ = 1) (hy : ∥y∥ = 1) :
1070+
⟪x, y⟫_ℝ < 1 ↔ x ≠ y :=
1071+
by { convert inner_lt_norm_mul_iff_real; simp [hx, hy] }
1072+
10131073
/-- The inner product of two weighted sums, where the weights in each
10141074
sum add to 0, in terms of the norms of pairwise differences. -/
10151075
lemma inner_sum_smul_sum_smul_of_sum_eq_zero {ι₁ : Type*} {s₁ : finset ι₁} {w₁ : ι₁ → ℝ}

src/data/complex/is_R_or_C.lean

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,18 @@ lemma re_le_abs (z : K) : re z ≤ abs z :=
475475
lemma im_le_abs (z : K) : im z ≤ abs z :=
476476
(abs_le.1 (abs_im_le_abs _)).2
477477

478+
lemma im_eq_zero_of_le {a : K} (h : abs a ≤ re a) : im a = 0 :=
479+
begin
480+
rw ← zero_eq_mul_self,
481+
have : re a * re a = re a * re a + im a * im a,
482+
{ convert is_R_or_C.mul_self_abs a;
483+
linarith [re_le_abs a] },
484+
linarith
485+
end
486+
487+
lemma re_eq_self_of_le {a : K} (h : abs a ≤ re a) : (re a : K) = a :=
488+
by { rw ← re_add_im a, simp [im_eq_zero_of_le h] }
489+
478490
lemma abs_add (z w : K) : abs (z + w) ≤ abs z + abs w :=
479491
(mul_self_le_mul_self_iff (abs_nonneg _)
480492
(add_nonneg (abs_nonneg _) (abs_nonneg _))).2 $

0 commit comments

Comments
 (0)