geometry.euclidean.basicMathlib.Geometry.Euclidean.Basic

This file has been ported!

Changes since the initial port

The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.

Changes in mathlib3

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(last sync)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -143,7 +143,7 @@ theorem inner_vsub_vsub_of_dist_eq_of_dist_eq {c₁ c₂ p₁ p₂ : P} (hc₁ :
       skip
       rw [← vsub_sub_vsub_cancel_right p₂ p₁ c₁]
     rw [dist_comm p₁, dist_comm p₂, dist_eq_norm_vsub V _ p₁, dist_eq_norm_vsub V _ p₂, ←
-      real_inner_add_sub_eq_zero_iff] at hc₁ hc₂ 
+      real_inner_add_sub_eq_zero_iff] at hc₁ hc₂
     simp_rw [← neg_vsub_eq_vsub_rev c₁, ← neg_vsub_eq_vsub_rev c₂, sub_neg_eq_add, neg_add_eq_sub,
       hc₁, hc₂, sub_zero]
   simpa [inner_add_left, ← mul_two, (by norm_num : (2 : ℝ) ≠ 0)] using h
@@ -228,21 +228,21 @@ theorem eq_of_dist_eq_of_dist_eq_of_mem_of_finrank_eq_two {s : AffineSubspace 
       rw [← Fintype.coe_image_univ, hu]
       simp
       rfl
-    rw [← hbs, hr, Submodule.mem_span_insert] at hv 
+    rw [← hbs, hr, Submodule.mem_span_insert] at hv
     rcases hv with ⟨t₁, v', hv', hv⟩
-    rw [Submodule.mem_span_singleton] at hv' 
+    rw [Submodule.mem_span_singleton] at hv'
     rcases hv' with ⟨t₂, rfl⟩
     exact ⟨t₁, t₂, hv⟩
   rcases hv (p -ᵥ p₁) (vsub_mem_direction hps hp₁s) with ⟨t₁, t₂, hpt⟩
   simp only [hpt, inner_add_right, inner_smul_right, ho, MulZeroClass.mul_zero, add_zero,
-    mul_eq_zero, inner_self_eq_zero, vsub_eq_zero_iff_eq, hc.symm, or_false_iff] at hop 
-  rw [hop, zero_smul, zero_add, ← eq_vadd_iff_vsub_eq] at hpt 
+    mul_eq_zero, inner_self_eq_zero, vsub_eq_zero_iff_eq, hc.symm, or_false_iff] at hop
+  rw [hop, zero_smul, zero_add, ← eq_vadd_iff_vsub_eq] at hpt
   subst hpt
   have hp' : (p₂ -ᵥ p₁ : V) ≠ 0 := by simp [hp.symm]
   have hp₂ : dist ((1 : ℝ) • (p₂ -ᵥ p₁) +ᵥ p₁) c₁ = r₁ := by simp [hp₂c₁]
