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

Commit fe3cd45

Browse files
committed
feat(geometry/euclidean/angle/oriented/basic): π / 2 rotations and inner product (#17687)
Add a series of lemmas relating to the inner product of a vector and a `π / 2` rotation of that vector being zero, with variants that are convenient for `simp` and an `iff` lemma that the inner product is zero if and only if a vector is zero or one is a multiple of a `π / 2` rotation of the other.
1 parent e45547e commit fe3cd45

File tree

1 file changed

+75
-0
lines changed

1 file changed

+75
-0
lines changed

src/geometry/euclidean/angle/oriented/basic.lean

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,6 +1142,81 @@ lemma inner_rev_eq_zero_of_oangle_eq_neg_pi_div_two {x y : V} (h : o.oangle x y
11421142
⟪y, x⟫ = 0 :=
11431143
by rw [real_inner_comm, o.inner_eq_zero_of_oangle_eq_neg_pi_div_two h]
11441144

1145+
/-- The inner product between a `π / 2` rotation of a vector and that vector is zero. -/
1146+
@[simp] lemma inner_rotation_pi_div_two_left (x : V) : ⟪o.rotation (π / 2 : ℝ) x, x⟫ = 0 :=
1147+
by rw [rotation_pi_div_two, inner_right_angle_rotation_self]
1148+
1149+
/-- The inner product between a vector and a `π / 2` rotation of that vector is zero. -/
1150+
@[simp] lemma inner_rotation_pi_div_two_right (x : V) : ⟪x, o.rotation (π / 2 : ℝ) x⟫ = 0 :=
1151+
by rw [real_inner_comm, inner_rotation_pi_div_two_left]
1152+
1153+
/-- The inner product between a multiple of a `π / 2` rotation of a vector and that vector is
1154+
zero. -/
1155+
@[simp] lemma inner_smul_rotation_pi_div_two_left (x : V) (r : ℝ) :
1156+
⟪r • o.rotation (π / 2 : ℝ) x, x⟫ = 0 :=
1157+
by rw [inner_smul_left, inner_rotation_pi_div_two_left, mul_zero]
1158+
1159+
/-- The inner product between a vector and a multiple of a `π / 2` rotation of that vector is
1160+
zero. -/
1161+
@[simp] lemma inner_smul_rotation_pi_div_two_right (x : V) (r : ℝ) :
1162+
⟪x, r • o.rotation (π / 2 : ℝ) x⟫ = 0 :=
1163+
by rw [real_inner_comm, inner_smul_rotation_pi_div_two_left]
1164+
1165+
/-- The inner product between a `π / 2` rotation of a vector and a multiple of that vector is
1166+
zero. -/
1167+
@[simp] lemma inner_rotation_pi_div_two_left_smul (x : V) (r : ℝ) :
1168+
⟪o.rotation (π / 2 : ℝ) x, r • x⟫ = 0 :=
1169+
by rw [inner_smul_right, inner_rotation_pi_div_two_left, mul_zero]
1170+
1171+
/-- The inner product between a multiple of a vector and a `π / 2` rotation of that vector is
1172+
zero. -/
1173+
@[simp] lemma inner_rotation_pi_div_two_right_smul (x : V) (r : ℝ) :
1174+
⟪r • x, o.rotation (π / 2 : ℝ) x⟫ = 0 :=
1175+
by rw [real_inner_comm, inner_rotation_pi_div_two_left_smul]
1176+
1177+
/-- The inner product between a multiple of a `π / 2` rotation of a vector and a multiple of
1178+
that vector is zero. -/
1179+
@[simp] lemma inner_smul_rotation_pi_div_two_smul_left (x : V) (r₁ r₂ : ℝ) :
1180+
⟪r₁ • o.rotation (π / 2 : ℝ) x, r₂ • x⟫ = 0 :=
1181+
by rw [inner_smul_right, inner_smul_rotation_pi_div_two_left, mul_zero]
1182+
1183+
/-- The inner product between a multiple of a vector and a multiple of a `π / 2` rotation of
1184+
that vector is zero. -/
1185+
@[simp] lemma inner_smul_rotation_pi_div_two_smul_right (x : V) (r₁ r₂ : ℝ) :
1186+
⟪r₂ • x, r₁ • o.rotation (π / 2 : ℝ) x⟫ = 0 :=
1187+
by rw [real_inner_comm, inner_smul_rotation_pi_div_two_smul_left]
1188+
1189+
/-- The inner product between two vectors is zero if and only if the first vector is zero or
1190+
the second is a multiple of a `π / 2` rotation of that vector. -/
1191+
lemma inner_eq_zero_iff_eq_zero_or_eq_smul_rotation_pi_div_two {x y : V} :
1192+
⟪x, y⟫ = 0 ↔ (x = 0 ∨ ∃ r : ℝ, r • o.rotation (π / 2 : ℝ) x = y) :=
1193+
begin
1194+
rw ←o.eq_zero_or_oangle_eq_iff_inner_eq_zero,
1195+
refine ⟨λ h, _, λ h, _⟩,
1196+
{ rcases h with rfl | rfl | h | h,
1197+
{ exact or.inl rfl },
1198+
{ exact or.inr ⟨0, zero_smul _ _⟩ },
1199+
{ obtain ⟨r, hr, rfl⟩ := (o.oangle_eq_iff_eq_pos_smul_rotation_of_ne_zero
1200+
(o.left_ne_zero_of_oangle_eq_pi_div_two h)
1201+
(o.right_ne_zero_of_oangle_eq_pi_div_two h) _).1 h,
1202+
exact or.inr ⟨r, rfl⟩ },
1203+
{ obtain ⟨r, hr, rfl⟩ := (o.oangle_eq_iff_eq_pos_smul_rotation_of_ne_zero
1204+
(o.left_ne_zero_of_oangle_eq_neg_pi_div_two h)
1205+
(o.right_ne_zero_of_oangle_eq_neg_pi_div_two h) _).1 h,
1206+
refine or.inr ⟨-r, _⟩,
1207+
rw [neg_smul, ←smul_neg, o.neg_rotation_pi_div_two] } },
1208+
{ rcases h with rfl | ⟨r, rfl⟩,
1209+
{ exact or.inl rfl },
1210+
{ by_cases hx : x = 0, { exact or.inl hx },
1211+
rcases lt_trichotomy r 0 with hr | rfl | hr,
1212+
{ refine or.inr (or.inr (or.inr _)),
1213+
rw [o.oangle_smul_right_of_neg _ _ hr, o.neg_rotation_pi_div_two,
1214+
o.oangle_rotation_self_right hx] },
1215+
{ exact or.inr (or.inl (zero_smul _ _)) },
1216+
{ refine or.inr (or.inr (or.inl _)),
1217+
rw [o.oangle_smul_right_of_pos _ _ hr, o.oangle_rotation_self_right hx] } } }
1218+
end
1219+
11451220
/-- Negating the first vector passed to `oangle` negates the sign of the angle. -/
11461221
@[simp] lemma oangle_sign_neg_left (x y : V) :
11471222
(o.oangle (-x) y).sign = -((o.oangle x y).sign) :=

0 commit comments

Comments
 (0)