[GOAL]
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
s : Sphere P
p : P
v : V
⊢ dist (secondInter s p v) s.center = dist p s.center
[PROOFSTEP]
rw [Sphere.secondInter]
[GOAL]
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
s : Sphere P
p : P
v : V
⊢ dist ((-2 * inner v (p -ᵥ s.center) / inner v v) • v +ᵥ p) s.center = dist p s.center
[PROOFSTEP]
by_cases hv : v = 0
[GOAL]
case pos
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
s : Sphere P
p : P
v : V
hv : v = 0
⊢ dist ((-2 * inner v (p -ᵥ s.center) / inner v v) • v +ᵥ p) s.center = dist p s.center
[PROOFSTEP]
simp [hv]
[GOAL]
case neg
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
s : Sphere P
p : P
v : V
hv : ¬v = 0
⊢ dist ((-2 * inner v (p -ᵥ s.center) / inner v v) • v +ᵥ p) s.center = dist p s.center
[PROOFSTEP]
rw [dist_smul_vadd_eq_dist _ _ hv]
[GOAL]
case neg
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
s : Sphere P
p : P
v : V
hv : ¬v = 0
⊢ -2 * inner v (p -ᵥ s.center) / inner v v = 0 ∨
    -2 * inner v (p -ᵥ s.center) / inner v v = -2 * inner v (p -ᵥ s.center) / inner v v
[PROOFSTEP]
exact Or.inr rfl
[GOAL]
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
s : Sphere P
p : P
v : V
⊢ secondInter s p v ∈ s ↔ p ∈ s
[PROOFSTEP]
simp_rw [mem_sphere, Sphere.secondInter_dist]
[GOAL]
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
s : Sphere P
p : P
⊢ secondInter s p 0 = p
[PROOFSTEP]
simp [Sphere.secondInter]
[GOAL]
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
s : Sphere P
p : P
v : V
⊢ secondInter s p v = p ↔ inner v (p -ᵥ s.center) = 0
[PROOFSTEP]
refine' ⟨fun hp => _, fun hp => _⟩
[GOAL]
case refine'_1
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
s : Sphere P
p : P
v : V
hp : secondInter s p v = p
⊢ inner v (p -ᵥ s.center) = 0
[PROOFSTEP]
by_cases hv : v = 0
[GOAL]
case pos
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
s : Sphere P
p : P
v : V
hp : secondInter s p v = p
hv : v = 0
⊢ inner v (p -ᵥ s.center) = 0
[PROOFSTEP]
simp [hv]
[GOAL]
case neg
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
s : Sphere P
p : P
v : V
hp : secondInter s p v = p
hv : ¬v = 0
⊢ inner v (p -ᵥ s.center) = 0
[PROOFSTEP]
rwa [Sphere.secondInter, eq_comm, eq_vadd_iff_vsub_eq, vsub_self, eq_comm, smul_eq_zero, or_iff_left hv,
  div_eq_zero_iff, inner_self_eq_zero, or_iff_left hv, mul_eq_zero, or_iff_right (by norm_num : (-2 : ℝ) ≠ 0)] at hp
