Theorem: EuclideanGeometry.inner_vsub_vsub_of_dist_eq_of_dist_eq
File: Mathlib/Geometry/Euclidean/Basic.lean

tactic: have h : ⟪c₂ -ᵥ c₁ + (c₂ -ᵥ c₁), p₂ -ᵥ p₁⟫ = 0 := by
  conv_lhs => congr; congr; rw [← vsub_sub_vsub_cancel_right c₂ c₁ p₁]
  rw [← vsub_sub_vsub_cancel_right c₂ c₁ p₂, sub_add_sub_comm, inner_sub_left]
  conv_lhs => congr; rw [← vsub_sub_vsub_cancel_right p₂ p₁ c₂]
  rw [← vsub_sub_vsub_cancel_right p₂ p₁ c₁]
  rw [dist_comm p₁, dist_comm p₂, dist_eq_norm_vsub V _ p₁, dist_eq_norm_vsub V _ p₂, ←
    real_inner_add_sub_eq_zero_iff] at hc₁ hc₂
  simp_rw [← neg_vsub_eq_vsub_rev c₁, ← neg_vsub_eq_vsub_rev c₂, sub_neg_eq_add, neg_add_eq_sub,
    hc₁, hc₂, sub_zero]
state_before: V : Type u_2
P : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
c₁ c₂ p₁ p₂ : P
hc₁ : dist p₁ c₁ = dist p₂ c₁
hc₂ : dist p₁ c₂ = dist p₂ c₂
⊢ inner (c₂ -ᵥ c₁) (p₂ -ᵥ p₁) = 0

tactic: simpa [inner_add_left, ← mul_two, (by norm_num : (2 : ℝ) ≠ 0)] using h
state_before: V : Type u_2
P : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
c₁ c₂ p₁ p₂ : P
hc₁ : dist p₁ c₁ = dist p₂ c₁
hc₂ : dist p₁ c₂ = dist p₂ c₂
h : inner (c₂ -ᵥ c₁ + (c₂ -ᵥ c₁)) (p₂ -ᵥ p₁) = 0
⊢ inner (c₂ -ᵥ c₁) (p₂ -ᵥ p₁) = 0

tactic: conv_lhs => congr; congr; rw [← vsub_sub_vsub_cancel_right c₂ c₁ p₁]
state_before: V : Type u_2
P : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
c₁ c₂ p₁ p₂ : P
hc₁ : dist p₁ c₁ = dist p₂ c₁
hc₂ : dist p₁ c₂ = dist p₂ c₂
⊢ inner (c₂ -ᵥ c₁ + (c₂ -ᵥ c₁)) (p₂ -ᵥ p₁) = 0

tactic: rw [← vsub_sub_vsub_cancel_right c₂ c₁ p₂, sub_add_sub_comm, inner_sub_left]
state_before: V : Type u_2
P : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
c₁ c₂ p₁ p₂ : P
hc₁ : dist p₁ c₁ = dist p₂ c₁
hc₂ : dist p₁ c₂ = dist p₂ c₂
⊢ inner (c₂ -ᵥ p₁ - (c₁ -ᵥ p₁) + (c₂ -ᵥ c₁)) (p₂ -ᵥ p₁) = 0

tactic: conv_lhs => congr; rw [← vsub_sub_vsub_cancel_right p₂ p₁ c₂]
state_before: V : Type u_2
P : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
c₁ c₂ p₁ p₂ : P
hc₁ : dist p₁ c₁ = dist p₂ c₁
hc₂ : dist p₁ c₂ = dist p₂ c₂
⊢ inner (c₂ -ᵥ p₁ + (c₂ -ᵥ p₂)) (p₂ -ᵥ p₁) - inner (c₁ -ᵥ p₁ + (c₁ -ᵥ p₂)) (p₂ -ᵥ p₁) = 0

tactic: rw [← vsub_sub_vsub_cancel_right p₂ p₁ c₁]
state_before: V : Type u_2
P : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
c₁ c₂ p₁ p₂ : P
hc₁ : dist p₁ c₁ = dist p₂ c₁
hc₂ : dist p₁ c₂ = dist p₂ c₂
⊢ inner (c₂ -ᵥ p₁ + (c₂ -ᵥ p₂)) (p₂ -ᵥ c₂ - (p₁ -ᵥ c₂)) - inner (c₁ -ᵥ p₁ + (c₁ -ᵥ p₂)) (p₂ -ᵥ p₁) = 0

tactic: rw [dist_comm p₁, dist_comm p₂, dist_eq_norm_vsub V _ p₁, dist_eq_norm_vsub V _ p₂, ←
  real_inner_add_sub_eq_zero_iff] at hc₁ hc₂
state_before: V : Type u_2
P : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
c₁ c₂ p₁ p₂ : P
hc₁ : dist p₁ c₁ = dist p₂ c₁
hc₂ : dist p₁ c₂ = dist p₂ c₂
⊢ inner (c₂ -ᵥ p₁ + (c₂ -ᵥ p₂)) (p₂ -ᵥ c₂ - (p₁ -ᵥ c₂)) - inner (c₁ -ᵥ p₁ + (c₁ -ᵥ p₂)) (p₂ -ᵥ c₁ - (p₁ -ᵥ c₁)) = 0

tactic: simp_rw [← neg_vsub_eq_vsub_rev c₁, ← neg_vsub_eq_vsub_rev c₂, sub_neg_eq_add, neg_add_eq_sub,
  hc₁, hc₂, sub_zero]
state_before: V : Type u_2
P : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
c₁ c₂ p₁ p₂ : P
hc₁✝ : ‖c₁ -ᵥ p₁‖ = ‖c₁ -ᵥ p₂‖
hc₁ : inner (c₁ -ᵥ p₁ + (c₁ -ᵥ p₂)) (c₁ -ᵥ p₁ - (c₁ -ᵥ p₂)) = 0
hc₂✝ : ‖c₂ -ᵥ p₁‖ = ‖c₂ -ᵥ p₂‖
hc₂ : inner (c₂ -ᵥ p₁ + (c₂ -ᵥ p₂)) (c₂ -ᵥ p₁ - (c₂ -ᵥ p₂)) = 0
⊢ inner (c₂ -ᵥ p₁ + (c₂ -ᵥ p₂)) (p₂ -ᵥ c₂ - (p₁ -ᵥ c₂)) - inner (c₁ -ᵥ p₁ + (c₁ -ᵥ p₂)) (p₂ -ᵥ c₁ - (p₁ -ᵥ c₁)) = 0

tactic: norm_num
state_before: V : Type u_2
P : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
c₁ c₂ p₁ p₂ : P
hc₁ : dist p₁ c₁ = dist p₂ c₁
hc₂ : dist p₁ c₂ = dist p₂ c₂
h : inner (c₂ -ᵥ c₁ + (c₂ -ᵥ c₁)) (p₂ -ᵥ p₁) = 0
⊢ 2 ≠ 0