Theorem: EuclideanGeometry.angle_left_midpoint_eq_pi_div_two_of_dist_eq
File: Mathlib/Geometry/Euclidean/Angle/Unoriented/Affine.lean

tactic: let m : P := midpoint ℝ p1 p2
state_before: V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
p p₀ p₁ p₂ p1 p2 p3 : P
h : dist p3 p1 = dist p3 p2
⊢ ∠ p3 (midpoint ℝ p1 p2) p1 = π / 2
state_after: V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
p p₀ p₁ p₂ p1 p2 p3 : P
h : dist p3 p1 = dist p3 p2
m : P := midpoint ℝ p1 p2
⊢ ∠ p3 (midpoint ℝ p1 p2) p1 = π / 2

tactic: have h1 : p3 -ᵥ p1 = p3 -ᵥ m - (p1 -ᵥ m) := (vsub_sub_vsub_cancel_right p3 p1 m).symm
state_before: V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
p p₀ p₁ p₂ p1 p2 p3 : P
h : dist p3 p1 = dist p3 p2
m : P := midpoint ℝ p1 p2
⊢ ∠ p3 (midpoint ℝ p1 p2) p1 = π / 2
state_after: V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
p p₀ p₁ p₂ p1 p2 p3 : P
h : dist p3 p1 = dist p3 p2
m : P := midpoint ℝ p1 p2
h1 : p3 -ᵥ p1 = p3 -ᵥ m - (p1 -ᵥ m)
⊢ ∠ p3 (midpoint ℝ p1 p2) p1 = π / 2

tactic: have h2 : p3 -ᵥ p2 = p3 -ᵥ m + (p1 -ᵥ m) := by
  rw [left_vsub_midpoint, ← midpoint_vsub_right, vsub_add_vsub_cancel]
state_before: V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
p p₀ p₁ p₂ p1 p2 p3 : P
h : dist p3 p1 = dist p3 p2
m : P := midpoint ℝ p1 p2
h1 : p3 -ᵥ p1 = p3 -ᵥ m - (p1 -ᵥ m)
⊢ ∠ p3 (midpoint ℝ p1 p2) p1 = π / 2
state_after: V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
p p₀ p₁ p₂ p1 p2 p3 : P
h : dist p3 p1 = dist p3 p2
m : P := midpoint ℝ p1 p2
h1 : p3 -ᵥ p1 = p3 -ᵥ m - (p1 -ᵥ m)
h2 : p3 -ᵥ p2 = p3 -ᵥ m + (p1 -ᵥ m)
⊢ ∠ p3 (midpoint ℝ p1 p2) p1 = π / 2

tactic: rw [dist_eq_norm_vsub V p3 p1, dist_eq_norm_vsub V p3 p2, h1, h2] at h
state_before: V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
p p₀ p₁ p₂ p1 p2 p3 : P
h : dist p3 p1 = dist p3 p2
m : P := midpoint ℝ p1 p2
h1 : p3 -ᵥ p1 = p3 -ᵥ m - (p1 -ᵥ m)
h2 : p3 -ᵥ p2 = p3 -ᵥ m + (p1 -ᵥ m)
⊢ ∠ p3 (midpoint ℝ p1 p2) p1 = π / 2
state_after: V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
p p₀ p₁ p₂ p1 p2 p3 : P
m : P := midpoint ℝ p1 p2
h : ‖p3 -ᵥ m - (p1 -ᵥ m)‖ = ‖p3 -ᵥ m + (p1 -ᵥ m)‖
h1 : p3 -ᵥ p1 = p3 -ᵥ m - (p1 -ᵥ m)
h2 : p3 -ᵥ p2 = p3 -ᵥ m + (p1 -ᵥ m)
⊢ ∠ p3 (midpoint ℝ p1 p2) p1 = π / 2

tactic: exact (norm_add_eq_norm_sub_iff_angle_eq_pi_div_two (p3 -ᵥ m) (p1 -ᵥ m)).mp h.symm
state_before: V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
p p₀ p₁ p₂ p1 p2 p3 : P
m : P := midpoint ℝ p1 p2
h : ‖p3 -ᵥ m - (p1 -ᵥ m)‖ = ‖p3 -ᵥ m + (p1 -ᵥ m)‖
h1 : p3 -ᵥ p1 = p3 -ᵥ m - (p1 -ᵥ m)
h2 : p3 -ᵥ p2 = p3 -ᵥ m + (p1 -ᵥ m)
⊢ ∠ p3 (midpoint ℝ p1 p2) p1 = π / 2
state_after: no goals

tactic: rw [left_vsub_midpoint, ← midpoint_vsub_right, vsub_add_vsub_cancel]
state_before: V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
p p₀ p₁ p₂ p1 p2 p3 : P
h : dist p3 p1 = dist p3 p2
m : P := midpoint ℝ p1 p2
h1 : p3 -ᵥ p1 = p3 -ᵥ m - (p1 -ᵥ m)
⊢ p3 -ᵥ p2 = p3 -ᵥ m + (p1 -ᵥ m)
state_after: no goals