Skip to content

Commit

Permalink
feat(analysis/inner_product_space/basic): Pythagoras with square roots (
Browse files Browse the repository at this point in the history
#17025)

Add two further variants of Pythagoras, expressed in terms of a norm equal to a square root instead of an expression for a square of a norm.
  • Loading branch information
jsm28 committed Oct 21, 2022
1 parent d94370d commit b5dd709
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/analysis/inner_product_space/basic.lean
Expand Up @@ -1347,6 +1347,12 @@ begin
norm_num
end

/-- Pythagorean theorem, if-and-if vector inner product form using square roots. -/
lemma norm_add_eq_sqrt_iff_real_inner_eq_zero {x y : F} :
∥x + y∥ = sqrt (∥x∥ * ∥x∥ + ∥y∥ * ∥y∥) ↔ ⟪x, y⟫_ℝ = 0 :=
by rw [←norm_add_sq_eq_norm_sq_add_norm_sq_iff_real_inner_eq_zero, eq_comm,
sqrt_eq_iff_mul_self_eq (add_nonneg (mul_self_nonneg _) (mul_self_nonneg _)) (norm_nonneg _)]

/-- Pythagorean theorem, vector inner product form. -/
lemma norm_add_sq_eq_norm_sq_add_norm_sq_of_inner_eq_zero (x y : E) (h : ⟪x, y⟫ = 0) :
∥x + y∥ * ∥x + y∥ = ∥x∥ * ∥x∥ + ∥y∥ * ∥y∥ :=
Expand All @@ -1371,6 +1377,13 @@ begin
norm_num
end

/-- Pythagorean theorem, subtracting vectors, if-and-if vector inner product form using square
roots. -/
lemma norm_sub_eq_sqrt_iff_real_inner_eq_zero {x y : F} :
∥x - y∥ = sqrt (∥x∥ * ∥x∥ + ∥y∥ * ∥y∥) ↔ ⟪x, y⟫_ℝ = 0 :=
by rw [←norm_sub_sq_eq_norm_sq_add_norm_sq_iff_real_inner_eq_zero, eq_comm,
sqrt_eq_iff_mul_self_eq (add_nonneg (mul_self_nonneg _) (mul_self_nonneg _)) (norm_nonneg _)]

/-- Pythagorean theorem, subtracting vectors, vector inner product
form. -/
lemma norm_sub_sq_eq_norm_sq_add_norm_sq_real {x y : F} (h : ⟪x, y⟫_ℝ = 0) :
Expand Down

0 comments on commit b5dd709

Please sign in to comment.