Theorem: EuclideanGeometry.mul_dist_eq_abs_sub_sq_dist
File: Mathlib/Geometry/Euclidean/Sphere/Power.lean

tactic: let m : P := midpoint ℝ a b
state_before: V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b p q : P
hp : ∃ k, k ≠ 1 ∧ b -ᵥ p = k • (a -ᵥ p)
hq : dist a q = dist b q
⊢ dist a p * dist b p = abs (dist b q ^ 2 - dist p q ^ 2)

tactic: have h1 := vsub_sub_vsub_cancel_left a p m
state_before: V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b p q : P
hp : ∃ k, k ≠ 1 ∧ b -ᵥ p = k • (a -ᵥ p)
hq : dist a q = dist b q
m : P := midpoint ℝ a b
⊢ dist a p * dist b p = abs (dist b q ^ 2 - dist p q ^ 2)

tactic: have h2 := vsub_sub_vsub_cancel_left p q m
state_before: V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b p q : P
hp : ∃ k, k ≠ 1 ∧ b -ᵥ p = k • (a -ᵥ p)
hq : dist a q = dist b q
m : P := midpoint ℝ a b
h1 : m -ᵥ p - (m -ᵥ a) = a -ᵥ p
⊢ dist a p * dist b p = abs (dist b q ^ 2 - dist p q ^ 2)

tactic: have h3 := vsub_sub_vsub_cancel_left a q m
state_before: V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b p q : P
hp : ∃ k, k ≠ 1 ∧ b -ᵥ p = k • (a -ᵥ p)
hq : dist a q = dist b q
m : P := midpoint ℝ a b
h1 : m -ᵥ p - (m -ᵥ a) = a -ᵥ p
h2 : m -ᵥ q - (m -ᵥ p) = p -ᵥ q
⊢ dist a p * dist b p = abs (dist b q ^ 2 - dist p q ^ 2)

tactic: have h : ∀ r, b -ᵥ r = m -ᵥ r + (m -ᵥ a) := fun r => by
  rw [midpoint_vsub_left, ← right_vsub_midpoint, add_comm, vsub_add_vsub_cancel]
state_before: V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b p q : P
hp : ∃ k, k ≠ 1 ∧ b -ᵥ p = k • (a -ᵥ p)
hq : dist a q = dist b q
m : P := midpoint ℝ a b
h1 : m -ᵥ p - (m -ᵥ a) = a -ᵥ p
h2 : m -ᵥ q - (m -ᵥ p) = p -ᵥ q
h3 : m -ᵥ q - (m -ᵥ a) = a -ᵥ q
⊢ dist a p * dist b p = abs (dist b q ^ 2 - dist p q ^ 2)

tactic: iterate 4 rw [dist_eq_norm_vsub V]
state_before: V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b p q : P
hp : ∃ k, k ≠ 1 ∧ b -ᵥ p = k • (a -ᵥ p)
hq : dist a q = dist b q
m : P := midpoint ℝ a b
h1 : m -ᵥ p - (m -ᵥ a) = a -ᵥ p
h2 : m -ᵥ q - (m -ᵥ p) = p -ᵥ q
h3 : m -ᵥ q - (m -ᵥ a) = a -ᵥ q
h : ∀ (r : P), b -ᵥ r = m -ᵥ r + (m -ᵥ a)
⊢ dist a p * dist b p = abs (dist b q ^ 2 - dist p q ^ 2)

tactic: rw [← h1, ← h2, h, h]
state_before: V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b p q : P
hp : ∃ k, k ≠ 1 ∧ b -ᵥ p = k • (a -ᵥ p)
hq : dist a q = dist b q
m : P := midpoint ℝ a b
h1 : m -ᵥ p - (m -ᵥ a) = a -ᵥ p
h2 : m -ᵥ q - (m -ᵥ p) = p -ᵥ q
h3 : m -ᵥ q - (m -ᵥ a) = a -ᵥ q
h : ∀ (r : P), b -ᵥ r = m -ᵥ r + (m -ᵥ a)
⊢ ‖a -ᵥ p‖ * ‖b -ᵥ p‖ = abs (‖b -ᵥ q‖ ^ 2 - ‖p -ᵥ q‖ ^ 2)