[GOAL]
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
s : Sphere P
p : P
v : V
hp : -2 = 0 ∨ inner v (p -ᵥ s.center) = 0
hv : ¬v = 0
⊢ -2 ≠ 0
[PROOFSTEP]
norm_num
[GOAL]
case refine'_2
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
s : Sphere P
p : P
v : V
hp : inner v (p -ᵥ s.center) = 0
⊢ secondInter s p v = p
[PROOFSTEP]
rw [Sphere.secondInter, hp, mul_zero, zero_div, zero_smul, zero_vadd]
[GOAL]
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
s : Sphere P
p : P
hp : p ∈ s
v : V
p' : P
hp' : p' ∈ AffineSubspace.mk' p (Submodule.span ℝ {v})
⊢ p' = p ∨ p' = secondInter s p v ↔ p' ∈ s
[PROOFSTEP]
refine' ⟨fun h => _, fun h => _⟩
[GOAL]
case refine'_1
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
s : Sphere P
p : P
hp : p ∈ s
v : V
p' : P
hp' : p' ∈ AffineSubspace.mk' p (Submodule.span ℝ {v})
h : p' = p ∨ p' = secondInter s p v
⊢ p' ∈ s
[PROOFSTEP]
rcases h with (h | h)
[GOAL]
case refine'_1.inl
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
s : Sphere P
p : P
hp : p ∈ s
v : V
p' : P
hp' : p' ∈ AffineSubspace.mk' p (Submodule.span ℝ {v})
h : p' = p
⊢ p' ∈ s
[PROOFSTEP]
rwa [h]
[GOAL]
case refine'_1.inr
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
s : Sphere P
p : P
hp : p ∈ s
v : V
p' : P
hp' : p' ∈ AffineSubspace.mk' p (Submodule.span ℝ {v})
h : p' = secondInter s p v
⊢ p' ∈ s
[PROOFSTEP]
rwa [h, Sphere.secondInter_mem]
[GOAL]
case refine'_2
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
s : Sphere P
p : P
hp : p ∈ s
v : V
p' : P
hp' : p' ∈ AffineSubspace.mk' p (Submodule.span ℝ {v})
h : p' ∈ s
⊢ p' = p ∨ p' = secondInter s p v
[PROOFSTEP]
rw [AffineSubspace.mem_mk'_iff_vsub_mem, Submodule.mem_span_singleton] at hp'
[GOAL]
case refine'_2
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
s : Sphere P
p : P
hp : p ∈ s
v : V
p' : P
hp' : ∃ a, a • v = p' -ᵥ p
h : p' ∈ s
⊢ p' = p ∨ p' = secondInter s p v
[PROOFSTEP]
rcases hp' with ⟨r, hr⟩
[GOAL]
case refine'_2.intro
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
s : Sphere P
p : P
hp : p ∈ s
v : V
p' : P
h : p' ∈ s
r : ℝ
hr : r • v = p' -ᵥ p
⊢ p' = p ∨ p' = secondInter s p v
[PROOFSTEP]
rw [eq_comm, ← eq_vadd_iff_vsub_eq] at hr
[GOAL]
case refine'_2.intro
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
s : Sphere P
p : P
hp : p ∈ s
v : V
p' : P
h : p' ∈ s
r : ℝ
hr : p' = r • v +ᵥ p
⊢ p' = p ∨ p' = secondInter s p v
[PROOFSTEP]
subst hr
[GOAL]
case refine'_2.intro
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
s : Sphere P
p : P
hp : p ∈ s
v : V
r : ℝ
h : r • v +ᵥ p ∈ s
⊢ r • v +ᵥ p = p ∨ r • v +ᵥ p = secondInter s p v
[PROOFSTEP]
by_cases hv : v = 0
[GOAL]
case pos
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
s : Sphere P
p : P
hp : p ∈ s
v : V
r : ℝ
h : r • v +ᵥ p ∈ s
hv : v = 0
⊢ r • v +ᵥ p = p ∨ r • v +ᵥ p = secondInter s p v
[PROOFSTEP]
simp [hv]
[GOAL]
case neg
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
s : Sphere P
p : P
hp : p ∈ s
v : V
r : ℝ
h : r • v +ᵥ p ∈ s
hv : ¬v = 0
⊢ r • v +ᵥ p = p ∨ r • v +ᵥ p = secondInter s p v
[PROOFSTEP]
rw [Sphere.secondInter]
[GOAL]
case neg
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
s : Sphere P
p : P
hp : p ∈ s
v : V
r : ℝ
h : r • v +ᵥ p ∈ s
hv : ¬v = 0
⊢ r • v +ᵥ p = p ∨ r • v +ᵥ p = (-2 * inner v (p -ᵥ s.center) / inner v v) • v +ᵥ p
[PROOFSTEP]
rw [mem_sphere] at h hp
[GOAL]
case neg
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
s : Sphere P
p : P
hp : dist p s.center = s.radius
v : V
r : ℝ
h : dist (r • v +ᵥ p) s.center = s.radius
hv : ¬v = 0
⊢ r • v +ᵥ p = p ∨ r • v +ᵥ p = (-2 * inner v (p -ᵥ s.center) / inner v v) • v +ᵥ p
[PROOFSTEP]
rw [← hp, dist_smul_vadd_eq_dist _ _ hv] at h
[GOAL]
case neg
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
s : Sphere P
p : P
hp : dist p s.center = s.radius
v : V
r : ℝ
h : r = 0 ∨ r = -2 * inner v (p -ᵥ s.center) / inner v v
hv : ¬v = 0
⊢ r • v +ᵥ p = p ∨ r • v +ᵥ p = (-2 * inner v (p -ᵥ s.center) / inner v v) • v +ᵥ p
[PROOFSTEP]
rcases h with (h | h)
[GOAL]
case neg.inl
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
s : Sphere P
p : P
hp : dist p s.center = s.radius
v : V
r : ℝ
hv : ¬v = 0
h : r = 0
⊢ r • v +ᵥ p = p ∨ r • v +ᵥ p = (-2 * inner v (p -ᵥ s.center) / inner v v) • v +ᵥ p
[PROOFSTEP]
simp [h]
[GOAL]
case neg.inr
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
s : Sphere P
p : P
hp : dist p s.center = s.radius
v : V
r : ℝ
hv : ¬v = 0
h : r = -2 * inner v (p -ᵥ s.center) / inner v v
⊢ r • v +ᵥ p = p ∨ r • v +ᵥ p = (-2 * inner v (p -ᵥ s.center) / inner v v) • v +ᵥ p
[PROOFSTEP]
simp [h]
[GOAL]
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
s : Sphere P
p : P
v : V
r : ℝ
hr : r ≠ 0
⊢ secondInter s p (r • v) = secondInter s p v
[PROOFSTEP]
simp_rw [Sphere.secondInter, real_inner_smul_left, inner_smul_right, smul_smul, div_mul_eq_div_div]
[GOAL]
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
s : Sphere P
p : P
v : V
r : ℝ
hr : r ≠ 0
⊢ (-2 * (r * inner v (p -ᵥ s.center)) / r / r / inner v v * r) • v +ᵥ p =
    (-2 * inner v (p -ᵥ s.center) / inner v v) • v +ᵥ p
[PROOFSTEP]
rw [mul_comm, ← mul_div_assoc, ← mul_div_assoc, mul_div_cancel_left _ hr, mul_comm, mul_assoc, mul_div_cancel_left _ hr,
  mul_comm]
[GOAL]
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
s : Sphere P
p : P
v : V
⊢ secondInter s p (-v) = secondInter s p v
[PROOFSTEP]
rw [← neg_one_smul ℝ v, s.secondInter_smul p v (by norm_num : (-1 : ℝ) ≠ 0)]
[GOAL]
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
s : Sphere P
p : P
v : V
⊢ -1 ≠ 0
[PROOFSTEP]
norm_num
[GOAL]
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
s : Sphere P
p : P
v : V
⊢ secondInter s (secondInter s p v) v = p
[PROOFSTEP]
by_cases hv : v = 0
[GOAL]
case pos
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
s : Sphere P
p : P
v : V
hv : v = 0
⊢ secondInter s (secondInter s p v) v = p
[PROOFSTEP]
simp [hv]
[GOAL]
case neg
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
s : Sphere P
p : P
v : V
hv : ¬v = 0
⊢ secondInter s (secondInter s p v) v = p
[PROOFSTEP]
have hv' : ⟪v, v⟫ ≠ 0 := inner_self_ne_zero.2 hv
[GOAL]
case neg
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
s : Sphere P
p : P
v : V
hv : ¬v = 0
hv' : inner v v ≠ 0
⊢ secondInter s (secondInter s p v) v = p
[PROOFSTEP]
simp only [Sphere.secondInter, vadd_vsub_assoc, vadd_vadd, inner_add_right, inner_smul_right, div_mul_cancel _ hv']
[GOAL]
case neg
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
s : Sphere P
p : P
v : V
hv : ¬v = 0
hv' : inner v v ≠ 0
⊢ (-2 * (-2 * inner v (p -ᵥ s.center) + inner v (p -ᵥ s.center)) / inner v v) • v +
        (-2 * inner v (p -ᵥ s.center) / inner v v) • v +ᵥ
      p =
    p
[PROOFSTEP]
rw [← @vsub_eq_zero_iff_eq V, vadd_vsub, ← add_smul, ← add_div]
[GOAL]
case neg
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
s : Sphere P
p : P
v : V
hv : ¬v = 0
hv' : inner v v ≠ 0
⊢ ((-2 * (-2 * inner v (p -ᵥ s.center) + inner v (p -ᵥ s.center)) + -2 * inner v (p -ᵥ s.center)) / inner v v) • v = 0
[PROOFSTEP]
convert zero_smul ℝ (M := V) _
[GOAL]
case h.e'_2.h.e'_5
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
s : Sphere P
p : P
v : V
hv : ¬v = 0
hv' : inner v v ≠ 0
⊢ (-2 * (-2 * inner v (p -ᵥ s.center) + inner v (p -ᵥ s.center)) + -2 * inner v (p -ᵥ s.center)) / inner v v = 0
[PROOFSTEP]
convert zero_div (G₀ := ℝ) _
[GOAL]
case h.e'_2.h.e'_5
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
s : Sphere P
p : P
v : V
hv : ¬v = 0
hv' : inner v v ≠ 0
⊢ -2 * (-2 * inner v (p -ᵥ s.center) + inner v (p -ᵥ s.center)) + -2 * inner v (p -ᵥ s.center) = 0
[PROOFSTEP]
ring
[GOAL]
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
s : Sphere P
p p' : P
⊢ Collinear ℝ {p, p', secondInter s p (p' -ᵥ p)}
[PROOFSTEP]
rw [Set.pair_comm, Set.insert_comm]
[GOAL]
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
s : Sphere P
p p' : P
⊢ Collinear ℝ {secondInter s p (p' -ᵥ p), p, p'}
[PROOFSTEP]
exact (collinear_insert_iff_of_mem_affineSpan (s.secondInter_vsub_mem_affineSpan _ _)).2 (collinear_pair ℝ _ _)
[GOAL]
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
s : Sphere P
p p' : P
hp : p ∈ s
hp' : dist p' s.center ≤ s.radius
⊢ Wbtw ℝ p p' (secondInter s p (p' -ᵥ p))
[PROOFSTEP]
by_cases h : p' = p
[GOAL]
case pos
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
s : Sphere P
p p' : P
hp : p ∈ s
hp' : dist p' s.center ≤ s.radius
h : p' = p
⊢ Wbtw ℝ p p' (secondInter s p (p' -ᵥ p))
[PROOFSTEP]
simp [h]
[GOAL]
case neg
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
s : Sphere P
p p' : P
hp : p ∈ s
hp' : dist p' s.center ≤ s.radius
h : ¬p' = p
⊢ Wbtw ℝ p p' (secondInter s p (p' -ᵥ p))
[PROOFSTEP]
refine'
  wbtw_of_collinear_of_dist_center_le_radius (s.secondInter_collinear p p') hp hp' ((Sphere.secondInter_mem _).2 hp) _
[GOAL]
case neg
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
s : Sphere P
p p' : P
hp : p ∈ s
hp' : dist p' s.center ≤ s.radius
h : ¬p' = p
⊢ p ≠ secondInter s p (p' -ᵥ p)
[PROOFSTEP]
intro he
[GOAL]
case neg
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
s : Sphere P
p p' : P
hp : p ∈ s
hp' : dist p' s.center ≤ s.radius
h : ¬p' = p
he : p = secondInter s p (p' -ᵥ p)
⊢ False
[PROOFSTEP]
rw [eq_comm, Sphere.secondInter_eq_self_iff, ← neg_neg (p' -ᵥ p), inner_neg_left, neg_vsub_eq_vsub_rev, neg_eq_zero,
  eq_comm] at he
[GOAL]
case neg
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
s : Sphere P
p p' : P
hp : p ∈ s
hp' : dist p' s.center ≤ s.radius
h : ¬p' = p
he : 0 = inner (p -ᵥ p') (p -ᵥ s.center)
⊢ False
[PROOFSTEP]
exact ((inner_pos_or_eq_of_dist_le_radius hp hp').resolve_right (Ne.symm h)).ne he
[GOAL]
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
s : Sphere P
p p' : P
hp : p ∈ s
hp' : dist p' s.center < s.radius
⊢ Sbtw ℝ p p' (secondInter s p (p' -ᵥ p))
[PROOFSTEP]
refine' ⟨Sphere.wbtw_secondInter hp hp'.le, _, _⟩
[GOAL]
case refine'_1
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
s : Sphere P
p p' : P
hp : p ∈ s
hp' : dist p' s.center < s.radius
⊢ p' ≠ p
[PROOFSTEP]
rintro rfl
[GOAL]
case refine'_1
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
s : Sphere P
p' : P
hp' : dist p' s.center < s.radius
hp : p' ∈ s
⊢ False
[PROOFSTEP]
rw [mem_sphere] at hp
[GOAL]
case refine'_1
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
s : Sphere P
p' : P
hp' : dist p' s.center < s.radius
hp : dist p' s.center = s.radius
⊢ False
[PROOFSTEP]
simp [hp] at hp'
[GOAL]
case refine'_2
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
s : Sphere P
p p' : P
hp : p ∈ s
hp' : dist p' s.center < s.radius
⊢ p' ≠ secondInter s p (p' -ᵥ p)
[PROOFSTEP]
rintro h
[GOAL]
case refine'_2
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
s : Sphere P
p p' : P
hp : p ∈ s
hp' : dist p' s.center < s.radius
h : p' = secondInter s p (p' -ᵥ p)
⊢ False
[PROOFSTEP]
rw [h, mem_sphere.1 ((Sphere.secondInter_mem _).2 hp)] at hp'
[GOAL]
case refine'_2
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
s : Sphere P
p p' : P
hp : p ∈ s
hp' : s.radius < s.radius
h : p' = secondInter s p (p' -ᵥ p)
⊢ False
[PROOFSTEP]
exact lt_irrefl _ hp'


[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : Preadditive C
x✝ : C
⊢ { obj := fun Y => preadditiveYonedaObj Y ⋙ forget₂ (ModuleCat (End Y)) AddCommGroupCat,
          map := fun {X Y} f =>
            NatTrans.mk fun X_1 =>
              { toZeroHom := { toFun := fun g => g ≫ f, map_zero' := (_ : 0 ≫ f = 0) },
                map_add' :=
                  (_ :
                    ∀
                      (g g' :
                        ↑(((fun Y => preadditiveYonedaObj Y ⋙ forget₂ (ModuleCat (End Y)) AddCommGroupCat) X).obj X_1)),
                      (g + g') ≫ f = g ≫ f + g' ≫ f) } }.map
      (𝟙 x✝) =
    𝟙
      ({ obj := fun Y => preadditiveYonedaObj Y ⋙ forget₂ (ModuleCat (End Y)) AddCommGroupCat,
            map := fun {X Y} f =>
              NatTrans.mk fun X_1 =>
                { toZeroHom := { toFun := fun g => g ≫ f, map_zero' := (_ : 0 ≫ f = 0) },
                  map_add' :=
                    (_ :
                      ∀
                        (g g' :
                          ↑(((fun Y => preadditiveYonedaObj Y ⋙ forget₂ (ModuleCat (End Y)) AddCommGroupCat) X).obj
                              X_1)),
                        (g + g') ≫ f = g ≫ f + g' ≫ f) } }.obj
        x✝)
[PROOFSTEP]
ext
[GOAL]
case w.h.w
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : Preadditive C
x✝² : C
x✝¹ : Cᵒᵖ
x✝ :
  ↑(({ obj := fun Y => preadditiveYonedaObj Y ⋙ forget₂ (ModuleCat (End Y)) AddCommGroupCat,
              map := fun {X Y} f =>
                NatTrans.mk fun X_1 =>
                  { toZeroHom := { toFun := fun g => g ≫ f, map_zero' := (_ : 0 ≫ f = 0) },
                    map_add' :=
                      (_ :
                        ∀
                          (g g' :
                            ↑(((fun Y => preadditiveYonedaObj Y ⋙ forget₂ (ModuleCat (End Y)) AddCommGroupCat) X).obj
                                X_1)),
                          (g + g') ≫ f = g ≫ f + g' ≫ f) } }.obj
          x✝²).obj
      x✝¹)
⊢ ↑(NatTrans.app
          ({ obj := fun Y => preadditiveYonedaObj Y ⋙ forget₂ (ModuleCat (End Y)) AddCommGroupCat,
                map := fun {X Y} f =>
                  NatTrans.mk fun X_1 =>
                    { toZeroHom := { toFun := fun g => g ≫ f, map_zero' := (_ : 0 ≫ f = 0) },
                      map_add' :=
                        (_ :
                          ∀
                            (g g' :
                              ↑(((fun Y => preadditiveYonedaObj Y ⋙ forget₂ (ModuleCat (End Y)) AddCommGroupCat) X).obj
                                  X_1)),
                            (g + g') ≫ f = g ≫ f + g' ≫ f) } }.map
            (𝟙 x✝²))
          x✝¹)
      x✝ =
    ↑(NatTrans.app
          (𝟙
            ({ obj := fun Y => preadditiveYonedaObj Y ⋙ forget₂ (ModuleCat (End Y)) AddCommGroupCat,
                  map := fun {X Y} f =>
                    NatTrans.mk fun X_1 =>
                      { toZeroHom := { toFun := fun g => g ≫ f, map_zero' := (_ : 0 ≫ f = 0) },
                        map_add' :=
                          (_ :
                            ∀
                              (g g' :
                                ↑(((fun Y => preadditiveYonedaObj Y ⋙ forget₂ (ModuleCat (End Y)) AddCommGroupCat)
                                        X).obj
                                    X_1)),
                              (g + g') ≫ f = g ≫ f + g' ≫ f) } }.obj
              x✝²))
          x✝¹)
      x✝
[PROOFSTEP]
dsimp
[GOAL]
case w.h.w
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : Preadditive C
x✝² : C
x✝¹ : Cᵒᵖ
x✝ :
  ↑(({ obj := fun Y => preadditiveYonedaObj Y ⋙ forget₂ (ModuleCat (End Y)) AddCommGroupCat,
              map := fun {X Y} f =>
                NatTrans.mk fun X_1 =>
                  { toZeroHom := { toFun := fun g => g ≫ f, map_zero' := (_ : 0 ≫ f = 0) },
                    map_add' :=
                      (_ :
                        ∀
                          (g g' :
                            ↑(((fun Y => preadditiveYonedaObj Y ⋙ forget₂ (ModuleCat (End Y)) AddCommGroupCat) X).obj
                                X_1)),
                          (g + g') ≫ f = g ≫ f + g' ≫ f) } }.obj
          x✝²).obj
      x✝¹)
⊢ x✝ ≫ 𝟙 x✝² = x✝
[PROOFSTEP]
simp
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : Preadditive C
X✝ Y✝ Z✝ : C
f : X✝ ⟶ Y✝
g : Y✝ ⟶ Z✝
⊢ { obj := fun Y => preadditiveYonedaObj Y ⋙ forget₂ (ModuleCat (End Y)) AddCommGroupCat,
          map := fun {X Y} f =>
            NatTrans.mk fun X_1 =>
              { toZeroHom := { toFun := fun g => g ≫ f, map_zero' := (_ : 0 ≫ f = 0) },
                map_add' :=
                  (_ :
                    ∀
                      (g g' :
                        ↑(((fun Y => preadditiveYonedaObj Y ⋙ forget₂ (ModuleCat (End Y)) AddCommGroupCat) X).obj X_1)),
                      (g + g') ≫ f = g ≫ f + g' ≫ f) } }.map
      (f ≫ g) =
    { obj := fun Y => preadditiveYonedaObj Y ⋙ forget₂ (ModuleCat (End Y)) AddCommGroupCat,
            map := fun {X Y} f =>
              NatTrans.mk fun X_1 =>
                { toZeroHom := { toFun := fun g => g ≫ f, map_zero' := (_ : 0 ≫ f = 0) },
                  map_add' :=
                    (_ :
                      ∀
                        (g g' :
                          ↑(((fun Y => preadditiveYonedaObj Y ⋙ forget₂ (ModuleCat (End Y)) AddCommGroupCat) X).obj
                              X_1)),
                        (g + g') ≫ f = g ≫ f + g' ≫ f) } }.map
        f ≫
      { obj := fun Y => preadditiveYonedaObj Y ⋙ forget₂ (ModuleCat (End Y)) AddCommGroupCat,
            map := fun {X Y} f =>
              NatTrans.mk fun X_1 =>
                { toZeroHom := { toFun := fun g => g ≫ f, map_zero' := (_ : 0 ≫ f = 0) },
                  map_add' :=
                    (_ :
                      ∀
                        (g g' :
                          ↑(((fun Y => preadditiveYonedaObj Y ⋙ forget₂ (ModuleCat (End Y)) AddCommGroupCat) X).obj
                              X_1)),
                        (g + g') ≫ f = g ≫ f + g' ≫ f) } }.map
        g
[PROOFSTEP]
ext
[GOAL]
case w.h.w
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : Preadditive C
X✝ Y✝ Z✝ : C
f : X✝ ⟶ Y✝
g : Y✝ ⟶ Z✝
x✝¹ : Cᵒᵖ
x✝ :
  ↑(({ obj := fun Y => preadditiveYonedaObj Y ⋙ forget₂ (ModuleCat (End Y)) AddCommGroupCat,
              map := fun {X Y} f =>
                NatTrans.mk fun X_1 =>
                  { toZeroHom := { toFun := fun g => g ≫ f, map_zero' := (_ : 0 ≫ f = 0) },
                    map_add' :=
                      (_ :
                        ∀
                          (g g' :
                            ↑(((fun Y => preadditiveYonedaObj Y ⋙ forget₂ (ModuleCat (End Y)) AddCommGroupCat) X).obj
                                X_1)),
                          (g + g') ≫ f = g ≫ f + g' ≫ f) } }.obj
          X✝).obj
      x✝¹)
⊢ ↑(NatTrans.app
          ({ obj := fun Y => preadditiveYonedaObj Y ⋙ forget₂ (ModuleCat (End Y)) AddCommGroupCat,
                map := fun {X Y} f =>
                  NatTrans.mk fun X_1 =>
                    { toZeroHom := { toFun := fun g => g ≫ f, map_zero' := (_ : 0 ≫ f = 0) },
                      map_add' :=
                        (_ :
                          ∀
                            (g g' :
                              ↑(((fun Y => preadditiveYonedaObj Y ⋙ forget₂ (ModuleCat (End Y)) AddCommGroupCat) X).obj
                                  X_1)),
                            (g + g') ≫ f = g ≫ f + g' ≫ f) } }.map
            (f ≫ g))
          x✝¹)
      x✝ =
    ↑(NatTrans.app
          ({ obj := fun Y => preadditiveYonedaObj Y ⋙ forget₂ (ModuleCat (End Y)) AddCommGroupCat,
                  map := fun {X Y} f =>
                    NatTrans.mk fun X_1 =>
                      { toZeroHom := { toFun := fun g => g ≫ f, map_zero' := (_ : 0 ≫ f = 0) },
                        map_add' :=
                          (_ :
                            ∀
                              (g g' :
                                ↑(((fun Y => preadditiveYonedaObj Y ⋙ forget₂ (ModuleCat (End Y)) AddCommGroupCat)
                                        X).obj
                                    X_1)),
                              (g + g') ≫ f = g ≫ f + g' ≫ f) } }.map
              f ≫
            { obj := fun Y => preadditiveYonedaObj Y ⋙ forget₂ (ModuleCat (End Y)) AddCommGroupCat,
                  map := fun {X Y} f =>
                    NatTrans.mk fun X_1 =>
                      { toZeroHom := { toFun := fun g => g ≫ f, map_zero' := (_ : 0 ≫ f = 0) },
                        map_add' :=
                          (_ :
                            ∀
                              (g g' :
                                ↑(((fun Y => preadditiveYonedaObj Y ⋙ forget₂ (ModuleCat (End Y)) AddCommGroupCat)
                                        X).obj
                                    X_1)),
                              (g + g') ≫ f = g ≫ f + g' ≫ f) } }.map
              g)
          x✝¹)
      x✝
[PROOFSTEP]
dsimp
[GOAL]
case w.h.w
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : Preadditive C
X✝ Y✝ Z✝ : C
f : X✝ ⟶ Y✝
g : Y✝ ⟶ Z✝
x✝¹ : Cᵒᵖ
x✝ :
  ↑(({ obj := fun Y => preadditiveYonedaObj Y ⋙ forget₂ (ModuleCat (End Y)) AddCommGroupCat,
              map := fun {X Y} f =>
                NatTrans.mk fun X_1 =>
                  { toZeroHom := { toFun := fun g => g ≫ f, map_zero' := (_ : 0 ≫ f = 0) },
                    map_add' :=
                      (_ :
                        ∀
                          (g g' :
                            ↑(((fun Y => preadditiveYonedaObj Y ⋙ forget₂ (ModuleCat (End Y)) AddCommGroupCat) X).obj
                                X_1)),
                          (g + g') ≫ f = g ≫ f + g' ≫ f) } }.obj
          X✝).obj
      x✝¹)
⊢ x✝ ≫ f ≫ g = (x✝ ≫ f) ≫ g
[PROOFSTEP]
simp
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : Preadditive C
x✝ : Cᵒᵖ
⊢ { obj := fun X => preadditiveCoyonedaObj X ⋙ forget₂ (ModuleCat (End X)) AddCommGroupCat,
          map := fun {X Y} f =>
            NatTrans.mk fun Y_1 =>
              { toZeroHom := { toFun := fun g => f.unop ≫ g, map_zero' := (_ : f.unop ≫ 0 = 0) },
                map_add' :=
                  (_ :
                    ∀
                      (g g' :
                        ↑(((fun X => preadditiveCoyonedaObj X ⋙ forget₂ (ModuleCat (End X)) AddCommGroupCat) X).obj
                            Y_1)),
                      f.unop ≫ (g + g') = f.unop ≫ g + f.unop ≫ g') } }.map
      (𝟙 x✝) =
    𝟙
      ({ obj := fun X => preadditiveCoyonedaObj X ⋙ forget₂ (ModuleCat (End X)) AddCommGroupCat,
            map := fun {X Y} f =>
              NatTrans.mk fun Y_1 =>
                { toZeroHom := { toFun := fun g => f.unop ≫ g, map_zero' := (_ : f.unop ≫ 0 = 0) },
                  map_add' :=
                    (_ :
                      ∀
                        (g g' :
                          ↑(((fun X => preadditiveCoyonedaObj X ⋙ forget₂ (ModuleCat (End X)) AddCommGroupCat) X).obj
                              Y_1)),
                        f.unop ≫ (g + g') = f.unop ≫ g + f.unop ≫ g') } }.obj
        x✝)
[PROOFSTEP]
ext
[GOAL]
case w.h.w
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : Preadditive C
x✝² : Cᵒᵖ
x✝¹ : C
x✝ :
  ↑(({ obj := fun X => preadditiveCoyonedaObj X ⋙ forget₂ (ModuleCat (End X)) AddCommGroupCat,
              map := fun {X Y} f =>
                NatTrans.mk fun Y_1 =>
                  { toZeroHom := { toFun := fun g => f.unop ≫ g, map_zero' := (_ : f.unop ≫ 0 = 0) },
                    map_add' :=
                      (_ :
                        ∀
                          (g g' :
                            ↑(((fun X => preadditiveCoyonedaObj X ⋙ forget₂ (ModuleCat (End X)) AddCommGroupCat) X).obj
                                Y_1)),
                          f.unop ≫ (g + g') = f.unop ≫ g + f.unop ≫ g') } }.obj
          x✝²).obj
      x✝¹)
⊢ ↑(NatTrans.app
          ({ obj := fun X => preadditiveCoyonedaObj X ⋙ forget₂ (ModuleCat (End X)) AddCommGroupCat,
                map := fun {X Y} f =>
                  NatTrans.mk fun Y_1 =>
                    { toZeroHom := { toFun := fun g => f.unop ≫ g, map_zero' := (_ : f.unop ≫ 0 = 0) },
                      map_add' :=
                        (_ :
                          ∀
                            (g g' :
                              ↑(((fun X => preadditiveCoyonedaObj X ⋙ forget₂ (ModuleCat (End X)) AddCommGroupCat)
                                      X).obj
                                  Y_1)),
                            f.unop ≫ (g + g') = f.unop ≫ g + f.unop ≫ g') } }.map
            (𝟙 x✝²))
          x✝¹)
      x✝ =
    ↑(NatTrans.app
          (𝟙
            ({ obj := fun X => preadditiveCoyonedaObj X ⋙ forget₂ (ModuleCat (End X)) AddCommGroupCat,
                  map := fun {X Y} f =>
                    NatTrans.mk fun Y_1 =>
                      { toZeroHom := { toFun := fun g => f.unop ≫ g, map_zero' := (_ : f.unop ≫ 0 = 0) },
                        map_add' :=
                          (_ :
                            ∀
                              (g g' :
                                ↑(((fun X => preadditiveCoyonedaObj X ⋙ forget₂ (ModuleCat (End X)) AddCommGroupCat)
                                        X).obj
                                    Y_1)),
                              f.unop ≫ (g + g') = f.unop ≫ g + f.unop ≫ g') } }.obj
              x✝²))
          x✝¹)
      x✝
[PROOFSTEP]
dsimp
[GOAL]
case w.h.w
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : Preadditive C
x✝² : Cᵒᵖ
x✝¹ : C
x✝ :
  ↑(({ obj := fun X => preadditiveCoyonedaObj X ⋙ forget₂ (ModuleCat (End X)) AddCommGroupCat,
              map := fun {X Y} f =>
                NatTrans.mk fun Y_1 =>
                  { toZeroHom := { toFun := fun g => f.unop ≫ g, map_zero' := (_ : f.unop ≫ 0 = 0) },
                    map_add' :=
                      (_ :
                        ∀
                          (g g' :
                            ↑(((fun X => preadditiveCoyonedaObj X ⋙ forget₂ (ModuleCat (End X)) AddCommGroupCat) X).obj
                                Y_1)),
                          f.unop ≫ (g + g') = f.unop ≫ g + f.unop ≫ g') } }.obj
          x✝²).obj
      x✝¹)
⊢ 𝟙 x✝².unop ≫ x✝ = x✝
[PROOFSTEP]
simp
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : Preadditive C
X✝ Y✝ Z✝ : Cᵒᵖ
f : X✝ ⟶ Y✝
g : Y✝ ⟶ Z✝
⊢ { obj := fun X => preadditiveCoyonedaObj X ⋙ forget₂ (ModuleCat (End X)) AddCommGroupCat,
          map := fun {X Y} f =>
            NatTrans.mk fun Y_1 =>
              { toZeroHom := { toFun := fun g => f.unop ≫ g, map_zero' := (_ : f.unop ≫ 0 = 0) },
                map_add' :=
                  (_ :
                    ∀
                      (g g' :
                        ↑(((fun X => preadditiveCoyonedaObj X ⋙ forget₂ (ModuleCat (End X)) AddCommGroupCat) X).obj
                            Y_1)),
                      f.unop ≫ (g + g') = f.unop ≫ g + f.unop ≫ g') } }.map
      (f ≫ g) =
    { obj := fun X => preadditiveCoyonedaObj X ⋙ forget₂ (ModuleCat (End X)) AddCommGroupCat,
            map := fun {X Y} f =>
              NatTrans.mk fun Y_1 =>
                { toZeroHom := { toFun := fun g => f.unop ≫ g, map_zero' := (_ : f.unop ≫ 0 = 0) },
                  map_add' :=
                    (_ :
                      ∀
                        (g g' :
                          ↑(((fun X => preadditiveCoyonedaObj X ⋙ forget₂ (ModuleCat (End X)) AddCommGroupCat) X).obj
                              Y_1)),
                        f.unop ≫ (g + g') = f.unop ≫ g + f.unop ≫ g') } }.map
        f ≫
      { obj := fun X => preadditiveCoyonedaObj X ⋙ forget₂ (ModuleCat (End X)) AddCommGroupCat,
            map := fun {X Y} f =>
              NatTrans.mk fun Y_1 =>
                { toZeroHom := { toFun := fun g => f.unop ≫ g, map_zero' := (_ : f.unop ≫ 0 = 0) },
                  map_add' :=
                    (_ :
                      ∀
                        (g g' :
                          ↑(((fun X => preadditiveCoyonedaObj X ⋙ forget₂ (ModuleCat (End X)) AddCommGroupCat) X).obj
                              Y_1)),
                        f.unop ≫ (g + g') = f.unop ≫ g + f.unop ≫ g') } }.map
        g
[PROOFSTEP]
ext
[GOAL]
case w.h.w
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : Preadditive C
X✝ Y✝ Z✝ : Cᵒᵖ
f : X✝ ⟶ Y✝
g : Y✝ ⟶ Z✝
x✝¹ : C
x✝ :
  ↑(({ obj := fun X => preadditiveCoyonedaObj X ⋙ forget₂ (ModuleCat (End X)) AddCommGroupCat,
              map := fun {X Y} f =>
                NatTrans.mk fun Y_1 =>
                  { toZeroHom := { toFun := fun g => f.unop ≫ g, map_zero' := (_ : f.unop ≫ 0 = 0) },
                    map_add' :=
                      (_ :
                        ∀
                          (g g' :
                            ↑(((fun X => preadditiveCoyonedaObj X ⋙ forget₂ (ModuleCat (End X)) AddCommGroupCat) X).obj
                                Y_1)),
                          f.unop ≫ (g + g') = f.unop ≫ g + f.unop ≫ g') } }.obj
          X✝).obj
      x✝¹)
⊢ ↑(NatTrans.app
          ({ obj := fun X => preadditiveCoyonedaObj X ⋙ forget₂ (ModuleCat (End X)) AddCommGroupCat,
                map := fun {X Y} f =>
                  NatTrans.mk fun Y_1 =>
                    { toZeroHom := { toFun := fun g => f.unop ≫ g, map_zero' := (_ : f.unop ≫ 0 = 0) },
                      map_add' :=
                        (_ :
                          ∀
                            (g g' :
                              ↑(((fun X => preadditiveCoyonedaObj X ⋙ forget₂ (ModuleCat (End X)) AddCommGroupCat)
                                      X).obj
                                  Y_1)),
                            f.unop ≫ (g + g') = f.unop ≫ g + f.unop ≫ g') } }.map
            (f ≫ g))
          x✝¹)
      x✝ =
    ↑(NatTrans.app
          ({ obj := fun X => preadditiveCoyonedaObj X ⋙ forget₂ (ModuleCat (End X)) AddCommGroupCat,
                  map := fun {X Y} f =>
                    NatTrans.mk fun Y_1 =>
                      { toZeroHom := { toFun := fun g => f.unop ≫ g, map_zero' := (_ : f.unop ≫ 0 = 0) },
                        map_add' :=
                          (_ :
                            ∀
                              (g g' :
                                ↑(((fun X => preadditiveCoyonedaObj X ⋙ forget₂ (ModuleCat (End X)) AddCommGroupCat)
                                        X).obj
                                    Y_1)),
                              f.unop ≫ (g + g') = f.unop ≫ g + f.unop ≫ g') } }.map
              f ≫
            { obj := fun X => preadditiveCoyonedaObj X ⋙ forget₂ (ModuleCat (End X)) AddCommGroupCat,
                  map := fun {X Y} f =>
                    NatTrans.mk fun Y_1 =>
                      { toZeroHom := { toFun := fun g => f.unop ≫ g, map_zero' := (_ : f.unop ≫ 0 = 0) },
                        map_add' :=
                          (_ :
                            ∀
                              (g g' :
                                ↑(((fun X => preadditiveCoyonedaObj X ⋙ forget₂ (ModuleCat (End X)) AddCommGroupCat)
                                        X).obj
                                    Y_1)),
                              f.unop ≫ (g + g') = f.unop ≫ g + f.unop ≫ g') } }.map
              g)
          x✝¹)
      x✝
[PROOFSTEP]
dsimp
[GOAL]
case w.h.w
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : Preadditive C
X✝ Y✝ Z✝ : Cᵒᵖ
f : X✝ ⟶ Y✝
g : Y✝ ⟶ Z✝
x✝¹ : C
x✝ :
  ↑(({ obj := fun X => preadditiveCoyonedaObj X ⋙ forget₂ (ModuleCat (End X)) AddCommGroupCat,
              map := fun {X Y} f =>
                NatTrans.mk fun Y_1 =>
                  { toZeroHom := { toFun := fun g => f.unop ≫ g, map_zero' := (_ : f.unop ≫ 0 = 0) },
                    map_add' :=
                      (_ :
                        ∀
                          (g g' :
                            ↑(((fun X => preadditiveCoyonedaObj X ⋙ forget₂ (ModuleCat (End X)) AddCommGroupCat) X).obj
                                Y_1)),
                          f.unop ≫ (g + g') = f.unop ≫ g + f.unop ≫ g') } }.obj
          X✝).obj
      x✝¹)
⊢ (g.unop ≫ f.unop) ≫ x✝ = g.unop ≫ f.unop ≫ x✝
[PROOFSTEP]
simp


[GOAL]
V : Type u_1
inst✝¹ : NormedAddCommGroup V
inst✝ : InnerProductSpace ℝ V
x y z : V
h₁ : ∃ k, k ≠ 1 ∧ x + y = k • (x - y)
h₂ : ‖z - y‖ = ‖z + y‖
⊢ ‖x - y‖ * ‖x + y‖ = |‖z + y‖ ^ 2 - ‖z - x‖ ^ 2|
[PROOFSTEP]
obtain ⟨k, hk_ne_one, hk⟩ := h₁
[GOAL]
case intro.intro
V : Type u_1
inst✝¹ : NormedAddCommGroup V
inst✝ : InnerProductSpace ℝ V
x y z : V
h₂ : ‖z - y‖ = ‖z + y‖
k : ℝ
hk_ne_one : k ≠ 1
hk : x + y = k • (x - y)
⊢ ‖x - y‖ * ‖x + y‖ = |‖z + y‖ ^ 2 - ‖z - x‖ ^ 2|
[PROOFSTEP]
let r := (k - 1)⁻¹ * (k + 1)
[GOAL]
case intro.intro
V : Type u_1
inst✝¹ : NormedAddCommGroup V
inst✝ : InnerProductSpace ℝ V
x y z : V
h₂ : ‖z - y‖ = ‖z + y‖
k : ℝ
hk_ne_one : k ≠ 1
hk : x + y = k • (x - y)
r : ℝ := (k - 1)⁻¹ * (k + 1)
⊢ ‖x - y‖ * ‖x + y‖ = |‖z + y‖ ^ 2 - ‖z - x‖ ^ 2|
[PROOFSTEP]
have hxy : x = r • y :=
  by
  rw [← smul_smul, eq_inv_smul_iff₀ (sub_ne_zero.mpr hk_ne_one), ← sub_eq_zero]
  calc
    (k - 1) • x - (k + 1) • y = k • x - x - (k • y + y) := by simp_rw [sub_smul, add_smul, one_smul]
    _ = k • x - k • y - (x + y) := by simp_rw [← sub_sub, sub_right_comm]
    _ = k • (x - y) - (x + y) := by rw [← smul_sub k x y]
    _ = 0 := sub_eq_zero.mpr hk.symm
[GOAL]
V : Type u_1
inst✝¹ : NormedAddCommGroup V
inst✝ : InnerProductSpace ℝ V
x y z : V
h₂ : ‖z - y‖ = ‖z + y‖
k : ℝ
hk_ne_one : k ≠ 1
hk : x + y = k • (x - y)
r : ℝ := (k - 1)⁻¹ * (k + 1)
⊢ x = r • y
[PROOFSTEP]
rw [← smul_smul, eq_inv_smul_iff₀ (sub_ne_zero.mpr hk_ne_one), ← sub_eq_zero]
[GOAL]
V : Type u_1
inst✝¹ : NormedAddCommGroup V
inst✝ : InnerProductSpace ℝ V
x y z : V
h₂ : ‖z - y‖ = ‖z + y‖
k : ℝ
hk_ne_one : k ≠ 1
hk : x + y = k • (x - y)
r : ℝ := (k - 1)⁻¹ * (k + 1)
⊢ (k - 1) • x - (k + 1) • y = 0
[PROOFSTEP]
calc
  (k - 1) • x - (k + 1) • y = k • x - x - (k • y + y) := by simp_rw [sub_smul, add_smul, one_smul]
  _ = k • x - k • y - (x + y) := by simp_rw [← sub_sub, sub_right_comm]
  _ = k • (x - y) - (x + y) := by rw [← smul_sub k x y]
  _ = 0 := sub_eq_zero.mpr hk.symm
[GOAL]
V : Type u_1
inst✝¹ : NormedAddCommGroup V
inst✝ : InnerProductSpace ℝ V
x y z : V
h₂ : ‖z - y‖ = ‖z + y‖
k : ℝ
hk_ne_one : k ≠ 1
hk : x + y = k • (x - y)
r : ℝ := (k - 1)⁻¹ * (k + 1)
⊢ (k - 1) • x - (k + 1) • y = k • x - x - (k • y + y)
[PROOFSTEP]
simp_rw [sub_smul, add_smul, one_smul]
[GOAL]
V : Type u_1
inst✝¹ : NormedAddCommGroup V
inst✝ : InnerProductSpace ℝ V
x y z : V
h₂ : ‖z - y‖ = ‖z + y‖
k : ℝ
hk_ne_one : k ≠ 1
hk : x + y = k • (x - y)
r : ℝ := (k - 1)⁻¹ * (k + 1)
⊢ k • x - x - (k • y + y) = k • x - k • y - (x + y)
[PROOFSTEP]
simp_rw [← sub_sub, sub_right_comm]
[GOAL]
V : Type u_1
inst✝¹ : NormedAddCommGroup V
inst✝ : InnerProductSpace ℝ V
x y z : V
h₂ : ‖z - y‖ = ‖z + y‖
k : ℝ
hk_ne_one : k ≠ 1
hk : x + y = k • (x - y)
r : ℝ := (k - 1)⁻¹ * (k + 1)
⊢ k • x - k • y - (x + y) = k • (x - y) - (x + y)
[PROOFSTEP]
rw [← smul_sub k x y]
[GOAL]
case intro.intro
V : Type u_1
inst✝¹ : NormedAddCommGroup V
inst✝ : InnerProductSpace ℝ V
x y z : V
h₂ : ‖z - y‖ = ‖z + y‖
k : ℝ
hk_ne_one : k ≠ 1
hk : x + y = k • (x - y)
r : ℝ := (k - 1)⁻¹ * (k + 1)
hxy : x = r • y
⊢ ‖x - y‖ * ‖x + y‖ = |‖z + y‖ ^ 2 - ‖z - x‖ ^ 2|
[PROOFSTEP]
have hzy : ⟪z, y⟫ = 0 := by
  rwa [inner_eq_zero_iff_angle_eq_pi_div_two, ← norm_add_eq_norm_sub_iff_angle_eq_pi_div_two, eq_comm]
[GOAL]
V : Type u_1
inst✝¹ : NormedAddCommGroup V
inst✝ : InnerProductSpace ℝ V
x y z : V
h₂ : ‖z - y‖ = ‖z + y‖
k : ℝ
hk_ne_one : k ≠ 1
hk : x + y = k • (x - y)
r : ℝ := (k - 1)⁻¹ * (k + 1)
hxy : x = r • y
⊢ inner z y = 0
[PROOFSTEP]
rwa [inner_eq_zero_iff_angle_eq_pi_div_two, ← norm_add_eq_norm_sub_iff_angle_eq_pi_div_two, eq_comm]
[GOAL]
case intro.intro
V : Type u_1
inst✝¹ : NormedAddCommGroup V
inst✝ : InnerProductSpace ℝ V
x y z : V
h₂ : ‖z - y‖ = ‖z + y‖
k : ℝ
hk_ne_one : k ≠ 1
hk : x + y = k • (x - y)
r : ℝ := (k - 1)⁻¹ * (k + 1)
hxy : x = r • y
hzy : inner z y = 0
⊢ ‖x - y‖ * ‖x + y‖ = |‖z + y‖ ^ 2 - ‖z - x‖ ^ 2|
[PROOFSTEP]
have hzx : ⟪z, x⟫ = 0 := by rw [hxy, inner_smul_right, hzy, mul_zero]
[GOAL]
V : Type u_1
inst✝¹ : NormedAddCommGroup V
inst✝ : InnerProductSpace ℝ V
x y z : V
h₂ : ‖z - y‖ = ‖z + y‖
k : ℝ
hk_ne_one : k ≠ 1
hk : x + y = k • (x - y)
r : ℝ := (k - 1)⁻¹ * (k + 1)
hxy : x = r • y
hzy : inner z y = 0
⊢ inner z x = 0
[PROOFSTEP]
rw [hxy, inner_smul_right, hzy, mul_zero]
[GOAL]
case intro.intro
V : Type u_1
inst✝¹ : NormedAddCommGroup V
inst✝ : InnerProductSpace ℝ V
x y z : V
h₂ : ‖z - y‖ = ‖z + y‖
k : ℝ
hk_ne_one : k ≠ 1
hk : x + y = k • (x - y)
r : ℝ := (k - 1)⁻¹ * (k + 1)
hxy : x = r • y
hzy : inner z y = 0
hzx : inner z x = 0
⊢ ‖x - y‖ * ‖x + y‖ = |‖z + y‖ ^ 2 - ‖z - x‖ ^ 2|
[PROOFSTEP]
calc
  ‖x - y‖ * ‖x + y‖ = ‖(r - 1) • y‖ * ‖(r + 1) • y‖ := by simp [sub_smul, add_smul, hxy]
  _ = ‖r - 1‖ * ‖y‖ * (‖r + 1‖ * ‖y‖) := by simp_rw [norm_smul]
  _ = ‖r - 1‖ * ‖r + 1‖ * ‖y‖ ^ 2 := by ring
  _ = |(r - 1) * (r + 1) * ‖y‖ ^ 2| := by simp [abs_mul]
  _ = |r ^ 2 * ‖y‖ ^ 2 - ‖y‖ ^ 2| := by ring_nf
  _ = |‖x‖ ^ 2 - ‖y‖ ^ 2| := by simp [hxy, norm_smul, mul_pow, sq_abs]
  _ = |‖z + y‖ ^ 2 - ‖z - x‖ ^ 2| := by simp [norm_add_sq_real, norm_sub_sq_real, hzy, hzx, abs_sub_comm]
[GOAL]
V : Type u_1
inst✝¹ : NormedAddCommGroup V
inst✝ : InnerProductSpace ℝ V
x y z : V
h₂ : ‖z - y‖ = ‖z + y‖
k : ℝ
hk_ne_one : k ≠ 1
hk : x + y = k • (x - y)
r : ℝ := (k - 1)⁻¹ * (k + 1)
hxy : x = r • y
hzy : inner z y = 0
hzx : inner z x = 0
⊢ ‖x - y‖ * ‖x + y‖ = ‖(r - 1) • y‖ * ‖(r + 1) • y‖
[PROOFSTEP]
simp [sub_smul, add_smul, hxy]
[GOAL]
V : Type u_1
inst✝¹ : NormedAddCommGroup V
inst✝ : InnerProductSpace ℝ V
x y z : V
h₂ : ‖z - y‖ = ‖z + y‖
k : ℝ
hk_ne_one : k ≠ 1
hk : x + y = k • (x - y)
r : ℝ := (k - 1)⁻¹ * (k + 1)
hxy : x = r • y
hzy : inner z y = 0
hzx : inner z x = 0
⊢ ‖(r - 1) • y‖ * ‖(r + 1) • y‖ = ‖r - 1‖ * ‖y‖ * (‖r + 1‖ * ‖y‖)
[PROOFSTEP]
simp_rw [norm_smul]
[GOAL]
V : Type u_1
inst✝¹ : NormedAddCommGroup V
inst✝ : InnerProductSpace ℝ V
x y z : V
h₂ : ‖z - y‖ = ‖z + y‖
k : ℝ
hk_ne_one : k ≠ 1
hk : x + y = k • (x - y)
r : ℝ := (k - 1)⁻¹ * (k + 1)
hxy : x = r • y
hzy : inner z y = 0
hzx : inner z x = 0
⊢ ‖r - 1‖ * ‖y‖ * (‖r + 1‖ * ‖y‖) = ‖r - 1‖ * ‖r + 1‖ * ‖y‖ ^ 2
[PROOFSTEP]
ring
[GOAL]
V : Type u_1
inst✝¹ : NormedAddCommGroup V
inst✝ : InnerProductSpace ℝ V
x y z : V
h₂ : ‖z - y‖ = ‖z + y‖
k : ℝ
hk_ne_one : k ≠ 1
hk : x + y = k • (x - y)
r : ℝ := (k - 1)⁻¹ * (k + 1)
hxy : x = r • y
hzy : inner z y = 0
hzx : inner z x = 0
⊢ ‖r - 1‖ * ‖r + 1‖ * ‖y‖ ^ 2 = |(r - 1) * (r + 1) * ‖y‖ ^ 2|
[PROOFSTEP]
simp [abs_mul]
[GOAL]
V : Type u_1
inst✝¹ : NormedAddCommGroup V
inst✝ : InnerProductSpace ℝ V
x y z : V
h₂ : ‖z - y‖ = ‖z + y‖
k : ℝ
hk_ne_one : k ≠ 1
hk : x + y = k • (x - y)
r : ℝ := (k - 1)⁻¹ * (k + 1)
hxy : x = r • y
hzy : inner z y = 0
hzx : inner z x = 0
⊢ |(r - 1) * (r + 1) * ‖y‖ ^ 2| = |r ^ 2 * ‖y‖ ^ 2 - ‖y‖ ^ 2|
[PROOFSTEP]
ring_nf
[GOAL]
V : Type u_1
inst✝¹ : NormedAddCommGroup V
inst✝ : InnerProductSpace ℝ V
x y z : V
h₂ : ‖z - y‖ = ‖z + y‖
k : ℝ
hk_ne_one : k ≠ 1
hk : x + y = k • (x - y)
r : ℝ := (k - 1)⁻¹ * (k + 1)
hxy : x = r • y
hzy : inner z y = 0
hzx : inner z x = 0
⊢ |r ^ 2 * ‖y‖ ^ 2 - ‖y‖ ^ 2| = |‖x‖ ^ 2 - ‖y‖ ^ 2|
[PROOFSTEP]
simp [hxy, norm_smul, mul_pow, sq_abs]
[GOAL]
V : Type u_1
inst✝¹ : NormedAddCommGroup V
inst✝ : InnerProductSpace ℝ V
x y z : V
h₂ : ‖z - y‖ = ‖z + y‖
k : ℝ
hk_ne_one : k ≠ 1
hk : x + y = k • (x - y)
r : ℝ := (k - 1)⁻¹ * (k + 1)
hxy : x = r • y
hzy : inner z y = 0
hzx : inner z x = 0
⊢ |‖x‖ ^ 2 - ‖y‖ ^ 2| = |‖z + y‖ ^ 2 - ‖z - x‖ ^ 2|
[PROOFSTEP]
simp [norm_add_sq_real, norm_sub_sq_real, hzy, hzx, abs_sub_comm]
[GOAL]
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 = |dist b q ^ 2 - dist p q ^ 2|
[PROOFSTEP]
let m : P := midpoint ℝ a b
[GOAL]
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 = |dist b q ^ 2 - dist p q ^ 2|
[PROOFSTEP]
have h1 := vsub_sub_vsub_cancel_left a p m
[GOAL]
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 = |dist b q ^ 2 - dist p q ^ 2|
[PROOFSTEP]
have h2 := vsub_sub_vsub_cancel_left p q m
[GOAL]
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 = |dist b q ^ 2 - dist p q ^ 2|
[PROOFSTEP]
have h3 := vsub_sub_vsub_cancel_left a q m
[GOAL]
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 = |dist b q ^ 2 - dist p q ^ 2|
[PROOFSTEP]
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]
[GOAL]
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)
[PROOFSTEP]
rw [midpoint_vsub_left, ← right_vsub_midpoint, add_comm, vsub_add_vsub_cancel]
[GOAL]
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 = |dist b q ^ 2 - dist p q ^ 2|
[PROOFSTEP]
iterate 4 rw [dist_eq_norm_vsub V]
[GOAL]
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 = |dist b q ^ 2 - dist p q ^ 2|
[PROOFSTEP]
rw [dist_eq_norm_vsub V]
[GOAL]
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‖ * dist b p = |dist b q ^ 2 - dist p q ^ 2|
[PROOFSTEP]
rw [dist_eq_norm_vsub V]
[GOAL]
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‖ = |dist b q ^ 2 - dist p q ^ 2|
[PROOFSTEP]
rw [dist_eq_norm_vsub V]
[GOAL]
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‖ = |‖b -ᵥ q‖ ^ 2 - dist p q ^ 2|
[PROOFSTEP]
rw [dist_eq_norm_vsub V]
[GOAL]
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‖ = |‖b -ᵥ q‖ ^ 2 - ‖p -ᵥ q‖ ^ 2|
[PROOFSTEP]
rw [← h1, ← h2, h, h]
[GOAL]
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)‖ = |‖m -ᵥ q + (m -ᵥ a)‖ ^ 2 - ‖m -ᵥ q - (m -ᵥ p)‖ ^ 2|
[PROOFSTEP]
rw [← h1, h] at hp
[GOAL]
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)‖ = |‖m -ᵥ q + (m -ᵥ a)‖ ^ 2 - ‖m -ᵥ q - (m -ᵥ p)‖ ^ 2|
[PROOFSTEP]
rw [dist_eq_norm_vsub V a q, dist_eq_norm_vsub V b q, ← h3, h] at hq
[GOAL]
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)‖ = |‖m -ᵥ q + (m -ᵥ a)‖ ^ 2 - ‖m -ᵥ q - (m -ᵥ p)‖ ^ 2|
[PROOFSTEP]
exact mul_norm_eq_abs_sub_sq_norm hp hq
[GOAL]
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d p : P
h : Cospherical {a, b, c, d}
hapb : ∃ k₁, k₁ ≠ 1 ∧ b -ᵥ p = k₁ • (a -ᵥ p)
hcpd : ∃ k₂, k₂ ≠ 1 ∧ d -ᵥ p = k₂ • (c -ᵥ p)
⊢ dist a p * dist b p = dist c p * dist d p
[PROOFSTEP]
obtain ⟨q, r, h'⟩ := (cospherical_def { a, b, c, d }).mp h
[GOAL]
case intro.intro
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d p : P
h : Cospherical {a, b, c, d}
hapb : ∃ k₁, k₁ ≠ 1 ∧ b -ᵥ p = k₁ • (a -ᵥ p)
hcpd : ∃ k₂, k₂ ≠ 1 ∧ d -ᵥ p = k₂ • (c -ᵥ p)
q : P
r : ℝ
h' : ∀ (p : P), p ∈ {a, b, c, d} → dist p q = r
⊢ dist a p * dist b p = dist c p * dist d p
[PROOFSTEP]
obtain ⟨ha, hb, hc, hd⟩ := h' a (by simp), h' b (by simp), h' c (by simp), h' d (by simp)
[GOAL]
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d p : P
h : Cospherical {a, b, c, d}
hapb : ∃ k₁, k₁ ≠ 1 ∧ b -ᵥ p = k₁ • (a -ᵥ p)
hcpd : ∃ k₂, k₂ ≠ 1 ∧ d -ᵥ p = k₂ • (c -ᵥ p)
q : P
r : ℝ
h' : ∀ (p : P), p ∈ {a, b, c, d} → dist p q = r
⊢ a ∈ {a, b, c, d}
[PROOFSTEP]
simp
[GOAL]
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d p : P
h : Cospherical {a, b, c, d}
hapb : ∃ k₁, k₁ ≠ 1 ∧ b -ᵥ p = k₁ • (a -ᵥ p)
hcpd : ∃ k₂, k₂ ≠ 1 ∧ d -ᵥ p = k₂ • (c -ᵥ p)
q : P
r : ℝ
h' : ∀ (p : P), p ∈ {a, b, c, d} → dist p q = r
⊢ b ∈ {a, b, c, d}
[PROOFSTEP]
simp
[GOAL]
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d p : P
h : Cospherical {a, b, c, d}
hapb : ∃ k₁, k₁ ≠ 1 ∧ b -ᵥ p = k₁ • (a -ᵥ p)
hcpd : ∃ k₂, k₂ ≠ 1 ∧ d -ᵥ p = k₂ • (c -ᵥ p)
q : P
r : ℝ
h' : ∀ (p : P), p ∈ {a, b, c, d} → dist p q = r
⊢ c ∈ {a, b, c, d}
[PROOFSTEP]
simp
[GOAL]
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d p : P
h : Cospherical {a, b, c, d}
hapb : ∃ k₁, k₁ ≠ 1 ∧ b -ᵥ p = k₁ • (a -ᵥ p)
hcpd : ∃ k₂, k₂ ≠ 1 ∧ d -ᵥ p = k₂ • (c -ᵥ p)
q : P
r : ℝ
h' : ∀ (p : P), p ∈ {a, b, c, d} → dist p q = r
⊢ d ∈ {a, b, c, d}
[PROOFSTEP]
simp
[GOAL]
case intro.intro
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d p : P
h : Cospherical {a, b, c, d}
hapb : ∃ k₁, k₁ ≠ 1 ∧ b -ᵥ p = k₁ • (a -ᵥ p)
hcpd : ∃ k₂, k₂ ≠ 1 ∧ d -ᵥ p = k₂ • (c -ᵥ p)
q : P
r : ℝ
h' : ∀ (p : P), p ∈ {a, b, c, d} → dist p q = r
ha : dist a q = r
hb : dist b q = r
hc : dist c q = r
hd : dist d q = r
⊢ dist a p * dist b p = dist c p * dist d p
[PROOFSTEP]
rw [← hd] at hc
[GOAL]
case intro.intro
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d p : P
h : Cospherical {a, b, c, d}
hapb : ∃ k₁, k₁ ≠ 1 ∧ b -ᵥ p = k₁ • (a -ᵥ p)
hcpd : ∃ k₂, k₂ ≠ 1 ∧ d -ᵥ p = k₂ • (c -ᵥ p)
q : P
r : ℝ
h' : ∀ (p : P), p ∈ {a, b, c, d} → dist p q = r
ha : dist a q = r
hb : dist b q = r
hc : dist c q = dist d q
hd : dist d q = r
⊢ dist a p * dist b p = dist c p * dist d p
[PROOFSTEP]
rw [← hb] at ha
[GOAL]
case intro.intro
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d p : P
h : Cospherical {a, b, c, d}
hapb : ∃ k₁, k₁ ≠ 1 ∧ b -ᵥ p = k₁ • (a -ᵥ p)
hcpd : ∃ k₂, k₂ ≠ 1 ∧ d -ᵥ p = k₂ • (c -ᵥ p)
q : P
r : ℝ
h' : ∀ (p : P), p ∈ {a, b, c, d} → dist p q = r
ha : dist a q = dist b q
hb : dist b q = r
hc : dist c q = dist d q
hd : dist d q = r
⊢ dist a p * dist b p = dist c p * dist d p
[PROOFSTEP]
rw [mul_dist_eq_abs_sub_sq_dist hapb ha, hb, mul_dist_eq_abs_sub_sq_dist hcpd hc, hd]
[GOAL]
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d p : P
h : Cospherical {a, b, c, d}
hapb : ∠ a p b = π
hcpd : ∠ c p d = π
⊢ dist a p * dist b p = dist c p * dist d p
[PROOFSTEP]
obtain ⟨-, k₁, _, hab⟩ := angle_eq_pi_iff.mp hapb
[GOAL]
case intro.intro.intro
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d p : P
h : Cospherical {a, b, c, d}
hapb : ∠ a p b = π
hcpd : ∠ c p d = π
k₁ : ℝ
left✝ : k₁ < 0
hab : b -ᵥ p = k₁ • (a -ᵥ p)
⊢ dist a p * dist b p = dist c p * dist d p
[PROOFSTEP]
obtain ⟨-, k₂, _, hcd⟩ := angle_eq_pi_iff.mp hcpd
[GOAL]
case intro.intro.intro.intro.intro.intro
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d p : P
h : Cospherical {a, b, c, d}
hapb : ∠ a p b = π
hcpd : ∠ c p d = π
k₁ : ℝ
left✝¹ : k₁ < 0
hab : b -ᵥ p = k₁ • (a -ᵥ p)
k₂ : ℝ
left✝ : k₂ < 0
hcd : d -ᵥ p = k₂ • (c -ᵥ p)
⊢ dist a p * dist b p = dist c p * dist d p
[PROOFSTEP]
exact mul_dist_eq_mul_dist_of_cospherical h ⟨k₁, by linarith, hab⟩ ⟨k₂, by linarith, hcd⟩
[GOAL]
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d p : P
h : Cospherical {a, b, c, d}
hapb : ∠ a p b = π
hcpd : ∠ c p d = π
k₁ : ℝ
left✝¹ : k₁ < 0
hab : b -ᵥ p = k₁ • (a -ᵥ p)
k₂ : ℝ
left✝ : k₂ < 0
hcd : d -ᵥ p = k₂ • (c -ᵥ p)
⊢ k₁ ≠ 1
[PROOFSTEP]
linarith
[GOAL]
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d p : P
h : Cospherical {a, b, c, d}
hapb : ∠ a p b = π
hcpd : ∠ c p d = π
k₁ : ℝ
left✝¹ : k₁ < 0
hab : b -ᵥ p = k₁ • (a -ᵥ p)
k₂ : ℝ
left✝ : k₂ < 0
hcd : d -ᵥ p = k₂ • (c -ᵥ p)
⊢ k₂ ≠ 1
[PROOFSTEP]
linarith
[GOAL]
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d p : P
h : Cospherical {a, b, c, d}
hab : a ≠ b
hcd : c ≠ d
hapb : ∠ a p b = 0
hcpd : ∠ c p d = 0
⊢ dist a p * dist b p = dist c p * dist d p
[PROOFSTEP]
obtain ⟨-, k₁, -, hab₁⟩ := angle_eq_zero_iff.mp hapb
[GOAL]
case intro.intro.intro
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d p : P
h : Cospherical {a, b, c, d}
hab : a ≠ b
hcd : c ≠ d
hapb : ∠ a p b = 0
hcpd : ∠ c p d = 0
k₁ : ℝ
hab₁ : b -ᵥ p = k₁ • (a -ᵥ p)
⊢ dist a p * dist b p = dist c p * dist d p
[PROOFSTEP]
obtain ⟨-, k₂, -, hcd₁⟩ := angle_eq_zero_iff.mp hcpd
[GOAL]
case intro.intro.intro.intro.intro.intro
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d p : P
h : Cospherical {a, b, c, d}
hab : a ≠ b
hcd : c ≠ d
hapb : ∠ a p b = 0
hcpd : ∠ c p d = 0
k₁ : ℝ
hab₁ : b -ᵥ p = k₁ • (a -ᵥ p)
k₂ : ℝ
hcd₁ : d -ᵥ p = k₂ • (c -ᵥ p)
⊢ dist a p * dist b p = dist c p * dist d p
[PROOFSTEP]
refine' mul_dist_eq_mul_dist_of_cospherical h ⟨k₁, _, hab₁⟩ ⟨k₂, _, hcd₁⟩
[GOAL]
case intro.intro.intro.intro.intro.intro.refine'_1
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d p : P
h : Cospherical {a, b, c, d}
hab : a ≠ b
hcd : c ≠ d
hapb : ∠ a p b = 0
hcpd : ∠ c p d = 0
k₁ : ℝ
hab₁ : b -ᵥ p = k₁ • (a -ᵥ p)
k₂ : ℝ
hcd₁ : d -ᵥ p = k₂ • (c -ᵥ p)
⊢ k₁ ≠ 1
[PROOFSTEP]
by_contra hnot
[GOAL]
case intro.intro.intro.intro.intro.intro.refine'_2
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d p : P
h : Cospherical {a, b, c, d}
hab : a ≠ b
hcd : c ≠ d
hapb : ∠ a p b = 0
hcpd : ∠ c p d = 0
k₁ : ℝ
hab₁ : b -ᵥ p = k₁ • (a -ᵥ p)
k₂ : ℝ
hcd₁ : d -ᵥ p = k₂ • (c -ᵥ p)
⊢ k₂ ≠ 1
[PROOFSTEP]
by_contra hnot
[GOAL]
case intro.intro.intro.intro.intro.intro.refine'_1
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d p : P
h : Cospherical {a, b, c, d}
hab : a ≠ b
hcd : c ≠ d
hapb : ∠ a p b = 0
hcpd : ∠ c p d = 0
k₁ : ℝ
hab₁ : b -ᵥ p = k₁ • (a -ᵥ p)
k₂ : ℝ
hcd₁ : d -ᵥ p = k₂ • (c -ᵥ p)
hnot : k₁ = 1
⊢ False
[PROOFSTEP]
simp_all only [Classical.not_not, one_smul]
[GOAL]
case intro.intro.intro.intro.intro.intro.refine'_2
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d p : P
h : Cospherical {a, b, c, d}
hab : a ≠ b
hcd : c ≠ d
hapb : ∠ a p b = 0
hcpd : ∠ c p d = 0
k₁ : ℝ
hab₁ : b -ᵥ p = k₁ • (a -ᵥ p)
k₂ : ℝ
hcd₁ : d -ᵥ p = k₂ • (c -ᵥ p)
hnot : k₂ = 1
⊢ False
[PROOFSTEP]
simp_all only [Classical.not_not, one_smul]
[GOAL]
case intro.intro.intro.intro.intro.intro.refine'_1
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d p : P
h : Cospherical {a, b, c, d}
hab : a ≠ b
hcd : c ≠ d
hapb : ∠ a p b = 0
hcpd : ∠ c p d = 0
k₁ k₂ : ℝ
hab₁ : b -ᵥ p = a -ᵥ p
hcd₁ : d -ᵥ p = k₂ • (c -ᵥ p)
hnot : k₁ = 1
⊢ False
case intro.intro.intro.intro.intro.intro.refine'_2
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d p : P
h : Cospherical {a, b, c, d}
hab : a ≠ b
hcd : c ≠ d
hapb : ∠ a p b = 0
hcpd : ∠ c p d = 0
k₁ : ℝ
hab₁ : b -ᵥ p = k₁ • (a -ᵥ p)
k₂ : ℝ
hcd₁ : d -ᵥ p = c -ᵥ p
hnot : k₂ = 1
⊢ False
[PROOFSTEP]
exacts [hab (vsub_left_cancel hab₁).symm, hcd (vsub_left_cancel hcd₁).symm]


[GOAL]
E : Type u_1
F : Type u_2
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : NormedAddCommGroup F
inst✝ : InnerProductSpace ℝ F
c x : E → F
R : E → ℝ
s : Set E
a : E
n : ℕ∞
hc : DifferentiableAt ℝ c a
hR : DifferentiableAt ℝ R a
hx : DifferentiableAt ℝ x a
hne : x a ≠ c a
⊢ DifferentiableAt ℝ (fun a => inversion (c a) (R a) (x a)) a
[PROOFSTEP]
rw [← differentiableWithinAt_univ] at *
[GOAL]
E : Type u_1
F : Type u_2
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : NormedAddCommGroup F
inst✝ : InnerProductSpace ℝ F
c x : E → F
R : E → ℝ
s : Set E
a : E
n : ℕ∞
hc : DifferentiableWithinAt ℝ c univ a
hR : DifferentiableWithinAt ℝ R univ a
hx : DifferentiableWithinAt ℝ x univ a
hne : x a ≠ c a
⊢ DifferentiableWithinAt ℝ (fun a => inversion (c a) (R a) (x a)) univ a
[PROOFSTEP]
exact hc.inversion hR hx hne
[GOAL]
E : Type u_1
F : Type u_2
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : NormedAddCommGroup F
inst✝ : InnerProductSpace ℝ F
a b c d x y z : F
r R : ℝ
hx : x ≠ c
⊢ HasFDerivAt (inversion c R)
    ((R / dist x c) ^ 2 • ↑(ContinuousLinearEquiv.mk (reflection (Submodule.span ℝ {x - c})ᗮ).toLinearEquiv)) x
[PROOFSTEP]
rcases add_left_surjective c x with ⟨x, rfl⟩
[GOAL]
case intro
E : Type u_1
F : Type u_2
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : NormedAddCommGroup F
inst✝ : InnerProductSpace ℝ F
a b c d y z : F
r R : ℝ
x : F
hx : (fun x x_1 => x + x_1) c x ≠ c
⊢ HasFDerivAt (inversion c R)
    ((R / dist ((fun x x_1 => x + x_1) c x) c) ^ 2 •
      ↑(ContinuousLinearEquiv.mk (reflection (Submodule.span ℝ {(fun x x_1 => x + x_1) c x - c})ᗮ).toLinearEquiv))
    ((fun x x_1 => x + x_1) c x)
[PROOFSTEP]
have : HasFDerivAt (inversion c R) (_ : F →L[ℝ] F) (c + x)
[GOAL]
case this
E : Type u_1
F : Type u_2
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : NormedAddCommGroup F
inst✝ : InnerProductSpace ℝ F
a b c d y z : F
r R : ℝ
x : F
hx : (fun x x_1 => x + x_1) c x ≠ c
⊢ HasFDerivAt (inversion c R) ?m.24683 (c + x)
[PROOFSTEP]
simp_rw [inversion, dist_eq_norm, div_pow, div_eq_mul_inv]
[GOAL]
case this
E : Type u_1
F : Type u_2
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : NormedAddCommGroup F
inst✝ : InnerProductSpace ℝ F
a b c d y z : F
r R : ℝ
x : F
hx : (fun x x_1 => x + x_1) c x ≠ c
⊢ HasFDerivAt (fun x => (R ^ 2 * (‖x - c‖ ^ 2)⁻¹) • (x -ᵥ c) +ᵥ c) ?m.24683 (c + x)
[PROOFSTEP]
have A := (hasFDerivAt_id (𝕜 := ℝ) (c + x)).sub_const c
[GOAL]
case this
E : Type u_1
F : Type u_2
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : NormedAddCommGroup F
inst✝ : InnerProductSpace ℝ F
a b c d y z : F
r R : ℝ
x : F
hx : (fun x x_1 => x + x_1) c x ≠ c
A : HasFDerivAt (fun x => _root_.id x - c) (ContinuousLinearMap.id ℝ F) (c + x)
⊢ HasFDerivAt (fun x => (R ^ 2 * (‖x - c‖ ^ 2)⁻¹) • (x -ᵥ c) +ᵥ c) ?m.24683 (c + x)
[PROOFSTEP]
have B := ((hasDerivAt_inv <| by simpa using hx).comp_hasFDerivAt _ A.norm_sq).const_mul (R ^ 2)
[GOAL]
E : Type u_1
F : Type u_2
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : NormedAddCommGroup F
inst✝ : InnerProductSpace ℝ F
a b c d y z : F
r R : ℝ
x : F
hx : (fun x x_1 => x + x_1) c x ≠ c
A : HasFDerivAt (fun x => _root_.id x - c) (ContinuousLinearMap.id ℝ F) (c + x)
⊢ ‖_root_.id (c + x) - c‖ ^ 2 ≠ 0
[PROOFSTEP]
simpa using hx
[GOAL]
case this
E : Type u_1
F : Type u_2
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : NormedAddCommGroup F
inst✝ : InnerProductSpace ℝ F
a b c d y z : F
r R : ℝ
x : F
hx : (fun x x_1 => x + x_1) c x ≠ c
A : HasFDerivAt (fun x => _root_.id x - c) (ContinuousLinearMap.id ℝ F) (c + x)
B :
  HasFDerivAt (fun y => R ^ 2 * ((fun y => y⁻¹) ∘ fun x => ‖_root_.id x - c‖ ^ 2) y)
    (R ^ 2 •
      -((‖_root_.id (c + x) - c‖ ^ 2) ^ 2)⁻¹ •
        2 • ContinuousLinearMap.comp (↑(innerSL ℝ) (_root_.id (c + x) - c)) (ContinuousLinearMap.id ℝ F))
    (c + x)
⊢ HasFDerivAt (fun x => (R ^ 2 * (‖x - c‖ ^ 2)⁻¹) • (x -ᵥ c) +ᵥ c) ?m.24683 (c + x)
[PROOFSTEP]
exact (B.smul A).add_const c
[GOAL]
case intro
E : Type u_1
F : Type u_2
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : NormedAddCommGroup F
inst✝ : InnerProductSpace ℝ F
a b c d y z : F
r R : ℝ
x : F
hx : (fun x x_1 => x + x_1) c x ≠ c
this :
  HasFDerivAt (inversion c R)
    ((R ^ 2 * ((fun y => y⁻¹) ∘ fun x => ‖_root_.id x - c‖ ^ 2) (c + x)) • ContinuousLinearMap.id ℝ F +
      ContinuousLinearMap.smulRight
        (R ^ 2 •
          -((‖_root_.id (c + x) - c‖ ^ 2) ^ 2)⁻¹ •
            2 • ContinuousLinearMap.comp (↑(innerSL ℝ) (_root_.id (c + x) - c)) (ContinuousLinearMap.id ℝ F))
        (_root_.id (c + x) - c))
    (c + x)
⊢ HasFDerivAt (inversion c R)
    ((R / dist ((fun x x_1 => x + x_1) c x) c) ^ 2 •
      ↑(ContinuousLinearEquiv.mk (reflection (Submodule.span ℝ {(fun x x_1 => x + x_1) c x - c})ᗮ).toLinearEquiv))
    ((fun x x_1 => x + x_1) c x)
[PROOFSTEP]
refine
  this.congr_fderiv
    (LinearMap.ext_on_codisjoint (Submodule.isCompl_orthogonal_of_completeSpace (K := ℝ ∙ x)).codisjoint
      (LinearMap.eqOn_span' ?_) fun y hy ↦ ?_)
[GOAL]
case intro.refine_1
E : Type u_1
F : Type u_2
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : NormedAddCommGroup F
inst✝ : InnerProductSpace ℝ F
a b c d y z : F
r R : ℝ
x : F
hx : (fun x x_1 => x + x_1) c x ≠ c
this :
  HasFDerivAt (inversion c R)
    ((R ^ 2 * ((fun y => y⁻¹) ∘ fun x => ‖_root_.id x - c‖ ^ 2) (c + x)) • ContinuousLinearMap.id ℝ F +
      ContinuousLinearMap.smulRight
        (R ^ 2 •
          -((‖_root_.id (c + x) - c‖ ^ 2) ^ 2)⁻¹ •
            2 • ContinuousLinearMap.comp (↑(innerSL ℝ) (_root_.id (c + x) - c)) (ContinuousLinearMap.id ℝ F))
        (_root_.id (c + x) - c))
    (c + x)
⊢ EqOn
    ↑((R ^ 2 * ((fun y => y⁻¹) ∘ fun x => ‖_root_.id x - c‖ ^ 2) (c + x)) • ContinuousLinearMap.id ℝ F +
        ContinuousLinearMap.smulRight
          (R ^ 2 •
            -((‖_root_.id (c + x) - c‖ ^ 2) ^ 2)⁻¹ •
              2 • ContinuousLinearMap.comp (↑(innerSL ℝ) (_root_.id (c + x) - c)) (ContinuousLinearMap.id ℝ F))
          (_root_.id (c + x) - c))
    ↑((R / dist ((fun x x_1 => x + x_1) c x) c) ^ 2 •
        ↑(ContinuousLinearEquiv.mk (reflection (Submodule.span ℝ {(fun x x_1 => x + x_1) c x - c})ᗮ).toLinearEquiv))
    {x}
[PROOFSTEP]
have : ((‖x‖ ^ 2) ^ 2)⁻¹ * (‖x‖ ^ 2) = (‖x‖ ^ 2)⁻¹
[GOAL]
case this
E : Type u_1
F : Type u_2
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : NormedAddCommGroup F
inst✝ : InnerProductSpace ℝ F
a b c d y z : F
r R : ℝ
x : F
hx : (fun x x_1 => x + x_1) c x ≠ c
this :
  HasFDerivAt (inversion c R)
    ((R ^ 2 * ((fun y => y⁻¹) ∘ fun x => ‖_root_.id x - c‖ ^ 2) (c + x)) • ContinuousLinearMap.id ℝ F +
      ContinuousLinearMap.smulRight
        (R ^ 2 •
          -((‖_root_.id (c + x) - c‖ ^ 2) ^ 2)⁻¹ •
            2 • ContinuousLinearMap.comp (↑(innerSL ℝ) (_root_.id (c + x) - c)) (ContinuousLinearMap.id ℝ F))
        (_root_.id (c + x) - c))
    (c + x)
⊢ ((‖x‖ ^ 2) ^ 2)⁻¹ * ‖x‖ ^ 2 = (‖x‖ ^ 2)⁻¹
[PROOFSTEP]
rw [← div_eq_inv_mul, sq (‖x‖ ^ 2), div_self_mul_self']
[GOAL]
case intro.refine_1
E : Type u_1
F : Type u_2
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : NormedAddCommGroup F
inst✝ : InnerProductSpace ℝ F
a b c d y z : F
r R : ℝ
x : F
hx : (fun x x_1 => x + x_1) c x ≠ c
this✝ :
  HasFDerivAt (inversion c R)
    ((R ^ 2 * ((fun y => y⁻¹) ∘ fun x => ‖_root_.id x - c‖ ^ 2) (c + x)) • ContinuousLinearMap.id ℝ F +
      ContinuousLinearMap.smulRight
        (R ^ 2 •
          -((‖_root_.id (c + x) - c‖ ^ 2) ^ 2)⁻¹ •
            2 • ContinuousLinearMap.comp (↑(innerSL ℝ) (_root_.id (c + x) - c)) (ContinuousLinearMap.id ℝ F))
        (_root_.id (c + x) - c))
    (c + x)
this : ((‖x‖ ^ 2) ^ 2)⁻¹ * ‖x‖ ^ 2 = (‖x‖ ^ 2)⁻¹
⊢ EqOn
    ↑((R ^ 2 * ((fun y => y⁻¹) ∘ fun x => ‖_root_.id x - c‖ ^ 2) (c + x)) • ContinuousLinearMap.id ℝ F +
        ContinuousLinearMap.smulRight
          (R ^ 2 •
            -((‖_root_.id (c + x) - c‖ ^ 2) ^ 2)⁻¹ •
              2 • ContinuousLinearMap.comp (↑(innerSL ℝ) (_root_.id (c + x) - c)) (ContinuousLinearMap.id ℝ F))
          (_root_.id (c + x) - c))
    ↑((R / dist ((fun x x_1 => x + x_1) c x) c) ^ 2 •
        ↑(ContinuousLinearEquiv.mk (reflection (Submodule.span ℝ {(fun x x_1 => x + x_1) c x - c})ᗮ).toLinearEquiv))
    {x}
[PROOFSTEP]
simp [reflection_orthogonalComplement_singleton_eq_neg, real_inner_self_eq_norm_sq, two_mul, this, div_eq_mul_inv,
  mul_add, add_smul, mul_pow]
[GOAL]
case intro.refine_2
E : Type u_1
F : Type u_2
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : NormedAddCommGroup F
inst✝ : InnerProductSpace ℝ F
a b c d y✝ z : F
r R : ℝ
x : F
hx : (fun x x_1 => x + x_1) c x ≠ c
this :
  HasFDerivAt (inversion c R)
    ((R ^ 2 * ((fun y => y⁻¹) ∘ fun x => ‖_root_.id x - c‖ ^ 2) (c + x)) • ContinuousLinearMap.id ℝ F +
      ContinuousLinearMap.smulRight
        (R ^ 2 •
          -((‖_root_.id (c + x) - c‖ ^ 2) ^ 2)⁻¹ •
            2 • ContinuousLinearMap.comp (↑(innerSL ℝ) (_root_.id (c + x) - c)) (ContinuousLinearMap.id ℝ F))
        (_root_.id (c + x) - c))
    (c + x)
y : F
hy : y ∈ ↑(Submodule.span ℝ {x})ᗮ
⊢ ↑((R ^ 2 * ((fun y => y⁻¹) ∘ fun x => ‖_root_.id x - c‖ ^ 2) (c + x)) • ContinuousLinearMap.id ℝ F +
          ContinuousLinearMap.smulRight
            (R ^ 2 •
              -((‖_root_.id (c + x) - c‖ ^ 2) ^ 2)⁻¹ •
                2 • ContinuousLinearMap.comp (↑(innerSL ℝ) (_root_.id (c + x) - c)) (ContinuousLinearMap.id ℝ F))
            (_root_.id (c + x) - c))
      y =
    ↑((R / dist ((fun x x_1 => x + x_1) c x) c) ^ 2 •
          ↑(ContinuousLinearEquiv.mk (reflection (Submodule.span ℝ {(fun x x_1 => x + x_1) c x - c})ᗮ).toLinearEquiv))
      y
[PROOFSTEP]
simp [Submodule.mem_orthogonal_singleton_iff_inner_right.1 hy, reflection_mem_subspace_eq_self hy, div_eq_mul_inv,
  mul_pow]


[GOAL]
E : Type u_1
F : Type u_2
inst✝³ : NormedAddCommGroup E
inst✝² : NormedAddCommGroup F
inst✝¹ : InnerProductSpace ℝ E
inst✝ : InnerProductSpace ℝ F
f' : E →L[ℝ] F
h : IsConformalMap f'
u v : E
⊢ angle (↑f' u) (↑f' v) = angle u v
[PROOFSTEP]
obtain ⟨c, hc, li, rfl⟩ := h
[GOAL]
case intro.intro.intro
E : Type u_1
F : Type u_2
inst✝³ : NormedAddCommGroup E
inst✝² : NormedAddCommGroup F
inst✝¹ : InnerProductSpace ℝ E
inst✝ : InnerProductSpace ℝ F
u v : E
c : ℝ
hc : c ≠ 0
li : E →ₗᵢ[ℝ] F
⊢ angle (↑(c • LinearIsometry.toContinuousLinearMap li) u) (↑(c • LinearIsometry.toContinuousLinearMap li) v) =
    angle u v
[PROOFSTEP]
exact (angle_smul_smul hc _ _).trans (li.angle_map _ _)


[GOAL]
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c✝ d x y z : P
r R✝ : ℝ
c : P
R : ℝ
⊢ inversion c R c = c
[PROOFSTEP]
simp [inversion]
[GOAL]
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c✝ d x✝ y z : P
r R : ℝ
c x : P
⊢ inversion c 0 x = c
[PROOFSTEP]
simp [inversion]
[GOAL]
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a✝ b c✝ d x✝ y z : P
r R✝ : ℝ
c : P
a R : ℝ
x : P
⊢ inversion c (a * R) x = ↑(homothety c (a ^ 2)) (inversion c R x)
[PROOFSTEP]
simp only [inversion_eq_lineMap, ← homothety_eq_lineMap, ← homothety_mul_apply, mul_div_assoc, mul_pow]
[GOAL]
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c✝ d x✝ y z : P
r R : ℝ
c x : P
⊢ inversion c (dist x c) x = x
[PROOFSTEP]
rcases eq_or_ne x c with (rfl | hne)
[GOAL]
case inl
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d x✝ y z : P
r R : ℝ
x : P
⊢ inversion x (dist x x) x = x
[PROOFSTEP]
apply inversion_self
[GOAL]
case inr
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c✝ d x✝ y z : P
r R : ℝ
c x : P
hne : x ≠ c
⊢ inversion c (dist x c) x = x
[PROOFSTEP]
rw [inversion, div_self, one_pow, one_smul, vsub_vadd]
[GOAL]
case inr
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c✝ d x✝ y z : P
r R : ℝ
c x : P
hne : x ≠ c
⊢ dist x c ≠ 0
[PROOFSTEP]
rwa [dist_ne_zero]
[GOAL]
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c✝ d x✝ y z : P
r R : ℝ
c x : P
⊢ inversion c (dist c x) x = x
[PROOFSTEP]
rw [dist_comm, inversion_dist_center]
[GOAL]
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c✝ d x✝ y z : P
r R✝ : ℝ
c x : P
R : ℝ
⊢ dist (inversion c R x) c = R ^ 2 / dist x c
[PROOFSTEP]
rcases eq_or_ne x c with (rfl | hx)
[GOAL]
case inl
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d x✝ y z : P
r R✝ : ℝ
x : P
R : ℝ
⊢ dist (inversion x R x) x = R ^ 2 / dist x x
[PROOFSTEP]
simp
[GOAL]
case inr
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c✝ d x✝ y z : P
r R✝ : ℝ
c x : P
R : ℝ
hx : x ≠ c
⊢ dist (inversion c R x) c = R ^ 2 / dist x c
[PROOFSTEP]
have : dist x c ≠ 0 := dist_ne_zero.2 hx
[GOAL]
case inr
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c✝ d x✝ y z : P
r R✝ : ℝ
c x : P
R : ℝ
hx : x ≠ c
this : dist x c ≠ 0
⊢ dist (inversion c R x) c = R ^ 2 / dist x c
[PROOFSTEP]
field_simp [inversion, norm_smul, abs_div, ← dist_eq_norm_vsub, sq, mul_assoc]
[GOAL]
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c✝ d x✝ y z : P
r R✝ : ℝ
c x : P
R : ℝ
⊢ dist c (inversion c R x) = R ^ 2 / dist c x
[PROOFSTEP]
rw [dist_comm c, dist_comm c, dist_inversion_center]
[GOAL]
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c✝ d x✝ y z : P
r R✝ : ℝ
c : P
R : ℝ
hR : R ≠ 0
x : P
⊢ inversion c R (inversion c R x) = x
[PROOFSTEP]
rcases eq_or_ne x c with (rfl | hne)
[GOAL]
case inl
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d x✝ y z : P
r R✝ R : ℝ
hR : R ≠ 0
x : P
⊢ inversion x R (inversion x R x) = x
[PROOFSTEP]
rw [inversion_self, inversion_self]
[GOAL]
case inr
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c✝ d x✝ y z : P
r R✝ : ℝ
c : P
R : ℝ
hR : R ≠ 0
x : P
hne : x ≠ c
⊢ inversion c R (inversion c R x) = x
[PROOFSTEP]
rw [inversion, dist_inversion_center, inversion_vsub_center, smul_smul, ← mul_pow, div_mul_div_comm,
  div_mul_cancel _ (dist_ne_zero.2 hne), ← sq, div_self, one_pow, one_smul, vsub_vadd]
[GOAL]
case inr
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c✝ d x✝ y z : P
r R✝ : ℝ
c : P
R : ℝ
hR : R ≠ 0
x : P
hne : x ≠ c
⊢ R ^ 2 ≠ 0
[PROOFSTEP]
exact pow_ne_zero _ hR
[GOAL]
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d x y z : P
r R : ℝ
⊢ inversion c R x = c ↔ x = c ∨ R = 0
[PROOFSTEP]
by_cases hR : R = 0
[GOAL]
case pos
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d x y z : P
r R : ℝ
hR : R = 0
⊢ inversion c R x = c ↔ x = c ∨ R = 0
[PROOFSTEP]
simp [inversion_eq_center, hR]
[GOAL]
case neg
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d x y z : P
r R : ℝ
hR : ¬R = 0
⊢ inversion c R x = c ↔ x = c ∨ R = 0
[PROOFSTEP]
simp [inversion_eq_center, hR]
[GOAL]
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d x y z : P
r R✝ : ℝ
hx : x ≠ c
hy : y ≠ c
R : ℝ
⊢ dist (inversion c R x) (inversion c R y) = R ^ 2 / (dist x c * dist y c) * dist x y
[PROOFSTEP]
dsimp only [inversion]
[GOAL]
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d x y z : P
r R✝ : ℝ
hx : x ≠ c
hy : y ≠ c
R : ℝ
⊢ dist ((R / dist x c) ^ 2 • (x -ᵥ c) +ᵥ c) ((R / dist y c) ^ 2 • (y -ᵥ c) +ᵥ c) =
    R ^ 2 / (dist x c * dist y c) * dist x y
[PROOFSTEP]
simp_rw [dist_vadd_cancel_right, dist_eq_norm_vsub V _ c]
[GOAL]
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d x y z : P
r R✝ : ℝ
hx : x ≠ c
hy : y ≠ c
R : ℝ
⊢ dist ((R / ‖x -ᵥ c‖) ^ 2 • (x -ᵥ c)) ((R / ‖y -ᵥ c‖) ^ 2 • (y -ᵥ c)) = R ^ 2 / (‖x -ᵥ c‖ * ‖y -ᵥ c‖) * dist x y
[PROOFSTEP]
simpa only [dist_vsub_cancel_right] using dist_div_norm_sq_smul (vsub_ne_zero.2 hx) (vsub_ne_zero.2 hy) R
[GOAL]
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d x y z : P
r R : ℝ
hx : x ≠ c
hy : y ≠ c
⊢ dist (inversion c R x) y * dist x c = dist x (inversion c R y) * dist y c
[PROOFSTEP]
rcases eq_or_ne R 0 with rfl | hR
[GOAL]
case inl
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d x y z : P
r : ℝ
hx : x ≠ c
hy : y ≠ c
⊢ dist (inversion c 0 x) y * dist x c = dist x (inversion c 0 y) * dist y c
[PROOFSTEP]
simp [dist_comm, mul_comm]
[GOAL]
case inr
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d x y z : P
r R : ℝ
hx : x ≠ c
hy : y ≠ c
hR : R ≠ 0
⊢ dist (inversion c R x) y * dist x c = dist x (inversion c R y) * dist y c
[PROOFSTEP]
have hy' : inversion c R y ≠ c := by simp [*]
[GOAL]
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d x y z : P
r R : ℝ
hx : x ≠ c
hy : y ≠ c
hR : R ≠ 0
⊢ inversion c R y ≠ c
[PROOFSTEP]
simp [*]
[GOAL]
case inr
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d x y z : P
r R : ℝ
hx : x ≠ c
hy : y ≠ c
hR : R ≠ 0
hy' : inversion c R y ≠ c
⊢ dist (inversion c R x) y * dist x c = dist x (inversion c R y) * dist y c
[PROOFSTEP]
conv in dist _ y => rw [← inversion_inversion c hR y]
[GOAL]
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d x y z : P
r R : ℝ
hx : x ≠ c
hy : y ≠ c
hR : R ≠ 0
hy' : inversion c R y ≠ c
| dist (inversion c R x) y
[PROOFSTEP]
rw [← inversion_inversion c hR y]
[GOAL]
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d x y z : P
r R : ℝ
hx : x ≠ c
hy : y ≠ c
hR : R ≠ 0
hy' : inversion c R y ≠ c
| dist (inversion c R x) y
[PROOFSTEP]
rw [← inversion_inversion c hR y]
[GOAL]
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d x y z : P
r R : ℝ
hx : x ≠ c
hy : y ≠ c
hR : R ≠ 0
hy' : inversion c R y ≠ c
| dist (inversion c R x) y
[PROOFSTEP]
rw [← inversion_inversion c hR y]
[GOAL]
case inr
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d x y z : P
r R : ℝ
hx : x ≠ c
hy : y ≠ c
hR : R ≠ 0
hy' : inversion c R y ≠ c
⊢ dist (inversion c R x) (inversion c R (inversion c R y)) * dist x c = dist x (inversion c R y) * dist y c
[PROOFSTEP]
rw [dist_inversion_inversion hx hy', dist_inversion_center]
[GOAL]
case inr
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d x y z : P
r R : ℝ
hx : x ≠ c
hy : y ≠ c
hR : R ≠ 0
hy' : inversion c R y ≠ c
⊢ R ^ 2 / (dist x c * (R ^ 2 / dist y c)) * dist x (inversion c R y) * dist x c = dist x (inversion c R y) * dist y c
[PROOFSTEP]
have : dist x c ≠ 0 := dist_ne_zero.2 hx
[GOAL]
case inr
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d x y z : P
r R : ℝ
hx : x ≠ c
hy : y ≠ c
hR : R ≠ 0
hy' : inversion c R y ≠ c
this : dist x c ≠ 0
⊢ R ^ 2 / (dist x c * (R ^ 2 / dist y c)) * dist x (inversion c R y) * dist x c = dist x (inversion c R y) * dist y c
[PROOFSTEP]
field_simp
[GOAL]
case inr
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d x y z : P
r R : ℝ
hx : x ≠ c
hy : y ≠ c
hR : R ≠ 0
hy' : inversion c R y ≠ c
this : dist x c ≠ 0
⊢ R ^ 2 * dist y c * dist x (inversion c R y) * dist x c = dist x (inversion c R y) * dist y c * (dist x c * R ^ 2)
[PROOFSTEP]
ring
[GOAL]
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a✝ b✝ c✝ d✝ x y z : P
r R : ℝ
a b c d : P
⊢ dist a c * dist b d ≤ dist a b * dist c d + dist b c * dist a d
[PROOFSTEP]
rcases eq_or_ne b a with (rfl | hb)
[GOAL]
case inl
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b✝ c✝ d✝ x y z : P
r R : ℝ
b c d : P
⊢ dist b c * dist b d ≤ dist b b * dist c d + dist b c * dist b d
[PROOFSTEP]
rw [dist_self, zero_mul, zero_add]
[GOAL]
case inr
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a✝ b✝ c✝ d✝ x y z : P
r R : ℝ
a b c d : P
hb : b ≠ a
⊢ dist a c * dist b d ≤ dist a b * dist c d + dist b c * dist a d
[PROOFSTEP]
rcases eq_or_ne c a with (rfl | hc)
[GOAL]
case inr.inl
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b✝ c✝ d✝ x y z : P
r R : ℝ
b c d : P
hb : b ≠ c
⊢ dist c c * dist b d ≤ dist c b * dist c d + dist b c * dist c d
[PROOFSTEP]
rw [dist_self, zero_mul]
[GOAL]
case inr.inl
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b✝ c✝ d✝ x y z : P
r R : ℝ
b c d : P
hb : b ≠ c
⊢ 0 ≤ dist c b * dist c d + dist b c * dist c d
[PROOFSTEP]
apply_rules [add_nonneg, mul_nonneg, dist_nonneg]
[GOAL]
case inr.inr
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a✝ b✝ c✝ d✝ x y z : P
r R : ℝ
a b c d : P
hb : b ≠ a
hc : c ≠ a
⊢ dist a c * dist b d ≤ dist a b * dist c d + dist b c * dist a d
[PROOFSTEP]
rcases eq_or_ne d a with (rfl | hd)
[GOAL]
case inr.inr.inl
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b✝ c✝ d✝ x y z : P
r R : ℝ
b c d : P
hb : b ≠ d
hc : c ≠ d
⊢ dist d c * dist b d ≤ dist d b * dist c d + dist b c * dist d d
[PROOFSTEP]
rw [dist_self, mul_zero, add_zero, dist_comm d, dist_comm d, mul_comm]
  /- Otherwise, we apply the triangle inequality to `EuclideanGeometry.inversion a 1 b`,
      `EuclideanGeometry.inversion a 1 c`, and `EuclideanGeometry.inversion a 1 d`. -/
[GOAL]
case inr.inr.inr
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a✝ b✝ c✝ d✝ x y z : P
r R : ℝ
a b c d : P
hb : b ≠ a
hc : c ≠ a
hd : d ≠ a
⊢ dist a c * dist b d ≤ dist a b * dist c d + dist b c * dist a d
[PROOFSTEP]
have H := dist_triangle (inversion a 1 b) (inversion a 1 c) (inversion a 1 d)
[GOAL]
case inr.inr.inr
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a✝ b✝ c✝ d✝ x y z : P
r R : ℝ
a b c d : P
hb : b ≠ a
hc : c ≠ a
hd : d ≠ a
H :
  dist (inversion a 1 b) (inversion a 1 d) ≤
    dist (inversion a 1 b) (inversion a 1 c) + dist (inversion a 1 c) (inversion a 1 d)
⊢ dist a c * dist b d ≤ dist a b * dist c d + dist b c * dist a d
[PROOFSTEP]
rw [dist_inversion_inversion hb hd, dist_inversion_inversion hb hc, dist_inversion_inversion hc hd, one_pow] at H
[GOAL]
case inr.inr.inr
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a✝ b✝ c✝ d✝ x y z : P
r R : ℝ
a b c d : P
hb : b ≠ a
hc : c ≠ a
hd : d ≠ a
H : 1 / (dist b a * dist d a) * dist b d ≤ 1 / (dist b a * dist c a) * dist b c + 1 / (dist c a * dist d a) * dist c d
⊢ dist a c * dist b d ≤ dist a b * dist c d + dist b c * dist a d
[PROOFSTEP]
rw [← dist_pos] at hb hc hd
[GOAL]
case inr.inr.inr
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a✝ b✝ c✝ d✝ x y z : P
r R : ℝ
a b c d : P
hb✝ : b ≠ a
hb : 0 < dist b a
hc✝ : c ≠ a
hc : 0 < dist c a
hd✝ : d ≠ a
hd : 0 < dist d a
H : 1 / (dist b a * dist d a) * dist b d ≤ 1 / (dist b a * dist c a) * dist b c + 1 / (dist c a * dist d a) * dist c d
⊢ dist a c * dist b d ≤ dist a b * dist c d + dist b c * dist a d
[PROOFSTEP]
rw [← div_le_div_right (mul_pos hb (mul_pos hc hd))]
[GOAL]
case inr.inr.inr
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a✝ b✝ c✝ d✝ x y z : P
r R : ℝ
a b c d : P
hb✝ : b ≠ a
hb : 0 < dist b a
hc✝ : c ≠ a
hc : 0 < dist c a
hd✝ : d ≠ a
hd : 0 < dist d a
H : 1 / (dist b a * dist d a) * dist b d ≤ 1 / (dist b a * dist c a) * dist b c + 1 / (dist c a * dist d a) * dist c d
⊢ dist a c * dist b d / (dist b a * (dist c a * dist d a)) ≤
    (dist a b * dist c d + dist b c * dist a d) / (dist b a * (dist c a * dist d a))
[PROOFSTEP]
convert H using 1
[GOAL]
case h.e'_3
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a✝ b✝ c✝ d✝ x y z : P
r R : ℝ
a b c d : P
hb✝ : b ≠ a
hb : 0 < dist b a
hc✝ : c ≠ a
hc : 0 < dist c a
hd✝ : d ≠ a
hd : 0 < dist d a
H : 1 / (dist b a * dist d a) * dist b d ≤ 1 / (dist b a * dist c a) * dist b c + 1 / (dist c a * dist d a) * dist c d
⊢ dist a c * dist b d / (dist b a * (dist c a * dist d a)) = 1 / (dist b a * dist d a) * dist b d
[PROOFSTEP]
field_simp [hb.ne', hc.ne', hd.ne', dist_comm a]
[GOAL]
case h.e'_3
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a✝ b✝ c✝ d✝ x y z : P
r R : ℝ
a b c d : P
hb✝ : b ≠ a
hb : 0 < dist b a
hc✝ : c ≠ a
hc : 0 < dist c a
hd✝ : d ≠ a
hd : 0 < dist d a
H : 1 / (dist b a * dist d a) * dist b d ≤ 1 / (dist b a * dist c a) * dist b c + 1 / (dist c a * dist d a) * dist c d
⊢ dist c a * dist b d * (dist b a * dist d a) = dist b d * (dist b a * (dist c a * dist d a))
[PROOFSTEP]
ring
[GOAL]
case h.e'_4
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a✝ b✝ c✝ d✝ x y z : P
r R : ℝ
a b c d : P
hb✝ : b ≠ a
hb : 0 < dist b a
hc✝ : c ≠ a
hc : 0 < dist c a
hd✝ : d ≠ a
hd : 0 < dist d a
H : 1 / (dist b a * dist d a) * dist b d ≤ 1 / (dist b a * dist c a) * dist b c + 1 / (dist c a * dist d a) * dist c d
⊢ (dist a b * dist c d + dist b c * dist a d) / (dist b a * (dist c a * dist d a)) =
    1 / (dist b a * dist c a) * dist b c + 1 / (dist c a * dist d a) * dist c d
[PROOFSTEP]
field_simp [hb.ne', hc.ne', hd.ne', dist_comm a]
[GOAL]
case h.e'_4
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a✝ b✝ c✝ d✝ x y z : P
r R : ℝ
a b c d : P
hb✝ : b ≠ a
hb : 0 < dist b a
hc✝ : c ≠ a
hc : 0 < dist c a
hd✝ : d ≠ a
hd : 0 < dist d a
H : 1 / (dist b a * dist d a) * dist b d ≤ 1 / (dist b a * dist c a) * dist b c + 1 / (dist c a * dist d a) * dist c d
⊢ (dist b a * dist c d + dist b c * dist d a) * (dist b a * dist c a * (dist c a * dist d a)) =
    (dist b c * (dist c a * dist d a) + dist c d * (dist b a * dist c a)) * (dist b a * (dist c a * dist d a))
[PROOFSTEP]
ring