Zulip Chat Archive
Stream: new members
Topic: inner product equal -1 iff vectors are opposite
IlmΔrs CΔ«rulis (Jun 21 2025 at 03:18):
Is there a shorter way to prove/golf this result? I want to put in Mathlib.Analysis.InnerProductSpace.Basic right after inner_eq_one_iff_of_norm_one.
import Mathlib.Analysis.InnerProductSpace.Basic
variable {π E : Type*}
variable [RCLike π]
variable [NormedAddCommGroup E]
variable [InnerProductSpace π E]
/-- If the inner product of two unit vectors is `-1`, then the two vectors are opposite. -/
theorem inner_eq_neg_one_iff_of_norm_one {x y : E} (hx : βxβ = 1) (hy : βyβ = 1) :
inner π x y = -1 β x = -y := by
have H := inner_eq_one_iff_of_norm_one (π := π) (x := x) (y := -y)
simp only [norm_neg, inner_neg_right] at H
rw [β H hx hy]
constructor <;> intros H0
Β· rw [H0]; simp
Β· rw [β H0]; simp
Aaron Liu (Jun 21 2025 at 03:32):
#mwe?
IlmΔrs CΔ«rulis (Jun 21 2025 at 03:33):
Fixed
IlmΔrs CΔ«rulis (Jun 21 2025 at 03:42):
Ok, this is a bit shorter
import Mathlib.Analysis.InnerProductSpace.Basic
variable {π E : Type*}
variable [RCLike π]
variable [NormedAddCommGroup E]
variable [InnerProductSpace π E]
/-- If the inner product of two unit vectors is `-1`, then the two vectors are opposite. -/
theorem inner_eq_neg_one_iff_of_norm_one {x y : E} (hx : βxβ = 1) (hy : βyβ = 1) :
inner π x y = -1 β x = -y := by
have H := inner_eq_one_iff_of_norm_one (π := π) (x := x) (y := -y)
simp only [norm_neg, inner_neg_right] at H
rw [β H hx hy, neg_eq_iff_eq_neg]
Aaron Liu (Jun 21 2025 at 03:49):
import Mathlib.Analysis.InnerProductSpace.Basic
variable {π E : Type*}
variable [RCLike π]
variable [NormedAddCommGroup E]
variable [InnerProductSpace π E]
/-- If the inner product of two unit vectors is `-1`, then the two vectors are opposite. -/
theorem inner_eq_neg_one_iff_of_norm_one {x y : E} (hx : βxβ = 1) (hy : βyβ = 1) :
inner π x y = -1 β x = -y := by
simpa [neg_eq_iff_eq_neg] using
inner_eq_one_iff_of_norm_one (π := π) hx (show β-yβ = 1 by simpa using hy)
Last updated: Dec 20 2025 at 21:32 UTC