tactic: rw [← h1, h] at hp
state_before: V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b p q : P
hp : ∃ k, k ≠ 1 ∧ b -ᵥ p = k • (a -ᵥ p)
hq : dist a q = dist b q
m : P := midpoint ℝ a b
h1 : m -ᵥ p - (m -ᵥ a) = a -ᵥ p
h2 : m -ᵥ q - (m -ᵥ p) = p -ᵥ q
h3 : m -ᵥ q - (m -ᵥ a) = a -ᵥ q
h : ∀ (r : P), b -ᵥ r = m -ᵥ r + (m -ᵥ a)
⊢ ‖m -ᵥ p - (m -ᵥ a)‖ * ‖m -ᵥ p + (m -ᵥ a)‖ = abs (‖m -ᵥ q + (m -ᵥ a)‖ ^ 2 - ‖m -ᵥ q - (m -ᵥ p)‖ ^ 2)

tactic: rw [dist_eq_norm_vsub V a q, dist_eq_norm_vsub V b q, ← h3, h] at hq
state_before: V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b p q : P
hq : dist a q = dist b q
m : P := midpoint ℝ a b
hp : ∃ k, k ≠ 1 ∧ m -ᵥ p + (m -ᵥ a) = k • (m -ᵥ p - (m -ᵥ a))
h1 : m -ᵥ p - (m -ᵥ a) = a -ᵥ p
h2 : m -ᵥ q - (m -ᵥ p) = p -ᵥ q
h3 : m -ᵥ q - (m -ᵥ a) = a -ᵥ q
h : ∀ (r : P), b -ᵥ r = m -ᵥ r + (m -ᵥ a)
⊢ ‖m -ᵥ p - (m -ᵥ a)‖ * ‖m -ᵥ p + (m -ᵥ a)‖ = abs (‖m -ᵥ q + (m -ᵥ a)‖ ^ 2 - ‖m -ᵥ q - (m -ᵥ p)‖ ^ 2)

tactic: exact mul_norm_eq_abs_sub_sq_norm hp hq
state_before: V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b p q : P
m : P := midpoint ℝ a b
hq : ‖m -ᵥ q - (m -ᵥ a)‖ = ‖m -ᵥ q + (m -ᵥ a)‖
hp : ∃ k, k ≠ 1 ∧ m -ᵥ p + (m -ᵥ a) = k • (m -ᵥ p - (m -ᵥ a))
h1 : m -ᵥ p - (m -ᵥ a) = a -ᵥ p
h2 : m -ᵥ q - (m -ᵥ p) = p -ᵥ q
h3 : m -ᵥ q - (m -ᵥ a) = a -ᵥ q
h : ∀ (r : P), b -ᵥ r = m -ᵥ r + (m -ᵥ a)
⊢ ‖m -ᵥ p - (m -ᵥ a)‖ * ‖m -ᵥ p + (m -ᵥ a)‖ = abs (‖m -ᵥ q + (m -ᵥ a)‖ ^ 2 - ‖m -ᵥ q - (m -ᵥ p)‖ ^ 2)

tactic: rw [midpoint_vsub_left, ← right_vsub_midpoint, add_comm, vsub_add_vsub_cancel]
state_before: V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b p q : P
hp : ∃ k, k ≠ 1 ∧ b -ᵥ p = k • (a -ᵥ p)
hq : dist a q = dist b q
m : P := midpoint ℝ a b
h1 : m -ᵥ p - (m -ᵥ a) = a -ᵥ p
h2 : m -ᵥ q - (m -ᵥ p) = p -ᵥ q
h3 : m -ᵥ q - (m -ᵥ a) = a -ᵥ q
r : P
⊢ b -ᵥ r = m -ᵥ r + (m -ᵥ a)

tactic: rw [dist_eq_norm_vsub V]
state_before: V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b p q : P
hp : ∃ k, k ≠ 1 ∧ b -ᵥ p = k • (a -ᵥ p)
hq : dist a q = dist b q
m : P := midpoint ℝ a b
h1 : m -ᵥ p - (m -ᵥ a) = a -ᵥ p
h2 : m -ᵥ q - (m -ᵥ p) = p -ᵥ q
h3 : m -ᵥ q - (m -ᵥ a) = a -ᵥ q
h : ∀ (r : P), b -ᵥ r = m -ᵥ r + (m -ᵥ a)
⊢ ‖a -ᵥ p‖ * ‖b -ᵥ p‖ = abs (‖b -ᵥ q‖ ^ 2 - dist p q ^ 2)