-  rw [← hp₁c₁, dist_smul_vadd_eq_dist _ _ hp'] at hpc₁ hp₂ 
-  simp only [one_ne_zero, false_or_iff] at hp₂ 
-  rw [hp₂.symm] at hpc₁ 
+  rw [← hp₁c₁, dist_smul_vadd_eq_dist _ _ hp'] at hpc₁ hp₂
+  simp only [one_ne_zero, false_or_iff] at hp₂
+  rw [hp₂.symm] at hpc₁
   cases hpc₁ <;> simp [hpc₁]
 #align euclidean_geometry.eq_of_dist_eq_of_dist_eq_of_mem_of_finrank_eq_two EuclideanGeometry.eq_of_dist_eq_of_dist_eq_of_mem_of_finrank_eq_two
 -/
@@ -372,7 +372,7 @@ def orthogonalProjection (s : AffineSubspace ℝ P) [Nonempty s] [CompleteSpace
       by
       rw [← inter_eq_singleton_orthogonal_projection_fn (v +ᵥ p)]
       exact Set.mem_inter hs ho
-    rw [Set.mem_singleton_iff] at hm 
+    rw [Set.mem_singleton_iff] at hm
     ext
     exact hm.symm
 #align euclidean_geometry.orthogonal_projection EuclideanGeometry.orthogonalProjection
@@ -456,7 +456,7 @@ theorem orthogonalProjection_eq_self_iff {s : AffineSubspace ℝ P} [Nonempty s]
   · exact fun h => h ▸ orthogonal_projection_mem p
   · intro h
     have hp : p ∈ (s : Set P) ∩ mk' p s.directionᗮ := ⟨h, self_mem_mk' p _⟩
-    rw [inter_eq_singleton_orthogonal_projection p] at hp 
+    rw [inter_eq_singleton_orthogonal_projection p] at hp
     symm
     exact hp
 #align euclidean_geometry.orthogonal_projection_eq_self_iff EuclideanGeometry.orthogonalProjection_eq_self_iff
@@ -556,7 +556,7 @@ theorem orthogonalProjection_vadd_eq_self {s : AffineSubspace ℝ P} [Nonempty s
     orthogonalProjection s (v +ᵥ p) = ⟨p, hp⟩ :=
   by
   have h := vsub_orthogonal_projection_mem_direction_orthogonal s (v +ᵥ p)
-  rw [vadd_vsub_assoc, Submodule.add_mem_iff_right _ hv] at h 
+  rw [vadd_vsub_assoc, Submodule.add_mem_iff_right _ hv] at h
   refine' (eq_of_vsub_eq_zero _).symm
   ext
   refine' Submodule.disjoint_def.1 s.direction.orthogonal_disjoint _ _ h
@@ -710,8 +710,8 @@ theorem reflection_eq_self_iff {s : AffineSubspace ℝ P} [Nonempty s] [Complete
   constructor
   · intro h
     rw [← @vsub_eq_zero_iff_eq V, vadd_vsub_assoc, ← two_smul ℝ (↑(orthogonalProjection s p) -ᵥ p),
-      smul_eq_zero] at h 
-    norm_num at h 
+      smul_eq_zero] at h
+    norm_num at h
     exact h
   · intro h
     simp [h]
@@ -732,8 +732,8 @@ theorem reflection_eq_iff_orthogonalProjection_eq (s₁ s₂ : AffineSubspace 
   · intro h
     rw [← @vsub_eq_zero_iff_eq V, vsub_vadd_eq_vsub_sub, vadd_vsub_assoc, add_comm, add_sub_assoc,
       vsub_sub_vsub_cancel_right, ←
-      two_smul ℝ ((orthogonalProjection s₁ p : P) -ᵥ orthogonalProjection s₂ p), smul_eq_zero] at h 
-    norm_num at h 
+      two_smul ℝ ((orthogonalProjection s₁ p : P) -ᵥ orthogonalProjection s₂ p), smul_eq_zero] at h
+    norm_num at h
     exact h
   · intro h
     rw [h]
@@ -757,7 +757,7 @@ reflection. -/
 theorem dist_reflection_eq_of_mem (s : AffineSubspace ℝ P) [Nonempty s] [CompleteSpace s.direction]
     {p₁ : P} (hp₁ : p₁ ∈ s) (p₂ : P) : dist p₁ (reflection s p₂) = dist p₁ p₂ :=
   by
-  rw [← reflection_eq_self_iff p₁] at hp₁ 
+  rw [← reflection_eq_self_iff p₁] at hp₁
   convert (reflection s).dist_map p₁ p₂
   rw [hp₁]
 #align euclidean_geometry.dist_reflection_eq_of_mem EuclideanGeometry.dist_reflection_eq_of_mem
Diff
@@ -3,8 +3,8 @@ Copyright (c) 2020 Joseph Myers. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Joseph Myers, Manuel Candales
 -/
-import Mathbin.Analysis.InnerProductSpace.Projection
-import Mathbin.Algebra.QuadraticDiscriminant
+import Analysis.InnerProductSpace.Projection
+import Algebra.QuadraticDiscriminant
 
 #align_import geometry.euclidean.basic from "leanprover-community/mathlib"@"0b7c740e25651db0ba63648fbae9f9d6f941e31b"
 
Diff
@@ -2,15 +2,12 @@
 Copyright (c) 2020 Joseph Myers. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Joseph Myers, Manuel Candales
-
-! This file was ported from Lean 3 source module geometry.euclidean.basic
-! leanprover-community/mathlib commit 0b7c740e25651db0ba63648fbae9f9d6f941e31b
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Analysis.InnerProductSpace.Projection
 import Mathbin.Algebra.QuadraticDiscriminant
 
+#align_import geometry.euclidean.basic from "leanprover-community/mathlib"@"0b7c740e25651db0ba63648fbae9f9d6f941e31b"
+
 /-!
 # Euclidean spaces
 
Diff
@@ -76,8 +76,6 @@ variable [NormedAddCommGroup V] [InnerProductSpace ℝ V] [MetricSpace P]
 
 variable [NormedAddTorsor V P]
 
-include V
-
 #print EuclideanGeometry.dist_left_midpoint_eq_dist_right_midpoint /-
 /-- The midpoint of the segment AB is the same distance from A as it is from B. -/
 theorem dist_left_midpoint_eq_dist_right_midpoint (p1 p2 : P) :
@@ -86,6 +84,7 @@ theorem dist_left_midpoint_eq_dist_right_midpoint (p1 p2 : P) :
 #align euclidean_geometry.dist_left_midpoint_eq_dist_right_midpoint EuclideanGeometry.dist_left_midpoint_eq_dist_right_midpoint
 -/
 
+#print EuclideanGeometry.inner_weightedVSub /-
 /-- The inner product of two vectors given with `weighted_vsub`, in
 terms of the pairwise distances. -/
 theorem inner_weightedVSub {ι₁ : Type _} {s₁ : Finset ι₁} {w₁ : ι₁ → ℝ} (p₁ : ι₁ → P)
@@ -100,7 +99,9 @@ theorem inner_weightedVSub {ι₁ : Type _} {s₁ : Finset ι₁} {w₁ : ι₁
   simp_rw [vsub_sub_vsub_cancel_right]
   rcongr (i₁ i₂) <;> rw [dist_eq_norm_vsub V (p₁ i₁) (p₂ i₂)]
 #align euclidean_geometry.inner_weighted_vsub EuclideanGeometry.inner_weightedVSub
+-/
 
+#print EuclideanGeometry.dist_affineCombination /-
 /-- The distance between two points given with `affine_combination`,
 in terms of the pairwise distances between the points in that
 combination. -/
@@ -120,7 +121,9 @@ theorem dist_affineCombination {ι : Type _} {s : Finset ι} {w₁ w₂ : ι →
     simp_rw [Pi.sub_apply, Finset.sum_sub_distrib, h₁, h₂, sub_self]
   exact inner_weighted_vsub p h p h
 #align euclidean_geometry.dist_affine_combination EuclideanGeometry.dist_affineCombination
+-/
 
+#print EuclideanGeometry.inner_vsub_vsub_of_dist_eq_of_dist_eq /-
 /-- Suppose that `c₁` is equidistant from `p₁` and `p₂`, and the same
 applies to `c₂`.  Then the vector between `c₁` and `c₂` is orthogonal
 to that between `p₁` and `p₂`.  (In two dimensions, this says that the
@@ -148,7 +151,9 @@ theorem inner_vsub_vsub_of_dist_eq_of_dist_eq {c₁ c₂ p₁ p₂ : P} (hc₁ :
       hc₁, hc₂, sub_zero]
   simpa [inner_add_left, ← mul_two, (by norm_num : (2 : ℝ) ≠ 0)] using h
 #align euclidean_geometry.inner_vsub_vsub_of_dist_eq_of_dist_eq EuclideanGeometry.inner_vsub_vsub_of_dist_eq_of_dist_eq
+-/
 
+#print EuclideanGeometry.dist_smul_vadd_sq /-
 /-- The squared distance between points on a line (expressed as a
 multiple of a fixed vector added to a point) and another point,
 expressed as a quadratic. -/
@@ -160,7 +165,9 @@ theorem dist_smul_vadd_sq (r : ℝ) (v : V) (p₁ p₂ : P) :
     real_inner_add_add_self, real_inner_smul_left, real_inner_smul_left, real_inner_smul_right]
   ring
 #align euclidean_geometry.dist_smul_vadd_sq EuclideanGeometry.dist_smul_vadd_sq
+-/
 
+#print EuclideanGeometry.dist_smul_vadd_eq_dist /-
 /-- The condition for two points on a line to be equidistant from
 another point. -/
 theorem dist_smul_vadd_eq_dist {v : V} (p₁ p₂ : P) (hv : v ≠ 0) (r : ℝ) :
@@ -177,9 +184,11 @@ theorem dist_smul_vadd_eq_dist {v : V} (p₁ p₂ : P) (hv : v ≠ 0) (r : ℝ)
     mul_div_assoc]
   norm_num
 #align euclidean_geometry.dist_smul_vadd_eq_dist EuclideanGeometry.dist_smul_vadd_eq_dist
+-/
 
 open AffineSubspace FiniteDimensional
 
+#print EuclideanGeometry.eq_of_dist_eq_of_dist_eq_of_mem_of_finrank_eq_two /-
 /-- Distances `r₁` `r₂` of `p` from two different points `c₁` `c₂` determine at
 most two points `p₁` `p₂` in a two-dimensional subspace containing those points
 (two circles intersect in at most two points). -/
@@ -239,7 +248,9 @@ theorem eq_of_dist_eq_of_dist_eq_of_mem_of_finrank_eq_two {s : AffineSubspace 
   rw [hp₂.symm] at hpc₁ 
   cases hpc₁ <;> simp [hpc₁]
 #align euclidean_geometry.eq_of_dist_eq_of_dist_eq_of_mem_of_finrank_eq_two EuclideanGeometry.eq_of_dist_eq_of_dist_eq_of_mem_of_finrank_eq_two
+-/
 
+#print EuclideanGeometry.eq_of_dist_eq_of_dist_eq_of_finrank_eq_two /-
 /-- Distances `r₁` `r₂` of `p` from two different points `c₁` `c₂` determine at
 most two points `p₁` `p₂` in two-dimensional space (two circles intersect in at
 most two points). -/
@@ -254,6 +265,7 @@ theorem eq_of_dist_eq_of_dist_eq_of_finrank_eq_two [FiniteDimensional ℝ V] (hd
   eq_of_dist_eq_of_dist_eq_of_mem_of_finrank_eq_two hd' (mem_top ℝ V _) (mem_top ℝ V _)
     (mem_top ℝ V _) (mem_top ℝ V _) (mem_top ℝ V _) hc hp hp₁c₁ hp₂c₁ hpc₁ hp₁c₂ hp₂c₂ hpc₂
 #align euclidean_geometry.eq_of_dist_eq_of_dist_eq_of_finrank_eq_two EuclideanGeometry.eq_of_dist_eq_of_dist_eq_of_finrank_eq_two
+-/
 
 variable {V}
 
@@ -274,6 +286,7 @@ def orthogonalProjectionFn (s : AffineSubspace ℝ P) [Nonempty s] [CompleteSpac
 #align euclidean_geometry.orthogonal_projection_fn EuclideanGeometry.orthogonalProjectionFn
 -/
 
+#print EuclideanGeometry.inter_eq_singleton_orthogonalProjectionFn /-
 /-- The intersection of the subspace and the orthogonal subspace
 through the given point is the `orthogonal_projection_fn` of that
 point onto the subspace.  This lemma is only intended for use in
@@ -289,7 +302,9 @@ theorem inter_eq_singleton_orthogonalProjectionFn {s : AffineSubspace ℝ P} [No
         rw [direction_mk' p s.directionᗮ]
         exact Submodule.isCompl_orthogonal_of_completeSpace)
 #align euclidean_geometry.inter_eq_singleton_orthogonal_projection_fn EuclideanGeometry.inter_eq_singleton_orthogonalProjectionFn
+-/
 
+#print EuclideanGeometry.orthogonalProjectionFn_mem /-
 /-- The `orthogonal_projection_fn` lies in the given subspace.  This
 lemma is only intended for use in setting up the bundled version and
 should not be used once that is defined. -/
@@ -299,7 +314,9 @@ theorem orthogonalProjectionFn_mem {s : AffineSubspace ℝ P} [Nonempty s] [Comp
   rw [← mem_coe, ← Set.singleton_subset_iff, ← inter_eq_singleton_orthogonal_projection_fn]
   exact Set.inter_subset_left _ _
 #align euclidean_geometry.orthogonal_projection_fn_mem EuclideanGeometry.orthogonalProjectionFn_mem
+-/
 
+#print EuclideanGeometry.orthogonalProjectionFn_mem_orthogonal /-
 /-- The `orthogonal_projection_fn` lies in the orthogonal
 subspace.  This lemma is only intended for use in setting up the
 bundled version and should not be used once that is defined. -/
@@ -309,7 +326,9 @@ theorem orthogonalProjectionFn_mem_orthogonal {s : AffineSubspace ℝ P} [Nonemp
   rw [← mem_coe, ← Set.singleton_subset_iff, ← inter_eq_singleton_orthogonal_projection_fn]
   exact Set.inter_subset_right _ _
 #align euclidean_geometry.orthogonal_projection_fn_mem_orthogonal EuclideanGeometry.orthogonalProjectionFn_mem_orthogonal
+-/
 
+#print EuclideanGeometry.orthogonalProjectionFn_vsub_mem_direction_orthogonal /-
 /-- Subtracting `p` from its `orthogonal_projection_fn` produces a
 result in the orthogonal direction.  This lemma is only intended for
 use in setting up the bundled version and should not be used once that
@@ -319,6 +338,7 @@ theorem orthogonalProjectionFn_vsub_mem_direction_orthogonal {s : AffineSubspace
   direction_mk' p s.directionᗮ ▸
     vsub_mem_direction (orthogonalProjectionFn_mem_orthogonal p) (self_mem_mk' _ _)
 #align euclidean_geometry.orthogonal_projection_fn_vsub_mem_direction_orthogonal EuclideanGeometry.orthogonalProjectionFn_vsub_mem_direction_orthogonal
+-/
 
 attribute [local instance] AffineSubspace.toAddTorsor
 
@@ -361,12 +381,15 @@ def orthogonalProjection (s : AffineSubspace ℝ P) [Nonempty s] [CompleteSpace
 #align euclidean_geometry.orthogonal_projection EuclideanGeometry.orthogonalProjection
 -/
 
+#print EuclideanGeometry.orthogonalProjectionFn_eq /-
 @[simp]
 theorem orthogonalProjectionFn_eq {s : AffineSubspace ℝ P} [Nonempty s] [CompleteSpace s.direction]
     (p : P) : orthogonalProjectionFn s p = orthogonalProjection s p :=
   rfl
 #align euclidean_geometry.orthogonal_projection_fn_eq EuclideanGeometry.orthogonalProjectionFn_eq
+-/
 
+#print EuclideanGeometry.orthogonalProjection_linear /-
 /-- The linear map corresponding to `orthogonal_projection`. -/
 @[simp]
 theorem orthogonalProjection_linear {s : AffineSubspace ℝ P} [Nonempty s]
@@ -374,7 +397,9 @@ theorem orthogonalProjection_linear {s : AffineSubspace ℝ P} [Nonempty s]
     (orthogonalProjection s).linear = orthogonalProjection s.direction :=
   rfl
 #align euclidean_geometry.orthogonal_projection_linear EuclideanGeometry.orthogonalProjection_linear
+-/
 
+#print EuclideanGeometry.inter_eq_singleton_orthogonalProjection /-
 /-- The intersection of the subspace and the orthogonal subspace
 through the given point is the `orthogonal_projection` of that point
 onto the subspace. -/
@@ -385,19 +410,25 @@ theorem inter_eq_singleton_orthogonalProjection {s : AffineSubspace ℝ P} [None
   rw [← orthogonalProjectionFn_eq]
   exact inter_eq_singleton_orthogonal_projection_fn p
 #align euclidean_geometry.inter_eq_singleton_orthogonal_projection EuclideanGeometry.inter_eq_singleton_orthogonalProjection
+-/
 
+#print EuclideanGeometry.orthogonalProjection_mem /-
 /-- The `orthogonal_projection` lies in the given subspace. -/
 theorem orthogonalProjection_mem {s : AffineSubspace ℝ P} [Nonempty s] [CompleteSpace s.direction]
     (p : P) : ↑(orthogonalProjection s p) ∈ s :=
   (orthogonalProjection s p).2
 #align euclidean_geometry.orthogonal_projection_mem EuclideanGeometry.orthogonalProjection_mem
+-/
 
+#print EuclideanGeometry.orthogonalProjection_mem_orthogonal /-
 /-- The `orthogonal_projection` lies in the orthogonal subspace. -/
 theorem orthogonalProjection_mem_orthogonal (s : AffineSubspace ℝ P) [Nonempty s]
     [CompleteSpace s.direction] (p : P) : ↑(orthogonalProjection s p) ∈ mk' p s.directionᗮ :=
   orthogonalProjectionFn_mem_orthogonal p
 #align euclidean_geometry.orthogonal_projection_mem_orthogonal EuclideanGeometry.orthogonalProjection_mem_orthogonal
+-/
 
+#print EuclideanGeometry.orthogonalProjection_vsub_mem_direction /-
 /-- Subtracting a point in the given subspace from the
 `orthogonal_projection` produces a result in the direction of the
 given subspace. -/
@@ -406,7 +437,9 @@ theorem orthogonalProjection_vsub_mem_direction {s : AffineSubspace ℝ P} [None
     ↑(orthogonalProjection s p2 -ᵥ ⟨p1, hp1⟩ : s.direction) ∈ s.direction :=
   (orthogonalProjection s p2 -ᵥ ⟨p1, hp1⟩ : s.direction).2
 #align euclidean_geometry.orthogonal_projection_vsub_mem_direction EuclideanGeometry.orthogonalProjection_vsub_mem_direction
+-/
 
+#print EuclideanGeometry.vsub_orthogonalProjection_mem_direction /-
 /-- Subtracting the `orthogonal_projection` from a point in the given
 subspace produces a result in the direction of the given subspace. -/
 theorem vsub_orthogonalProjection_mem_direction {s : AffineSubspace ℝ P} [Nonempty s]
@@ -414,7 +447,9 @@ theorem vsub_orthogonalProjection_mem_direction {s : AffineSubspace ℝ P} [None
     ↑((⟨p1, hp1⟩ : s) -ᵥ orthogonalProjection s p2 : s.direction) ∈ s.direction :=
   ((⟨p1, hp1⟩ : s) -ᵥ orthogonalProjection s p2 : s.direction).2
 #align euclidean_geometry.vsub_orthogonal_projection_mem_direction EuclideanGeometry.vsub_orthogonalProjection_mem_direction
+-/
 
+#print EuclideanGeometry.orthogonalProjection_eq_self_iff /-
 /-- A point equals its orthogonal projection if and only if it lies in
 the subspace. -/
 theorem orthogonalProjection_eq_self_iff {s : AffineSubspace ℝ P} [Nonempty s]
@@ -428,7 +463,9 @@ theorem orthogonalProjection_eq_self_iff {s : AffineSubspace ℝ P} [Nonempty s]
     symm
     exact hp
 #align euclidean_geometry.orthogonal_projection_eq_self_iff EuclideanGeometry.orthogonalProjection_eq_self_iff
+-/
 
+#print EuclideanGeometry.orthogonalProjection_mem_subspace_eq_self /-
 @[simp]
 theorem orthogonalProjection_mem_subspace_eq_self {s : AffineSubspace ℝ P} [Nonempty s]
     [CompleteSpace s.direction] (p : s) : orthogonalProjection s p = p :=
@@ -437,7 +474,9 @@ theorem orthogonalProjection_mem_subspace_eq_self {s : AffineSubspace ℝ P} [No
   rw [orthogonalProjection_eq_self_iff]
   exact p.2
 #align euclidean_geometry.orthogonal_projection_mem_subspace_eq_self EuclideanGeometry.orthogonalProjection_mem_subspace_eq_self
+-/
 
+#print EuclideanGeometry.orthogonalProjection_orthogonalProjection /-
 /-- Orthogonal projection is idempotent. -/
 @[simp]
 theorem orthogonalProjection_orthogonalProjection (s : AffineSubspace ℝ P) [Nonempty s]
@@ -448,7 +487,9 @@ theorem orthogonalProjection_orthogonalProjection (s : AffineSubspace ℝ P) [No
   rw [orthogonalProjection_eq_self_iff]
   exact orthogonal_projection_mem p
 #align euclidean_geometry.orthogonal_projection_orthogonal_projection EuclideanGeometry.orthogonalProjection_orthogonalProjection
+-/
 
+#print EuclideanGeometry.eq_orthogonalProjection_of_eq_subspace /-
 theorem eq_orthogonalProjection_of_eq_subspace {s s' : AffineSubspace ℝ P} [Nonempty s]
     [Nonempty s'] [CompleteSpace s.direction] [CompleteSpace s'.direction] (h : s = s') (p : P) :
     (orthogonalProjection s p : P) = (orthogonalProjection s' p : P) :=
@@ -457,27 +498,35 @@ theorem eq_orthogonalProjection_of_eq_subspace {s s' : AffineSubspace ℝ P} [No
   congr
   exact h
 #align euclidean_geometry.eq_orthogonal_projection_of_eq_subspace EuclideanGeometry.eq_orthogonalProjection_of_eq_subspace
+-/
 
+#print EuclideanGeometry.dist_orthogonalProjection_eq_zero_iff /-
 /-- The distance to a point's orthogonal projection is 0 iff it lies in the subspace. -/
 theorem dist_orthogonalProjection_eq_zero_iff {s : AffineSubspace ℝ P} [Nonempty s]
     [CompleteSpace s.direction] {p : P} : dist p (orthogonalProjection s p) = 0 ↔ p ∈ s := by
   rw [dist_comm, dist_eq_zero, orthogonalProjection_eq_self_iff]
 #align euclidean_geometry.dist_orthogonal_projection_eq_zero_iff EuclideanGeometry.dist_orthogonalProjection_eq_zero_iff
+-/
 
+#print EuclideanGeometry.dist_orthogonalProjection_ne_zero_of_not_mem /-
 /-- The distance between a point and its orthogonal projection is
 nonzero if it does not lie in the subspace. -/
 theorem dist_orthogonalProjection_ne_zero_of_not_mem {s : AffineSubspace ℝ P} [Nonempty s]
     [CompleteSpace s.direction] {p : P} (hp : p ∉ s) : dist p (orthogonalProjection s p) ≠ 0 :=
   mt dist_orthogonalProjection_eq_zero_iff.mp hp
 #align euclidean_geometry.dist_orthogonal_projection_ne_zero_of_not_mem EuclideanGeometry.dist_orthogonalProjection_ne_zero_of_not_mem
+-/
 
+#print EuclideanGeometry.orthogonalProjection_vsub_mem_direction_orthogonal /-
 /-- Subtracting `p` from its `orthogonal_projection` produces a result
 in the orthogonal direction. -/
 theorem orthogonalProjection_vsub_mem_direction_orthogonal (s : AffineSubspace ℝ P) [Nonempty s]
     [CompleteSpace s.direction] (p : P) : (orthogonalProjection s p : P) -ᵥ p ∈ s.directionᗮ :=
   orthogonalProjectionFn_vsub_mem_direction_orthogonal p
 #align euclidean_geometry.orthogonal_projection_vsub_mem_direction_orthogonal EuclideanGeometry.orthogonalProjection_vsub_mem_direction_orthogonal
+-/
 
+#print EuclideanGeometry.vsub_orthogonalProjection_mem_direction_orthogonal /-
 /-- Subtracting the `orthogonal_projection` from `p` produces a result
 in the orthogonal direction. -/
 theorem vsub_orthogonalProjection_mem_direction_orthogonal (s : AffineSubspace ℝ P) [Nonempty s]
@@ -485,7 +534,9 @@ theorem vsub_orthogonalProjection_mem_direction_orthogonal (s : AffineSubspace 
   direction_mk' p s.directionᗮ ▸
     vsub_mem_direction (self_mem_mk' _ _) (orthogonalProjection_mem_orthogonal s p)
 #align euclidean_geometry.vsub_orthogonal_projection_mem_direction_orthogonal EuclideanGeometry.vsub_orthogonalProjection_mem_direction_orthogonal
+-/
 
+#print EuclideanGeometry.orthogonalProjection_vsub_orthogonalProjection /-
 /-- Subtracting the `orthogonal_projection` from `p` produces a result in the kernel of the linear
 part of the orthogonal projection. -/
 theorem orthogonalProjection_vsub_orthogonalProjection (s : AffineSubspace ℝ P) [Nonempty s]
@@ -497,7 +548,9 @@ theorem orthogonalProjection_vsub_orthogonalProjection (s : AffineSubspace ℝ P
   rw [← neg_vsub_eq_vsub_rev, inner_neg_right,
     orthogonal_projection_vsub_mem_direction_orthogonal s p c hc, neg_zero]
 #align euclidean_geometry.orthogonal_projection_vsub_orthogonal_projection EuclideanGeometry.orthogonalProjection_vsub_orthogonalProjection
+-/
 
+#print EuclideanGeometry.orthogonalProjection_vadd_eq_self /-
 /-- Adding a vector to a point in the given subspace, then taking the
 orthogonal projection, produces the original point if the vector was
 in the orthogonal direction. -/
@@ -512,7 +565,9 @@ theorem orthogonalProjection_vadd_eq_self {s : AffineSubspace ℝ P} [Nonempty s
   refine' Submodule.disjoint_def.1 s.direction.orthogonal_disjoint _ _ h
   exact (_ : s.direction).2
 #align euclidean_geometry.orthogonal_projection_vadd_eq_self EuclideanGeometry.orthogonalProjection_vadd_eq_self
+-/
 
+#print EuclideanGeometry.orthogonalProjection_vadd_smul_vsub_orthogonalProjection /-
 /-- Adding a vector to a point in the given subspace, then taking the
 orthogonal projection, produces the original point if the vector is a
 multiple of the result of subtracting a point's orthogonal projection
@@ -523,7 +578,9 @@ theorem orthogonalProjection_vadd_smul_vsub_orthogonalProjection {s : AffineSubs
   orthogonalProjection_vadd_eq_self hp
     (Submodule.smul_mem _ _ (vsub_orthogonalProjection_mem_direction_orthogonal s _))
 #align euclidean_geometry.orthogonal_projection_vadd_smul_vsub_orthogonal_projection EuclideanGeometry.orthogonalProjection_vadd_smul_vsub_orthogonalProjection
+-/
 
+#print EuclideanGeometry.dist_sq_eq_dist_orthogonalProjection_sq_add_dist_orthogonalProjection_sq /-
 /-- The square of the distance from a point in `s` to `p2` equals the
 sum of the squares of the distances of the two points to the
 `orthogonal_projection`. -/
@@ -541,7 +598,9 @@ theorem dist_sq_eq_dist_orthogonalProjection_sq_add_dist_orthogonalProjection_sq
     Submodule.inner_right_of_mem_orthogonal (vsub_orthogonal_projection_mem_direction p2 hp1)
       (orthogonal_projection_vsub_mem_direction_orthogonal s p2)
 #align euclidean_geometry.dist_sq_eq_dist_orthogonal_projection_sq_add_dist_orthogonal_projection_sq EuclideanGeometry.dist_sq_eq_dist_orthogonalProjection_sq_add_dist_orthogonalProjection_sq
+-/
 
+#print EuclideanGeometry.dist_sq_smul_orthogonal_vadd_smul_orthogonal_vadd /-
 /-- The square of the distance between two points constructed by
 adding multiples of the same orthogonal vector to points in the same
 subspace. -/
@@ -564,6 +623,7 @@ theorem dist_sq_smul_orthogonal_vadd_smul_orthogonal_vadd {s : AffineSubspace 
     _ = dist p1 p2 * dist p1 p2 + (r1 - r2) * (r1 - r2) * (‖v‖ * ‖v‖) := by
       rw [dist_eq_norm_vsub V p1, abs_mul_abs_self, mul_assoc]
 #align euclidean_geometry.dist_sq_smul_orthogonal_vadd_smul_orthogonal_vadd EuclideanGeometry.dist_sq_smul_orthogonal_vadd_smul_orthogonal_vadd
+-/
 
 #print EuclideanGeometry.reflection /-
 /-- Reflection in an affine subspace, which is expected to be nonempty
@@ -592,17 +652,22 @@ def reflection (s : AffineSubspace ℝ P) [Nonempty s] [CompleteSpace s.directio
 #align euclidean_geometry.reflection EuclideanGeometry.reflection
 -/
 
+#print EuclideanGeometry.reflection_apply /-
 /-- The result of reflecting. -/
 theorem reflection_apply (s : AffineSubspace ℝ P) [Nonempty s] [CompleteSpace s.direction] (p : P) :
     reflection s p = ↑(orthogonalProjection s p) -ᵥ p +ᵥ orthogonalProjection s p :=
   rfl
 #align euclidean_geometry.reflection_apply EuclideanGeometry.reflection_apply
+-/
 
+#print EuclideanGeometry.eq_reflection_of_eq_subspace /-
 theorem eq_reflection_of_eq_subspace {s s' : AffineSubspace ℝ P} [Nonempty s] [Nonempty s']
     [CompleteSpace s.direction] [CompleteSpace s'.direction] (h : s = s') (p : P) :
     (reflection s p : P) = (reflection s' p : P) := by subst h
 #align euclidean_geometry.eq_reflection_of_eq_subspace EuclideanGeometry.eq_reflection_of_eq_subspace
+-/
 
+#print EuclideanGeometry.reflection_reflection /-
 /-- Reflecting twice in the same subspace. -/
 @[simp]
 theorem reflection_reflection (s : AffineSubspace ℝ P) [Nonempty s] [CompleteSpace s.direction]
@@ -620,19 +685,25 @@ theorem reflection_reflection (s : AffineSubspace ℝ P) [Nonempty s] [CompleteS
   rw [← vsub_vadd p (orthogonalProjection s p)]
   exact this (orthogonalProjection s p) _ (orthogonal_projection_vsub_orthogonal_projection s p)
 #align euclidean_geometry.reflection_reflection EuclideanGeometry.reflection_reflection
+-/
 
+#print EuclideanGeometry.reflection_symm /-
 /-- Reflection is its own inverse. -/
 @[simp]
 theorem reflection_symm (s : AffineSubspace ℝ P) [Nonempty s] [CompleteSpace s.direction] :
     (reflection s).symm = reflection s := by ext; rw [← (reflection s).Injective.eq_iff]; simp
 #align euclidean_geometry.reflection_symm EuclideanGeometry.reflection_symm
+-/
 
+#print EuclideanGeometry.reflection_involutive /-
 /-- Reflection is involutive. -/
 theorem reflection_involutive (s : AffineSubspace ℝ P) [Nonempty s] [CompleteSpace s.direction] :
     Function.Involutive (reflection s) :=
   reflection_reflection s
 #align euclidean_geometry.reflection_involutive EuclideanGeometry.reflection_involutive
+-/
 
+#print EuclideanGeometry.reflection_eq_self_iff /-
 /-- A point is its own reflection if and only if it is in the
 subspace. -/
 theorem reflection_eq_self_iff {s : AffineSubspace ℝ P} [Nonempty s] [CompleteSpace s.direction]
@@ -648,7 +719,9 @@ theorem reflection_eq_self_iff {s : AffineSubspace ℝ P} [Nonempty s] [Complete
   · intro h
     simp [h]
 #align euclidean_geometry.reflection_eq_self_iff EuclideanGeometry.reflection_eq_self_iff
+-/
 
+#print EuclideanGeometry.reflection_eq_iff_orthogonalProjection_eq /-
 /-- Reflecting a point in two subspaces produces the same result if
 and only if the point has the same orthogonal projection in each of
 those subspaces. -/
@@ -668,7 +741,9 @@ theorem reflection_eq_iff_orthogonalProjection_eq (s₁ s₂ : AffineSubspace 
   · intro h
     rw [h]
 #align euclidean_geometry.reflection_eq_iff_orthogonal_projection_eq EuclideanGeometry.reflection_eq_iff_orthogonalProjection_eq
+-/
 
+#print EuclideanGeometry.dist_reflection /-
 /-- The distance between `p₁` and the reflection of `p₂` equals that
 between the reflection of `p₁` and `p₂`. -/
 theorem dist_reflection (s : AffineSubspace ℝ P) [Nonempty s] [CompleteSpace s.direction]
@@ -677,7 +752,9 @@ theorem dist_reflection (s : AffineSubspace ℝ P) [Nonempty s] [CompleteSpace s
   conv_lhs => rw [← reflection_reflection s p₁]
   exact (reflection s).dist_map _ _
 #align euclidean_geometry.dist_reflection EuclideanGeometry.dist_reflection
+-/
 
+#print EuclideanGeometry.dist_reflection_eq_of_mem /-
 /-- A point in the subspace is equidistant from another point and its
 reflection. -/
 theorem dist_reflection_eq_of_mem (s : AffineSubspace ℝ P) [Nonempty s] [CompleteSpace s.direction]
@@ -687,7 +764,9 @@ theorem dist_reflection_eq_of_mem (s : AffineSubspace ℝ P) [Nonempty s] [Compl
   convert (reflection s).dist_map p₁ p₂
   rw [hp₁]
 #align euclidean_geometry.dist_reflection_eq_of_mem EuclideanGeometry.dist_reflection_eq_of_mem
+-/
 
+#print EuclideanGeometry.reflection_mem_of_le_of_mem /-
 /-- The reflection of a point in a subspace is contained in any larger
 subspace containing both the point and the subspace reflected in. -/
 theorem reflection_mem_of_le_of_mem {s₁ s₂ : AffineSubspace ℝ P} [Nonempty s₁]
@@ -697,7 +776,9 @@ theorem reflection_mem_of_le_of_mem {s₁ s₂ : AffineSubspace ℝ P} [Nonempty
   have ho : ↑(orthogonalProjection s₁ p) ∈ s₂ := hle (orthogonal_projection_mem p)
   exact vadd_mem_of_mem_direction (vsub_mem_direction ho hp) ho
 #align euclidean_geometry.reflection_mem_of_le_of_mem EuclideanGeometry.reflection_mem_of_le_of_mem
+-/
 
+#print EuclideanGeometry.reflection_orthogonal_vadd /-
 /-- Reflecting an orthogonal vector plus a point in the subspace
 produces the negation of that vector plus the point. -/
 theorem reflection_orthogonal_vadd {s : AffineSubspace ℝ P} [Nonempty s] [CompleteSpace s.direction]
@@ -706,7 +787,9 @@ theorem reflection_orthogonal_vadd {s : AffineSubspace ℝ P} [Nonempty s] [Comp
   rw [reflection_apply, orthogonal_projection_vadd_eq_self hp hv, vsub_vadd_eq_vsub_sub]
   simp
 #align euclidean_geometry.reflection_orthogonal_vadd EuclideanGeometry.reflection_orthogonal_vadd
+-/
 
+#print EuclideanGeometry.reflection_vadd_smul_vsub_orthogonalProjection /-
 /-- Reflecting a vector plus a point in the subspace produces the
 negation of that vector plus the point if the vector is a multiple of
 the result of subtracting a point's orthogonal projection from that
@@ -718,6 +801,7 @@ theorem reflection_vadd_smul_vsub_orthogonalProjection {s : AffineSubspace ℝ P
   reflection_orthogonal_vadd hp₁
     (Submodule.smul_mem _ _ (vsub_orthogonalProjection_mem_direction_orthogonal s _))
 #align euclidean_geometry.reflection_vadd_smul_vsub_orthogonal_projection EuclideanGeometry.reflection_vadd_smul_vsub_orthogonalProjection
+-/
 
 end EuclideanGeometry
 
Diff
@@ -89,8 +89,8 @@ theorem dist_left_midpoint_eq_dist_right_midpoint (p1 p2 : P) :
 /-- The inner product of two vectors given with `weighted_vsub`, in
 terms of the pairwise distances. -/
 theorem inner_weightedVSub {ι₁ : Type _} {s₁ : Finset ι₁} {w₁ : ι₁ → ℝ} (p₁ : ι₁ → P)
-    (h₁ : (∑ i in s₁, w₁ i) = 0) {ι₂ : Type _} {s₂ : Finset ι₂} {w₂ : ι₂ → ℝ} (p₂ : ι₂ → P)
-    (h₂ : (∑ i in s₂, w₂ i) = 0) :
+    (h₁ : ∑ i in s₁, w₁ i = 0) {ι₂ : Type _} {s₂ : Finset ι₂} {w₂ : ι₂ → ℝ} (p₂ : ι₂ → P)
+    (h₂ : ∑ i in s₂, w₂ i = 0) :
     ⟪s₁.weightedVSub p₁ w₁, s₂.weightedVSub p₂ w₂⟫ =
       (-∑ i₁ in s₁, ∑ i₂ in s₂, w₁ i₁ * w₂ i₂ * (dist (p₁ i₁) (p₂ i₂) * dist (p₁ i₁) (p₂ i₂))) /
         2 :=
@@ -105,7 +105,7 @@ theorem inner_weightedVSub {ι₁ : Type _} {s₁ : Finset ι₁} {w₁ : ι₁
 in terms of the pairwise distances between the points in that
 combination. -/
 theorem dist_affineCombination {ι : Type _} {s : Finset ι} {w₁ w₂ : ι → ℝ} (p : ι → P)
-    (h₁ : (∑ i in s, w₁ i) = 1) (h₂ : (∑ i in s, w₂ i) = 1) : by
+    (h₁ : ∑ i in s, w₁ i = 1) (h₂ : ∑ i in s, w₂ i = 1) : by
     have a₁ := s.affine_combination ℝ p w₁ <;> have a₂ := s.affine_combination ℝ p w₂ <;>
       exact
         dist a₁ a₂ * dist a₁ a₂ =
@@ -116,7 +116,7 @@ theorem dist_affineCombination {ι : Type _} {s : Finset ι} {w₁ w₂ : ι →
   by
   rw [dist_eq_norm_vsub V (s.affine_combination ℝ p w₁) (s.affine_combination ℝ p w₂), ←
     @inner_self_eq_norm_mul_norm ℝ, Finset.affineCombination_vsub]
-  have h : (∑ i in s, (w₁ - w₂) i) = 0 := by
+  have h : ∑ i in s, (w₁ - w₂) i = 0 := by
     simp_rw [Pi.sub_apply, Finset.sum_sub_distrib, h₁, h₂, sub_self]
   exact inner_weighted_vsub p h p h
 #align euclidean_geometry.dist_affine_combination EuclideanGeometry.dist_affineCombination
Diff
@@ -563,7 +563,6 @@ theorem dist_sq_smul_orthogonal_vadd_smul_orthogonal_vadd {s : AffineSubspace 
       rw [norm_smul, Real.norm_eq_abs]; ring
     _ = dist p1 p2 * dist p1 p2 + (r1 - r2) * (r1 - r2) * (‖v‖ * ‖v‖) := by
       rw [dist_eq_norm_vsub V p1, abs_mul_abs_self, mul_assoc]
-    
 #align euclidean_geometry.dist_sq_smul_orthogonal_vadd_smul_orthogonal_vadd EuclideanGeometry.dist_sq_smul_orthogonal_vadd_smul_orthogonal_vadd
 
 #print EuclideanGeometry.reflection /-
Diff
@@ -685,7 +685,7 @@ theorem dist_reflection_eq_of_mem (s : AffineSubspace ℝ P) [Nonempty s] [Compl
     {p₁ : P} (hp₁ : p₁ ∈ s) (p₂ : P) : dist p₁ (reflection s p₂) = dist p₁ p₂ :=
   by
   rw [← reflection_eq_self_iff p₁] at hp₁ 
-  convert(reflection s).dist_map p₁ p₂
+  convert (reflection s).dist_map p₁ p₂
   rw [hp₁]
 #align euclidean_geometry.dist_reflection_eq_of_mem EuclideanGeometry.dist_reflection_eq_of_mem
 
Diff
@@ -143,7 +143,7 @@ theorem inner_vsub_vsub_of_dist_eq_of_dist_eq {c₁ c₂ p₁ p₂ : P} (hc₁ :
       skip
       rw [← vsub_sub_vsub_cancel_right p₂ p₁ c₁]
     rw [dist_comm p₁, dist_comm p₂, dist_eq_norm_vsub V _ p₁, dist_eq_norm_vsub V _ p₂, ←
-      real_inner_add_sub_eq_zero_iff] at hc₁ hc₂
+      real_inner_add_sub_eq_zero_iff] at hc₁ hc₂ 
     simp_rw [← neg_vsub_eq_vsub_rev c₁, ← neg_vsub_eq_vsub_rev c₂, sub_neg_eq_add, neg_add_eq_sub,
       hc₁, hc₂, sub_zero]
   simpa [inner_add_left, ← mul_two, (by norm_num : (2 : ℝ) ≠ 0)] using h
@@ -222,21 +222,21 @@ theorem eq_of_dist_eq_of_dist_eq_of_mem_of_finrank_eq_two {s : AffineSubspace 
       rw [← Fintype.coe_image_univ, hu]
       simp
       rfl
-    rw [← hbs, hr, Submodule.mem_span_insert] at hv
+    rw [← hbs, hr, Submodule.mem_span_insert] at hv 
     rcases hv with ⟨t₁, v', hv', hv⟩
-    rw [Submodule.mem_span_singleton] at hv'
+    rw [Submodule.mem_span_singleton] at hv' 
     rcases hv' with ⟨t₂, rfl⟩
     exact ⟨t₁, t₂, hv⟩
   rcases hv (p -ᵥ p₁) (vsub_mem_direction hps hp₁s) with ⟨t₁, t₂, hpt⟩
   simp only [hpt, inner_add_right, inner_smul_right, ho, MulZeroClass.mul_zero, add_zero,
-    mul_eq_zero, inner_self_eq_zero, vsub_eq_zero_iff_eq, hc.symm, or_false_iff] at hop
-  rw [hop, zero_smul, zero_add, ← eq_vadd_iff_vsub_eq] at hpt
+    mul_eq_zero, inner_self_eq_zero, vsub_eq_zero_iff_eq, hc.symm, or_false_iff] at hop 
+  rw [hop, zero_smul, zero_add, ← eq_vadd_iff_vsub_eq] at hpt 
   subst hpt
   have hp' : (p₂ -ᵥ p₁ : V) ≠ 0 := by simp [hp.symm]
   have hp₂ : dist ((1 : ℝ) • (p₂ -ᵥ p₁) +ᵥ p₁) c₁ = r₁ := by simp [hp₂c₁]
-  rw [← hp₁c₁, dist_smul_vadd_eq_dist _ _ hp'] at hpc₁ hp₂
-  simp only [one_ne_zero, false_or_iff] at hp₂
-  rw [hp₂.symm] at hpc₁
+  rw [← hp₁c₁, dist_smul_vadd_eq_dist _ _ hp'] at hpc₁ hp₂ 
+  simp only [one_ne_zero, false_or_iff] at hp₂ 
+  rw [hp₂.symm] at hpc₁ 
   cases hpc₁ <;> simp [hpc₁]
 #align euclidean_geometry.eq_of_dist_eq_of_dist_eq_of_mem_of_finrank_eq_two EuclideanGeometry.eq_of_dist_eq_of_dist_eq_of_mem_of_finrank_eq_two
 
@@ -355,7 +355,7 @@ def orthogonalProjection (s : AffineSubspace ℝ P) [Nonempty s] [CompleteSpace
       by
       rw [← inter_eq_singleton_orthogonal_projection_fn (v +ᵥ p)]
       exact Set.mem_inter hs ho
-    rw [Set.mem_singleton_iff] at hm
+    rw [Set.mem_singleton_iff] at hm 
     ext
     exact hm.symm
 #align euclidean_geometry.orthogonal_projection EuclideanGeometry.orthogonalProjection
@@ -424,7 +424,7 @@ theorem orthogonalProjection_eq_self_iff {s : AffineSubspace ℝ P} [Nonempty s]
   · exact fun h => h ▸ orthogonal_projection_mem p
   · intro h
     have hp : p ∈ (s : Set P) ∩ mk' p s.directionᗮ := ⟨h, self_mem_mk' p _⟩
-    rw [inter_eq_singleton_orthogonal_projection p] at hp
+    rw [inter_eq_singleton_orthogonal_projection p] at hp 
     symm
     exact hp
 #align euclidean_geometry.orthogonal_projection_eq_self_iff EuclideanGeometry.orthogonalProjection_eq_self_iff
@@ -506,7 +506,7 @@ theorem orthogonalProjection_vadd_eq_self {s : AffineSubspace ℝ P} [Nonempty s
     orthogonalProjection s (v +ᵥ p) = ⟨p, hp⟩ :=
   by
   have h := vsub_orthogonal_projection_mem_direction_orthogonal s (v +ᵥ p)
-  rw [vadd_vsub_assoc, Submodule.add_mem_iff_right _ hv] at h
+  rw [vadd_vsub_assoc, Submodule.add_mem_iff_right _ hv] at h 
   refine' (eq_of_vsub_eq_zero _).symm
   ext
   refine' Submodule.disjoint_def.1 s.direction.orthogonal_disjoint _ _ h
@@ -643,8 +643,8 @@ theorem reflection_eq_self_iff {s : AffineSubspace ℝ P} [Nonempty s] [Complete
   constructor
   · intro h
     rw [← @vsub_eq_zero_iff_eq V, vadd_vsub_assoc, ← two_smul ℝ (↑(orthogonalProjection s p) -ᵥ p),
-      smul_eq_zero] at h
-    norm_num at h
+      smul_eq_zero] at h 
+    norm_num at h 
     exact h
   · intro h
     simp [h]
@@ -663,8 +663,8 @@ theorem reflection_eq_iff_orthogonalProjection_eq (s₁ s₂ : AffineSubspace 
   · intro h
     rw [← @vsub_eq_zero_iff_eq V, vsub_vadd_eq_vsub_sub, vadd_vsub_assoc, add_comm, add_sub_assoc,
       vsub_sub_vsub_cancel_right, ←
-      two_smul ℝ ((orthogonalProjection s₁ p : P) -ᵥ orthogonalProjection s₂ p), smul_eq_zero] at h
-    norm_num at h
+      two_smul ℝ ((orthogonalProjection s₁ p : P) -ᵥ orthogonalProjection s₂ p), smul_eq_zero] at h 
+    norm_num at h 
     exact h
   · intro h
     rw [h]
@@ -684,7 +684,7 @@ reflection. -/
 theorem dist_reflection_eq_of_mem (s : AffineSubspace ℝ P) [Nonempty s] [CompleteSpace s.direction]
     {p₁ : P} (hp₁ : p₁ ∈ s) (p₂ : P) : dist p₁ (reflection s p₂) = dist p₁ p₂ :=
   by
-  rw [← reflection_eq_self_iff p₁] at hp₁
+  rw [← reflection_eq_self_iff p₁] at hp₁ 
   convert(reflection s).dist_map p₁ p₂
   rw [hp₁]
 #align euclidean_geometry.dist_reflection_eq_of_mem EuclideanGeometry.dist_reflection_eq_of_mem
Diff
@@ -54,11 +54,11 @@ theorems that need it.
 
 noncomputable section
 
-open BigOperators
+open scoped BigOperators
 
-open Classical
+open scoped Classical
 
-open RealInnerProductSpace
+open scoped RealInnerProductSpace
 
 namespace EuclideanGeometry
 
Diff
@@ -86,9 +86,6 @@ theorem dist_left_midpoint_eq_dist_right_midpoint (p1 p2 : P) :
 #align euclidean_geometry.dist_left_midpoint_eq_dist_right_midpoint EuclideanGeometry.dist_left_midpoint_eq_dist_right_midpoint
 -/
 
-/- warning: euclidean_geometry.inner_weighted_vsub -> EuclideanGeometry.inner_weightedVSub is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align euclidean_geometry.inner_weighted_vsub EuclideanGeometry.inner_weightedVSubₓ'. -/
 /-- The inner product of two vectors given with `weighted_vsub`, in
 terms of the pairwise distances. -/
 theorem inner_weightedVSub {ι₁ : Type _} {s₁ : Finset ι₁} {w₁ : ι₁ → ℝ} (p₁ : ι₁ → P)
@@ -104,9 +101,6 @@ theorem inner_weightedVSub {ι₁ : Type _} {s₁ : Finset ι₁} {w₁ : ι₁
   rcongr (i₁ i₂) <;> rw [dist_eq_norm_vsub V (p₁ i₁) (p₂ i₂)]
 #align euclidean_geometry.inner_weighted_vsub EuclideanGeometry.inner_weightedVSub
 
-/- warning: euclidean_geometry.dist_affine_combination -> EuclideanGeometry.dist_affineCombination is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align euclidean_geometry.dist_affine_combination EuclideanGeometry.dist_affineCombinationₓ'. -/
 /-- The distance between two points given with `affine_combination`,
 in terms of the pairwise distances between the points in that
 combination. -/
@@ -127,12 +121,6 @@ theorem dist_affineCombination {ι : Type _} {s : Finset ι} {w₁ w₂ : ι →
   exact inner_weighted_vsub p h p h
 #align euclidean_geometry.dist_affine_combination EuclideanGeometry.dist_affineCombination
 
-/- warning: euclidean_geometry.inner_vsub_vsub_of_dist_eq_of_dist_eq -> EuclideanGeometry.inner_vsub_vsub_of_dist_eq_of_dist_eq is a dubious translation:
-lean 3 declaration is
-  forall {V : Type.{u1}} {P : Type.{u2}} [_inst_1 : NormedAddCommGroup.{u1} V] [_inst_2 : InnerProductSpace.{0, u1} Real V Real.isROrC _inst_1] [_inst_3 : MetricSpace.{u2} P] [_inst_4 : NormedAddTorsor.{u1, u2} V P (NormedAddCommGroup.toSeminormedAddCommGroup.{u1} V _inst_1) (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)] {c₁ : P} {c₂ : P} {p₁ : P} {p₂ : P}, (Eq.{1} Real (Dist.dist.{u2} P (PseudoMetricSpace.toHasDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) p₁ c₁) (Dist.dist.{u2} P (PseudoMetricSpace.toHasDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) p₂ c₁)) -> (Eq.{1} Real (Dist.dist.{u2} P (PseudoMetricSpace.toHasDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) p₁ c₂) (Dist.dist.{u2} P (PseudoMetricSpace.toHasDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) p₂ c₂)) -> (Eq.{1} Real (Inner.inner.{0, u1} Real V (InnerProductSpace.toHasInner.{0, u1} Real V Real.isROrC _inst_1 _inst_2) (VSub.vsub.{u1, u2} V P (AddTorsor.toHasVsub.{u1, u2} V P (NormedAddGroup.toAddGroup.{u1} V (NormedAddCommGroup.toNormedAddGroup.{u1} V _inst_1)) (NormedAddTorsor.toAddTorsor'.{u1, u2} V P _inst_1 _inst_3 _inst_4)) c₂ c₁) (VSub.vsub.{u1, u2} V P (AddTorsor.toHasVsub.{u1, u2} V P (NormedAddGroup.toAddGroup.{u1} V (NormedAddCommGroup.toNormedAddGroup.{u1} V _inst_1)) (NormedAddTorsor.toAddTorsor'.{u1, u2} V P _inst_1 _inst_3 _inst_4)) p₂ p₁)) (OfNat.ofNat.{0} Real 0 (OfNat.mk.{0} Real 0 (Zero.zero.{0} Real Real.hasZero))))
-but is expected to have type
-  forall {V : Type.{u1}} {P : Type.{u2}} [_inst_1 : NormedAddCommGroup.{u1} V] [_inst_2 : InnerProductSpace.{0, u1} Real V Real.isROrC _inst_1] [_inst_3 : MetricSpace.{u2} P] [_inst_4 : NormedAddTorsor.{u1, u2} V P (NormedAddCommGroup.toSeminormedAddCommGroup.{u1} V _inst_1) (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)] {c₁ : P} {c₂ : P} {p₁ : P} {p₂ : P}, (Eq.{1} Real (Dist.dist.{u2} P (PseudoMetricSpace.toDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) p₁ c₁) (Dist.dist.{u2} P (PseudoMetricSpace.toDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) p₂ c₁)) -> (Eq.{1} Real (Dist.dist.{u2} P (PseudoMetricSpace.toDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) p₁ c₂) (Dist.dist.{u2} P (PseudoMetricSpace.toDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) p₂ c₂)) -> (Eq.{1} Real (Inner.inner.{0, u1} Real V (InnerProductSpace.toInner.{0, u1} Real V Real.isROrC _inst_1 _inst_2) (VSub.vsub.{u1, u2} V P (AddTorsor.toVSub.{u1, u2} V P (SeminormedAddGroup.toAddGroup.{u1} V (SeminormedAddCommGroup.toSeminormedAddGroup.{u1} V (NormedAddCommGroup.toSeminormedAddCommGroup.{u1} V _inst_1))) (NormedAddTorsor.toAddTorsor.{u1, u2} V P (NormedAddCommGroup.toSeminormedAddCommGroup.{u1} V _inst_1) (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3) _inst_4)) c₂ c₁) (VSub.vsub.{u1, u2} V P (AddTorsor.toVSub.{u1, u2} V P (SeminormedAddGroup.toAddGroup.{u1} V (SeminormedAddCommGroup.toSeminormedAddGroup.{u1} V (NormedAddCommGroup.toSeminormedAddCommGroup.{u1} V _inst_1))) (NormedAddTorsor.toAddTorsor.{u1, u2} V P (NormedAddCommGroup.toSeminormedAddCommGroup.{u1} V _inst_1) (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3) _inst_4)) p₂ p₁)) (OfNat.ofNat.{0} Real 0 (Zero.toOfNat0.{0} Real Real.instZeroReal)))
-Case conversion may be inaccurate. Consider using '#align euclidean_geometry.inner_vsub_vsub_of_dist_eq_of_dist_eq EuclideanGeometry.inner_vsub_vsub_of_dist_eq_of_dist_eqₓ'. -/
 /-- Suppose that `c₁` is equidistant from `p₁` and `p₂`, and the same
 applies to `c₂`.  Then the vector between `c₁` and `c₂` is orthogonal
 to that between `p₁` and `p₂`.  (In two dimensions, this says that the
@@ -161,9 +149,6 @@ theorem inner_vsub_vsub_of_dist_eq_of_dist_eq {c₁ c₂ p₁ p₂ : P} (hc₁ :
   simpa [inner_add_left, ← mul_two, (by norm_num : (2 : ℝ) ≠ 0)] using h
 #align euclidean_geometry.inner_vsub_vsub_of_dist_eq_of_dist_eq EuclideanGeometry.inner_vsub_vsub_of_dist_eq_of_dist_eq
 
-/- warning: euclidean_geometry.dist_smul_vadd_sq -> EuclideanGeometry.dist_smul_vadd_sq is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align euclidean_geometry.dist_smul_vadd_sq EuclideanGeometry.dist_smul_vadd_sqₓ'. -/
 /-- The squared distance between points on a line (expressed as a
 multiple of a fixed vector added to a point) and another point,
 expressed as a quadratic. -/
@@ -176,9 +161,6 @@ theorem dist_smul_vadd_sq (r : ℝ) (v : V) (p₁ p₂ : P) :
   ring
 #align euclidean_geometry.dist_smul_vadd_sq EuclideanGeometry.dist_smul_vadd_sq
 
-/- warning: euclidean_geometry.dist_smul_vadd_eq_dist -> EuclideanGeometry.dist_smul_vadd_eq_dist is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align euclidean_geometry.dist_smul_vadd_eq_dist EuclideanGeometry.dist_smul_vadd_eq_distₓ'. -/
 /-- The condition for two points on a line to be equidistant from
 another point. -/
 theorem dist_smul_vadd_eq_dist {v : V} (p₁ p₂ : P) (hv : v ≠ 0) (r : ℝ) :
@@ -198,9 +180,6 @@ theorem dist_smul_vadd_eq_dist {v : V} (p₁ p₂ : P) (hv : v ≠ 0) (r : ℝ)
 
 open AffineSubspace FiniteDimensional
 
-/- warning: euclidean_geometry.eq_of_dist_eq_of_dist_eq_of_mem_of_finrank_eq_two -> EuclideanGeometry.eq_of_dist_eq_of_dist_eq_of_mem_of_finrank_eq_two is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align euclidean_geometry.eq_of_dist_eq_of_dist_eq_of_mem_of_finrank_eq_two EuclideanGeometry.eq_of_dist_eq_of_dist_eq_of_mem_of_finrank_eq_twoₓ'. -/
 /-- Distances `r₁` `r₂` of `p` from two different points `c₁` `c₂` determine at
 most two points `p₁` `p₂` in a two-dimensional subspace containing those points
 (two circles intersect in at most two points). -/
@@ -261,9 +240,6 @@ theorem eq_of_dist_eq_of_dist_eq_of_mem_of_finrank_eq_two {s : AffineSubspace 
   cases hpc₁ <;> simp [hpc₁]
 #align euclidean_geometry.eq_of_dist_eq_of_dist_eq_of_mem_of_finrank_eq_two EuclideanGeometry.eq_of_dist_eq_of_dist_eq_of_mem_of_finrank_eq_two
 
-/- warning: euclidean_geometry.eq_of_dist_eq_of_dist_eq_of_finrank_eq_two -> EuclideanGeometry.eq_of_dist_eq_of_dist_eq_of_finrank_eq_two is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align euclidean_geometry.eq_of_dist_eq_of_dist_eq_of_finrank_eq_two EuclideanGeometry.eq_of_dist_eq_of_dist_eq_of_finrank_eq_twoₓ'. -/
 /-- Distances `r₁` `r₂` of `p` from two different points `c₁` `c₂` determine at
 most two points `p₁` `p₂` in two-dimensional space (two circles intersect in at
 most two points). -/
@@ -298,9 +274,6 @@ def orthogonalProjectionFn (s : AffineSubspace ℝ P) [Nonempty s] [CompleteSpac
 #align euclidean_geometry.orthogonal_projection_fn EuclideanGeometry.orthogonalProjectionFn
 -/
 
-/- warning: euclidean_geometry.inter_eq_singleton_orthogonal_projection_fn -> EuclideanGeometry.inter_eq_singleton_orthogonalProjectionFn is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align euclidean_geometry.inter_eq_singleton_orthogonal_projection_fn EuclideanGeometry.inter_eq_singleton_orthogonalProjectionFnₓ'. -/
 /-- The intersection of the subspace and the orthogonal subspace
 through the given point is the `orthogonal_projection_fn` of that
 point onto the subspace.  This lemma is only intended for use in
@@ -317,9 +290,6 @@ theorem inter_eq_singleton_orthogonalProjectionFn {s : AffineSubspace ℝ P} [No
         exact Submodule.isCompl_orthogonal_of_completeSpace)
 #align euclidean_geometry.inter_eq_singleton_orthogonal_projection_fn EuclideanGeometry.inter_eq_singleton_orthogonalProjectionFn
 
-/- warning: euclidean_geometry.orthogonal_projection_fn_mem -> EuclideanGeometry.orthogonalProjectionFn_mem is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align euclidean_geometry.orthogonal_projection_fn_mem EuclideanGeometry.orthogonalProjectionFn_memₓ'. -/
 /-- The `orthogonal_projection_fn` lies in the given subspace.  This
 lemma is only intended for use in setting up the bundled version and
 should not be used once that is defined. -/
@@ -330,9 +300,6 @@ theorem orthogonalProjectionFn_mem {s : AffineSubspace ℝ P} [Nonempty s] [Comp
   exact Set.inter_subset_left _ _
 #align euclidean_geometry.orthogonal_projection_fn_mem EuclideanGeometry.orthogonalProjectionFn_mem
 
-/- warning: euclidean_geometry.orthogonal_projection_fn_mem_orthogonal -> EuclideanGeometry.orthogonalProjectionFn_mem_orthogonal is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align euclidean_geometry.orthogonal_projection_fn_mem_orthogonal EuclideanGeometry.orthogonalProjectionFn_mem_orthogonalₓ'. -/
 /-- The `orthogonal_projection_fn` lies in the orthogonal
 subspace.  This lemma is only intended for use in setting up the
 bundled version and should not be used once that is defined. -/
@@ -343,9 +310,6 @@ theorem orthogonalProjectionFn_mem_orthogonal {s : AffineSubspace ℝ P} [Nonemp
   exact Set.inter_subset_right _ _
 #align euclidean_geometry.orthogonal_projection_fn_mem_orthogonal EuclideanGeometry.orthogonalProjectionFn_mem_orthogonal
 
-/- warning: euclidean_geometry.orthogonal_projection_fn_vsub_mem_direction_orthogonal -> EuclideanGeometry.orthogonalProjectionFn_vsub_mem_direction_orthogonal is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align euclidean_geometry.orthogonal_projection_fn_vsub_mem_direction_orthogonal EuclideanGeometry.orthogonalProjectionFn_vsub_mem_direction_orthogonalₓ'. -/
 /-- Subtracting `p` from its `orthogonal_projection_fn` produces a
 result in the orthogonal direction.  This lemma is only intended for
 use in setting up the bundled version and should not be used once that
@@ -397,18 +361,12 @@ def orthogonalProjection (s : AffineSubspace ℝ P) [Nonempty s] [CompleteSpace
 #align euclidean_geometry.orthogonal_projection EuclideanGeometry.orthogonalProjection
 -/
 
-/- warning: euclidean_geometry.orthogonal_projection_fn_eq -> EuclideanGeometry.orthogonalProjectionFn_eq is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align euclidean_geometry.orthogonal_projection_fn_eq EuclideanGeometry.orthogonalProjectionFn_eqₓ'. -/
 @[simp]
 theorem orthogonalProjectionFn_eq {s : AffineSubspace ℝ P} [Nonempty s] [CompleteSpace s.direction]
     (p : P) : orthogonalProjectionFn s p = orthogonalProjection s p :=
   rfl
 #align euclidean_geometry.orthogonal_projection_fn_eq EuclideanGeometry.orthogonalProjectionFn_eq
 
-/- warning: euclidean_geometry.orthogonal_projection_linear -> EuclideanGeometry.orthogonalProjection_linear is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align euclidean_geometry.orthogonal_projection_linear EuclideanGeometry.orthogonalProjection_linearₓ'. -/
 /-- The linear map corresponding to `orthogonal_projection`. -/
 @[simp]
 theorem orthogonalProjection_linear {s : AffineSubspace ℝ P} [Nonempty s]
@@ -417,9 +375,6 @@ theorem orthogonalProjection_linear {s : AffineSubspace ℝ P} [Nonempty s]
   rfl
 #align euclidean_geometry.orthogonal_projection_linear EuclideanGeometry.orthogonalProjection_linear
 
-/- warning: euclidean_geometry.inter_eq_singleton_orthogonal_projection -> EuclideanGeometry.inter_eq_singleton_orthogonalProjection is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align euclidean_geometry.inter_eq_singleton_orthogonal_projection EuclideanGeometry.inter_eq_singleton_orthogonalProjectionₓ'. -/
 /-- The intersection of the subspace and the orthogonal subspace
 through the given point is the `orthogonal_projection` of that point
 onto the subspace. -/
@@ -431,27 +386,18 @@ theorem inter_eq_singleton_orthogonalProjection {s : AffineSubspace ℝ P} [None
   exact inter_eq_singleton_orthogonal_projection_fn p
 #align euclidean_geometry.inter_eq_singleton_orthogonal_projection EuclideanGeometry.inter_eq_singleton_orthogonalProjection
 
-/- warning: euclidean_geometry.orthogonal_projection_mem -> EuclideanGeometry.orthogonalProjection_mem is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align euclidean_geometry.orthogonal_projection_mem EuclideanGeometry.orthogonalProjection_memₓ'. -/
 /-- The `orthogonal_projection` lies in the given subspace. -/
 theorem orthogonalProjection_mem {s : AffineSubspace ℝ P} [Nonempty s] [CompleteSpace s.direction]
     (p : P) : ↑(orthogonalProjection s p) ∈ s :=
   (orthogonalProjection s p).2
 #align euclidean_geometry.orthogonal_projection_mem EuclideanGeometry.orthogonalProjection_mem
 
-/- warning: euclidean_geometry.orthogonal_projection_mem_orthogonal -> EuclideanGeometry.orthogonalProjection_mem_orthogonal is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align euclidean_geometry.orthogonal_projection_mem_orthogonal EuclideanGeometry.orthogonalProjection_mem_orthogonalₓ'. -/
 /-- The `orthogonal_projection` lies in the orthogonal subspace. -/
 theorem orthogonalProjection_mem_orthogonal (s : AffineSubspace ℝ P) [Nonempty s]
     [CompleteSpace s.direction] (p : P) : ↑(orthogonalProjection s p) ∈ mk' p s.directionᗮ :=
   orthogonalProjectionFn_mem_orthogonal p
 #align euclidean_geometry.orthogonal_projection_mem_orthogonal EuclideanGeometry.orthogonalProjection_mem_orthogonal
 
-/- warning: euclidean_geometry.orthogonal_projection_vsub_mem_direction -> EuclideanGeometry.orthogonalProjection_vsub_mem_direction is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align euclidean_geometry.orthogonal_projection_vsub_mem_direction EuclideanGeometry.orthogonalProjection_vsub_mem_directionₓ'. -/
 /-- Subtracting a point in the given subspace from the
 `orthogonal_projection` produces a result in the direction of the
 given subspace. -/
@@ -461,9 +407,6 @@ theorem orthogonalProjection_vsub_mem_direction {s : AffineSubspace ℝ P} [None
   (orthogonalProjection s p2 -ᵥ ⟨p1, hp1⟩ : s.direction).2
 #align euclidean_geometry.orthogonal_projection_vsub_mem_direction EuclideanGeometry.orthogonalProjection_vsub_mem_direction
 
-/- warning: euclidean_geometry.vsub_orthogonal_projection_mem_direction -> EuclideanGeometry.vsub_orthogonalProjection_mem_direction is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align euclidean_geometry.vsub_orthogonal_projection_mem_direction EuclideanGeometry.vsub_orthogonalProjection_mem_directionₓ'. -/
 /-- Subtracting the `orthogonal_projection` from a point in the given
 subspace produces a result in the direction of the given subspace. -/
 theorem vsub_orthogonalProjection_mem_direction {s : AffineSubspace ℝ P} [Nonempty s]
@@ -472,9 +415,6 @@ theorem vsub_orthogonalProjection_mem_direction {s : AffineSubspace ℝ P} [None
   ((⟨p1, hp1⟩ : s) -ᵥ orthogonalProjection s p2 : s.direction).2
 #align euclidean_geometry.vsub_orthogonal_projection_mem_direction EuclideanGeometry.vsub_orthogonalProjection_mem_direction
 
-/- warning: euclidean_geometry.orthogonal_projection_eq_self_iff -> EuclideanGeometry.orthogonalProjection_eq_self_iff is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align euclidean_geometry.orthogonal_projection_eq_self_iff EuclideanGeometry.orthogonalProjection_eq_self_iffₓ'. -/
 /-- A point equals its orthogonal projection if and only if it lies in
 the subspace. -/
 theorem orthogonalProjection_eq_self_iff {s : AffineSubspace ℝ P} [Nonempty s]
@@ -489,9 +429,6 @@ theorem orthogonalProjection_eq_self_iff {s : AffineSubspace ℝ P} [Nonempty s]
     exact hp
 #align euclidean_geometry.orthogonal_projection_eq_self_iff EuclideanGeometry.orthogonalProjection_eq_self_iff
 
-/- warning: euclidean_geometry.orthogonal_projection_mem_subspace_eq_self -> EuclideanGeometry.orthogonalProjection_mem_subspace_eq_self is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align euclidean_geometry.orthogonal_projection_mem_subspace_eq_self EuclideanGeometry.orthogonalProjection_mem_subspace_eq_selfₓ'. -/
 @[simp]
 theorem orthogonalProjection_mem_subspace_eq_self {s : AffineSubspace ℝ P} [Nonempty s]
     [CompleteSpace s.direction] (p : s) : orthogonalProjection s p = p :=
@@ -501,9 +438,6 @@ theorem orthogonalProjection_mem_subspace_eq_self {s : AffineSubspace ℝ P} [No
   exact p.2
 #align euclidean_geometry.orthogonal_projection_mem_subspace_eq_self EuclideanGeometry.orthogonalProjection_mem_subspace_eq_self
 
-/- warning: euclidean_geometry.orthogonal_projection_orthogonal_projection -> EuclideanGeometry.orthogonalProjection_orthogonalProjection is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align euclidean_geometry.orthogonal_projection_orthogonal_projection EuclideanGeometry.orthogonalProjection_orthogonalProjectionₓ'. -/
 /-- Orthogonal projection is idempotent. -/
 @[simp]
 theorem orthogonalProjection_orthogonalProjection (s : AffineSubspace ℝ P) [Nonempty s]
@@ -515,9 +449,6 @@ theorem orthogonalProjection_orthogonalProjection (s : AffineSubspace ℝ P) [No
   exact orthogonal_projection_mem p
 #align euclidean_geometry.orthogonal_projection_orthogonal_projection EuclideanGeometry.orthogonalProjection_orthogonalProjection
 
-/- warning: euclidean_geometry.eq_orthogonal_projection_of_eq_subspace -> EuclideanGeometry.eq_orthogonalProjection_of_eq_subspace is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align euclidean_geometry.eq_orthogonal_projection_of_eq_subspace EuclideanGeometry.eq_orthogonalProjection_of_eq_subspaceₓ'. -/
 theorem eq_orthogonalProjection_of_eq_subspace {s s' : AffineSubspace ℝ P} [Nonempty s]
     [Nonempty s'] [CompleteSpace s.direction] [CompleteSpace s'.direction] (h : s = s') (p : P) :
     (orthogonalProjection s p : P) = (orthogonalProjection s' p : P) :=
@@ -527,18 +458,12 @@ theorem eq_orthogonalProjection_of_eq_subspace {s s' : AffineSubspace ℝ P} [No
   exact h
 #align euclidean_geometry.eq_orthogonal_projection_of_eq_subspace EuclideanGeometry.eq_orthogonalProjection_of_eq_subspace
 
-/- warning: euclidean_geometry.dist_orthogonal_projection_eq_zero_iff -> EuclideanGeometry.dist_orthogonalProjection_eq_zero_iff is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align euclidean_geometry.dist_orthogonal_projection_eq_zero_iff EuclideanGeometry.dist_orthogonalProjection_eq_zero_iffₓ'. -/
 /-- The distance to a point's orthogonal projection is 0 iff it lies in the subspace. -/
 theorem dist_orthogonalProjection_eq_zero_iff {s : AffineSubspace ℝ P} [Nonempty s]
     [CompleteSpace s.direction] {p : P} : dist p (orthogonalProjection s p) = 0 ↔ p ∈ s := by
   rw [dist_comm, dist_eq_zero, orthogonalProjection_eq_self_iff]
 #align euclidean_geometry.dist_orthogonal_projection_eq_zero_iff EuclideanGeometry.dist_orthogonalProjection_eq_zero_iff
 
-/- warning: euclidean_geometry.dist_orthogonal_projection_ne_zero_of_not_mem -> EuclideanGeometry.dist_orthogonalProjection_ne_zero_of_not_mem is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align euclidean_geometry.dist_orthogonal_projection_ne_zero_of_not_mem EuclideanGeometry.dist_orthogonalProjection_ne_zero_of_not_memₓ'. -/
 /-- The distance between a point and its orthogonal projection is
 nonzero if it does not lie in the subspace. -/
 theorem dist_orthogonalProjection_ne_zero_of_not_mem {s : AffineSubspace ℝ P} [Nonempty s]
@@ -546,9 +471,6 @@ theorem dist_orthogonalProjection_ne_zero_of_not_mem {s : AffineSubspace ℝ P}
   mt dist_orthogonalProjection_eq_zero_iff.mp hp
 #align euclidean_geometry.dist_orthogonal_projection_ne_zero_of_not_mem EuclideanGeometry.dist_orthogonalProjection_ne_zero_of_not_mem
 
-/- warning: euclidean_geometry.orthogonal_projection_vsub_mem_direction_orthogonal -> EuclideanGeometry.orthogonalProjection_vsub_mem_direction_orthogonal is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align euclidean_geometry.orthogonal_projection_vsub_mem_direction_orthogonal EuclideanGeometry.orthogonalProjection_vsub_mem_direction_orthogonalₓ'. -/
 /-- Subtracting `p` from its `orthogonal_projection` produces a result
 in the orthogonal direction. -/
 theorem orthogonalProjection_vsub_mem_direction_orthogonal (s : AffineSubspace ℝ P) [Nonempty s]
@@ -556,9 +478,6 @@ theorem orthogonalProjection_vsub_mem_direction_orthogonal (s : AffineSubspace 
   orthogonalProjectionFn_vsub_mem_direction_orthogonal p
 #align euclidean_geometry.orthogonal_projection_vsub_mem_direction_orthogonal EuclideanGeometry.orthogonalProjection_vsub_mem_direction_orthogonal
 
-/- warning: euclidean_geometry.vsub_orthogonal_projection_mem_direction_orthogonal -> EuclideanGeometry.vsub_orthogonalProjection_mem_direction_orthogonal is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align euclidean_geometry.vsub_orthogonal_projection_mem_direction_orthogonal EuclideanGeometry.vsub_orthogonalProjection_mem_direction_orthogonalₓ'. -/
 /-- Subtracting the `orthogonal_projection` from `p` produces a result
 in the orthogonal direction. -/
 theorem vsub_orthogonalProjection_mem_direction_orthogonal (s : AffineSubspace ℝ P) [Nonempty s]
@@ -567,9 +486,6 @@ theorem vsub_orthogonalProjection_mem_direction_orthogonal (s : AffineSubspace 
     vsub_mem_direction (self_mem_mk' _ _) (orthogonalProjection_mem_orthogonal s p)
 #align euclidean_geometry.vsub_orthogonal_projection_mem_direction_orthogonal EuclideanGeometry.vsub_orthogonalProjection_mem_direction_orthogonal
 
-/- warning: euclidean_geometry.orthogonal_projection_vsub_orthogonal_projection -> EuclideanGeometry.orthogonalProjection_vsub_orthogonalProjection is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align euclidean_geometry.orthogonal_projection_vsub_orthogonal_projection EuclideanGeometry.orthogonalProjection_vsub_orthogonalProjectionₓ'. -/
 /-- Subtracting the `orthogonal_projection` from `p` produces a result in the kernel of the linear
 part of the orthogonal projection. -/
 theorem orthogonalProjection_vsub_orthogonalProjection (s : AffineSubspace ℝ P) [Nonempty s]
@@ -582,9 +498,6 @@ theorem orthogonalProjection_vsub_orthogonalProjection (s : AffineSubspace ℝ P
     orthogonal_projection_vsub_mem_direction_orthogonal s p c hc, neg_zero]
 #align euclidean_geometry.orthogonal_projection_vsub_orthogonal_projection EuclideanGeometry.orthogonalProjection_vsub_orthogonalProjection
 
-/- warning: euclidean_geometry.orthogonal_projection_vadd_eq_self -> EuclideanGeometry.orthogonalProjection_vadd_eq_self is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align euclidean_geometry.orthogonal_projection_vadd_eq_self EuclideanGeometry.orthogonalProjection_vadd_eq_selfₓ'. -/
 /-- Adding a vector to a point in the given subspace, then taking the
 orthogonal projection, produces the original point if the vector was
 in the orthogonal direction. -/
@@ -600,9 +513,6 @@ theorem orthogonalProjection_vadd_eq_self {s : AffineSubspace ℝ P} [Nonempty s
   exact (_ : s.direction).2
 #align euclidean_geometry.orthogonal_projection_vadd_eq_self EuclideanGeometry.orthogonalProjection_vadd_eq_self
 
-/- warning: euclidean_geometry.orthogonal_projection_vadd_smul_vsub_orthogonal_projection -> EuclideanGeometry.orthogonalProjection_vadd_smul_vsub_orthogonalProjection is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align euclidean_geometry.orthogonal_projection_vadd_smul_vsub_orthogonal_projection EuclideanGeometry.orthogonalProjection_vadd_smul_vsub_orthogonalProjectionₓ'. -/
 /-- Adding a vector to a point in the given subspace, then taking the
 orthogonal projection, produces the original point if the vector is a
 multiple of the result of subtracting a point's orthogonal projection
@@ -614,9 +524,6 @@ theorem orthogonalProjection_vadd_smul_vsub_orthogonalProjection {s : AffineSubs
     (Submodule.smul_mem _ _ (vsub_orthogonalProjection_mem_direction_orthogonal s _))
 #align euclidean_geometry.orthogonal_projection_vadd_smul_vsub_orthogonal_projection EuclideanGeometry.orthogonalProjection_vadd_smul_vsub_orthogonalProjection
 
-/- warning: euclidean_geometry.dist_sq_eq_dist_orthogonal_projection_sq_add_dist_orthogonal_projection_sq -> EuclideanGeometry.dist_sq_eq_dist_orthogonalProjection_sq_add_dist_orthogonalProjection_sq is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align euclidean_geometry.dist_sq_eq_dist_orthogonal_projection_sq_add_dist_orthogonal_projection_sq EuclideanGeometry.dist_sq_eq_dist_orthogonalProjection_sq_add_dist_orthogonalProjection_sqₓ'. -/
 /-- The square of the distance from a point in `s` to `p2` equals the
 sum of the squares of the distances of the two points to the
 `orthogonal_projection`. -/
@@ -635,9 +542,6 @@ theorem dist_sq_eq_dist_orthogonalProjection_sq_add_dist_orthogonalProjection_sq
       (orthogonal_projection_vsub_mem_direction_orthogonal s p2)
 #align euclidean_geometry.dist_sq_eq_dist_orthogonal_projection_sq_add_dist_orthogonal_projection_sq EuclideanGeometry.dist_sq_eq_dist_orthogonalProjection_sq_add_dist_orthogonalProjection_sq
 
-/- warning: euclidean_geometry.dist_sq_smul_orthogonal_vadd_smul_orthogonal_vadd -> EuclideanGeometry.dist_sq_smul_orthogonal_vadd_smul_orthogonal_vadd is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align euclidean_geometry.dist_sq_smul_orthogonal_vadd_smul_orthogonal_vadd EuclideanGeometry.dist_sq_smul_orthogonal_vadd_smul_orthogonal_vaddₓ'. -/
 /-- The square of the distance between two points constructed by
 adding multiples of the same orthogonal vector to points in the same
 subspace. -/
@@ -689,26 +593,17 @@ def reflection (s : AffineSubspace ℝ P) [Nonempty s] [CompleteSpace s.directio
 #align euclidean_geometry.reflection EuclideanGeometry.reflection
 -/
 
-/- warning: euclidean_geometry.reflection_apply -> EuclideanGeometry.reflection_apply is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align euclidean_geometry.reflection_apply EuclideanGeometry.reflection_applyₓ'. -/
 /-- The result of reflecting. -/
 theorem reflection_apply (s : AffineSubspace ℝ P) [Nonempty s] [CompleteSpace s.direction] (p : P) :
     reflection s p = ↑(orthogonalProjection s p) -ᵥ p +ᵥ orthogonalProjection s p :=
   rfl
 #align euclidean_geometry.reflection_apply EuclideanGeometry.reflection_apply
 
-/- warning: euclidean_geometry.eq_reflection_of_eq_subspace -> EuclideanGeometry.eq_reflection_of_eq_subspace is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align euclidean_geometry.eq_reflection_of_eq_subspace EuclideanGeometry.eq_reflection_of_eq_subspaceₓ'. -/
 theorem eq_reflection_of_eq_subspace {s s' : AffineSubspace ℝ P} [Nonempty s] [Nonempty s']
     [CompleteSpace s.direction] [CompleteSpace s'.direction] (h : s = s') (p : P) :
     (reflection s p : P) = (reflection s' p : P) := by subst h
 #align euclidean_geometry.eq_reflection_of_eq_subspace EuclideanGeometry.eq_reflection_of_eq_subspace
 
-/- warning: euclidean_geometry.reflection_reflection -> EuclideanGeometry.reflection_reflection is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align euclidean_geometry.reflection_reflection EuclideanGeometry.reflection_reflectionₓ'. -/
 /-- Reflecting twice in the same subspace. -/
 @[simp]
 theorem reflection_reflection (s : AffineSubspace ℝ P) [Nonempty s] [CompleteSpace s.direction]
@@ -727,27 +622,18 @@ theorem reflection_reflection (s : AffineSubspace ℝ P) [Nonempty s] [CompleteS
   exact this (orthogonalProjection s p) _ (orthogonal_projection_vsub_orthogonal_projection s p)
 #align euclidean_geometry.reflection_reflection EuclideanGeometry.reflection_reflection
 
-/- warning: euclidean_geometry.reflection_symm -> EuclideanGeometry.reflection_symm is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align euclidean_geometry.reflection_symm EuclideanGeometry.reflection_symmₓ'. -/
 /-- Reflection is its own inverse. -/
 @[simp]
 theorem reflection_symm (s : AffineSubspace ℝ P) [Nonempty s] [CompleteSpace s.direction] :
     (reflection s).symm = reflection s := by ext; rw [← (reflection s).Injective.eq_iff]; simp
 #align euclidean_geometry.reflection_symm EuclideanGeometry.reflection_symm
 
-/- warning: euclidean_geometry.reflection_involutive -> EuclideanGeometry.reflection_involutive is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align euclidean_geometry.reflection_involutive EuclideanGeometry.reflection_involutiveₓ'. -/
 /-- Reflection is involutive. -/
 theorem reflection_involutive (s : AffineSubspace ℝ P) [Nonempty s] [CompleteSpace s.direction] :
     Function.Involutive (reflection s) :=
   reflection_reflection s
 #align euclidean_geometry.reflection_involutive EuclideanGeometry.reflection_involutive
 
-/- warning: euclidean_geometry.reflection_eq_self_iff -> EuclideanGeometry.reflection_eq_self_iff is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align euclidean_geometry.reflection_eq_self_iff EuclideanGeometry.reflection_eq_self_iffₓ'. -/
 /-- A point is its own reflection if and only if it is in the
 subspace. -/
 theorem reflection_eq_self_iff {s : AffineSubspace ℝ P} [Nonempty s] [CompleteSpace s.direction]
@@ -764,9 +650,6 @@ theorem reflection_eq_self_iff {s : AffineSubspace ℝ P} [Nonempty s] [Complete
     simp [h]
 #align euclidean_geometry.reflection_eq_self_iff EuclideanGeometry.reflection_eq_self_iff
 
-/- warning: euclidean_geometry.reflection_eq_iff_orthogonal_projection_eq -> EuclideanGeometry.reflection_eq_iff_orthogonalProjection_eq is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align euclidean_geometry.reflection_eq_iff_orthogonal_projection_eq EuclideanGeometry.reflection_eq_iff_orthogonalProjection_eqₓ'. -/
 /-- Reflecting a point in two subspaces produces the same result if
 and only if the point has the same orthogonal projection in each of
 those subspaces. -/
@@ -787,9 +670,6 @@ theorem reflection_eq_iff_orthogonalProjection_eq (s₁ s₂ : AffineSubspace 
     rw [h]
 #align euclidean_geometry.reflection_eq_iff_orthogonal_projection_eq EuclideanGeometry.reflection_eq_iff_orthogonalProjection_eq
 
-/- warning: euclidean_geometry.dist_reflection -> EuclideanGeometry.dist_reflection is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align euclidean_geometry.dist_reflection EuclideanGeometry.dist_reflectionₓ'. -/
 /-- The distance between `p₁` and the reflection of `p₂` equals that
 between the reflection of `p₁` and `p₂`. -/
 theorem dist_reflection (s : AffineSubspace ℝ P) [Nonempty s] [CompleteSpace s.direction]
@@ -799,9 +679,6 @@ theorem dist_reflection (s : AffineSubspace ℝ P) [Nonempty s] [CompleteSpace s
   exact (reflection s).dist_map _ _
 #align euclidean_geometry.dist_reflection EuclideanGeometry.dist_reflection
 
-/- warning: euclidean_geometry.dist_reflection_eq_of_mem -> EuclideanGeometry.dist_reflection_eq_of_mem is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align euclidean_geometry.dist_reflection_eq_of_mem EuclideanGeometry.dist_reflection_eq_of_memₓ'. -/
 /-- A point in the subspace is equidistant from another point and its
 reflection. -/
 theorem dist_reflection_eq_of_mem (s : AffineSubspace ℝ P) [Nonempty s] [CompleteSpace s.direction]
@@ -812,9 +689,6 @@ theorem dist_reflection_eq_of_mem (s : AffineSubspace ℝ P) [Nonempty s] [Compl
   rw [hp₁]
 #align euclidean_geometry.dist_reflection_eq_of_mem EuclideanGeometry.dist_reflection_eq_of_mem
 
-/- warning: euclidean_geometry.reflection_mem_of_le_of_mem -> EuclideanGeometry.reflection_mem_of_le_of_mem is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align euclidean_geometry.reflection_mem_of_le_of_mem EuclideanGeometry.reflection_mem_of_le_of_memₓ'. -/
 /-- The reflection of a point in a subspace is contained in any larger
 subspace containing both the point and the subspace reflected in. -/
 theorem reflection_mem_of_le_of_mem {s₁ s₂ : AffineSubspace ℝ P} [Nonempty s₁]
@@ -825,9 +699,6 @@ theorem reflection_mem_of_le_of_mem {s₁ s₂ : AffineSubspace ℝ P} [Nonempty
   exact vadd_mem_of_mem_direction (vsub_mem_direction ho hp) ho
 #align euclidean_geometry.reflection_mem_of_le_of_mem EuclideanGeometry.reflection_mem_of_le_of_mem
 
-/- warning: euclidean_geometry.reflection_orthogonal_vadd -> EuclideanGeometry.reflection_orthogonal_vadd is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align euclidean_geometry.reflection_orthogonal_vadd EuclideanGeometry.reflection_orthogonal_vaddₓ'. -/
 /-- Reflecting an orthogonal vector plus a point in the subspace
 produces the negation of that vector plus the point. -/
 theorem reflection_orthogonal_vadd {s : AffineSubspace ℝ P} [Nonempty s] [CompleteSpace s.direction]
@@ -837,9 +708,6 @@ theorem reflection_orthogonal_vadd {s : AffineSubspace ℝ P} [Nonempty s] [Comp
   simp
 #align euclidean_geometry.reflection_orthogonal_vadd EuclideanGeometry.reflection_orthogonal_vadd
 
-/- warning: euclidean_geometry.reflection_vadd_smul_vsub_orthogonal_projection -> EuclideanGeometry.reflection_vadd_smul_vsub_orthogonalProjection is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align euclidean_geometry.reflection_vadd_smul_vsub_orthogonal_projection EuclideanGeometry.reflection_vadd_smul_vsub_orthogonalProjectionₓ'. -/
 /-- Reflecting a vector plus a point in the subspace produces the
 negation of that vector plus the point if the vector is a multiple of
 the result of subtracting a point's orthogonal projection from that
Diff
@@ -188,10 +188,8 @@ theorem dist_smul_vadd_eq_dist {v : V} (p₁ p₂ : P) (hv : v ≠ 0) (r : ℝ)
     rw [← mul_self_inj_of_nonneg dist_nonneg dist_nonneg, dist_smul_vadd_sq, ← sub_eq_zero,
       add_sub_assoc, dist_eq_norm_vsub V p₁ p₂, ← real_inner_self_eq_norm_mul_norm, sub_self]
   have hvi : ⟪v, v⟫ ≠ 0 := by simpa using hv
-  have hd : discrim ⟪v, v⟫ (2 * ⟪v, p₁ -ᵥ p₂⟫) 0 = 2 * ⟪v, p₁ -ᵥ p₂⟫ * (2 * ⟪v, p₁ -ᵥ p₂⟫) :=
-    by
-    rw [discrim]
-    ring
+  have hd : discrim ⟪v, v⟫ (2 * ⟪v, p₁ -ᵥ p₂⟫) 0 = 2 * ⟪v, p₁ -ᵥ p₂⟫ * (2 * ⟪v, p₁ -ᵥ p₂⟫) := by
+    rw [discrim]; ring
   rw [quadratic_eq_zero_iff hvi hd, add_left_neg, zero_div, neg_mul_eq_neg_mul, ←
     mul_sub_right_distrib, sub_eq_add_neg, ← mul_two, mul_assoc, mul_div_assoc, mul_div_mul_left,
     mul_div_assoc]
@@ -226,8 +224,7 @@ theorem eq_of_dist_eq_of_dist_eq_of_mem_of_finrank_eq_two {s : AffineSubspace 
     · intro i j hij
       fin_cases i <;> fin_cases j <;> try exact False.elim (hij rfl)
       · exact ho
-      · rw [real_inner_comm]
-        exact ho
+      · rw [real_inner_comm]; exact ho
   have hbs : Submodule.span ℝ (Set.range b) = s.direction :=
     by
     refine' eq_of_le_of_finrank_eq _ _
@@ -658,10 +655,8 @@ theorem dist_sq_smul_orthogonal_vadd_smul_orthogonal_vadd {s : AffineSubspace 
       (norm_add_sq_eq_norm_sq_add_norm_sq_real
         (Submodule.inner_right_of_mem_orthogonal (vsub_mem_direction hp1 hp2)
           (Submodule.smul_mem _ _ hv)))
-    _ = ‖(p1 -ᵥ p2 : V)‖ * ‖(p1 -ᵥ p2 : V)‖ + |r1 - r2| * |r1 - r2| * ‖v‖ * ‖v‖ :=
-      by
-      rw [norm_smul, Real.norm_eq_abs]
-      ring
+    _ = ‖(p1 -ᵥ p2 : V)‖ * ‖(p1 -ᵥ p2 : V)‖ + |r1 - r2| * |r1 - r2| * ‖v‖ * ‖v‖ := by
+      rw [norm_smul, Real.norm_eq_abs]; ring
     _ = dist p1 p2 * dist p1 p2 + (r1 - r2) * (r1 - r2) * (‖v‖ * ‖v‖) := by
       rw [dist_eq_norm_vsub V p1, abs_mul_abs_self, mul_assoc]
     
@@ -738,10 +733,7 @@ Case conversion may be inaccurate. Consider using '#align euclidean_geometry.ref
 /-- Reflection is its own inverse. -/
 @[simp]
 theorem reflection_symm (s : AffineSubspace ℝ P) [Nonempty s] [CompleteSpace s.direction] :
-    (reflection s).symm = reflection s := by
-  ext
-  rw [← (reflection s).Injective.eq_iff]
-  simp
+    (reflection s).symm = reflection s := by ext; rw [← (reflection s).Injective.eq_iff]; simp
 #align euclidean_geometry.reflection_symm EuclideanGeometry.reflection_symm
 
 /- warning: euclidean_geometry.reflection_involutive -> EuclideanGeometry.reflection_involutive is a dubious translation:
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Joseph Myers, Manuel Candales
 
 ! This file was ported from Lean 3 source module geometry.euclidean.basic
-! leanprover-community/mathlib commit 2de9c37fa71dde2f1c6feff19876dd6a7b1519f0
+! leanprover-community/mathlib commit 0b7c740e25651db0ba63648fbae9f9d6f941e31b
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -14,6 +14,9 @@ import Mathbin.Algebra.QuadraticDiscriminant
 /-!
 # Euclidean spaces
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 This file makes some definitions and proves very basic geometrical
 results about real inner product spaces and Euclidean affine spaces.
 Results about real inner product spaces that involve the norm and
@@ -75,12 +78,17 @@ variable [NormedAddTorsor V P]
 
 include V
 
+#print EuclideanGeometry.dist_left_midpoint_eq_dist_right_midpoint /-
 /-- The midpoint of the segment AB is the same distance from A as it is from B. -/
 theorem dist_left_midpoint_eq_dist_right_midpoint (p1 p2 : P) :
     dist p1 (midpoint ℝ p1 p2) = dist p2 (midpoint ℝ p1 p2) := by
   rw [dist_left_midpoint p1 p2, dist_right_midpoint p1 p2]
 #align euclidean_geometry.dist_left_midpoint_eq_dist_right_midpoint EuclideanGeometry.dist_left_midpoint_eq_dist_right_midpoint
+-/
 
+/- warning: euclidean_geometry.inner_weighted_vsub -> EuclideanGeometry.inner_weightedVSub is a dubious translation:
+<too large>
+Case conversion may be inaccurate. Consider using '#align euclidean_geometry.inner_weighted_vsub EuclideanGeometry.inner_weightedVSubₓ'. -/
 /-- The inner product of two vectors given with `weighted_vsub`, in
 terms of the pairwise distances. -/
 theorem inner_weightedVSub {ι₁ : Type _} {s₁ : Finset ι₁} {w₁ : ι₁ → ℝ} (p₁ : ι₁ → P)
@@ -96,6 +104,9 @@ theorem inner_weightedVSub {ι₁ : Type _} {s₁ : Finset ι₁} {w₁ : ι₁
   rcongr (i₁ i₂) <;> rw [dist_eq_norm_vsub V (p₁ i₁) (p₂ i₂)]
 #align euclidean_geometry.inner_weighted_vsub EuclideanGeometry.inner_weightedVSub
 
+/- warning: euclidean_geometry.dist_affine_combination -> EuclideanGeometry.dist_affineCombination is a dubious translation:
+<too large>
+Case conversion may be inaccurate. Consider using '#align euclidean_geometry.dist_affine_combination EuclideanGeometry.dist_affineCombinationₓ'. -/
 /-- The distance between two points given with `affine_combination`,
 in terms of the pairwise distances between the points in that
 combination. -/
@@ -116,6 +127,12 @@ theorem dist_affineCombination {ι : Type _} {s : Finset ι} {w₁ w₂ : ι →
   exact inner_weighted_vsub p h p h
 #align euclidean_geometry.dist_affine_combination EuclideanGeometry.dist_affineCombination
 
+/- warning: euclidean_geometry.inner_vsub_vsub_of_dist_eq_of_dist_eq -> EuclideanGeometry.inner_vsub_vsub_of_dist_eq_of_dist_eq is a dubious translation:
+lean 3 declaration is
+  forall {V : Type.{u1}} {P : Type.{u2}} [_inst_1 : NormedAddCommGroup.{u1} V] [_inst_2 : InnerProductSpace.{0, u1} Real V Real.isROrC _inst_1] [_inst_3 : MetricSpace.{u2} P] [_inst_4 : NormedAddTorsor.{u1, u2} V P (NormedAddCommGroup.toSeminormedAddCommGroup.{u1} V _inst_1) (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)] {c₁ : P} {c₂ : P} {p₁ : P} {p₂ : P}, (Eq.{1} Real (Dist.dist.{u2} P (PseudoMetricSpace.toHasDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) p₁ c₁) (Dist.dist.{u2} P (PseudoMetricSpace.toHasDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) p₂ c₁)) -> (Eq.{1} Real (Dist.dist.{u2} P (PseudoMetricSpace.toHasDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) p₁ c₂) (Dist.dist.{u2} P (PseudoMetricSpace.toHasDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) p₂ c₂)) -> (Eq.{1} Real (Inner.inner.{0, u1} Real V (InnerProductSpace.toHasInner.{0, u1} Real V Real.isROrC _inst_1 _inst_2) (VSub.vsub.{u1, u2} V P (AddTorsor.toHasVsub.{u1, u2} V P (NormedAddGroup.toAddGroup.{u1} V (NormedAddCommGroup.toNormedAddGroup.{u1} V _inst_1)) (NormedAddTorsor.toAddTorsor'.{u1, u2} V P _inst_1 _inst_3 _inst_4)) c₂ c₁) (VSub.vsub.{u1, u2} V P (AddTorsor.toHasVsub.{u1, u2} V P (NormedAddGroup.toAddGroup.{u1} V (NormedAddCommGroup.toNormedAddGroup.{u1} V _inst_1)) (NormedAddTorsor.toAddTorsor'.{u1, u2} V P _inst_1 _inst_3 _inst_4)) p₂ p₁)) (OfNat.ofNat.{0} Real 0 (OfNat.mk.{0} Real 0 (Zero.zero.{0} Real Real.hasZero))))
+but is expected to have type
+  forall {V : Type.{u1}} {P : Type.{u2}} [_inst_1 : NormedAddCommGroup.{u1} V] [_inst_2 : InnerProductSpace.{0, u1} Real V Real.isROrC _inst_1] [_inst_3 : MetricSpace.{u2} P] [_inst_4 : NormedAddTorsor.{u1, u2} V P (NormedAddCommGroup.toSeminormedAddCommGroup.{u1} V _inst_1) (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)] {c₁ : P} {c₂ : P} {p₁ : P} {p₂ : P}, (Eq.{1} Real (Dist.dist.{u2} P (PseudoMetricSpace.toDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) p₁ c₁) (Dist.dist.{u2} P (PseudoMetricSpace.toDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) p₂ c₁)) -> (Eq.{1} Real (Dist.dist.{u2} P (PseudoMetricSpace.toDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) p₁ c₂) (Dist.dist.{u2} P (PseudoMetricSpace.toDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) p₂ c₂)) -> (Eq.{1} Real (Inner.inner.{0, u1} Real V (InnerProductSpace.toInner.{0, u1} Real V Real.isROrC _inst_1 _inst_2) (VSub.vsub.{u1, u2} V P (AddTorsor.toVSub.{u1, u2} V P (SeminormedAddGroup.toAddGroup.{u1} V (SeminormedAddCommGroup.toSeminormedAddGroup.{u1} V (NormedAddCommGroup.toSeminormedAddCommGroup.{u1} V _inst_1))) (NormedAddTorsor.toAddTorsor.{u1, u2} V P (NormedAddCommGroup.toSeminormedAddCommGroup.{u1} V _inst_1) (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3) _inst_4)) c₂ c₁) (VSub.vsub.{u1, u2} V P (AddTorsor.toVSub.{u1, u2} V P (SeminormedAddGroup.toAddGroup.{u1} V (SeminormedAddCommGroup.toSeminormedAddGroup.{u1} V (NormedAddCommGroup.toSeminormedAddCommGroup.{u1} V _inst_1))) (NormedAddTorsor.toAddTorsor.{u1, u2} V P (NormedAddCommGroup.toSeminormedAddCommGroup.{u1} V _inst_1) (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3) _inst_4)) p₂ p₁)) (OfNat.ofNat.{0} Real 0 (Zero.toOfNat0.{0} Real Real.instZeroReal)))
+Case conversion may be inaccurate. Consider using '#align euclidean_geometry.inner_vsub_vsub_of_dist_eq_of_dist_eq EuclideanGeometry.inner_vsub_vsub_of_dist_eq_of_dist_eqₓ'. -/
 /-- Suppose that `c₁` is equidistant from `p₁` and `p₂`, and the same
 applies to `c₂`.  Then the vector between `c₁` and `c₂` is orthogonal
 to that between `p₁` and `p₂`.  (In two dimensions, this says that the
@@ -144,6 +161,9 @@ theorem inner_vsub_vsub_of_dist_eq_of_dist_eq {c₁ c₂ p₁ p₂ : P} (hc₁ :
   simpa [inner_add_left, ← mul_two, (by norm_num : (2 : ℝ) ≠ 0)] using h
 #align euclidean_geometry.inner_vsub_vsub_of_dist_eq_of_dist_eq EuclideanGeometry.inner_vsub_vsub_of_dist_eq_of_dist_eq
 
+/- warning: euclidean_geometry.dist_smul_vadd_sq -> EuclideanGeometry.dist_smul_vadd_sq is a dubious translation:
+<too large>
+Case conversion may be inaccurate. Consider using '#align euclidean_geometry.dist_smul_vadd_sq EuclideanGeometry.dist_smul_vadd_sqₓ'. -/
 /-- The squared distance between points on a line (expressed as a
 multiple of a fixed vector added to a point) and another point,
 expressed as a quadratic. -/
@@ -156,6 +176,9 @@ theorem dist_smul_vadd_sq (r : ℝ) (v : V) (p₁ p₂ : P) :
   ring
 #align euclidean_geometry.dist_smul_vadd_sq EuclideanGeometry.dist_smul_vadd_sq
 
+/- warning: euclidean_geometry.dist_smul_vadd_eq_dist -> EuclideanGeometry.dist_smul_vadd_eq_dist is a dubious translation:
+<too large>
+Case conversion may be inaccurate. Consider using '#align euclidean_geometry.dist_smul_vadd_eq_dist EuclideanGeometry.dist_smul_vadd_eq_distₓ'. -/
 /-- The condition for two points on a line to be equidistant from
 another point. -/
 theorem dist_smul_vadd_eq_dist {v : V} (p₁ p₂ : P) (hv : v ≠ 0) (r : ℝ) :
@@ -177,6 +200,9 @@ theorem dist_smul_vadd_eq_dist {v : V} (p₁ p₂ : P) (hv : v ≠ 0) (r : ℝ)
 
 open AffineSubspace FiniteDimensional
 
+/- warning: euclidean_geometry.eq_of_dist_eq_of_dist_eq_of_mem_of_finrank_eq_two -> EuclideanGeometry.eq_of_dist_eq_of_dist_eq_of_mem_of_finrank_eq_two is a dubious translation:
+<too large>
+Case conversion may be inaccurate. Consider using '#align euclidean_geometry.eq_of_dist_eq_of_dist_eq_of_mem_of_finrank_eq_two EuclideanGeometry.eq_of_dist_eq_of_dist_eq_of_mem_of_finrank_eq_twoₓ'. -/
 /-- Distances `r₁` `r₂` of `p` from two different points `c₁` `c₂` determine at
 most two points `p₁` `p₂` in a two-dimensional subspace containing those points
 (two circles intersect in at most two points). -/
@@ -238,6 +264,9 @@ theorem eq_of_dist_eq_of_dist_eq_of_mem_of_finrank_eq_two {s : AffineSubspace 
   cases hpc₁ <;> simp [hpc₁]
 #align euclidean_geometry.eq_of_dist_eq_of_dist_eq_of_mem_of_finrank_eq_two EuclideanGeometry.eq_of_dist_eq_of_dist_eq_of_mem_of_finrank_eq_two
 
+/- warning: euclidean_geometry.eq_of_dist_eq_of_dist_eq_of_finrank_eq_two -> EuclideanGeometry.eq_of_dist_eq_of_dist_eq_of_finrank_eq_two is a dubious translation:
+<too large>
+Case conversion may be inaccurate. Consider using '#align euclidean_geometry.eq_of_dist_eq_of_dist_eq_of_finrank_eq_two EuclideanGeometry.eq_of_dist_eq_of_dist_eq_of_finrank_eq_twoₓ'. -/
 /-- Distances `r₁` `r₂` of `p` from two different points `c₁` `c₂` determine at
 most two points `p₁` `p₂` in two-dimensional space (two circles intersect in at
 most two points). -/
@@ -255,6 +284,7 @@ theorem eq_of_dist_eq_of_dist_eq_of_finrank_eq_two [FiniteDimensional ℝ V] (hd
 
 variable {V}
 
+#print EuclideanGeometry.orthogonalProjectionFn /-
 /-- The orthogonal projection of a point onto a nonempty affine
 subspace, whose direction is complete, as an unbundled function.  This
 definition is only intended for use in setting up the bundled version
@@ -269,7 +299,11 @@ def orthogonalProjectionFn (s : AffineSubspace ℝ P) [Nonempty s] [CompleteSpac
         rw [direction_mk' p s.directionᗮ]
         exact Submodule.isCompl_orthogonal_of_completeSpace)
 #align euclidean_geometry.orthogonal_projection_fn EuclideanGeometry.orthogonalProjectionFn
+-/
 
+/- warning: euclidean_geometry.inter_eq_singleton_orthogonal_projection_fn -> EuclideanGeometry.inter_eq_singleton_orthogonalProjectionFn is a dubious translation:
+<too large>
+Case conversion may be inaccurate. Consider using '#align euclidean_geometry.inter_eq_singleton_orthogonal_projection_fn EuclideanGeometry.inter_eq_singleton_orthogonalProjectionFnₓ'. -/
 /-- The intersection of the subspace and the orthogonal subspace
 through the given point is the `orthogonal_projection_fn` of that
 point onto the subspace.  This lemma is only intended for use in
@@ -286,6 +320,9 @@ theorem inter_eq_singleton_orthogonalProjectionFn {s : AffineSubspace ℝ P} [No
         exact Submodule.isCompl_orthogonal_of_completeSpace)
 #align euclidean_geometry.inter_eq_singleton_orthogonal_projection_fn EuclideanGeometry.inter_eq_singleton_orthogonalProjectionFn
 
+/- warning: euclidean_geometry.orthogonal_projection_fn_mem -> EuclideanGeometry.orthogonalProjectionFn_mem is a dubious translation:
+<too large>
+Case conversion may be inaccurate. Consider using '#align euclidean_geometry.orthogonal_projection_fn_mem EuclideanGeometry.orthogonalProjectionFn_memₓ'. -/
 /-- The `orthogonal_projection_fn` lies in the given subspace.  This
 lemma is only intended for use in setting up the bundled version and
 should not be used once that is defined. -/
@@ -296,6 +333,9 @@ theorem orthogonalProjectionFn_mem {s : AffineSubspace ℝ P} [Nonempty s] [Comp
   exact Set.inter_subset_left _ _
 #align euclidean_geometry.orthogonal_projection_fn_mem EuclideanGeometry.orthogonalProjectionFn_mem
 
+/- warning: euclidean_geometry.orthogonal_projection_fn_mem_orthogonal -> EuclideanGeometry.orthogonalProjectionFn_mem_orthogonal is a dubious translation:
+<too large>
+Case conversion may be inaccurate. Consider using '#align euclidean_geometry.orthogonal_projection_fn_mem_orthogonal EuclideanGeometry.orthogonalProjectionFn_mem_orthogonalₓ'. -/
 /-- The `orthogonal_projection_fn` lies in the orthogonal
 subspace.  This lemma is only intended for use in setting up the
 bundled version and should not be used once that is defined. -/
@@ -306,6 +346,9 @@ theorem orthogonalProjectionFn_mem_orthogonal {s : AffineSubspace ℝ P} [Nonemp
   exact Set.inter_subset_right _ _
 #align euclidean_geometry.orthogonal_projection_fn_mem_orthogonal EuclideanGeometry.orthogonalProjectionFn_mem_orthogonal
 
+/- warning: euclidean_geometry.orthogonal_projection_fn_vsub_mem_direction_orthogonal -> EuclideanGeometry.orthogonalProjectionFn_vsub_mem_direction_orthogonal is a dubious translation:
+<too large>
+Case conversion may be inaccurate. Consider using '#align euclidean_geometry.orthogonal_projection_fn_vsub_mem_direction_orthogonal EuclideanGeometry.orthogonalProjectionFn_vsub_mem_direction_orthogonalₓ'. -/
 /-- Subtracting `p` from its `orthogonal_projection_fn` produces a
 result in the orthogonal direction.  This lemma is only intended for
 use in setting up the bundled version and should not be used once that
@@ -318,6 +361,7 @@ theorem orthogonalProjectionFn_vsub_mem_direction_orthogonal {s : AffineSubspace
 
 attribute [local instance] AffineSubspace.toAddTorsor
 
+#print EuclideanGeometry.orthogonalProjection /-
 /-- The orthogonal projection of a point onto a nonempty affine
 subspace, whose direction is complete. The corresponding linear map
 (mapping a vector to the difference between the projections of two
@@ -354,13 +398,20 @@ def orthogonalProjection (s : AffineSubspace ℝ P) [Nonempty s] [CompleteSpace
     ext
     exact hm.symm
 #align euclidean_geometry.orthogonal_projection EuclideanGeometry.orthogonalProjection
+-/
 
+/- warning: euclidean_geometry.orthogonal_projection_fn_eq -> EuclideanGeometry.orthogonalProjectionFn_eq is a dubious translation:
+<too large>
+Case conversion may be inaccurate. Consider using '#align euclidean_geometry.orthogonal_projection_fn_eq EuclideanGeometry.orthogonalProjectionFn_eqₓ'. -/
 @[simp]
 theorem orthogonalProjectionFn_eq {s : AffineSubspace ℝ P} [Nonempty s] [CompleteSpace s.direction]
     (p : P) : orthogonalProjectionFn s p = orthogonalProjection s p :=
   rfl
 #align euclidean_geometry.orthogonal_projection_fn_eq EuclideanGeometry.orthogonalProjectionFn_eq
 
+/- warning: euclidean_geometry.orthogonal_projection_linear -> EuclideanGeometry.orthogonalProjection_linear is a dubious translation:
+<too large>
+Case conversion may be inaccurate. Consider using '#align euclidean_geometry.orthogonal_projection_linear EuclideanGeometry.orthogonalProjection_linearₓ'. -/
 /-- The linear map corresponding to `orthogonal_projection`. -/
 @[simp]
 theorem orthogonalProjection_linear {s : AffineSubspace ℝ P} [Nonempty s]
@@ -369,6 +420,9 @@ theorem orthogonalProjection_linear {s : AffineSubspace ℝ P} [Nonempty s]
   rfl
 #align euclidean_geometry.orthogonal_projection_linear EuclideanGeometry.orthogonalProjection_linear
 
+/- warning: euclidean_geometry.inter_eq_singleton_orthogonal_projection -> EuclideanGeometry.inter_eq_singleton_orthogonalProjection is a dubious translation:
+<too large>
+Case conversion may be inaccurate. Consider using '#align euclidean_geometry.inter_eq_singleton_orthogonal_projection EuclideanGeometry.inter_eq_singleton_orthogonalProjectionₓ'. -/
 /-- The intersection of the subspace and the orthogonal subspace
 through the given point is the `orthogonal_projection` of that point
 onto the subspace. -/
@@ -380,18 +434,27 @@ theorem inter_eq_singleton_orthogonalProjection {s : AffineSubspace ℝ P} [None
   exact inter_eq_singleton_orthogonal_projection_fn p
 #align euclidean_geometry.inter_eq_singleton_orthogonal_projection EuclideanGeometry.inter_eq_singleton_orthogonalProjection
 
+/- warning: euclidean_geometry.orthogonal_projection_mem -> EuclideanGeometry.orthogonalProjection_mem is a dubious translation:
+<too large>
+Case conversion may be inaccurate. Consider using '#align euclidean_geometry.orthogonal_projection_mem EuclideanGeometry.orthogonalProjection_memₓ'. -/
 /-- The `orthogonal_projection` lies in the given subspace. -/
 theorem orthogonalProjection_mem {s : AffineSubspace ℝ P} [Nonempty s] [CompleteSpace s.direction]
     (p : P) : ↑(orthogonalProjection s p) ∈ s :=
   (orthogonalProjection s p).2
 #align euclidean_geometry.orthogonal_projection_mem EuclideanGeometry.orthogonalProjection_mem
 
+/- warning: euclidean_geometry.orthogonal_projection_mem_orthogonal -> EuclideanGeometry.orthogonalProjection_mem_orthogonal is a dubious translation:
+<too large>
+Case conversion may be inaccurate. Consider using '#align euclidean_geometry.orthogonal_projection_mem_orthogonal EuclideanGeometry.orthogonalProjection_mem_orthogonalₓ'. -/
 /-- The `orthogonal_projection` lies in the orthogonal subspace. -/
 theorem orthogonalProjection_mem_orthogonal (s : AffineSubspace ℝ P) [Nonempty s]
     [CompleteSpace s.direction] (p : P) : ↑(orthogonalProjection s p) ∈ mk' p s.directionᗮ :=
   orthogonalProjectionFn_mem_orthogonal p
 #align euclidean_geometry.orthogonal_projection_mem_orthogonal EuclideanGeometry.orthogonalProjection_mem_orthogonal
 
+/- warning: euclidean_geometry.orthogonal_projection_vsub_mem_direction -> EuclideanGeometry.orthogonalProjection_vsub_mem_direction is a dubious translation:
+<too large>
+Case conversion may be inaccurate. Consider using '#align euclidean_geometry.orthogonal_projection_vsub_mem_direction EuclideanGeometry.orthogonalProjection_vsub_mem_directionₓ'. -/
 /-- Subtracting a point in the given subspace from the
 `orthogonal_projection` produces a result in the direction of the
 given subspace. -/
@@ -401,6 +464,9 @@ theorem orthogonalProjection_vsub_mem_direction {s : AffineSubspace ℝ P} [None
   (orthogonalProjection s p2 -ᵥ ⟨p1, hp1⟩ : s.direction).2
 #align euclidean_geometry.orthogonal_projection_vsub_mem_direction EuclideanGeometry.orthogonalProjection_vsub_mem_direction
 
+/- warning: euclidean_geometry.vsub_orthogonal_projection_mem_direction -> EuclideanGeometry.vsub_orthogonalProjection_mem_direction is a dubious translation:
+<too large>
+Case conversion may be inaccurate. Consider using '#align euclidean_geometry.vsub_orthogonal_projection_mem_direction EuclideanGeometry.vsub_orthogonalProjection_mem_directionₓ'. -/
 /-- Subtracting the `orthogonal_projection` from a point in the given
 subspace produces a result in the direction of the given subspace. -/
 theorem vsub_orthogonalProjection_mem_direction {s : AffineSubspace ℝ P} [Nonempty s]
@@ -409,6 +475,9 @@ theorem vsub_orthogonalProjection_mem_direction {s : AffineSubspace ℝ P} [None
   ((⟨p1, hp1⟩ : s) -ᵥ orthogonalProjection s p2 : s.direction).2
 #align euclidean_geometry.vsub_orthogonal_projection_mem_direction EuclideanGeometry.vsub_orthogonalProjection_mem_direction
 
+/- warning: euclidean_geometry.orthogonal_projection_eq_self_iff -> EuclideanGeometry.orthogonalProjection_eq_self_iff is a dubious translation:
+<too large>
+Case conversion may be inaccurate. Consider using '#align euclidean_geometry.orthogonal_projection_eq_self_iff EuclideanGeometry.orthogonalProjection_eq_self_iffₓ'. -/
 /-- A point equals its orthogonal projection if and only if it lies in
 the subspace. -/
 theorem orthogonalProjection_eq_self_iff {s : AffineSubspace ℝ P} [Nonempty s]
@@ -423,6 +492,9 @@ theorem orthogonalProjection_eq_self_iff {s : AffineSubspace ℝ P} [Nonempty s]
     exact hp
 #align euclidean_geometry.orthogonal_projection_eq_self_iff EuclideanGeometry.orthogonalProjection_eq_self_iff
 
+/- warning: euclidean_geometry.orthogonal_projection_mem_subspace_eq_self -> EuclideanGeometry.orthogonalProjection_mem_subspace_eq_self is a dubious translation:
+<too large>
+Case conversion may be inaccurate. Consider using '#align euclidean_geometry.orthogonal_projection_mem_subspace_eq_self EuclideanGeometry.orthogonalProjection_mem_subspace_eq_selfₓ'. -/
 @[simp]
 theorem orthogonalProjection_mem_subspace_eq_self {s : AffineSubspace ℝ P} [Nonempty s]
     [CompleteSpace s.direction] (p : s) : orthogonalProjection s p = p :=
@@ -432,6 +504,9 @@ theorem orthogonalProjection_mem_subspace_eq_self {s : AffineSubspace ℝ P} [No
   exact p.2
 #align euclidean_geometry.orthogonal_projection_mem_subspace_eq_self EuclideanGeometry.orthogonalProjection_mem_subspace_eq_self
 
+/- warning: euclidean_geometry.orthogonal_projection_orthogonal_projection -> EuclideanGeometry.orthogonalProjection_orthogonalProjection is a dubious translation:
+<too large>
+Case conversion may be inaccurate. Consider using '#align euclidean_geometry.orthogonal_projection_orthogonal_projection EuclideanGeometry.orthogonalProjection_orthogonalProjectionₓ'. -/
 /-- Orthogonal projection is idempotent. -/
 @[simp]
 theorem orthogonalProjection_orthogonalProjection (s : AffineSubspace ℝ P) [Nonempty s]
@@ -443,6 +518,9 @@ theorem orthogonalProjection_orthogonalProjection (s : AffineSubspace ℝ P) [No
   exact orthogonal_projection_mem p
 #align euclidean_geometry.orthogonal_projection_orthogonal_projection EuclideanGeometry.orthogonalProjection_orthogonalProjection
 
+/- warning: euclidean_geometry.eq_orthogonal_projection_of_eq_subspace -> EuclideanGeometry.eq_orthogonalProjection_of_eq_subspace is a dubious translation:
+<too large>
+Case conversion may be inaccurate. Consider using '#align euclidean_geometry.eq_orthogonal_projection_of_eq_subspace EuclideanGeometry.eq_orthogonalProjection_of_eq_subspaceₓ'. -/
 theorem eq_orthogonalProjection_of_eq_subspace {s s' : AffineSubspace ℝ P} [Nonempty s]
     [Nonempty s'] [CompleteSpace s.direction] [CompleteSpace s'.direction] (h : s = s') (p : P) :
     (orthogonalProjection s p : P) = (orthogonalProjection s' p : P) :=
@@ -452,12 +530,18 @@ theorem eq_orthogonalProjection_of_eq_subspace {s s' : AffineSubspace ℝ P} [No
   exact h
 #align euclidean_geometry.eq_orthogonal_projection_of_eq_subspace EuclideanGeometry.eq_orthogonalProjection_of_eq_subspace
 
+/- warning: euclidean_geometry.dist_orthogonal_projection_eq_zero_iff -> EuclideanGeometry.dist_orthogonalProjection_eq_zero_iff is a dubious translation:
+<too large>
+Case conversion may be inaccurate. Consider using '#align euclidean_geometry.dist_orthogonal_projection_eq_zero_iff EuclideanGeometry.dist_orthogonalProjection_eq_zero_iffₓ'. -/
 /-- The distance to a point's orthogonal projection is 0 iff it lies in the subspace. -/
 theorem dist_orthogonalProjection_eq_zero_iff {s : AffineSubspace ℝ P} [Nonempty s]
     [CompleteSpace s.direction] {p : P} : dist p (orthogonalProjection s p) = 0 ↔ p ∈ s := by
   rw [dist_comm, dist_eq_zero, orthogonalProjection_eq_self_iff]
 #align euclidean_geometry.dist_orthogonal_projection_eq_zero_iff EuclideanGeometry.dist_orthogonalProjection_eq_zero_iff
 
+/- warning: euclidean_geometry.dist_orthogonal_projection_ne_zero_of_not_mem -> EuclideanGeometry.dist_orthogonalProjection_ne_zero_of_not_mem is a dubious translation:
+<too large>
+Case conversion may be inaccurate. Consider using '#align euclidean_geometry.dist_orthogonal_projection_ne_zero_of_not_mem EuclideanGeometry.dist_orthogonalProjection_ne_zero_of_not_memₓ'. -/
 /-- The distance between a point and its orthogonal projection is
 nonzero if it does not lie in the subspace. -/
 theorem dist_orthogonalProjection_ne_zero_of_not_mem {s : AffineSubspace ℝ P} [Nonempty s]
@@ -465,6 +549,9 @@ theorem dist_orthogonalProjection_ne_zero_of_not_mem {s : AffineSubspace ℝ P}
   mt dist_orthogonalProjection_eq_zero_iff.mp hp
 #align euclidean_geometry.dist_orthogonal_projection_ne_zero_of_not_mem EuclideanGeometry.dist_orthogonalProjection_ne_zero_of_not_mem
 
+/- warning: euclidean_geometry.orthogonal_projection_vsub_mem_direction_orthogonal -> EuclideanGeometry.orthogonalProjection_vsub_mem_direction_orthogonal is a dubious translation:
+<too large>
+Case conversion may be inaccurate. Consider using '#align euclidean_geometry.orthogonal_projection_vsub_mem_direction_orthogonal EuclideanGeometry.orthogonalProjection_vsub_mem_direction_orthogonalₓ'. -/
 /-- Subtracting `p` from its `orthogonal_projection` produces a result
 in the orthogonal direction. -/
 theorem orthogonalProjection_vsub_mem_direction_orthogonal (s : AffineSubspace ℝ P) [Nonempty s]
@@ -472,6 +559,9 @@ theorem orthogonalProjection_vsub_mem_direction_orthogonal (s : AffineSubspace 
   orthogonalProjectionFn_vsub_mem_direction_orthogonal p
 #align euclidean_geometry.orthogonal_projection_vsub_mem_direction_orthogonal EuclideanGeometry.orthogonalProjection_vsub_mem_direction_orthogonal
 
+/- warning: euclidean_geometry.vsub_orthogonal_projection_mem_direction_orthogonal -> EuclideanGeometry.vsub_orthogonalProjection_mem_direction_orthogonal is a dubious translation:
+<too large>
+Case conversion may be inaccurate. Consider using '#align euclidean_geometry.vsub_orthogonal_projection_mem_direction_orthogonal EuclideanGeometry.vsub_orthogonalProjection_mem_direction_orthogonalₓ'. -/
 /-- Subtracting the `orthogonal_projection` from `p` produces a result
 in the orthogonal direction. -/
 theorem vsub_orthogonalProjection_mem_direction_orthogonal (s : AffineSubspace ℝ P) [Nonempty s]
@@ -480,18 +570,24 @@ theorem vsub_orthogonalProjection_mem_direction_orthogonal (s : AffineSubspace 
     vsub_mem_direction (self_mem_mk' _ _) (orthogonalProjection_mem_orthogonal s p)
 #align euclidean_geometry.vsub_orthogonal_projection_mem_direction_orthogonal EuclideanGeometry.vsub_orthogonalProjection_mem_direction_orthogonal
 
+/- warning: euclidean_geometry.orthogonal_projection_vsub_orthogonal_projection -> EuclideanGeometry.orthogonalProjection_vsub_orthogonalProjection is a dubious translation:
+<too large>
+Case conversion may be inaccurate. Consider using '#align euclidean_geometry.orthogonal_projection_vsub_orthogonal_projection EuclideanGeometry.orthogonalProjection_vsub_orthogonalProjectionₓ'. -/
 /-- Subtracting the `orthogonal_projection` from `p` produces a result in the kernel of the linear
 part of the orthogonal projection. -/
 theorem orthogonalProjection_vsub_orthogonalProjection (s : AffineSubspace ℝ P) [Nonempty s]
     [CompleteSpace s.direction] (p : P) :
     orthogonalProjection s.direction (p -ᵥ orthogonalProjection s p) = 0 :=
   by
-  apply orthogonalProjection_mem_subspace_orthogonal_complement_eq_zero
+  apply orthogonalProjection_mem_subspace_orthogonalComplement_eq_zero
   intro c hc
   rw [← neg_vsub_eq_vsub_rev, inner_neg_right,
     orthogonal_projection_vsub_mem_direction_orthogonal s p c hc, neg_zero]
 #align euclidean_geometry.orthogonal_projection_vsub_orthogonal_projection EuclideanGeometry.orthogonalProjection_vsub_orthogonalProjection
 
+/- warning: euclidean_geometry.orthogonal_projection_vadd_eq_self -> EuclideanGeometry.orthogonalProjection_vadd_eq_self is a dubious translation:
+<too large>
+Case conversion may be inaccurate. Consider using '#align euclidean_geometry.orthogonal_projection_vadd_eq_self EuclideanGeometry.orthogonalProjection_vadd_eq_selfₓ'. -/
 /-- Adding a vector to a point in the given subspace, then taking the
 orthogonal projection, produces the original point if the vector was
 in the orthogonal direction. -/
@@ -507,6 +603,9 @@ theorem orthogonalProjection_vadd_eq_self {s : AffineSubspace ℝ P} [Nonempty s
   exact (_ : s.direction).2
 #align euclidean_geometry.orthogonal_projection_vadd_eq_self EuclideanGeometry.orthogonalProjection_vadd_eq_self
 
+/- warning: euclidean_geometry.orthogonal_projection_vadd_smul_vsub_orthogonal_projection -> EuclideanGeometry.orthogonalProjection_vadd_smul_vsub_orthogonalProjection is a dubious translation:
+<too large>
+Case conversion may be inaccurate. Consider using '#align euclidean_geometry.orthogonal_projection_vadd_smul_vsub_orthogonal_projection EuclideanGeometry.orthogonalProjection_vadd_smul_vsub_orthogonalProjectionₓ'. -/
 /-- Adding a vector to a point in the given subspace, then taking the
 orthogonal projection, produces the original point if the vector is a
 multiple of the result of subtracting a point's orthogonal projection
@@ -518,6 +617,9 @@ theorem orthogonalProjection_vadd_smul_vsub_orthogonalProjection {s : AffineSubs
     (Submodule.smul_mem _ _ (vsub_orthogonalProjection_mem_direction_orthogonal s _))
 #align euclidean_geometry.orthogonal_projection_vadd_smul_vsub_orthogonal_projection EuclideanGeometry.orthogonalProjection_vadd_smul_vsub_orthogonalProjection
 
+/- warning: euclidean_geometry.dist_sq_eq_dist_orthogonal_projection_sq_add_dist_orthogonal_projection_sq -> EuclideanGeometry.dist_sq_eq_dist_orthogonalProjection_sq_add_dist_orthogonalProjection_sq is a dubious translation:
+<too large>
+Case conversion may be inaccurate. Consider using '#align euclidean_geometry.dist_sq_eq_dist_orthogonal_projection_sq_add_dist_orthogonal_projection_sq EuclideanGeometry.dist_sq_eq_dist_orthogonalProjection_sq_add_dist_orthogonalProjection_sqₓ'. -/
 /-- The square of the distance from a point in `s` to `p2` equals the
 sum of the squares of the distances of the two points to the
 `orthogonal_projection`. -/
@@ -536,6 +638,9 @@ theorem dist_sq_eq_dist_orthogonalProjection_sq_add_dist_orthogonalProjection_sq
       (orthogonal_projection_vsub_mem_direction_orthogonal s p2)
 #align euclidean_geometry.dist_sq_eq_dist_orthogonal_projection_sq_add_dist_orthogonal_projection_sq EuclideanGeometry.dist_sq_eq_dist_orthogonalProjection_sq_add_dist_orthogonalProjection_sq
 
+/- warning: euclidean_geometry.dist_sq_smul_orthogonal_vadd_smul_orthogonal_vadd -> EuclideanGeometry.dist_sq_smul_orthogonal_vadd_smul_orthogonal_vadd is a dubious translation:
+<too large>
+Case conversion may be inaccurate. Consider using '#align euclidean_geometry.dist_sq_smul_orthogonal_vadd_smul_orthogonal_vadd EuclideanGeometry.dist_sq_smul_orthogonal_vadd_smul_orthogonal_vaddₓ'. -/
 /-- The square of the distance between two points constructed by
 adding multiples of the same orthogonal vector to points in the same
 subspace. -/
@@ -562,6 +667,7 @@ theorem dist_sq_smul_orthogonal_vadd_smul_orthogonal_vadd {s : AffineSubspace 
     
 #align euclidean_geometry.dist_sq_smul_orthogonal_vadd_smul_orthogonal_vadd EuclideanGeometry.dist_sq_smul_orthogonal_vadd_smul_orthogonal_vadd
 
+#print EuclideanGeometry.reflection /-
 /-- Reflection in an affine subspace, which is expected to be nonempty
 and complete.  The word "reflection" is sometimes understood to mean
 specifically reflection in a codimension-one subspace, and sometimes
@@ -586,18 +692,28 @@ def reflection (s : AffineSubspace ℝ P) [Nonempty s] [CompleteSpace s.directio
         orthogonalProjection_mem_subspace_eq_self, vadd_vsub, ContinuousLinearMap.coe_coe,
         ContinuousLinearEquiv.coe_coe, this] using key)
 #align euclidean_geometry.reflection EuclideanGeometry.reflection
+-/
 
+/- warning: euclidean_geometry.reflection_apply -> EuclideanGeometry.reflection_apply is a dubious translation:
+<too large>
+Case conversion may be inaccurate. Consider using '#align euclidean_geometry.reflection_apply EuclideanGeometry.reflection_applyₓ'. -/
 /-- The result of reflecting. -/
 theorem reflection_apply (s : AffineSubspace ℝ P) [Nonempty s] [CompleteSpace s.direction] (p : P) :
     reflection s p = ↑(orthogonalProjection s p) -ᵥ p +ᵥ orthogonalProjection s p :=
   rfl
 #align euclidean_geometry.reflection_apply EuclideanGeometry.reflection_apply
 
+/- warning: euclidean_geometry.eq_reflection_of_eq_subspace -> EuclideanGeometry.eq_reflection_of_eq_subspace is a dubious translation:
+<too large>
+Case conversion may be inaccurate. Consider using '#align euclidean_geometry.eq_reflection_of_eq_subspace EuclideanGeometry.eq_reflection_of_eq_subspaceₓ'. -/
 theorem eq_reflection_of_eq_subspace {s s' : AffineSubspace ℝ P} [Nonempty s] [Nonempty s']
     [CompleteSpace s.direction] [CompleteSpace s'.direction] (h : s = s') (p : P) :
     (reflection s p : P) = (reflection s' p : P) := by subst h
 #align euclidean_geometry.eq_reflection_of_eq_subspace EuclideanGeometry.eq_reflection_of_eq_subspace
 
+/- warning: euclidean_geometry.reflection_reflection -> EuclideanGeometry.reflection_reflection is a dubious translation:
+<too large>
+Case conversion may be inaccurate. Consider using '#align euclidean_geometry.reflection_reflection EuclideanGeometry.reflection_reflectionₓ'. -/
 /-- Reflecting twice in the same subspace. -/
 @[simp]
 theorem reflection_reflection (s : AffineSubspace ℝ P) [Nonempty s] [CompleteSpace s.direction]
@@ -616,6 +732,9 @@ theorem reflection_reflection (s : AffineSubspace ℝ P) [Nonempty s] [CompleteS
   exact this (orthogonalProjection s p) _ (orthogonal_projection_vsub_orthogonal_projection s p)
 #align euclidean_geometry.reflection_reflection EuclideanGeometry.reflection_reflection
 
+/- warning: euclidean_geometry.reflection_symm -> EuclideanGeometry.reflection_symm is a dubious translation:
+<too large>
+Case conversion may be inaccurate. Consider using '#align euclidean_geometry.reflection_symm EuclideanGeometry.reflection_symmₓ'. -/
 /-- Reflection is its own inverse. -/
 @[simp]
 theorem reflection_symm (s : AffineSubspace ℝ P) [Nonempty s] [CompleteSpace s.direction] :
@@ -625,12 +744,18 @@ theorem reflection_symm (s : AffineSubspace ℝ P) [Nonempty s] [CompleteSpace s
   simp
 #align euclidean_geometry.reflection_symm EuclideanGeometry.reflection_symm
 
+/- warning: euclidean_geometry.reflection_involutive -> EuclideanGeometry.reflection_involutive is a dubious translation:
+<too large>
+Case conversion may be inaccurate. Consider using '#align euclidean_geometry.reflection_involutive EuclideanGeometry.reflection_involutiveₓ'. -/
 /-- Reflection is involutive. -/
 theorem reflection_involutive (s : AffineSubspace ℝ P) [Nonempty s] [CompleteSpace s.direction] :
     Function.Involutive (reflection s) :=
   reflection_reflection s
 #align euclidean_geometry.reflection_involutive EuclideanGeometry.reflection_involutive
 
+/- warning: euclidean_geometry.reflection_eq_self_iff -> EuclideanGeometry.reflection_eq_self_iff is a dubious translation:
+<too large>
+Case conversion may be inaccurate. Consider using '#align euclidean_geometry.reflection_eq_self_iff EuclideanGeometry.reflection_eq_self_iffₓ'. -/
 /-- A point is its own reflection if and only if it is in the
 subspace. -/
 theorem reflection_eq_self_iff {s : AffineSubspace ℝ P} [Nonempty s] [CompleteSpace s.direction]
@@ -647,6 +772,9 @@ theorem reflection_eq_self_iff {s : AffineSubspace ℝ P} [Nonempty s] [Complete
     simp [h]
 #align euclidean_geometry.reflection_eq_self_iff EuclideanGeometry.reflection_eq_self_iff
 
+/- warning: euclidean_geometry.reflection_eq_iff_orthogonal_projection_eq -> EuclideanGeometry.reflection_eq_iff_orthogonalProjection_eq is a dubious translation:
+<too large>
+Case conversion may be inaccurate. Consider using '#align euclidean_geometry.reflection_eq_iff_orthogonal_projection_eq EuclideanGeometry.reflection_eq_iff_orthogonalProjection_eqₓ'. -/
 /-- Reflecting a point in two subspaces produces the same result if
 and only if the point has the same orthogonal projection in each of
 those subspaces. -/
@@ -667,6 +795,9 @@ theorem reflection_eq_iff_orthogonalProjection_eq (s₁ s₂ : AffineSubspace 
     rw [h]
 #align euclidean_geometry.reflection_eq_iff_orthogonal_projection_eq EuclideanGeometry.reflection_eq_iff_orthogonalProjection_eq
 
+/- warning: euclidean_geometry.dist_reflection -> EuclideanGeometry.dist_reflection is a dubious translation:
+<too large>
+Case conversion may be inaccurate. Consider using '#align euclidean_geometry.dist_reflection EuclideanGeometry.dist_reflectionₓ'. -/
 /-- The distance between `p₁` and the reflection of `p₂` equals that
 between the reflection of `p₁` and `p₂`. -/
 theorem dist_reflection (s : AffineSubspace ℝ P) [Nonempty s] [CompleteSpace s.direction]
@@ -676,6 +807,9 @@ theorem dist_reflection (s : AffineSubspace ℝ P) [Nonempty s] [CompleteSpace s
   exact (reflection s).dist_map _ _
 #align euclidean_geometry.dist_reflection EuclideanGeometry.dist_reflection
 
+/- warning: euclidean_geometry.dist_reflection_eq_of_mem -> EuclideanGeometry.dist_reflection_eq_of_mem is a dubious translation:
+<too large>
+Case conversion may be inaccurate. Consider using '#align euclidean_geometry.dist_reflection_eq_of_mem EuclideanGeometry.dist_reflection_eq_of_memₓ'. -/
 /-- A point in the subspace is equidistant from another point and its
 reflection. -/
 theorem dist_reflection_eq_of_mem (s : AffineSubspace ℝ P) [Nonempty s] [CompleteSpace s.direction]
@@ -686,6 +820,9 @@ theorem dist_reflection_eq_of_mem (s : AffineSubspace ℝ P) [Nonempty s] [Compl
   rw [hp₁]
 #align euclidean_geometry.dist_reflection_eq_of_mem EuclideanGeometry.dist_reflection_eq_of_mem
 
+/- warning: euclidean_geometry.reflection_mem_of_le_of_mem -> EuclideanGeometry.reflection_mem_of_le_of_mem is a dubious translation:
+<too large>
+Case conversion may be inaccurate. Consider using '#align euclidean_geometry.reflection_mem_of_le_of_mem EuclideanGeometry.reflection_mem_of_le_of_memₓ'. -/
 /-- The reflection of a point in a subspace is contained in any larger
 subspace containing both the point and the subspace reflected in. -/
 theorem reflection_mem_of_le_of_mem {s₁ s₂ : AffineSubspace ℝ P} [Nonempty s₁]
@@ -696,6 +833,9 @@ theorem reflection_mem_of_le_of_mem {s₁ s₂ : AffineSubspace ℝ P} [Nonempty
   exact vadd_mem_of_mem_direction (vsub_mem_direction ho hp) ho
 #align euclidean_geometry.reflection_mem_of_le_of_mem EuclideanGeometry.reflection_mem_of_le_of_mem
 
+/- warning: euclidean_geometry.reflection_orthogonal_vadd -> EuclideanGeometry.reflection_orthogonal_vadd is a dubious translation:
+<too large>
+Case conversion may be inaccurate. Consider using '#align euclidean_geometry.reflection_orthogonal_vadd EuclideanGeometry.reflection_orthogonal_vaddₓ'. -/
 /-- Reflecting an orthogonal vector plus a point in the subspace
 produces the negation of that vector plus the point. -/
 theorem reflection_orthogonal_vadd {s : AffineSubspace ℝ P} [Nonempty s] [CompleteSpace s.direction]
@@ -705,6 +845,9 @@ theorem reflection_orthogonal_vadd {s : AffineSubspace ℝ P} [Nonempty s] [Comp
   simp
 #align euclidean_geometry.reflection_orthogonal_vadd EuclideanGeometry.reflection_orthogonal_vadd
 
+/- warning: euclidean_geometry.reflection_vadd_smul_vsub_orthogonal_projection -> EuclideanGeometry.reflection_vadd_smul_vsub_orthogonalProjection is a dubious translation:
+<too large>
+Case conversion may be inaccurate. Consider using '#align euclidean_geometry.reflection_vadd_smul_vsub_orthogonal_projection EuclideanGeometry.reflection_vadd_smul_vsub_orthogonalProjectionₓ'. -/
 /-- Reflecting a vector plus a point in the subspace produces the
 negation of that vector plus the point if the vector is a multiple of
 the result of subtracting a point's orthogonal projection from that
Diff
@@ -83,18 +83,18 @@ theorem dist_left_midpoint_eq_dist_right_midpoint (p1 p2 : P) :
 
 /-- The inner product of two vectors given with `weighted_vsub`, in
 terms of the pairwise distances. -/
-theorem inner_weightedVsub {ι₁ : Type _} {s₁ : Finset ι₁} {w₁ : ι₁ → ℝ} (p₁ : ι₁ → P)
+theorem inner_weightedVSub {ι₁ : Type _} {s₁ : Finset ι₁} {w₁ : ι₁ → ℝ} (p₁ : ι₁ → P)
     (h₁ : (∑ i in s₁, w₁ i) = 0) {ι₂ : Type _} {s₂ : Finset ι₂} {w₂ : ι₂ → ℝ} (p₂ : ι₂ → P)
     (h₂ : (∑ i in s₂, w₂ i) = 0) :
-    ⟪s₁.weightedVsub p₁ w₁, s₂.weightedVsub p₂ w₂⟫ =
+    ⟪s₁.weightedVSub p₁ w₁, s₂.weightedVSub p₂ w₂⟫ =
       (-∑ i₁ in s₁, ∑ i₂ in s₂, w₁ i₁ * w₂ i₂ * (dist (p₁ i₁) (p₂ i₂) * dist (p₁ i₁) (p₂ i₂))) /
         2 :=
   by
-  rw [Finset.weightedVsub_apply, Finset.weightedVsub_apply,
+  rw [Finset.weightedVSub_apply, Finset.weightedVSub_apply,
     inner_sum_smul_sum_smul_of_sum_eq_zero _ h₁ _ h₂]
   simp_rw [vsub_sub_vsub_cancel_right]
   rcongr (i₁ i₂) <;> rw [dist_eq_norm_vsub V (p₁ i₁) (p₂ i₂)]
-#align euclidean_geometry.inner_weighted_vsub EuclideanGeometry.inner_weightedVsub
+#align euclidean_geometry.inner_weighted_vsub EuclideanGeometry.inner_weightedVSub
 
 /-- The distance between two points given with `affine_combination`,
 in terms of the pairwise distances between the points in that
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Joseph Myers, Manuel Candales
 
 ! This file was ported from Lean 3 source module geometry.euclidean.basic
-! leanprover-community/mathlib commit 46b633fd842bef9469441c0209906f6dddd2b4f5
+! leanprover-community/mathlib commit 2de9c37fa71dde2f1c6feff19876dd6a7b1519f0
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -101,7 +101,7 @@ in terms of the pairwise distances between the points in that
 combination. -/
 theorem dist_affineCombination {ι : Type _} {s : Finset ι} {w₁ w₂ : ι → ℝ} (p : ι → P)
     (h₁ : (∑ i in s, w₁ i) = 1) (h₂ : (∑ i in s, w₂ i) = 1) : by
-    have a₁ := s.affine_combination p w₁ <;> have a₂ := s.affine_combination p w₂ <;>
+    have a₁ := s.affine_combination ℝ p w₁ <;> have a₂ := s.affine_combination ℝ p w₂ <;>
       exact
         dist a₁ a₂ * dist a₁ a₂ =
           (-∑ i₁ in s,
@@ -109,7 +109,7 @@ theorem dist_affineCombination {ι : Type _} {s : Finset ι} {w₁ w₂ : ι →
                   (w₁ - w₂) i₁ * (w₁ - w₂) i₂ * (dist (p i₁) (p i₂) * dist (p i₁) (p i₂))) /
             2 :=
   by
-  rw [dist_eq_norm_vsub V (s.affine_combination p w₁) (s.affine_combination p w₂), ←
+  rw [dist_eq_norm_vsub V (s.affine_combination ℝ p w₁) (s.affine_combination ℝ p w₂), ←
     @inner_self_eq_norm_mul_norm ℝ, Finset.affineCombination_vsub]
   have h : (∑ i in s, (w₁ - w₂) i) = 0 := by
     simp_rw [Pi.sub_apply, Finset.sum_sub_distrib, h₁, h₂, sub_self]
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Joseph Myers, Manuel Candales
 
 ! This file was ported from Lean 3 source module geometry.euclidean.basic
-! leanprover-community/mathlib commit eea141bc9cf205beebfd46e2068c7c01ee8db4f6
+! leanprover-community/mathlib commit 46b633fd842bef9469441c0209906f6dddd2b4f5
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -32,8 +32,9 @@ proofs or more geometrical content generally go in separate files.
 ## Implementation notes
 
 To declare `P` as the type of points in a Euclidean affine space with
-`V` as the type of vectors, use `[inner_product_space ℝ V] [metric_space P]
-[normed_add_torsor V P]`.  This works better with `out_param` to make
+`V` as the type of vectors, use
+`[normed_add_comm_group V] [inner_product_space ℝ V] [metric_space P] [normed_add_torsor V P]`.
+This works better with `out_param` to make
 `V` implicit in most cases than having a separate type alias for
 Euclidean affine spaces.
 
@@ -66,7 +67,11 @@ Euclidean affine spaces.
 -/
 
 
-variable {V : Type _} {P : Type _} [InnerProductSpace ℝ V] [MetricSpace P] [NormedAddTorsor V P]
+variable {V : Type _} {P : Type _}
+
+variable [NormedAddCommGroup V] [InnerProductSpace ℝ V] [MetricSpace P]
+
+variable [NormedAddTorsor V P]
 
 include V
 
@@ -105,7 +110,7 @@ theorem dist_affineCombination {ι : Type _} {s : Finset ι} {w₁ w₂ : ι →
             2 :=
   by
   rw [dist_eq_norm_vsub V (s.affine_combination p w₁) (s.affine_combination p w₂), ←
-    inner_self_eq_norm_mul_norm, Finset.affineCombination_vsub]
+    @inner_self_eq_norm_mul_norm ℝ, Finset.affineCombination_vsub]
   have h : (∑ i in s, (w₁ - w₂) i) = 0 := by
     simp_rw [Pi.sub_apply, Finset.sum_sub_distrib, h₁, h₂, sub_self]
   exact inner_weighted_vsub p h p h
Diff
@@ -4,11 +4,10 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Joseph Myers, Manuel Candales
 
 ! This file was ported from Lean 3 source module geometry.euclidean.basic
-! leanprover-community/mathlib commit a37865088599172dc923253bb7b31998297d9c8a
+! leanprover-community/mathlib commit eea141bc9cf205beebfd46e2068c7c01ee8db4f6
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
-import Mathbin.Analysis.Convex.StrictConvexBetween
 import Mathbin.Analysis.InnerProductSpace.Projection
 import Mathbin.Algebra.QuadraticDiscriminant
 
@@ -713,530 +712,5 @@ theorem reflection_vadd_smul_vsub_orthogonalProjection {s : AffineSubspace ℝ P
     (Submodule.smul_mem _ _ (vsub_orthogonalProjection_mem_direction_orthogonal s _))
 #align euclidean_geometry.reflection_vadd_smul_vsub_orthogonal_projection EuclideanGeometry.reflection_vadd_smul_vsub_orthogonalProjection
 
-omit V
-
-variable (P)
-
-/-- A `sphere P` bundles a `center` and `radius`. This definition does not require the radius to
-be positive; that should be given as a hypothesis to lemmas that require it. -/
-@[ext]
-structure Sphere where
-  center : P
-  radius : ℝ
-#align euclidean_geometry.sphere EuclideanGeometry.Sphere
-
-variable {P}
-
-instance [Nonempty P] : Nonempty (Sphere P) :=
-  ⟨⟨Classical.arbitrary P, 0⟩⟩
-
-instance : Coe (Sphere P) (Set P) :=
-  ⟨fun s => Metric.sphere s.center s.radius⟩
-
-instance : Membership P (Sphere P) :=
-  ⟨fun p s => p ∈ (s : Set P)⟩
-
-theorem Sphere.mk_center (c : P) (r : ℝ) : (⟨c, r⟩ : Sphere P).center = c :=
-  rfl
-#align euclidean_geometry.sphere.mk_center EuclideanGeometry.Sphere.mk_center
-
-theorem Sphere.mk_radius (c : P) (r : ℝ) : (⟨c, r⟩ : Sphere P).radius = r :=
-  rfl
-#align euclidean_geometry.sphere.mk_radius EuclideanGeometry.Sphere.mk_radius
-
-@[simp]
-theorem Sphere.mk_center_radius (s : Sphere P) : (⟨s.center, s.radius⟩ : Sphere P) = s := by
-  ext <;> rfl
-#align euclidean_geometry.sphere.mk_center_radius EuclideanGeometry.Sphere.mk_center_radius
-
-theorem Sphere.coe_def (s : Sphere P) : (s : Set P) = Metric.sphere s.center s.radius :=
-  rfl
-#align euclidean_geometry.sphere.coe_def EuclideanGeometry.Sphere.coe_def
-
-@[simp]
-theorem Sphere.coe_mk (c : P) (r : ℝ) : ↑(⟨c, r⟩ : Sphere P) = Metric.sphere c r :=
-  rfl
-#align euclidean_geometry.sphere.coe_mk EuclideanGeometry.Sphere.coe_mk
-
-@[simp]
-theorem Sphere.mem_coe {p : P} {s : Sphere P} : p ∈ (s : Set P) ↔ p ∈ s :=
-  Iff.rfl
-#align euclidean_geometry.sphere.mem_coe EuclideanGeometry.Sphere.mem_coe
-
-theorem mem_sphere {p : P} {s : Sphere P} : p ∈ s ↔ dist p s.center = s.radius :=
-  Iff.rfl
-#align euclidean_geometry.mem_sphere EuclideanGeometry.mem_sphere
-
-theorem mem_sphere' {p : P} {s : Sphere P} : p ∈ s ↔ dist s.center p = s.radius :=
-  Metric.mem_sphere'
-#align euclidean_geometry.mem_sphere' EuclideanGeometry.mem_sphere'
-
-theorem subset_sphere {ps : Set P} {s : Sphere P} : ps ⊆ s ↔ ∀ p ∈ ps, p ∈ s :=
-  Iff.rfl
-#align euclidean_geometry.subset_sphere EuclideanGeometry.subset_sphere
-
-theorem dist_of_mem_subset_sphere {p : P} {ps : Set P} {s : Sphere P} (hp : p ∈ ps)
-    (hps : ps ⊆ (s : Set P)) : dist p s.center = s.radius :=
-  mem_sphere.1 (Sphere.mem_coe.1 (Set.mem_of_mem_of_subset hp hps))
-#align euclidean_geometry.dist_of_mem_subset_sphere EuclideanGeometry.dist_of_mem_subset_sphere
-
-theorem dist_of_mem_subset_mk_sphere {p c : P} {ps : Set P} {r : ℝ} (hp : p ∈ ps)
-    (hps : ps ⊆ ↑(⟨c, r⟩ : Sphere P)) : dist p c = r :=
-  dist_of_mem_subset_sphere hp hps
-#align euclidean_geometry.dist_of_mem_subset_mk_sphere EuclideanGeometry.dist_of_mem_subset_mk_sphere
-
-theorem Sphere.ne_iff {s₁ s₂ : Sphere P} :
-    s₁ ≠ s₂ ↔ s₁.center ≠ s₂.center ∨ s₁.radius ≠ s₂.radius := by
-  rw [← not_and_or, ← sphere.ext_iff]
-#align euclidean_geometry.sphere.ne_iff EuclideanGeometry.Sphere.ne_iff
-
-theorem Sphere.center_eq_iff_eq_of_mem {s₁ s₂ : Sphere P} {p : P} (hs₁ : p ∈ s₁) (hs₂ : p ∈ s₂) :
-    s₁.center = s₂.center ↔ s₁ = s₂ :=
-  by
-  refine' ⟨fun h => sphere.ext _ _ h _, fun h => h ▸ rfl⟩
-  rw [mem_sphere] at hs₁ hs₂
-  rw [← hs₁, ← hs₂, h]
-#align euclidean_geometry.sphere.center_eq_iff_eq_of_mem EuclideanGeometry.Sphere.center_eq_iff_eq_of_mem
-
-theorem Sphere.center_ne_iff_ne_of_mem {s₁ s₂ : Sphere P} {p : P} (hs₁ : p ∈ s₁) (hs₂ : p ∈ s₂) :
-    s₁.center ≠ s₂.center ↔ s₁ ≠ s₂ :=
-  (Sphere.center_eq_iff_eq_of_mem hs₁ hs₂).Not
-#align euclidean_geometry.sphere.center_ne_iff_ne_of_mem EuclideanGeometry.Sphere.center_ne_iff_ne_of_mem
-
-theorem dist_center_eq_dist_center_of_mem_sphere {p₁ p₂ : P} {s : Sphere P} (hp₁ : p₁ ∈ s)
-    (hp₂ : p₂ ∈ s) : dist p₁ s.center = dist p₂ s.center := by
-  rw [mem_sphere.1 hp₁, mem_sphere.1 hp₂]
-#align euclidean_geometry.dist_center_eq_dist_center_of_mem_sphere EuclideanGeometry.dist_center_eq_dist_center_of_mem_sphere
-
-theorem dist_center_eq_dist_center_of_mem_sphere' {p₁ p₂ : P} {s : Sphere P} (hp₁ : p₁ ∈ s)
-    (hp₂ : p₂ ∈ s) : dist s.center p₁ = dist s.center p₂ := by
-  rw [mem_sphere'.1 hp₁, mem_sphere'.1 hp₂]
-#align euclidean_geometry.dist_center_eq_dist_center_of_mem_sphere' EuclideanGeometry.dist_center_eq_dist_center_of_mem_sphere'
-
-/-- A set of points is cospherical if they are equidistant from some
-point.  In two dimensions, this is the same thing as being
-concyclic. -/
-def Cospherical (ps : Set P) : Prop :=
-  ∃ (center : P)(radius : ℝ), ∀ p ∈ ps, dist p center = radius
-#align euclidean_geometry.cospherical EuclideanGeometry.Cospherical
-
-/-- The definition of `cospherical`. -/
-theorem cospherical_def (ps : Set P) :
-    Cospherical ps ↔ ∃ (center : P)(radius : ℝ), ∀ p ∈ ps, dist p center = radius :=
-  Iff.rfl
-#align euclidean_geometry.cospherical_def EuclideanGeometry.cospherical_def
-
-/-- A set of points is cospherical if and only if they lie in some sphere. -/
-theorem cospherical_iff_exists_sphere {ps : Set P} :
-    Cospherical ps ↔ ∃ s : Sphere P, ps ⊆ (s : Set P) :=
-  by
-  refine' ⟨fun h => _, fun h => _⟩
-  · rcases h with ⟨c, r, h⟩
-    exact ⟨⟨c, r⟩, h⟩
-  · rcases h with ⟨s, h⟩
-    exact ⟨s.center, s.radius, h⟩
-#align euclidean_geometry.cospherical_iff_exists_sphere EuclideanGeometry.cospherical_iff_exists_sphere
-
-/-- The set of points in a sphere is cospherical. -/
-theorem Sphere.cospherical (s : Sphere P) : Cospherical (s : Set P) :=
-  cospherical_iff_exists_sphere.2 ⟨s, Set.Subset.rfl⟩
-#align euclidean_geometry.sphere.cospherical EuclideanGeometry.Sphere.cospherical
-
-/-- A subset of a cospherical set is cospherical. -/
-theorem Cospherical.subset {ps₁ ps₂ : Set P} (hs : ps₁ ⊆ ps₂) (hc : Cospherical ps₂) :
-    Cospherical ps₁ := by
-  rcases hc with ⟨c, r, hcr⟩
-  exact ⟨c, r, fun p hp => hcr p (hs hp)⟩
-#align euclidean_geometry.cospherical.subset EuclideanGeometry.Cospherical.subset
-
-include V
-
-/-- The empty set is cospherical. -/
-theorem cospherical_empty : Cospherical (∅ : Set P) :=
-  by
-  use add_torsor.nonempty.some
-  simp
-#align euclidean_geometry.cospherical_empty EuclideanGeometry.cospherical_empty
-
-omit V
-
-/-- A single point is cospherical. -/
-theorem cospherical_singleton (p : P) : Cospherical ({p} : Set P) :=
-  by
-  use p
-  simp
-#align euclidean_geometry.cospherical_singleton EuclideanGeometry.cospherical_singleton
-
-include V
-
-/-- Two points are cospherical. -/
-theorem cospherical_pair (p₁ p₂ : P) : Cospherical ({p₁, p₂} : Set P) :=
-  by
-  use (2⁻¹ : ℝ) • (p₂ -ᵥ p₁) +ᵥ p₁, (2⁻¹ : ℝ) * dist p₂ p₁
-  intro p
-  rw [Set.mem_insert_iff, Set.mem_singleton_iff]
-  rintro ⟨_ | _⟩
-  · rw [dist_eq_norm_vsub V p₁, vsub_vadd_eq_vsub_sub, vsub_self, zero_sub, norm_neg, norm_smul,
-      dist_eq_norm_vsub V p₂]
-    simp
-  · rw [H, dist_eq_norm_vsub V p₂, vsub_vadd_eq_vsub_sub, dist_eq_norm_vsub V p₂]
-    conv_lhs =>
-      congr
-      congr
-      rw [← one_smul ℝ (p₂ -ᵥ p₁ : V)]
-    rw [← sub_smul, norm_smul]
-    norm_num
-#align euclidean_geometry.cospherical_pair EuclideanGeometry.cospherical_pair
-
-/-- Any three points in a cospherical set are affinely independent. -/
-theorem Cospherical.affineIndependent {s : Set P} (hs : Cospherical s) {p : Fin 3 → P}
-    (hps : Set.range p ⊆ s) (hpi : Function.Injective p) : AffineIndependent ℝ p :=
-  by
-  rw [affineIndependent_iff_not_collinear]
-  intro hc
-  rw [collinear_iff_of_mem (Set.mem_range_self (0 : Fin 3))] at hc
-  rcases hc with ⟨v, hv⟩
-  rw [Set.forall_range_iff] at hv
-  have hv0 : v ≠ 0 := by
-    intro h
-    have he : p 1 = p 0 := by simpa [h] using hv 1
-    exact (by decide : (1 : Fin 3) ≠ 0) (hpi he)
-  rcases hs with ⟨c, r, hs⟩
-  have hs' := fun i => hs (p i) (Set.mem_of_mem_of_subset (Set.mem_range_self _) hps)
-  choose f hf using hv
-  have hsd : ∀ i, dist (f i • v +ᵥ p 0) c = r :=
-    by
-    intro i
-    rw [← hf]
-    exact hs' i
-  have hf0 : f 0 = 0 := by
-    have hf0' := hf 0
-    rw [eq_comm, ← @vsub_eq_zero_iff_eq V, vadd_vsub, smul_eq_zero] at hf0'
-    simpa [hv0] using hf0'
-  have hfi : Function.Injective f := by
-    intro i j h
-    have hi := hf i
-    rw [h, ← hf j] at hi
-    exact hpi hi
-  simp_rw [← hsd 0, hf0, zero_smul, zero_vadd, dist_smul_vadd_eq_dist (p 0) c hv0] at hsd
-  have hfn0 : ∀ i, i ≠ 0 → f i ≠ 0 := fun i => (hfi.ne_iff' hf0).2
-  have hfn0' : ∀ i, i ≠ 0 → f i = -2 * ⟪v, p 0 -ᵥ c⟫ / ⟪v, v⟫ :=
-    by
-    intro i hi
-    have hsdi := hsd i
-    simpa [hfn0, hi] using hsdi
-  have hf12 : f 1 = f 2 := by rw [hfn0' 1 (by decide), hfn0' 2 (by decide)]
-  exact (by decide : (1 : Fin 3) ≠ 2) (hfi hf12)
-#align euclidean_geometry.cospherical.affine_independent EuclideanGeometry.Cospherical.affineIndependent
-
-/-- Any three points in a cospherical set are affinely independent. -/
-theorem Cospherical.affineIndependent_of_mem_of_ne {s : Set P} (hs : Cospherical s) {p₁ p₂ p₃ : P}
-    (h₁ : p₁ ∈ s) (h₂ : p₂ ∈ s) (h₃ : p₃ ∈ s) (h₁₂ : p₁ ≠ p₂) (h₁₃ : p₁ ≠ p₃) (h₂₃ : p₂ ≠ p₃) :
-    AffineIndependent ℝ ![p₁, p₂, p₃] :=
-  by
-  refine' hs.affine_independent _ _
-  · simp [h₁, h₂, h₃, Set.insert_subset]
-  · erw [Fin.cons_injective_iff, Fin.cons_injective_iff]
-    simp [h₁₂, h₁₃, h₂₃, Function.Injective]
-#align euclidean_geometry.cospherical.affine_independent_of_mem_of_ne EuclideanGeometry.Cospherical.affineIndependent_of_mem_of_ne
-
-/-- The three points of a cospherical set are affinely independent. -/
-theorem Cospherical.affineIndependent_of_ne {p₁ p₂ p₃ : P} (hs : Cospherical ({p₁, p₂, p₃} : Set P))
-    (h₁₂ : p₁ ≠ p₂) (h₁₃ : p₁ ≠ p₃) (h₂₃ : p₂ ≠ p₃) : AffineIndependent ℝ ![p₁, p₂, p₃] :=
-  hs.affineIndependent_of_mem_of_ne (Set.mem_insert _ _)
-    (Set.mem_insert_of_mem _ (Set.mem_insert _ _))
-    (Set.mem_insert_of_mem _ (Set.mem_insert_of_mem _ (Set.mem_singleton _))) h₁₂ h₁₃ h₂₃
-#align euclidean_geometry.cospherical.affine_independent_of_ne EuclideanGeometry.Cospherical.affineIndependent_of_ne
-
-/-- Suppose that `p₁` and `p₂` lie in spheres `s₁` and `s₂`.  Then the vector between the centers
-of those spheres is orthogonal to that between `p₁` and `p₂`; this is a version of
-`inner_vsub_vsub_of_dist_eq_of_dist_eq` for bundled spheres.  (In two dimensions, this says that
-the diagonals of a kite are orthogonal.) -/
-theorem inner_vsub_vsub_of_mem_sphere_of_mem_sphere {p₁ p₂ : P} {s₁ s₂ : Sphere P} (hp₁s₁ : p₁ ∈ s₁)
-    (hp₂s₁ : p₂ ∈ s₁) (hp₁s₂ : p₁ ∈ s₂) (hp₂s₂ : p₂ ∈ s₂) :
-    ⟪s₂.center -ᵥ s₁.center, p₂ -ᵥ p₁⟫ = 0 :=
-  inner_vsub_vsub_of_dist_eq_of_dist_eq (dist_center_eq_dist_center_of_mem_sphere hp₁s₁ hp₂s₁)
-    (dist_center_eq_dist_center_of_mem_sphere hp₁s₂ hp₂s₂)
-#align euclidean_geometry.inner_vsub_vsub_of_mem_sphere_of_mem_sphere EuclideanGeometry.inner_vsub_vsub_of_mem_sphere_of_mem_sphere
-
-/-- Two spheres intersect in at most two points in a two-dimensional subspace containing their
-centers; this is a version of `eq_of_dist_eq_of_dist_eq_of_mem_of_finrank_eq_two` for bundled
-spheres. -/
-theorem eq_of_mem_sphere_of_mem_sphere_of_mem_of_finrank_eq_two {s : AffineSubspace ℝ P}
-    [FiniteDimensional ℝ s.direction] (hd : finrank ℝ s.direction = 2) {s₁ s₂ : Sphere P}
-    {p₁ p₂ p : P} (hs₁ : s₁.center ∈ s) (hs₂ : s₂.center ∈ s) (hp₁s : p₁ ∈ s) (hp₂s : p₂ ∈ s)
-    (hps : p ∈ s) (hs : s₁ ≠ s₂) (hp : p₁ ≠ p₂) (hp₁s₁ : p₁ ∈ s₁) (hp₂s₁ : p₂ ∈ s₁) (hps₁ : p ∈ s₁)
-    (hp₁s₂ : p₁ ∈ s₂) (hp₂s₂ : p₂ ∈ s₂) (hps₂ : p ∈ s₂) : p = p₁ ∨ p = p₂ :=
-  eq_of_dist_eq_of_dist_eq_of_mem_of_finrank_eq_two hd hs₁ hs₂ hp₁s hp₂s hps
-    ((Sphere.center_ne_iff_ne_of_mem hps₁ hps₂).2 hs) hp hp₁s₁ hp₂s₁ hps₁ hp₁s₂ hp₂s₂ hps₂
-#align euclidean_geometry.eq_of_mem_sphere_of_mem_sphere_of_mem_of_finrank_eq_two EuclideanGeometry.eq_of_mem_sphere_of_mem_sphere_of_mem_of_finrank_eq_two
-
-/-- Two spheres intersect in at most two points in two-dimensional space; this is a version of
-`eq_of_dist_eq_of_dist_eq_of_finrank_eq_two` for bundled spheres. -/
-theorem eq_of_mem_sphere_of_mem_sphere_of_finrank_eq_two [FiniteDimensional ℝ V]
-    (hd : finrank ℝ V = 2) {s₁ s₂ : Sphere P} {p₁ p₂ p : P} (hs : s₁ ≠ s₂) (hp : p₁ ≠ p₂)
-    (hp₁s₁ : p₁ ∈ s₁) (hp₂s₁ : p₂ ∈ s₁) (hps₁ : p ∈ s₁) (hp₁s₂ : p₁ ∈ s₂) (hp₂s₂ : p₂ ∈ s₂)
-    (hps₂ : p ∈ s₂) : p = p₁ ∨ p = p₂ :=
-  eq_of_dist_eq_of_dist_eq_of_finrank_eq_two hd ((Sphere.center_ne_iff_ne_of_mem hps₁ hps₂).2 hs) hp
-    hp₁s₁ hp₂s₁ hps₁ hp₁s₂ hp₂s₂ hps₂
-#align euclidean_geometry.eq_of_mem_sphere_of_mem_sphere_of_finrank_eq_two EuclideanGeometry.eq_of_mem_sphere_of_mem_sphere_of_finrank_eq_two
-
-/-- Given a point on a sphere and a point not outside it, the inner product between the
-difference of those points and the radius vector is positive unless the points are equal. -/
-theorem inner_pos_or_eq_of_dist_le_radius {s : Sphere P} {p₁ p₂ : P} (hp₁ : p₁ ∈ s)
-    (hp₂ : dist p₂ s.center ≤ s.radius) : 0 < ⟪p₁ -ᵥ p₂, p₁ -ᵥ s.center⟫ ∨ p₁ = p₂ :=
-  by
-  by_cases h : p₁ = p₂; · exact Or.inr h
-  refine' Or.inl _
-  rw [mem_sphere] at hp₁
-  rw [← vsub_sub_vsub_cancel_right p₁ p₂ s.center, inner_sub_left,
-    real_inner_self_eq_norm_mul_norm,--, ←dist_eq_norm_vsub, hp₁
-    sub_pos]
-  refine'
-    lt_of_le_of_ne ((real_inner_le_norm _ _).trans (mul_le_mul_of_nonneg_right _ (norm_nonneg _))) _
-  · rwa [← dist_eq_norm_vsub, ← dist_eq_norm_vsub, hp₁]
-  · rcases hp₂.lt_or_eq with (hp₂' | hp₂')
-    · refine' ((real_inner_le_norm _ _).trans_lt (mul_lt_mul_of_pos_right _ _)).Ne
-      · rwa [← hp₁, @dist_eq_norm_vsub V, @dist_eq_norm_vsub V] at hp₂'
-      · rw [norm_pos_iff, vsub_ne_zero]
-        rintro rfl
-        rw [← hp₁] at hp₂'
-        refine' (dist_nonneg.not_lt : ¬dist p₂ s.center < 0) _
-        simpa using hp₂'
-    · rw [← hp₁, @dist_eq_norm_vsub V, @dist_eq_norm_vsub V] at hp₂'
-      nth_rw 1 [← hp₂']
-      rw [Ne.def, inner_eq_norm_mul_iff_real, hp₂', ← sub_eq_zero, ← smul_sub,
-        vsub_sub_vsub_cancel_right, ← Ne.def, smul_ne_zero_iff, vsub_ne_zero,
-        and_iff_left (Ne.symm h), norm_ne_zero_iff, vsub_ne_zero]
-      rintro rfl
-      refine' h (Eq.symm _)
-      simpa using hp₂'
-#align euclidean_geometry.inner_pos_or_eq_of_dist_le_radius EuclideanGeometry.inner_pos_or_eq_of_dist_le_radius
-
-/-- Given a point on a sphere and a point not outside it, the inner product between the
-difference of those points and the radius vector is nonnegative. -/
-theorem inner_nonneg_of_dist_le_radius {s : Sphere P} {p₁ p₂ : P} (hp₁ : p₁ ∈ s)
-    (hp₂ : dist p₂ s.center ≤ s.radius) : 0 ≤ ⟪p₁ -ᵥ p₂, p₁ -ᵥ s.center⟫ :=
-  by
-  rcases inner_pos_or_eq_of_dist_le_radius hp₁ hp₂ with (h | rfl)
-  · exact h.le
-  · simp
-#align euclidean_geometry.inner_nonneg_of_dist_le_radius EuclideanGeometry.inner_nonneg_of_dist_le_radius
-
-/-- Given a point on a sphere and a point inside it, the inner product between the difference of
-those points and the radius vector is positive. -/
-theorem inner_pos_of_dist_lt_radius {s : Sphere P} {p₁ p₂ : P} (hp₁ : p₁ ∈ s)
-    (hp₂ : dist p₂ s.center < s.radius) : 0 < ⟪p₁ -ᵥ p₂, p₁ -ᵥ s.center⟫ :=
-  by
-  by_cases h : p₁ = p₂
-  · rw [h, mem_sphere] at hp₁
-    exact False.elim (hp₂.ne hp₁)
-  exact (inner_pos_or_eq_of_dist_le_radius hp₁ hp₂.le).resolve_right h
-#align euclidean_geometry.inner_pos_of_dist_lt_radius EuclideanGeometry.inner_pos_of_dist_lt_radius
-
-/-- Given three collinear points, two on a sphere and one not outside it, the one not outside it
-is weakly between the other two points. -/
-theorem wbtw_of_collinear_of_dist_center_le_radius {s : Sphere P} {p₁ p₂ p₃ : P}
-    (h : Collinear ℝ ({p₁, p₂, p₃} : Set P)) (hp₁ : p₁ ∈ s) (hp₂ : dist p₂ s.center ≤ s.radius)
-    (hp₃ : p₃ ∈ s) (hp₁p₃ : p₁ ≠ p₃) : Wbtw ℝ p₁ p₂ p₃ :=
-  h.wbtw_of_dist_eq_of_dist_le hp₁ hp₂ hp₃ hp₁p₃
-#align euclidean_geometry.wbtw_of_collinear_of_dist_center_le_radius EuclideanGeometry.wbtw_of_collinear_of_dist_center_le_radius
-
-/-- Given three collinear points, two on a sphere and one inside it, the one inside it is
-strictly between the other two points. -/
-theorem sbtw_of_collinear_of_dist_center_lt_radius {s : Sphere P} {p₁ p₂ p₃ : P}
-    (h : Collinear ℝ ({p₁, p₂, p₃} : Set P)) (hp₁ : p₁ ∈ s) (hp₂ : dist p₂ s.center < s.radius)
-    (hp₃ : p₃ ∈ s) (hp₁p₃ : p₁ ≠ p₃) : Sbtw ℝ p₁ p₂ p₃ :=
-  h.sbtw_of_dist_eq_of_dist_lt hp₁ hp₂ hp₃ hp₁p₃
-#align euclidean_geometry.sbtw_of_collinear_of_dist_center_lt_radius EuclideanGeometry.sbtw_of_collinear_of_dist_center_lt_radius
-
-/-- The second intersection of a sphere with a line through a point on that sphere; that point
-if it is the only point of intersection of the line with the sphere. The intended use of this
-definition is when `p ∈ s`; the definition does not use `s.radius`, so in general it returns
-the second intersection with the sphere through `p` and with center `s.center`. -/
-def Sphere.secondInter (s : Sphere P) (p : P) (v : V) : P :=
-  (-2 * ⟪v, p -ᵥ s.center⟫ / ⟪v, v⟫) • v +ᵥ p
-#align euclidean_geometry.sphere.second_inter EuclideanGeometry.Sphere.secondInter
-
-/-- The distance between `second_inter` and the center equals the distance between the original
-point and the center. -/
-@[simp]
-theorem Sphere.secondInter_dist (s : Sphere P) (p : P) (v : V) :
-    dist (s.secondInter p v) s.center = dist p s.center :=
-  by
-  rw [sphere.second_inter]
-  by_cases hv : v = 0; · simp [hv]
-  rw [dist_smul_vadd_eq_dist _ _ hv]
-  exact Or.inr rfl
-#align euclidean_geometry.sphere.second_inter_dist EuclideanGeometry.Sphere.secondInter_dist
-
-/-- The point given by `second_inter` lies on the sphere. -/
-@[simp]
-theorem Sphere.secondInter_mem {s : Sphere P} {p : P} (v : V) : s.secondInter p v ∈ s ↔ p ∈ s := by
-  simp_rw [mem_sphere, sphere.second_inter_dist]
-#align euclidean_geometry.sphere.second_inter_mem EuclideanGeometry.Sphere.secondInter_mem
-
-variable (V)
-
-/-- If the vector is zero, `second_inter` gives the original point. -/
-@[simp]
-theorem Sphere.secondInter_zero (s : Sphere P) (p : P) : s.secondInter p (0 : V) = p := by
-  simp [sphere.second_inter]
-#align euclidean_geometry.sphere.second_inter_zero EuclideanGeometry.Sphere.secondInter_zero
-
-variable {V}
-
-/-- The point given by `second_inter` equals the original point if and only if the line is
-orthogonal to the radius vector. -/
-theorem Sphere.secondInter_eq_self_iff {s : Sphere P} {p : P} {v : V} :
-    s.secondInter p v = p ↔ ⟪v, p -ᵥ s.center⟫ = 0 :=
-  by
-  refine' ⟨fun hp => _, fun hp => _⟩
-  · by_cases hv : v = 0
-    · simp [hv]
-    rwa [sphere.second_inter, 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
-  · rw [sphere.second_inter, hp, MulZeroClass.mul_zero, zero_div, zero_smul, zero_vadd]
-#align euclidean_geometry.sphere.second_inter_eq_self_iff EuclideanGeometry.Sphere.secondInter_eq_self_iff
-
-/-- A point on a line through a point on a sphere equals that point or `second_inter`. -/
-theorem Sphere.eq_or_eq_secondInter_of_mem_mk'_span_singleton_iff_mem {s : Sphere P} {p : P}
-    (hp : p ∈ s) {v : V} {p' : P} (hp' : p' ∈ AffineSubspace.mk' p (ℝ ∙ v)) :
-    p' = p ∨ p' = s.secondInter p v ↔ p' ∈ s :=
-  by
-  refine' ⟨fun h => _, fun h => _⟩
-  · rcases h with (h | h)
-    · rwa [h]
-    · rwa [h, sphere.second_inter_mem]
-  · rw [AffineSubspace.mem_mk'_iff_vsub_mem, Submodule.mem_span_singleton] at hp'
-    rcases hp' with ⟨r, hr⟩
-    rw [eq_comm, ← eq_vadd_iff_vsub_eq] at hr
-    subst hr
-    by_cases hv : v = 0
-    · simp [hv]
-    rw [sphere.second_inter]
-    rw [mem_sphere] at h hp
-    rw [← hp, dist_smul_vadd_eq_dist _ _ hv] at h
-    rcases h with (h | h) <;> simp [h]
-#align euclidean_geometry.sphere.eq_or_eq_second_inter_of_mem_mk'_span_singleton_iff_mem EuclideanGeometry.Sphere.eq_or_eq_secondInter_of_mem_mk'_span_singleton_iff_mem
-
-/-- `second_inter` is unchanged by multiplying the vector by a nonzero real. -/
-@[simp]
-theorem Sphere.secondInter_smul (s : Sphere P) (p : P) (v : V) {r : ℝ} (hr : r ≠ 0) :
-    s.secondInter p (r • v) = s.secondInter p v :=
-  by
-  simp_rw [sphere.second_inter, real_inner_smul_left, inner_smul_right, smul_smul,
-    div_mul_eq_div_div]
-  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]
-#align euclidean_geometry.sphere.second_inter_smul EuclideanGeometry.Sphere.secondInter_smul
-
-/-- `second_inter` is unchanged by negating the vector. -/
-@[simp]
-theorem Sphere.secondInter_neg (s : Sphere P) (p : P) (v : V) :
-    s.secondInter p (-v) = s.secondInter p v := by
-  rw [← neg_one_smul ℝ v, s.second_inter_smul p v (by norm_num : (-1 : ℝ) ≠ 0)]
-#align euclidean_geometry.sphere.second_inter_neg EuclideanGeometry.Sphere.secondInter_neg
-
-/-- Applying `second_inter` twice returns the original point. -/
-@[simp]
-theorem Sphere.secondInter_secondInter (s : Sphere P) (p : P) (v : V) :
-    s.secondInter (s.secondInter p v) v = p :=
-  by
-  by_cases hv : v = 0; · simp [hv]
-  have hv' : ⟪v, v⟫ ≠ 0 := inner_self_ne_zero.2 hv
-  simp only [sphere.second_inter, vadd_vsub_assoc, vadd_vadd, inner_add_right, inner_smul_right,
-    div_mul_cancel _ hv']
-  rw [← @vsub_eq_zero_iff_eq V, vadd_vsub, ← add_smul, ← add_div]
-  convert zero_smul ℝ _
-  convert zero_div _
-  ring
-#align euclidean_geometry.sphere.second_inter_second_inter EuclideanGeometry.Sphere.secondInter_secondInter
-
-/-- If the vector passed to `second_inter` is given by a subtraction involving the point in
-`second_inter`, the result of `second_inter` may be expressed using `line_map`. -/
-theorem Sphere.secondInter_eq_lineMap (s : Sphere P) (p p' : P) :
-    s.secondInter p (p' -ᵥ p) =
-      AffineMap.lineMap p p' (-2 * ⟪p' -ᵥ p, p -ᵥ s.center⟫ / ⟪p' -ᵥ p, p' -ᵥ p⟫) :=
-  rfl
-#align euclidean_geometry.sphere.second_inter_eq_line_map EuclideanGeometry.Sphere.secondInter_eq_lineMap
-
-/-- If the vector passed to `second_inter` is given by a subtraction involving the point in
-`second_inter`, the result lies in the span of the two points. -/
-theorem Sphere.secondInter_vsub_mem_affineSpan (s : Sphere P) (p₁ p₂ : P) :
-    s.secondInter p₁ (p₂ -ᵥ p₁) ∈ line[ℝ, p₁, p₂] :=
-  smul_vsub_vadd_mem_affineSpan_pair _ _ _
-#align euclidean_geometry.sphere.second_inter_vsub_mem_affine_span EuclideanGeometry.Sphere.secondInter_vsub_mem_affineSpan
-
-/-- If the vector passed to `second_inter` is given by a subtraction involving the point in
-`second_inter`, the three points are collinear. -/
-theorem Sphere.secondInter_collinear (s : Sphere P) (p p' : P) :
-    Collinear ℝ ({p, p', s.secondInter p (p' -ᵥ p)} : Set P) :=
-  by
-  rw [Set.pair_comm, Set.insert_comm]
-  exact
-    (collinear_insert_iff_of_mem_affineSpan (s.second_inter_vsub_mem_affine_span _ _)).2
-      (collinear_pair ℝ _ _)
-#align euclidean_geometry.sphere.second_inter_collinear EuclideanGeometry.Sphere.secondInter_collinear
-
-/-- If the vector passed to `second_inter` is given by a subtraction involving the point in
-`second_inter`, and the second point is not outside the sphere, the second point is weakly
-between the first point and the result of `second_inter`. -/
-theorem Sphere.wbtw_secondInter {s : Sphere P} {p p' : P} (hp : p ∈ s)
-    (hp' : dist p' s.center ≤ s.radius) : Wbtw ℝ p p' (s.secondInter p (p' -ᵥ p)) :=
-  by
-  by_cases h : p' = p; · simp [h]
-  refine'
-    wbtw_of_collinear_of_dist_center_le_radius (s.second_inter_collinear p p') hp hp'
-      ((sphere.second_inter_mem _).2 hp) _
-  intro he
-  rw [eq_comm, sphere.second_inter_eq_self_iff, ← neg_neg (p' -ᵥ p), inner_neg_left,
-    neg_vsub_eq_vsub_rev, neg_eq_zero, eq_comm] at he
-  exact ((inner_pos_or_eq_of_dist_le_radius hp hp').resolve_right (Ne.symm h)).Ne he
-#align euclidean_geometry.sphere.wbtw_second_inter EuclideanGeometry.Sphere.wbtw_secondInter
-
-/-- If the vector passed to `second_inter` is given by a subtraction involving the point in
-`second_inter`, and the second point is inside the sphere, the second point is strictly between
-the first point and the result of `second_inter`. -/
-theorem Sphere.sbtw_secondInter {s : Sphere P} {p p' : P} (hp : p ∈ s)
-    (hp' : dist p' s.center < s.radius) : Sbtw ℝ p p' (s.secondInter p (p' -ᵥ p)) :=
-  by
-  refine' ⟨sphere.wbtw_second_inter hp hp'.le, _, _⟩
-  · rintro rfl
-    rw [mem_sphere] at hp
-    simpa [hp] using hp'
-  · rintro h
-    rw [h, mem_sphere.1 ((sphere.second_inter_mem _).2 hp)] at hp'
-    exact lt_irrefl _ hp'
-#align euclidean_geometry.sphere.sbtw_second_inter EuclideanGeometry.Sphere.sbtw_secondInter
-
-/-- A set of points is concyclic if it is cospherical and coplanar. (Most results are stated
-directly in terms of `cospherical` instead of using `concyclic`.) -/
-structure Concyclic (ps : Set P) : Prop where
-  Cospherical : Cospherical ps
-  Coplanar : Coplanar ℝ ps
-#align euclidean_geometry.concyclic EuclideanGeometry.Concyclic
-
-/-- A subset of a concyclic set is concyclic. -/
-theorem Concyclic.subset {ps₁ ps₂ : Set P} (hs : ps₁ ⊆ ps₂) (h : Concyclic ps₂) : Concyclic ps₁ :=
-  ⟨h.1.Subset hs, h.2.Subset hs⟩
-#align euclidean_geometry.concyclic.subset EuclideanGeometry.Concyclic.subset
-
-/-- The empty set is concyclic. -/
-theorem concyclic_empty : Concyclic (∅ : Set P) :=
-  ⟨cospherical_empty, coplanar_empty ℝ P⟩
-#align euclidean_geometry.concyclic_empty EuclideanGeometry.concyclic_empty
-
-/-- A single point is concyclic. -/
-theorem concyclic_singleton (p : P) : Concyclic ({p} : Set P) :=
-  ⟨cospherical_singleton p, coplanar_singleton ℝ p⟩
-#align euclidean_geometry.concyclic_singleton EuclideanGeometry.concyclic_singleton
-
-/-- Two points are concyclic. -/
-theorem concyclic_pair (p₁ p₂ : P) : Concyclic ({p₁, p₂} : Set P) :=
-  ⟨cospherical_pair p₁ p₂, coplanar_pair ℝ p₁ p₂⟩
-#align euclidean_geometry.concyclic_pair EuclideanGeometry.concyclic_pair
-
 end EuclideanGeometry
 
Diff
@@ -678,7 +678,7 @@ theorem dist_reflection_eq_of_mem (s : AffineSubspace ℝ P) [Nonempty s] [Compl
     {p₁ : P} (hp₁ : p₁ ∈ s) (p₂ : P) : dist p₁ (reflection s p₂) = dist p₁ p₂ :=
   by
   rw [← reflection_eq_self_iff p₁] at hp₁
-  convert (reflection s).dist_map p₁ p₂
+  convert(reflection s).dist_map p₁ p₂
   rw [hp₁]
 #align euclidean_geometry.dist_reflection_eq_of_mem EuclideanGeometry.dist_reflection_eq_of_mem
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Joseph Myers, Manuel Candales
 
 ! This file was ported from Lean 3 source module geometry.euclidean.basic
-! leanprover-community/mathlib commit ea9c24f633dbd90e37891c05bac8f5027986853d
+! leanprover-community/mathlib commit a37865088599172dc923253bb7b31998297d9c8a
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -1145,7 +1145,7 @@ theorem Sphere.secondInter_secondInter (s : Sphere P) (p : P) (v : V) :
     s.secondInter (s.secondInter p v) v = p :=
   by
   by_cases hv : v = 0; · simp [hv]
-  have hv' : ⟪v, v⟫ ≠ 0 := inner_self_eq_zero.not.2 hv
+  have hv' : ⟪v, v⟫ ≠ 0 := inner_self_ne_zero.2 hv
   simp only [sphere.second_inter, vadd_vsub_assoc, vadd_vadd, inner_add_right, inner_smul_right,
     div_mul_cancel _ hv']
   rw [← @vsub_eq_zero_iff_eq V, vadd_vsub, ← add_smul, ← add_div]
Diff
@@ -1224,19 +1224,19 @@ theorem Concyclic.subset {ps₁ ps₂ : Set P} (hs : ps₁ ⊆ ps₂) (h : Concy
 #align euclidean_geometry.concyclic.subset EuclideanGeometry.Concyclic.subset
 
 /-- The empty set is concyclic. -/
-theorem concyclicEmpty : Concyclic (∅ : Set P) :=
+theorem concyclic_empty : Concyclic (∅ : Set P) :=
   ⟨cospherical_empty, coplanar_empty ℝ P⟩
-#align euclidean_geometry.concyclic_empty EuclideanGeometry.concyclicEmpty
+#align euclidean_geometry.concyclic_empty EuclideanGeometry.concyclic_empty
 
 /-- A single point is concyclic. -/
-theorem concyclicSingleton (p : P) : Concyclic ({p} : Set P) :=
+theorem concyclic_singleton (p : P) : Concyclic ({p} : Set P) :=
   ⟨cospherical_singleton p, coplanar_singleton ℝ p⟩
-#align euclidean_geometry.concyclic_singleton EuclideanGeometry.concyclicSingleton
+#align euclidean_geometry.concyclic_singleton EuclideanGeometry.concyclic_singleton
 
 /-- Two points are concyclic. -/
-theorem concyclicPair (p₁ p₂ : P) : Concyclic ({p₁, p₂} : Set P) :=
+theorem concyclic_pair (p₁ p₂ : P) : Concyclic ({p₁, p₂} : Set P) :=
   ⟨cospherical_pair p₁ p₂, coplanar_pair ℝ p₁ p₂⟩
-#align euclidean_geometry.concyclic_pair EuclideanGeometry.concyclicPair
+#align euclidean_geometry.concyclic_pair EuclideanGeometry.concyclic_pair
 
 end EuclideanGeometry
 
Diff
@@ -222,8 +222,8 @@ theorem eq_of_dist_eq_of_dist_eq_of_mem_of_finrank_eq_two {s : AffineSubspace 
     rcases hv' with ⟨t₂, rfl⟩
     exact ⟨t₁, t₂, hv⟩
   rcases hv (p -ᵥ p₁) (vsub_mem_direction hps hp₁s) with ⟨t₁, t₂, hpt⟩
-  simp only [hpt, inner_add_right, inner_smul_right, ho, mul_zero, add_zero, mul_eq_zero,
-    inner_self_eq_zero, vsub_eq_zero_iff_eq, hc.symm, or_false_iff] at hop
+  simp only [hpt, inner_add_right, inner_smul_right, ho, MulZeroClass.mul_zero, add_zero,
+    mul_eq_zero, inner_self_eq_zero, vsub_eq_zero_iff_eq, hc.symm, or_false_iff] at hop
   rw [hop, zero_smul, zero_add, ← eq_vadd_iff_vsub_eq] at hpt
   subst hpt
   have hp' : (p₂ -ᵥ p₁ : V) ≠ 0 := by simp [hp.symm]
@@ -1097,7 +1097,7 @@ theorem Sphere.secondInter_eq_self_iff {s : Sphere P} {p : P} {v : V} :
     rwa [sphere.second_inter, 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
-  · rw [sphere.second_inter, hp, mul_zero, zero_div, zero_smul, zero_vadd]
+  · rw [sphere.second_inter, hp, MulZeroClass.mul_zero, zero_div, zero_smul, zero_vadd]
 #align euclidean_geometry.sphere.second_inter_eq_self_iff EuclideanGeometry.Sphere.secondInter_eq_self_iff
 
 /-- A point on a line through a point on a sphere equals that point or `second_inter`. -/
Diff
@@ -546,9 +546,9 @@ theorem dist_sq_smul_orthogonal_vadd_smul_orthogonal_vadd {s : AffineSubspace 
       rw [dist_eq_norm_vsub V (r1 • v +ᵥ p1), vsub_vadd_eq_vsub_sub, vadd_vsub_assoc, sub_smul,
         add_comm, add_sub_assoc]
     _ = ‖p1 -ᵥ p2‖ * ‖p1 -ᵥ p2‖ + ‖(r1 - r2) • v‖ * ‖(r1 - r2) • v‖ :=
-      norm_add_sq_eq_norm_sq_add_norm_sq_real
+      (norm_add_sq_eq_norm_sq_add_norm_sq_real
         (Submodule.inner_right_of_mem_orthogonal (vsub_mem_direction hp1 hp2)
-          (Submodule.smul_mem _ _ hv))
+          (Submodule.smul_mem _ _ hv)))
     _ = ‖(p1 -ᵥ p2 : V)‖ * ‖(p1 -ᵥ p2 : V)‖ + |r1 - r2| * |r1 - r2| * ‖v‖ * ‖v‖ :=
       by
       rw [norm_smul, Real.norm_eq_abs]

Changes in mathlib4

mathlib3
mathlib4
chore(*): remove empty lines between variable statements (#11418)

Empty lines were removed by executing the following Python script twice

import os
import re


# Loop through each file in the repository
for dir_path, dirs, files in os.walk('.'):
  for filename in files:
    if filename.endswith('.lean'):
      file_path = os.path.join(dir_path, filename)

      # Open the file and read its contents
      with open(file_path, 'r') as file:
        content = file.read()

      # Use a regular expression to replace sequences of "variable" lines separated by empty lines
      # with sequences without empty lines
      modified_content = re.sub(r'(variable.*\n)\n(variable(?! .* in))', r'\1\2', content)

      # Write the modified content back to the file
      with open(file_path, 'w') as file:
        file.write(modified_content)
Diff
@@ -66,9 +66,7 @@ Euclidean affine spaces.
 
 
 variable {V : Type*} {P : Type*}
-
 variable [NormedAddCommGroup V] [InnerProductSpace ℝ V] [MetricSpace P]
-
 variable [NormedAddTorsor V P]
 
 /-- The midpoint of the segment AB is the same distance from A as it is from B. -/
chore: scope open Classical (#11199)

We remove all but one open Classicals, instead preferring to use open scoped Classical. The only real side-effect this led to is moving a couple declarations to use Exists.choose instead of Classical.choose.

The first few commits are explicitly labelled regex replaces for ease of review.

Diff
@@ -51,7 +51,7 @@ noncomputable section
 
 open BigOperators
 
-open Classical
+open scoped Classical
 
 open RealInnerProductSpace
 
chore: prepare Lean version bump with explicit simp (#10999)

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -157,7 +157,7 @@ theorem eq_of_dist_eq_of_dist_eq_of_mem_of_finrank_eq_two {s : AffineSubspace 
   have hb : LinearIndependent ℝ b := by
     refine' linearIndependent_of_ne_zero_of_inner_eq_zero _ _
     · intro i
-      fin_cases i <;> simp [hc.symm, hp.symm]
+      fin_cases i <;> simp [b, hc.symm, hp.symm]
     · intro i j hij
       fin_cases i <;> fin_cases j <;> try exact False.elim (hij rfl)
       · exact ho
@@ -176,7 +176,7 @@ theorem eq_of_dist_eq_of_dist_eq_of_mem_of_finrank_eq_two {s : AffineSubspace 
     have hr : Set.range b = {c₂ -ᵥ c₁, p₂ -ᵥ p₁} := by
       have hu : (Finset.univ : Finset (Fin 2)) = {0, 1} := by decide
       rw [← Fintype.coe_image_univ, hu]
-      simp
+      simp [b]
     rw [← hbs, hr, Submodule.mem_span_insert] at hv
     rcases hv with ⟨t₁, v', hv', hv⟩
     rw [Submodule.mem_span_singleton] at hv'
chore: classify simp can do this porting notes (#10619)

Classify by adding issue number (#10618) to porting notes claiming anything semantically equivalent to simp can prove this or simp can simplify this.

Diff
@@ -382,7 +382,7 @@ theorem orthogonalProjection_mem_subspace_eq_self {s : AffineSubspace ℝ P} [No
 #align euclidean_geometry.orthogonal_projection_mem_subspace_eq_self EuclideanGeometry.orthogonalProjection_mem_subspace_eq_self
 
 /-- Orthogonal projection is idempotent. -/
--- @[simp] -- Porting note: simp can prove this
+-- @[simp] -- Porting note (#10618): simp can prove this
 theorem orthogonalProjection_orthogonalProjection (s : AffineSubspace ℝ P) [Nonempty s]
     [HasOrthogonalProjection s.direction] (p : P) :
     orthogonalProjection s (orthogonalProjection s p) = orthogonalProjection s p := by
chore: shake some imports (#10341)
Diff
@@ -4,6 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yury Kudryashov, Joseph Myers
 -/
 import Mathlib.Analysis.InnerProductSpace.Orthogonal
+import Mathlib.Analysis.Normed.Group.AddTorsor
 
 #align_import geometry.euclidean.basic from "leanprover-community/mathlib"@"2de9c37fa71dde2f1c6feff19876dd6a7b1519f0"
 
chore(Analysis,Geometry): remove almost all autoImplicit (#9691)

After this PR, no file in Geometry uses autoImplicit, and in Analysis it's scoped to six declarations.

Diff
@@ -20,12 +20,10 @@ define this subspace.
 euclidean geometry, perpendicular, perpendicular bisector, line segment bisector, equidistant
 -/
 
-set_option autoImplicit true
-
 open Set
 open scoped BigOperators RealInnerProductSpace
 
-variable [NormedAddCommGroup V] [InnerProductSpace ℝ V] [MetricSpace P]
+variable {V P : Type*} [NormedAddCommGroup V] [InnerProductSpace ℝ V] [MetricSpace P]
 variable [NormedAddTorsor V P]
 
 noncomputable section
@@ -135,7 +133,7 @@ theorem inner_vsub_vsub_of_dist_eq_of_dist_eq {c₁ c₂ p₁ p₂ : P} (hc₁ :
 
 end EuclideanGeometry
 
-variable [NormedAddCommGroup V'] [InnerProductSpace ℝ V'] [MetricSpace P']
+variable {V' P' : Type*} [NormedAddCommGroup V'] [InnerProductSpace ℝ V'] [MetricSpace P']
 variable [NormedAddTorsor V' P']
 
 theorem Isometry.preimage_perpBisector {f : P → P'} (h : Isometry f) (p₁ p₂ : P) :
chore(*): drop $/<| before fun (#9361)

Subset of #9319

Diff
@@ -108,7 +108,7 @@ theorem perpBisector_comm (p₁ p₂ : P) : perpBisector p₁ p₂ = perpBisecto
   rw [perpBisector_comm, right_mem_perpBisector, eq_comm]
 
 @[simp] theorem perpBisector_self (p : P) : perpBisector p p = ⊤ :=
-  top_unique <| fun _ ↦ by simp [mem_perpBisector_iff_inner_eq_inner]
+  top_unique fun _ ↦ by simp [mem_perpBisector_iff_inner_eq_inner]
 
 @[simp] theorem perpBisector_eq_top : perpBisector p₁ p₂ = ⊤ ↔ p₁ = p₂ := by
   refine ⟨fun h ↦ ?_, fun h ↦ h ▸ perpBisector_self _⟩
chore: missing spaces after rcases, convert and congrm (#7725)

Replace rcases( with rcases (. Same thing for convert( and congrm(. No other change.

Diff
@@ -617,7 +617,7 @@ theorem dist_reflection_eq_of_mem (s : AffineSubspace ℝ P) [Nonempty s]
     [HasOrthogonalProjection s.direction] {p₁ : P} (hp₁ : p₁ ∈ s) (p₂ : P) :
     dist p₁ (reflection s p₂) = dist p₁ p₂ := by
   rw [← reflection_eq_self_iff p₁] at hp₁
-  convert(reflection s).dist_map p₁ p₂
+  convert (reflection s).dist_map p₁ p₂
   rw [hp₁]
 #align euclidean_geometry.dist_reflection_eq_of_mem EuclideanGeometry.dist_reflection_eq_of_mem
 
chore: drop MulZeroClass. in mul_zero/zero_mul (#6682)

Search&replace MulZeroClass.mul_zero -> mul_zero, MulZeroClass.zero_mul -> zero_mul.

These were introduced by Mathport, as the full name of mul_zero is actually MulZeroClass.mul_zero (it's exported with the short name).

Diff
@@ -183,7 +183,7 @@ theorem eq_of_dist_eq_of_dist_eq_of_mem_of_finrank_eq_two {s : AffineSubspace 
     rcases hv' with ⟨t₂, rfl⟩
     exact ⟨t₁, t₂, hv⟩
   rcases hv (p -ᵥ p₁) (vsub_mem_direction hps hp₁s) with ⟨t₁, t₂, hpt⟩
-  simp only [hpt, inner_add_right, inner_smul_right, ho, MulZeroClass.mul_zero, add_zero,
+  simp only [hpt, inner_add_right, inner_smul_right, ho, mul_zero, add_zero,
     mul_eq_zero, inner_self_eq_zero, vsub_eq_zero_iff_eq, hc.symm, or_false_iff] at hop
   rw [hop, zero_smul, zero_add, ← eq_vadd_iff_vsub_eq] at hpt
   subst hpt
fix: disable autoImplicit globally (#6528)

Autoimplicits are highly controversial and also defeat the performance-improving work in #6474.

The intent of this PR is to make autoImplicit opt-in on a per-file basis, by disabling it in the lakefile and enabling it again with set_option autoImplicit true in the few files that rely on it.

That also keeps this PR small, as opposed to attempting to "fix" files to not need it any more.

I claim that many of the uses of autoImplicit in these files are accidental; situations such as:

  • Assuming variables are in scope, but pasting the lemma in the wrong section
  • Pasting in a lemma from a scratch file without checking to see if the variable names are consistent with the rest of the file
  • Making a copy-paste error between lemmas and forgetting to add an explicit arguments.

Having set_option autoImplicit false as the default prevents these types of mistake being made in the 90% of files where autoImplicits are not used at all, and causes them to be caught by CI during review.

I think there were various points during the port where we encouraged porters to delete the universes u v lines; I think having autoparams for universe variables only would cover a lot of the cases we actually use them, while avoiding any real shortcomings.

A Zulip poll (after combining overlapping votes accordingly) was in favor of this change with 5:5:18 as the no:dontcare:yes vote ratio.

While this PR was being reviewed, a handful of files gained some more likely-accidental autoImplicits. In these places, set_option autoImplicit true has been placed locally within a section, rather than at the top of the file.

Diff
@@ -20,6 +20,8 @@ define this subspace.
 euclidean geometry, perpendicular, perpendicular bisector, line segment bisector, equidistant
 -/
 
+set_option autoImplicit true
+
 open Set
 open scoped BigOperators RealInnerProductSpace
 
chore: banish Type _ and Sort _ (#6499)

We remove all possible occurences of Type _ and Sort _ in favor of Type* and Sort*.

This has nice performance benefits.

Diff
@@ -65,7 +65,7 @@ Euclidean affine spaces.
 -/
 
 
-variable {V : Type _} {P : Type _}
+variable {V : Type*} {P : Type*}
 
 variable [NormedAddCommGroup V] [InnerProductSpace ℝ V] [MetricSpace P]
 
@@ -79,8 +79,8 @@ theorem dist_left_midpoint_eq_dist_right_midpoint (p1 p2 : P) :
 
 /-- The inner product of two vectors given with `weightedVSub`, in
 terms of the pairwise distances. -/
-theorem inner_weightedVSub {ι₁ : Type _} {s₁ : Finset ι₁} {w₁ : ι₁ → ℝ} (p₁ : ι₁ → P)
-    (h₁ : ∑ i in s₁, w₁ i = 0) {ι₂ : Type _} {s₂ : Finset ι₂} {w₂ : ι₂ → ℝ} (p₂ : ι₂ → P)
+theorem inner_weightedVSub {ι₁ : Type*} {s₁ : Finset ι₁} {w₁ : ι₁ → ℝ} (p₁ : ι₁ → P)
+    (h₁ : ∑ i in s₁, w₁ i = 0) {ι₂ : Type*} {s₂ : Finset ι₂} {w₂ : ι₂ → ℝ} (p₂ : ι₂ → P)
     (h₂ : ∑ i in s₂, w₂ i = 0) :
     ⟪s₁.weightedVSub p₁ w₁, s₂.weightedVSub p₂ w₂⟫ =
       (-∑ i₁ in s₁, ∑ i₂ in s₂, w₁ i₁ * w₂ i₂ * (dist (p₁ i₁) (p₂ i₂) * dist (p₁ i₁) (p₂ i₂))) /
@@ -94,7 +94,7 @@ theorem inner_weightedVSub {ι₁ : Type _} {s₁ : Finset ι₁} {w₁ : ι₁
 /-- The distance between two points given with `affineCombination`,
 in terms of the pairwise distances between the points in that
 combination. -/
-theorem dist_affineCombination {ι : Type _} {s : Finset ι} {w₁ w₂ : ι → ℝ} (p : ι → P)
+theorem dist_affineCombination {ι : Type*} {s : Finset ι} {w₁ w₂ : ι → ℝ} (p : ι → P)
     (h₁ : ∑ i in s, w₁ i = 1) (h₂ : ∑ i in s, w₂ i = 1) : by
       have a₁ := s.affineCombination ℝ p w₁
       have a₂ := s.affineCombination ℝ p w₂
chore: add 2 #align_imports (#6003)
  • Mathlib/Analysis/Calculus/BumpFunction/Convolution.lean was extracted from Mathlib/Analysis/Convolution.lean in #5940
  • Mathlib/Geometry/Euclidean/PerpBisector.lean has lemmas moved from Mathlib/Geometry/Euclidean/Basic.lean in #5627
Diff
@@ -4,6 +4,9 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yury Kudryashov, Joseph Myers
 -/
 import Mathlib.Analysis.InnerProductSpace.Orthogonal
+
+#align_import geometry.euclidean.basic from "leanprover-community/mathlib"@"2de9c37fa71dde2f1c6feff19876dd6a7b1519f0"
+
 /-!
 # Perpendicular bisector of a segment
 
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -2,16 +2,13 @@
 Copyright (c) 2020 Joseph Myers. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Joseph Myers, Manuel Candales
-
-! This file was ported from Lean 3 source module geometry.euclidean.basic
-! leanprover-community/mathlib commit 2de9c37fa71dde2f1c6feff19876dd6a7b1519f0
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Analysis.InnerProductSpace.Projection
 import Mathlib.Geometry.Euclidean.PerpBisector
 import Mathlib.Algebra.QuadraticDiscriminant
 
+#align_import geometry.euclidean.basic from "leanprover-community/mathlib"@"2de9c37fa71dde2f1c6feff19876dd6a7b1519f0"
+
 /-!
 # Euclidean spaces
 
Generalize orthogonalProjection (#5917)

Introduce a typeclass HasOrthogonalProjection and use it instead of [CompleteSpace K] in the definitions of orthogonalProjection and reflection, as well as lemmas about these definitions.

This way we do not need a [CompleteSpace E] assumption to talk about orthogonalProjection (𝕜 ∙ v).

Fixes #5877

Diff
@@ -217,8 +217,8 @@ subspace, whose direction is complete, as an unbundled function. This
 definition is only intended for use in setting up the bundled version
 `orthogonalProjection` and should not be used once that is
 defined. -/
-def orthogonalProjectionFn (s : AffineSubspace ℝ P) [Nonempty s] [CompleteSpace s.direction]
-    (p : P) : P :=
+def orthogonalProjectionFn (s : AffineSubspace ℝ P) [Nonempty s]
+    [HasOrthogonalProjection s.direction] (p : P) : P :=
   Classical.choose <|
     inter_eq_singleton_of_nonempty_of_isCompl (nonempty_subtype.mp ‹_›)
       (mk'_nonempty p s.directionᗮ)
@@ -233,7 +233,7 @@ point onto the subspace. This lemma is only intended for use in
 setting up the bundled version and should not be used once that is
 defined. -/
 theorem inter_eq_singleton_orthogonalProjectionFn {s : AffineSubspace ℝ P} [Nonempty s]
-    [CompleteSpace s.direction] (p : P) :
+    [HasOrthogonalProjection s.direction] (p : P) :
     (s : Set P) ∩ mk' p s.directionᗮ = {orthogonalProjectionFn s p} :=
   Classical.choose_spec <|
     inter_eq_singleton_of_nonempty_of_isCompl (nonempty_subtype.mp ‹_›)
@@ -246,8 +246,8 @@ theorem inter_eq_singleton_orthogonalProjectionFn {s : AffineSubspace ℝ P} [No
 /-- The `orthogonalProjectionFn` lies in the given subspace. This
 lemma is only intended for use in setting up the bundled version and
 should not be used once that is defined. -/
-theorem orthogonalProjectionFn_mem {s : AffineSubspace ℝ P} [Nonempty s] [CompleteSpace s.direction]
-    (p : P) : orthogonalProjectionFn s p ∈ s := by
+theorem orthogonalProjectionFn_mem {s : AffineSubspace ℝ P} [Nonempty s]
+    [HasOrthogonalProjection s.direction] (p : P) : orthogonalProjectionFn s p ∈ s := by
   rw [← mem_coe, ← Set.singleton_subset_iff, ← inter_eq_singleton_orthogonalProjectionFn]
   exact Set.inter_subset_left _ _
 #align euclidean_geometry.orthogonal_projection_fn_mem EuclideanGeometry.orthogonalProjectionFn_mem
@@ -256,7 +256,8 @@ theorem orthogonalProjectionFn_mem {s : AffineSubspace ℝ P} [Nonempty s] [Comp
 subspace. This lemma is only intended for use in setting up the
 bundled version and should not be used once that is defined. -/
 theorem orthogonalProjectionFn_mem_orthogonal {s : AffineSubspace ℝ P} [Nonempty s]
-    [CompleteSpace s.direction] (p : P) : orthogonalProjectionFn s p ∈ mk' p s.directionᗮ := by
+    [HasOrthogonalProjection s.direction] (p : P) :
+    orthogonalProjectionFn s p ∈ mk' p s.directionᗮ := by
   rw [← mem_coe, ← Set.singleton_subset_iff, ← inter_eq_singleton_orthogonalProjectionFn]
   exact Set.inter_subset_right _ _
 #align euclidean_geometry.orthogonal_projection_fn_mem_orthogonal EuclideanGeometry.orthogonalProjectionFn_mem_orthogonal
@@ -266,7 +267,8 @@ result in the orthogonal direction. This lemma is only intended for
 use in setting up the bundled version and should not be used once that
 is defined. -/
 theorem orthogonalProjectionFn_vsub_mem_direction_orthogonal {s : AffineSubspace ℝ P} [Nonempty s]
-    [CompleteSpace s.direction] (p : P) : orthogonalProjectionFn s p -ᵥ p ∈ s.directionᗮ :=
+    [HasOrthogonalProjection s.direction] (p : P) :
+    orthogonalProjectionFn s p -ᵥ p ∈ s.directionᗮ :=
   direction_mk' p s.directionᗮ ▸
     vsub_mem_direction (orthogonalProjectionFn_mem_orthogonal p) (self_mem_mk' _ _)
 #align euclidean_geometry.orthogonal_projection_fn_vsub_mem_direction_orthogonal EuclideanGeometry.orthogonalProjectionFn_vsub_mem_direction_orthogonal
@@ -279,8 +281,8 @@ subspace, whose direction is complete. The corresponding linear map
 points whose difference is that vector) is the `orthogonalProjection`
 for real inner product spaces, onto the direction of the affine
 subspace being projected onto. -/
-nonrec def orthogonalProjection (s : AffineSubspace ℝ P) [Nonempty s] [CompleteSpace s.direction] :
-    P →ᵃ[ℝ] s where
+nonrec def orthogonalProjection (s : AffineSubspace ℝ P) [Nonempty s]
+    [HasOrthogonalProjection s.direction] : P →ᵃ[ℝ] s where
   toFun p := ⟨orthogonalProjectionFn s p, orthogonalProjectionFn_mem p⟩
   linear := orthogonalProjection s.direction
   map_vadd' p v := by
@@ -307,15 +309,16 @@ nonrec def orthogonalProjection (s : AffineSubspace ℝ P) [Nonempty s] [Complet
 #align euclidean_geometry.orthogonal_projection EuclideanGeometry.orthogonalProjection
 
 @[simp]
-theorem orthogonalProjectionFn_eq {s : AffineSubspace ℝ P} [Nonempty s] [CompleteSpace s.direction]
-    (p : P) : orthogonalProjectionFn s p = orthogonalProjection s p :=
+theorem orthogonalProjectionFn_eq {s : AffineSubspace ℝ P} [Nonempty s]
+    [HasOrthogonalProjection s.direction] (p : P) :
+    orthogonalProjectionFn s p = orthogonalProjection s p :=
   rfl
 #align euclidean_geometry.orthogonal_projection_fn_eq EuclideanGeometry.orthogonalProjectionFn_eq
 
 /-- The linear map corresponding to `orthogonalProjection`. -/
 @[simp]
 theorem orthogonalProjection_linear {s : AffineSubspace ℝ P} [Nonempty s]
-    [CompleteSpace s.direction] :
+    [HasOrthogonalProjection s.direction] :
     (orthogonalProjection s).linear = _root_.orthogonalProjection s.direction :=
   rfl
 #align euclidean_geometry.orthogonal_projection_linear EuclideanGeometry.orthogonalProjection_linear
@@ -324,21 +327,22 @@ theorem orthogonalProjection_linear {s : AffineSubspace ℝ P} [Nonempty s]
 through the given point is the `orthogonalProjection` of that point
 onto the subspace. -/
 theorem inter_eq_singleton_orthogonalProjection {s : AffineSubspace ℝ P} [Nonempty s]
-    [CompleteSpace s.direction] (p : P) :
+    [HasOrthogonalProjection s.direction] (p : P) :
     (s : Set P) ∩ mk' p s.directionᗮ = {↑(orthogonalProjection s p)} := by
   rw [← orthogonalProjectionFn_eq]
   exact inter_eq_singleton_orthogonalProjectionFn p
 #align euclidean_geometry.inter_eq_singleton_orthogonal_projection EuclideanGeometry.inter_eq_singleton_orthogonalProjection
 
 /-- The `orthogonalProjection` lies in the given subspace. -/
-theorem orthogonalProjection_mem {s : AffineSubspace ℝ P} [Nonempty s] [CompleteSpace s.direction]
-    (p : P) : ↑(orthogonalProjection s p) ∈ s :=
+theorem orthogonalProjection_mem {s : AffineSubspace ℝ P} [Nonempty s]
+    [HasOrthogonalProjection s.direction] (p : P) : ↑(orthogonalProjection s p) ∈ s :=
   (orthogonalProjection s p).2
 #align euclidean_geometry.orthogonal_projection_mem EuclideanGeometry.orthogonalProjection_mem
 
 /-- The `orthogonalProjection` lies in the orthogonal subspace. -/
 theorem orthogonalProjection_mem_orthogonal (s : AffineSubspace ℝ P) [Nonempty s]
-    [CompleteSpace s.direction] (p : P) : ↑(orthogonalProjection s p) ∈ mk' p s.directionᗮ :=
+    [HasOrthogonalProjection s.direction] (p : P) :
+    ↑(orthogonalProjection s p) ∈ mk' p s.directionᗮ :=
   orthogonalProjectionFn_mem_orthogonal p
 #align euclidean_geometry.orthogonal_projection_mem_orthogonal EuclideanGeometry.orthogonalProjection_mem_orthogonal
 
@@ -346,7 +350,7 @@ theorem orthogonalProjection_mem_orthogonal (s : AffineSubspace ℝ P) [Nonempty
 `orthogonalProjection` produces a result in the direction of the
 given subspace. -/
 theorem orthogonalProjection_vsub_mem_direction {s : AffineSubspace ℝ P} [Nonempty s]
-    [CompleteSpace s.direction] {p1 : P} (p2 : P) (hp1 : p1 ∈ s) :
+    [HasOrthogonalProjection s.direction] {p1 : P} (p2 : P) (hp1 : p1 ∈ s) :
     ↑(orthogonalProjection s p2 -ᵥ ⟨p1, hp1⟩ : s.direction) ∈ s.direction :=
   (orthogonalProjection s p2 -ᵥ ⟨p1, hp1⟩ : s.direction).2
 #align euclidean_geometry.orthogonal_projection_vsub_mem_direction EuclideanGeometry.orthogonalProjection_vsub_mem_direction
@@ -354,7 +358,7 @@ theorem orthogonalProjection_vsub_mem_direction {s : AffineSubspace ℝ P} [None
 /-- Subtracting the `orthogonalProjection` from a point in the given
 subspace produces a result in the direction of the given subspace. -/
 theorem vsub_orthogonalProjection_mem_direction {s : AffineSubspace ℝ P} [Nonempty s]
-    [CompleteSpace s.direction] {p1 : P} (p2 : P) (hp1 : p1 ∈ s) :
+    [HasOrthogonalProjection s.direction] {p1 : P} (p2 : P) (hp1 : p1 ∈ s) :
     ↑((⟨p1, hp1⟩ : s) -ᵥ orthogonalProjection s p2 : s.direction) ∈ s.direction :=
   ((⟨p1, hp1⟩ : s) -ᵥ orthogonalProjection s p2 : s.direction).2
 #align euclidean_geometry.vsub_orthogonal_projection_mem_direction EuclideanGeometry.vsub_orthogonalProjection_mem_direction
@@ -362,7 +366,7 @@ theorem vsub_orthogonalProjection_mem_direction {s : AffineSubspace ℝ P} [None
 /-- A point equals its orthogonal projection if and only if it lies in
 the subspace. -/
 theorem orthogonalProjection_eq_self_iff {s : AffineSubspace ℝ P} [Nonempty s]
-    [CompleteSpace s.direction] {p : P} : ↑(orthogonalProjection s p) = p ↔ p ∈ s := by
+    [HasOrthogonalProjection s.direction] {p : P} : ↑(orthogonalProjection s p) = p ↔ p ∈ s := by
   constructor
   · exact fun h => h ▸ orthogonalProjection_mem p
   · intro h
@@ -374,7 +378,7 @@ theorem orthogonalProjection_eq_self_iff {s : AffineSubspace ℝ P} [Nonempty s]
 
 @[simp]
 theorem orthogonalProjection_mem_subspace_eq_self {s : AffineSubspace ℝ P} [Nonempty s]
-    [CompleteSpace s.direction] (p : s) : orthogonalProjection s p = p := by
+    [HasOrthogonalProjection s.direction] (p : s) : orthogonalProjection s p = p := by
   ext
   rw [orthogonalProjection_eq_self_iff]
   exact p.2
@@ -383,7 +387,7 @@ theorem orthogonalProjection_mem_subspace_eq_self {s : AffineSubspace ℝ P} [No
 /-- Orthogonal projection is idempotent. -/
 -- @[simp] -- Porting note: simp can prove this
 theorem orthogonalProjection_orthogonalProjection (s : AffineSubspace ℝ P) [Nonempty s]
-    [CompleteSpace s.direction] (p : P) :
+    [HasOrthogonalProjection s.direction] (p : P) :
     orthogonalProjection s (orthogonalProjection s p) = orthogonalProjection s p := by
   ext
   rw [orthogonalProjection_eq_self_iff]
@@ -391,36 +395,39 @@ theorem orthogonalProjection_orthogonalProjection (s : AffineSubspace ℝ P) [No
 #align euclidean_geometry.orthogonal_projection_orthogonal_projection EuclideanGeometry.orthogonalProjection_orthogonalProjection
 
 theorem eq_orthogonalProjection_of_eq_subspace {s s' : AffineSubspace ℝ P} [Nonempty s]
-    [Nonempty s'] [CompleteSpace s.direction] [CompleteSpace s'.direction] (h : s = s') (p : P) :
-    (orthogonalProjection s p : P) = (orthogonalProjection s' p : P) := by
+    [Nonempty s'] [HasOrthogonalProjection s.direction] [HasOrthogonalProjection s'.direction]
+    (h : s = s') (p : P) : (orthogonalProjection s p : P) = (orthogonalProjection s' p : P) := by
   subst h
   rfl
 #align euclidean_geometry.eq_orthogonal_projection_of_eq_subspace EuclideanGeometry.eq_orthogonalProjection_of_eq_subspace
 
 /-- The distance to a point's orthogonal projection is 0 iff it lies in the subspace. -/
 theorem dist_orthogonalProjection_eq_zero_iff {s : AffineSubspace ℝ P} [Nonempty s]
-    [CompleteSpace s.direction] {p : P} : dist p (orthogonalProjection s p) = 0 ↔ p ∈ s := by
+    [HasOrthogonalProjection s.direction] {p : P} :
+    dist p (orthogonalProjection s p) = 0 ↔ p ∈ s := by
   rw [dist_comm, dist_eq_zero, orthogonalProjection_eq_self_iff]
 #align euclidean_geometry.dist_orthogonal_projection_eq_zero_iff EuclideanGeometry.dist_orthogonalProjection_eq_zero_iff
 
 /-- The distance between a point and its orthogonal projection is
 nonzero if it does not lie in the subspace. -/
 theorem dist_orthogonalProjection_ne_zero_of_not_mem {s : AffineSubspace ℝ P} [Nonempty s]
-    [CompleteSpace s.direction] {p : P} (hp : p ∉ s) : dist p (orthogonalProjection s p) ≠ 0 :=
+    [HasOrthogonalProjection s.direction] {p : P} (hp : p ∉ s) :
+    dist p (orthogonalProjection s p) ≠ 0 :=
   mt dist_orthogonalProjection_eq_zero_iff.mp hp
 #align euclidean_geometry.dist_orthogonal_projection_ne_zero_of_not_mem EuclideanGeometry.dist_orthogonalProjection_ne_zero_of_not_mem
 
 /-- Subtracting `p` from its `orthogonalProjection` produces a result
 in the orthogonal direction. -/
 theorem orthogonalProjection_vsub_mem_direction_orthogonal (s : AffineSubspace ℝ P) [Nonempty s]
-    [CompleteSpace s.direction] (p : P) : (orthogonalProjection s p : P) -ᵥ p ∈ s.directionᗮ :=
+    [HasOrthogonalProjection s.direction] (p : P) :
+    (orthogonalProjection s p : P) -ᵥ p ∈ s.directionᗮ :=
   orthogonalProjectionFn_vsub_mem_direction_orthogonal p
 #align euclidean_geometry.orthogonal_projection_vsub_mem_direction_orthogonal EuclideanGeometry.orthogonalProjection_vsub_mem_direction_orthogonal
 
 /-- Subtracting the `orthogonalProjection` from `p` produces a result
 in the orthogonal direction. -/
 theorem vsub_orthogonalProjection_mem_direction_orthogonal (s : AffineSubspace ℝ P) [Nonempty s]
-    [CompleteSpace s.direction] (p : P) : p -ᵥ orthogonalProjection s p ∈ s.directionᗮ :=
+    [HasOrthogonalProjection s.direction] (p : P) : p -ᵥ orthogonalProjection s p ∈ s.directionᗮ :=
   direction_mk' p s.directionᗮ ▸
     vsub_mem_direction (self_mem_mk' _ _) (orthogonalProjection_mem_orthogonal s p)
 #align euclidean_geometry.vsub_orthogonal_projection_mem_direction_orthogonal EuclideanGeometry.vsub_orthogonalProjection_mem_direction_orthogonal
@@ -428,7 +435,7 @@ theorem vsub_orthogonalProjection_mem_direction_orthogonal (s : AffineSubspace 
 /-- Subtracting the `orthogonalProjection` from `p` produces a result in the kernel of the linear
 part of the orthogonal projection. -/
 theorem orthogonalProjection_vsub_orthogonalProjection (s : AffineSubspace ℝ P) [Nonempty s]
-    [CompleteSpace s.direction] (p : P) :
+    [HasOrthogonalProjection s.direction] (p : P) :
     _root_.orthogonalProjection s.direction (p -ᵥ orthogonalProjection s p) = 0 := by
   apply orthogonalProjection_mem_subspace_orthogonalComplement_eq_zero
   intro c hc
@@ -440,7 +447,7 @@ theorem orthogonalProjection_vsub_orthogonalProjection (s : AffineSubspace ℝ P
 orthogonal projection, produces the original point if the vector was
 in the orthogonal direction. -/
 theorem orthogonalProjection_vadd_eq_self {s : AffineSubspace ℝ P} [Nonempty s]
-    [CompleteSpace s.direction] {p : P} (hp : p ∈ s) {v : V} (hv : v ∈ s.directionᗮ) :
+    [HasOrthogonalProjection s.direction] {p : P} (hp : p ∈ s) {v : V} (hv : v ∈ s.directionᗮ) :
     orthogonalProjection s (v +ᵥ p) = ⟨p, hp⟩ := by
   have h := vsub_orthogonalProjection_mem_direction_orthogonal s (v +ᵥ p)
   rw [vadd_vsub_assoc, Submodule.add_mem_iff_right _ hv] at h
@@ -455,7 +462,7 @@ orthogonal projection, produces the original point if the vector is a
 multiple of the result of subtracting a point's orthogonal projection
 from that point. -/
 theorem orthogonalProjection_vadd_smul_vsub_orthogonalProjection {s : AffineSubspace ℝ P}
-    [Nonempty s] [CompleteSpace s.direction] {p1 : P} (p2 : P) (r : ℝ) (hp : p1 ∈ s) :
+    [Nonempty s] [HasOrthogonalProjection s.direction] {p1 : P} (p2 : P) (r : ℝ) (hp : p1 ∈ s) :
     orthogonalProjection s (r • (p2 -ᵥ orthogonalProjection s p2 : V) +ᵥ p1) = ⟨p1, hp⟩ :=
   orthogonalProjection_vadd_eq_self hp
     (Submodule.smul_mem _ _ (vsub_orthogonalProjection_mem_direction_orthogonal s _))
@@ -465,7 +472,7 @@ theorem orthogonalProjection_vadd_smul_vsub_orthogonalProjection {s : AffineSubs
 sum of the squares of the distances of the two points to the
 `orthogonalProjection`. -/
 theorem dist_sq_eq_dist_orthogonalProjection_sq_add_dist_orthogonalProjection_sq
-    {s : AffineSubspace ℝ P} [Nonempty s] [CompleteSpace s.direction] {p1 : P} (p2 : P)
+    {s : AffineSubspace ℝ P} [Nonempty s] [HasOrthogonalProjection s.direction] {p1 : P} (p2 : P)
     (hp1 : p1 ∈ s) :
     dist p1 p2 * dist p1 p2 =
       dist p1 (orthogonalProjection s p2) * dist p1 (orthogonalProjection s p2) +
@@ -506,7 +513,8 @@ specifically reflection in a codimension-one subspace, and sometimes
 more generally to cover operations such as reflection in a point. The
 definition here, of reflection in an affine subspace, is a more
 general sense of the word that includes both those common cases. -/
-def reflection (s : AffineSubspace ℝ P) [Nonempty s] [CompleteSpace s.direction] : P ≃ᵃⁱ[ℝ] P :=
+def reflection (s : AffineSubspace ℝ P) [Nonempty s] [HasOrthogonalProjection s.direction] :
+    P ≃ᵃⁱ[ℝ] P :=
   AffineIsometryEquiv.mk'
     (fun p => ↑(orthogonalProjection s p) -ᵥ p +ᵥ (orthogonalProjection s p : P))
     (_root_.reflection s.direction) (↑(Classical.arbitrary s))
@@ -525,22 +533,22 @@ def reflection (s : AffineSubspace ℝ P) [Nonempty s] [CompleteSpace s.directio
 #align euclidean_geometry.reflection EuclideanGeometry.reflection
 
 /-- The result of reflecting. -/
-theorem reflection_apply (s : AffineSubspace ℝ P) [Nonempty s] [CompleteSpace s.direction] (p : P) :
-    reflection s p = ↑(orthogonalProjection s p) -ᵥ p +ᵥ (orthogonalProjection s p : P) :=
+theorem reflection_apply (s : AffineSubspace ℝ P) [Nonempty s] [HasOrthogonalProjection s.direction]
+    (p : P) : reflection s p = ↑(orthogonalProjection s p) -ᵥ p +ᵥ (orthogonalProjection s p : P) :=
   rfl
 #align euclidean_geometry.reflection_apply EuclideanGeometry.reflection_apply
 
 theorem eq_reflection_of_eq_subspace {s s' : AffineSubspace ℝ P} [Nonempty s] [Nonempty s']
-    [CompleteSpace s.direction] [CompleteSpace s'.direction] (h : s = s') (p : P) :
-    (reflection s p : P) = (reflection s' p : P) := by
+    [HasOrthogonalProjection s.direction] [HasOrthogonalProjection s'.direction] (h : s = s')
+    (p : P) : (reflection s p : P) = (reflection s' p : P) := by
   subst h
   rfl
 #align euclidean_geometry.eq_reflection_of_eq_subspace EuclideanGeometry.eq_reflection_of_eq_subspace
 
 /-- Reflecting twice in the same subspace. -/
 @[simp]
-theorem reflection_reflection (s : AffineSubspace ℝ P) [Nonempty s] [CompleteSpace s.direction]
-    (p : P) : reflection s (reflection s p) = p := by
+theorem reflection_reflection (s : AffineSubspace ℝ P) [Nonempty s]
+    [HasOrthogonalProjection s.direction] (p : P) : reflection s (reflection s p) = p := by
   have : ∀ a : s, ∀ b : V, (_root_.orthogonalProjection s.direction) b = 0 →
       reflection s (reflection s (b +ᵥ (a : P))) = b +ᵥ (a : P) := by
     intro _ _ h
@@ -551,23 +559,22 @@ theorem reflection_reflection (s : AffineSubspace ℝ P) [Nonempty s] [CompleteS
 
 /-- Reflection is its own inverse. -/
 @[simp]
-theorem reflection_symm (s : AffineSubspace ℝ P) [Nonempty s] [CompleteSpace s.direction] :
-    (reflection s).symm = reflection s := by
+theorem reflection_symm (s : AffineSubspace ℝ P) [Nonempty s]
+    [HasOrthogonalProjection s.direction] : (reflection s).symm = reflection s := by
   ext
   rw [← (reflection s).injective.eq_iff]
   simp
 #align euclidean_geometry.reflection_symm EuclideanGeometry.reflection_symm
 
 /-- Reflection is involutive. -/
-theorem reflection_involutive (s : AffineSubspace ℝ P) [Nonempty s] [CompleteSpace s.direction] :
-    Function.Involutive (reflection s) :=
+theorem reflection_involutive (s : AffineSubspace ℝ P) [Nonempty s]
+    [HasOrthogonalProjection s.direction] : Function.Involutive (reflection s) :=
   reflection_reflection s
 #align euclidean_geometry.reflection_involutive EuclideanGeometry.reflection_involutive
 
-/-- A point is its own reflection if and only if it is in the
-subspace. -/
-theorem reflection_eq_self_iff {s : AffineSubspace ℝ P} [Nonempty s] [CompleteSpace s.direction]
-    (p : P) : reflection s p = p ↔ p ∈ s := by
+/-- A point is its own reflection if and only if it is in the subspace. -/
+theorem reflection_eq_self_iff {s : AffineSubspace ℝ P} [Nonempty s]
+    [HasOrthogonalProjection s.direction] (p : P) : reflection s p = p ↔ p ∈ s := by
   rw [← orthogonalProjection_eq_self_iff, reflection_apply]
   constructor
   · intro h
@@ -583,7 +590,8 @@ theorem reflection_eq_self_iff {s : AffineSubspace ℝ P} [Nonempty s] [Complete
 and only if the point has the same orthogonal projection in each of
 those subspaces. -/
 theorem reflection_eq_iff_orthogonalProjection_eq (s₁ s₂ : AffineSubspace ℝ P) [Nonempty s₁]
-    [Nonempty s₂] [CompleteSpace s₁.direction] [CompleteSpace s₂.direction] (p : P) :
+    [Nonempty s₂] [HasOrthogonalProjection s₁.direction] [HasOrthogonalProjection s₂.direction]
+    (p : P) :
     reflection s₁ p = reflection s₂ p ↔
       (orthogonalProjection s₁ p : P) = orthogonalProjection s₂ p := by
   rw [reflection_apply, reflection_apply]
@@ -600,7 +608,7 @@ theorem reflection_eq_iff_orthogonalProjection_eq (s₁ s₂ : AffineSubspace 
 
 /-- The distance between `p₁` and the reflection of `p₂` equals that
 between the reflection of `p₁` and `p₂`. -/
-theorem dist_reflection (s : AffineSubspace ℝ P) [Nonempty s] [CompleteSpace s.direction]
+theorem dist_reflection (s : AffineSubspace ℝ P) [Nonempty s] [HasOrthogonalProjection s.direction]
     (p₁ p₂ : P) : dist p₁ (reflection s p₂) = dist (reflection s p₁) p₂ := by
   conv_lhs => rw [← reflection_reflection s p₁]
   exact (reflection s).dist_map _ _
@@ -608,8 +616,9 @@ theorem dist_reflection (s : AffineSubspace ℝ P) [Nonempty s] [CompleteSpace s
 
 /-- A point in the subspace is equidistant from another point and its
 reflection. -/
-theorem dist_reflection_eq_of_mem (s : AffineSubspace ℝ P) [Nonempty s] [CompleteSpace s.direction]
-    {p₁ : P} (hp₁ : p₁ ∈ s) (p₂ : P) : dist p₁ (reflection s p₂) = dist p₁ p₂ := by
+theorem dist_reflection_eq_of_mem (s : AffineSubspace ℝ P) [Nonempty s]
+    [HasOrthogonalProjection s.direction] {p₁ : P} (hp₁ : p₁ ∈ s) (p₂ : P) :
+    dist p₁ (reflection s p₂) = dist p₁ p₂ := by
   rw [← reflection_eq_self_iff p₁] at hp₁
   convert(reflection s).dist_map p₁ p₂
   rw [hp₁]
@@ -618,7 +627,8 @@ theorem dist_reflection_eq_of_mem (s : AffineSubspace ℝ P) [Nonempty s] [Compl
 /-- The reflection of a point in a subspace is contained in any larger
 subspace containing both the point and the subspace reflected in. -/
 theorem reflection_mem_of_le_of_mem {s₁ s₂ : AffineSubspace ℝ P} [Nonempty s₁]
-    [CompleteSpace s₁.direction] (hle : s₁ ≤ s₂) {p : P} (hp : p ∈ s₂) : reflection s₁ p ∈ s₂ := by
+    [HasOrthogonalProjection s₁.direction] (hle : s₁ ≤ s₂) {p : P} (hp : p ∈ s₂) :
+    reflection s₁ p ∈ s₂ := by
   rw [reflection_apply]
   have ho : ↑(orthogonalProjection s₁ p) ∈ s₂ := hle (orthogonalProjection_mem p)
   exact vadd_mem_of_mem_direction (vsub_mem_direction ho hp) ho
@@ -626,8 +636,9 @@ theorem reflection_mem_of_le_of_mem {s₁ s₂ : AffineSubspace ℝ P} [Nonempty
 
 /-- Reflecting an orthogonal vector plus a point in the subspace
 produces the negation of that vector plus the point. -/
-theorem reflection_orthogonal_vadd {s : AffineSubspace ℝ P} [Nonempty s] [CompleteSpace s.direction]
-    {p : P} (hp : p ∈ s) {v : V} (hv : v ∈ s.directionᗮ) : reflection s (v +ᵥ p) = -v +ᵥ p := by
+theorem reflection_orthogonal_vadd {s : AffineSubspace ℝ P} [Nonempty s]
+    [HasOrthogonalProjection s.direction] {p : P} (hp : p ∈ s) {v : V} (hv : v ∈ s.directionᗮ) :
+    reflection s (v +ᵥ p) = -v +ᵥ p := by
   rw [reflection_apply, orthogonalProjection_vadd_eq_self hp hv, vsub_vadd_eq_vsub_sub]
   simp
 #align euclidean_geometry.reflection_orthogonal_vadd EuclideanGeometry.reflection_orthogonal_vadd
@@ -637,7 +648,7 @@ negation of that vector plus the point if the vector is a multiple of
 the result of subtracting a point's orthogonal projection from that
 point. -/
 theorem reflection_vadd_smul_vsub_orthogonalProjection {s : AffineSubspace ℝ P} [Nonempty s]
-    [CompleteSpace s.direction] {p₁ : P} (p₂ : P) (r : ℝ) (hp₁ : p₁ ∈ s) :
+    [HasOrthogonalProjection s.direction] {p₁ : P} (p₂ : P) (r : ℝ) (hp₁ : p₁ ∈ s) :
     reflection s (r • (p₂ -ᵥ orthogonalProjection s p₂) +ᵥ p₁) =
       -(r • (p₂ -ᵥ orthogonalProjection s p₂)) +ᵥ p₁ :=
   reflection_orthogonal_vadd hp₁
fix: ∑' precedence (#5615)
  • Also remove most superfluous parentheses around big operators (, and variants).
  • roughly the used regex: ([^a-zA-Zα-ωΑ-Ω'𝓝ℳ₀𝕂ₛ)]) \(([∑∏][^()∑∏]*,[^()∑∏:]*)\) ([⊂⊆=<≤]) replaced by $1 $2 $3
Diff
@@ -83,8 +83,8 @@ theorem dist_left_midpoint_eq_dist_right_midpoint (p1 p2 : P) :
 /-- The inner product of two vectors given with `weightedVSub`, in
 terms of the pairwise distances. -/
 theorem inner_weightedVSub {ι₁ : Type _} {s₁ : Finset ι₁} {w₁ : ι₁ → ℝ} (p₁ : ι₁ → P)
-    (h₁ : (∑ i in s₁, w₁ i) = 0) {ι₂ : Type _} {s₂ : Finset ι₂} {w₂ : ι₂ → ℝ} (p₂ : ι₂ → P)
-    (h₂ : (∑ i in s₂, w₂ i) = 0) :
+    (h₁ : ∑ i in s₁, w₁ i = 0) {ι₂ : Type _} {s₂ : Finset ι₂} {w₂ : ι₂ → ℝ} (p₂ : ι₂ → P)
+    (h₂ : ∑ i in s₂, w₂ i = 0) :
     ⟪s₁.weightedVSub p₁ w₁, s₂.weightedVSub p₂ w₂⟫ =
       (-∑ i₁ in s₁, ∑ i₂ in s₂, w₁ i₁ * w₂ i₂ * (dist (p₁ i₁) (p₂ i₂) * dist (p₁ i₁) (p₂ i₂))) /
         2 := by
@@ -98,7 +98,7 @@ theorem inner_weightedVSub {ι₁ : Type _} {s₁ : Finset ι₁} {w₁ : ι₁
 in terms of the pairwise distances between the points in that
 combination. -/
 theorem dist_affineCombination {ι : Type _} {s : Finset ι} {w₁ w₂ : ι → ℝ} (p : ι → P)
-    (h₁ : (∑ i in s, w₁ i) = 1) (h₂ : (∑ i in s, w₂ i) = 1) : by
+    (h₁ : ∑ i in s, w₁ i = 1) (h₂ : ∑ i in s, w₂ i = 1) : by
       have a₁ := s.affineCombination ℝ p w₁
       have a₂ := s.affineCombination ℝ p w₂
       exact dist a₁ a₂ * dist a₁ a₂ = (-∑ i₁ in s, ∑ i₂ in s,
feat: add a file about perpendicular bisector (#5627)
Diff
@@ -9,6 +9,7 @@ Authors: Joseph Myers, Manuel Candales
 ! if you have ported upstream changes.
 -/
 import Mathlib.Analysis.InnerProductSpace.Projection
+import Mathlib.Geometry.Euclidean.PerpBisector
 import Mathlib.Algebra.QuadraticDiscriminant
 
 /-!
@@ -110,23 +111,7 @@ theorem dist_affineCombination {ι : Type _} {s : Finset ι} {w₁ w₂ : ι →
   exact inner_weightedVSub p h p h
 #align euclidean_geometry.dist_affine_combination EuclideanGeometry.dist_affineCombination
 
-/-- Suppose that `c₁` is equidistant from `p₁` and `p₂`, and the same
-applies to `c₂`. Then the vector between `c₁` and `c₂` is orthogonal
-to that between `p₁` and `p₂`. (In two dimensions, this says that the
-diagonals of a kite are orthogonal.) -/
-theorem inner_vsub_vsub_of_dist_eq_of_dist_eq {c₁ c₂ p₁ p₂ : P} (hc₁ : dist p₁ c₁ = dist p₂ c₁)
-    (hc₂ : dist p₁ c₂ = dist p₂ c₂) : ⟪c₂ -ᵥ c₁, p₂ -ᵥ p₁⟫ = 0 := by
-  have h : ⟪c₂ -ᵥ c₁ + (c₂ -ᵥ c₁), p₂ -ᵥ p₁⟫ = 0 := by
-    conv_lhs => congr; congr; rw [← vsub_sub_vsub_cancel_right c₂ c₁ p₁]
-    rw [← vsub_sub_vsub_cancel_right c₂ c₁ p₂, sub_add_sub_comm, inner_sub_left]
-    conv_lhs => congr; rw [← vsub_sub_vsub_cancel_right p₂ p₁ c₂]
-    rw [← vsub_sub_vsub_cancel_right p₂ p₁ c₁]
-    rw [dist_comm p₁, dist_comm p₂, dist_eq_norm_vsub V _ p₁, dist_eq_norm_vsub V _ p₂, ←
-      real_inner_add_sub_eq_zero_iff] at hc₁ hc₂
-    simp_rw [← neg_vsub_eq_vsub_rev c₁, ← neg_vsub_eq_vsub_rev c₂, sub_neg_eq_add, neg_add_eq_sub,
-      hc₁, hc₂, sub_zero]
-  simpa [inner_add_left, ← mul_two, (by norm_num : (2 : ℝ) ≠ 0)] using h
-#align euclidean_geometry.inner_vsub_vsub_of_dist_eq_of_dist_eq EuclideanGeometry.inner_vsub_vsub_of_dist_eq_of_dist_eq
+-- Porting note: `inner_vsub_vsub_of_dist_eq_of_dist_eq` moved to `PerpendicularBisector`
 
 /-- The squared distance between points on a line (expressed as a
 multiple of a fixed vector added to a point) and another point,
feat: port Geometry.Euclidean.Basic (#4406)

Co-authored-by: Jeremy Tan Jie Rui <reddeloostw@gmail.com>

Dependencies 12 + 869

870 files ported (98.6%)
386854 lines ported (98.6%)
Show graph

The unported dependencies are

The following 1 dependencies have changed in mathlib3 since they were ported, which may complicate porting this file