geometry.euclidean.circumcenterMathlib.Geometry.Euclidean.Circumcenter

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
@@ -145,7 +145,7 @@ theorem existsUnique_dist_eq_of_insert {s : AffineSubspace ℝ P} [CompleteSpace
           orthogonal_projection_vadd_smul_vsub_orthogonal_projection _ _ hcc, Subtype.coe_mk,
           dist_of_mem_subset_mk_sphere hp1 hcr, dist_eq_norm_vsub V cc₂ cc, vadd_vsub, norm_smul, ←
           dist_eq_norm_vsub V, Real.norm_eq_abs, abs_div, abs_of_nonneg dist_nonneg,
-          div_mul_cancel _ hy0, abs_mul_abs_self]
+          div_mul_cancel₀ _ hy0, abs_mul_abs_self]
   · rintro ⟨cc₃, cr₃⟩ ⟨hcc₃, hcr₃⟩
     simp only at hcc₃ hcr₃
     obtain ⟨t₃, cc₃', hcc₃', hcc₃''⟩ :
@@ -522,7 +522,7 @@ theorem dist_circumcenter_sq_eq_sq_sub_circumradius {n : ℕ} {r : ℝ} (s : Sim
   by
   rw [dist_comm, ← h₁ 0,
     s.dist_sq_eq_dist_orthogonal_projection_sq_add_dist_orthogonal_projection_sq p₁ h]
-  simp only [h₁', dist_comm p₁, add_sub_cancel', simplex.dist_circumcenter_eq_circumradius]
+  simp only [h₁', dist_comm p₁, add_sub_cancel_left, simplex.dist_circumcenter_eq_circumradius]
 #align affine.simplex.dist_circumcenter_sq_eq_sq_sub_circumradius Affine.Simplex.dist_circumcenter_sq_eq_sq_sub_circumradius
 -/
 
Diff
@@ -89,7 +89,7 @@ theorem exists_dist_eq_iff_exists_dist_orthogonalProjection_eq {s : AffineSubspa
     (∃ r, ∀ p1 ∈ ps, dist p1 p = r) ↔ ∃ r, ∀ p1 ∈ ps, dist p1 ↑(orthogonalProjection s p) = r :=
   by
   have h := dist_set_eq_iff_dist_orthogonal_projection_eq hps p
-  simp_rw [Set.pairwise_eq_iff_exists_eq] at h 
+  simp_rw [Set.pairwise_eq_iff_exists_eq] at h
   exact h
 #align euclidean_geometry.exists_dist_eq_iff_exists_dist_orthogonal_projection_eq EuclideanGeometry.exists_dist_eq_iff_exists_dist_orthogonalProjection_eq
 -/
@@ -110,7 +110,7 @@ theorem existsUnique_dist_eq_of_insert {s : AffineSubspace ℝ P} [CompleteSpace
   by
   haveI : Nonempty s := Set.Nonempty.to_subtype (hnps.mono hps)
   rcases hu with ⟨⟨cc, cr⟩, ⟨hcc, hcr⟩, hcccru⟩
-  simp only at hcc hcr hcccru 
+  simp only at hcc hcr hcccru
   let x := dist cc (orthogonalProjection s p)
   let y := dist p (orthogonalProjection s p)
   have hy0 : y ≠ 0 := dist_orthogonal_projection_ne_zero_of_not_mem hp
@@ -147,17 +147,17 @@ theorem existsUnique_dist_eq_of_insert {s : AffineSubspace ℝ P} [CompleteSpace
           dist_eq_norm_vsub V, Real.norm_eq_abs, abs_div, abs_of_nonneg dist_nonneg,
           div_mul_cancel _ hy0, abs_mul_abs_self]
   · rintro ⟨cc₃, cr₃⟩ ⟨hcc₃, hcr₃⟩
-    simp only at hcc₃ hcr₃ 
+    simp only at hcc₃ hcr₃
     obtain ⟨t₃, cc₃', hcc₃', hcc₃''⟩ :
       ∃ (r : ℝ) (p0 : P) (hp0 : p0 ∈ s), cc₃ = r • (p -ᵥ ↑((orthogonalProjection s) p)) +ᵥ p0 := by
-      rwa [mem_affine_span_insert_iff (orthogonal_projection_mem p)] at hcc₃ 
+      rwa [mem_affine_span_insert_iff (orthogonal_projection_mem p)] at hcc₃
     have hcr₃' : ∃ r, ∀ p1 ∈ ps, dist p1 cc₃ = r :=
       ⟨cr₃, fun p1 hp1 => dist_of_mem_subset_mk_sphere (Set.mem_insert_of_mem _ hp1) hcr₃⟩
     rw [exists_dist_eq_iff_exists_dist_orthogonal_projection_eq hps cc₃, hcc₃'',
-      orthogonal_projection_vadd_smul_vsub_orthogonal_projection _ _ hcc₃'] at hcr₃' 
+      orthogonal_projection_vadd_smul_vsub_orthogonal_projection _ _ hcc₃'] at hcr₃'
     cases' hcr₃' with cr₃' hcr₃'
     have hu := hcccru ⟨cc₃', cr₃'⟩
-    simp only at hu 
+    simp only at hu
     replace hu := hu ⟨hcc₃', hcr₃'⟩
     cases' hu with hucc hucr
     substs hucc hucr
@@ -179,17 +179,17 @@ theorem existsUnique_dist_eq_of_insert {s : AffineSubspace ℝ P} [CompleteSpace
       dist_sq_smul_orthogonal_vadd_smul_orthogonal_vadd (orthogonal_projection_mem p) hcc₃' _ _
         (vsub_orthogonal_projection_mem_direction_orthogonal s p),
       dist_comm, ← dist_eq_norm_vsub V p,
-      Real.mul_self_sqrt (add_nonneg (hMul_self_nonneg _) (hMul_self_nonneg _))] at hcr₃ 
-    change x * x + _ * (y * y) = _ at hcr₃ 
+      Real.mul_self_sqrt (add_nonneg (hMul_self_nonneg _) (hMul_self_nonneg _))] at hcr₃
+    change x * x + _ * (y * y) = _ at hcr₃
     rw [show
         x * x + (1 - t₃) * (1 - t₃) * (y * y) = x * x + y * y - 2 * y * (t₃ * y) + t₃ * y * (t₃ * y)
         by ring,
-      add_left_inj] at hcr₃ 
+      add_left_inj] at hcr₃
     have ht₃ : t₃ = ycc₂ / y := by
       field_simp [← hcr₃, hy0]
       ring
     subst ht₃
-    change cc₃ = cc₂ at hcc₃'' 
+    change cc₃ = cc₂ at hcc₃''
     congr
     rw [hcr₃val]
     congr 2
@@ -210,10 +210,10 @@ theorem AffineIndependent.existsUnique_dist_eq {ι : Type _} [hne : Nonempty ι]
   induction' hn : Fintype.card ι with m hm generalizing ι
   · exfalso
     have h := Fintype.card_pos_iff.2 hne
-    rw [hn] at h 
+    rw [hn] at h
     exact lt_irrefl 0 h
   · cases m
-    · rw [Fintype.card_eq_one_iff] at hn 
+    · rw [Fintype.card_eq_one_iff] at hn
       cases' hn with i hi
       haveI : Unique ι := ⟨⟨i⟩, hi⟩
       use⟨p i, 0⟩
@@ -224,7 +224,7 @@ theorem AffineIndependent.existsUnique_dist_eq {ι : Type _} [hne : Nonempty ι]
       · rintro ⟨cc, cr⟩
         simp only
         rintro ⟨rfl, hdist⟩
-        simp_rw [Set.singleton_subset_iff, sphere.mem_coe, mem_sphere, dist_self] at hdist 
+        simp_rw [Set.singleton_subset_iff, sphere.mem_coe, mem_sphere, dist_self] at hdist
         rw [hi default, hdist]
         exact ⟨rfl, rfl⟩
     · have i := hne.some
@@ -364,7 +364,7 @@ theorem eq_circumcenter_of_dist_eq {n : ℕ} (s : Simplex ℝ P n) {p : P}
   by
   have h := s.circumsphere_unique_dist_eq.2 ⟨p, r⟩
   simp only [hp, hr, forall_const, eq_self_iff_true, subset_sphere, sphere.ext_iff,
-    Set.forall_range_iff, mem_sphere, true_and_iff] at h 
+    Set.forall_mem_range, mem_sphere, true_and_iff] at h
   exact h.1
 #align affine.simplex.eq_circumcenter_of_dist_eq Affine.Simplex.eq_circumcenter_of_dist_eq
 -/
@@ -378,7 +378,7 @@ theorem eq_circumradius_of_dist_eq {n : ℕ} (s : Simplex ℝ P n) {p : P}
   by
   have h := s.circumsphere_unique_dist_eq.2 ⟨p, r⟩
   simp only [hp, hr, forall_const, eq_self_iff_true, subset_sphere, sphere.ext_iff,
-    Set.forall_range_iff, mem_sphere, true_and_iff] at h 
+    Set.forall_mem_range, mem_sphere, true_and_iff] at h
   exact h.2
 #align affine.simplex.eq_circumradius_of_dist_eq Affine.Simplex.eq_circumradius_of_dist_eq
 -/
@@ -398,7 +398,7 @@ theorem circumradius_pos {n : ℕ} (s : Simplex ℝ P (n + 1)) : 0 < s.circumrad
   refine' lt_of_le_of_ne s.circumradius_nonneg _
   intro h
   have hr := s.dist_circumcenter_eq_circumradius
-  simp_rw [← h, dist_eq_zero] at hr 
+  simp_rw [← h, dist_eq_zero] at hr
   have h01 := s.independent.injective.ne (by decide : (0 : Fin (n + 2)) ≠ 1)
   simpa [hr] using h01
 #align affine.simplex.circumradius_pos Affine.Simplex.circumradius_pos
@@ -409,7 +409,7 @@ theorem circumradius_pos {n : ℕ} (s : Simplex ℝ P (n + 1)) : 0 < s.circumrad
 theorem circumcenter_eq_point (s : Simplex ℝ P 0) (i : Fin 1) : s.circumcenter = s.points i :=
   by
   have h := s.circumcenter_mem_affine_span
-  rw [Set.range_unique, mem_affine_span_singleton] at h 
+  rw [Set.range_unique, mem_affine_span_singleton] at h
   rw [h]
   congr
 #align affine.simplex.circumcenter_eq_point Affine.Simplex.circumcenter_eq_point
@@ -430,7 +430,7 @@ theorem circumcenter_eq_centroid (s : Simplex ℝ P 1) :
       dist_eq_norm_vsub V (s.points j), vsub_vadd_eq_vsub_sub, vsub_vadd_eq_vsub_sub, ←
       one_smul ℝ (s.points i -ᵥ s.points 0), ← one_smul ℝ (s.points j -ᵥ s.points 0)]
     fin_cases i <;> fin_cases j <;> simp [-one_smul, ← sub_smul] <;> norm_num
-  rw [Set.pairwise_eq_iff_exists_eq] at hr 
+  rw [Set.pairwise_eq_iff_exists_eq] at hr
   cases' hr with r hr
   exact
     (s.eq_circumcenter_of_dist_eq
@@ -533,12 +533,12 @@ spanned by that simplex is its circumcenter.  -/
 theorem orthogonalProjection_eq_circumcenter_of_exists_dist_eq {n : ℕ} (s : Simplex ℝ P n) {p : P}
     (hr : ∃ r, ∀ i, dist (s.points i) p = r) : ↑(s.orthogonalProjectionSpan p) = s.circumcenter :=
   by
-  change ∃ r : ℝ, ∀ i, (fun x => dist x p = r) (s.points i) at hr 
+  change ∃ r : ℝ, ∀ i, (fun x => dist x p = r) (s.points i) at hr
   conv at hr =>
     congr
     ext
-    rw [← Set.forall_range_iff]
-  rw [exists_dist_eq_iff_exists_dist_orthogonal_projection_eq (subset_affineSpan ℝ _) p] at hr 
+    rw [← Set.forall_mem_range]
+  rw [exists_dist_eq_iff_exists_dist_orthogonal_projection_eq (subset_affineSpan ℝ _) p] at hr
   cases' hr with r hr
   exact
     s.eq_circumcenter_of_dist_eq (orthogonal_projection_mem p) fun i => hr _ (Set.mem_range_self i)
@@ -580,7 +580,7 @@ theorem circumcenter_eq_of_range_eq {n : ℕ} {s₁ s₂ : Simplex ℝ P n}
     by
     intro i
     have hi : s₂.points i ∈ Set.range s₂.points := Set.mem_range_self _
-    rw [← h, Set.mem_range] at hi 
+    rw [← h, Set.mem_range] at hi
     rcases hi with ⟨j, hj⟩
     rw [← hj, s₁.dist_circumcenter_eq_circumradius j]
   exact s₂.eq_circumcenter_of_dist_eq hs hr
@@ -864,7 +864,7 @@ theorem cospherical_iff_exists_mem_of_complete {s : AffineSubspace ℝ P} {ps :
   by
   constructor
   · rintro ⟨c, hcr⟩
-    rw [exists_dist_eq_iff_exists_dist_orthogonal_projection_eq h c] at hcr 
+    rw [exists_dist_eq_iff_exists_dist_orthogonal_projection_eq h c] at hcr
     exact ⟨orthogonalProjection s c, orthogonal_projection_mem _, hcr⟩
   · exact fun ⟨c, hc, hd⟩ => ⟨c, hd⟩
 #align euclidean_geometry.cospherical_iff_exists_mem_of_complete EuclideanGeometry.cospherical_iff_exists_mem_of_complete
@@ -890,7 +890,7 @@ theorem exists_circumradius_eq_of_cospherical_subset {s : AffineSubspace ℝ P}
     (hd : finrank ℝ s.direction = n) (hc : Cospherical ps) :
     ∃ r : ℝ, ∀ sx : Simplex ℝ P n, Set.range sx.points ⊆ ps → sx.circumradius = r :=
   by
-  rw [cospherical_iff_exists_mem_of_finite_dimensional h] at hc 
+  rw [cospherical_iff_exists_mem_of_finite_dimensional h] at hc
   rcases hc with ⟨c, hc, r, hcr⟩
   use r
   intro sx hsxps
@@ -928,7 +928,7 @@ theorem exists_circumradius_eq_of_cospherical {ps : Set P} {n : ℕ} [FiniteDime
     ∃ r : ℝ, ∀ sx : Simplex ℝ P n, Set.range sx.points ⊆ ps → sx.circumradius = r :=
   by
   haveI : Nonempty (⊤ : AffineSubspace ℝ P) := Set.univ.nonempty
-  rw [← finrank_top, ← direction_top ℝ V P] at hd 
+  rw [← finrank_top, ← direction_top ℝ V P] at hd
   refine' exists_circumradius_eq_of_cospherical_subset _ hd hc
   exact Set.subset_univ _
 #align euclidean_geometry.exists_circumradius_eq_of_cospherical EuclideanGeometry.exists_circumradius_eq_of_cospherical
@@ -955,7 +955,7 @@ theorem exists_circumcenter_eq_of_cospherical_subset {s : AffineSubspace ℝ P}
     (hd : finrank ℝ s.direction = n) (hc : Cospherical ps) :
     ∃ c : P, ∀ sx : Simplex ℝ P n, Set.range sx.points ⊆ ps → sx.circumcenter = c :=
   by
-  rw [cospherical_iff_exists_mem_of_finite_dimensional h] at hc 
+  rw [cospherical_iff_exists_mem_of_finite_dimensional h] at hc
   rcases hc with ⟨c, hc, r, hcr⟩
   use c
   intro sx hsxps
@@ -993,7 +993,7 @@ theorem exists_circumcenter_eq_of_cospherical {ps : Set P} {n : ℕ} [FiniteDime
     ∃ c : P, ∀ sx : Simplex ℝ P n, Set.range sx.points ⊆ ps → sx.circumcenter = c :=
   by
   haveI : Nonempty (⊤ : AffineSubspace ℝ P) := Set.univ.nonempty
-  rw [← finrank_top, ← direction_top ℝ V P] at hd 
+  rw [← finrank_top, ← direction_top ℝ V P] at hd
   refine' exists_circumcenter_eq_of_cospherical_subset _ hd hc
   exact Set.subset_univ _
 #align euclidean_geometry.exists_circumcenter_eq_of_cospherical EuclideanGeometry.exists_circumcenter_eq_of_cospherical
@@ -1047,7 +1047,7 @@ theorem exists_circumsphere_eq_of_cospherical {ps : Set P} {n : ℕ} [FiniteDime
     ∃ c : Sphere P, ∀ sx : Simplex ℝ P n, Set.range sx.points ⊆ ps → sx.circumsphere = c :=
   by
   haveI : Nonempty (⊤ : AffineSubspace ℝ P) := Set.univ.nonempty
-  rw [← finrank_top, ← direction_top ℝ V P] at hd 
+  rw [← finrank_top, ← direction_top ℝ V P] at hd
   refine' exists_circumsphere_eq_of_cospherical_subset _ hd hc
   exact Set.subset_univ _
 #align euclidean_geometry.exists_circumsphere_eq_of_cospherical EuclideanGeometry.exists_circumsphere_eq_of_cospherical
@@ -1082,15 +1082,15 @@ theorem eq_or_eq_reflection_of_dist_eq {n : ℕ} {s : Simplex ℝ P n} {p p₁ p
   have h₁' := s.orthogonal_projection_eq_circumcenter_of_dist_eq h₁
   have h₂' := s.orthogonal_projection_eq_circumcenter_of_dist_eq h₂
   rw [← affineSpan_insert_affineSpan, mem_affine_span_insert_iff (orthogonal_projection_mem p)] at
-    hp₁ hp₂ 
+    hp₁ hp₂
   obtain ⟨r₁, p₁o, hp₁o, hp₁⟩ := hp₁
   obtain ⟨r₂, p₂o, hp₂o, hp₂⟩ := hp₂
   obtain rfl : ↑(s.orthogonal_projection_span p₁) = p₁o := by subst hp₁;
     exact s.coe_orthogonal_projection_vadd_smul_vsub_orthogonal_projection hp₁o
-  rw [h₁'] at hp₁ 
+  rw [h₁'] at hp₁
   obtain rfl : ↑(s.orthogonal_projection_span p₂) = p₂o := by subst hp₂;
     exact s.coe_orthogonal_projection_vadd_smul_vsub_orthogonal_projection hp₂o
-  rw [h₂'] at hp₂ 
+  rw [h₂'] at hp₂
   have h : s.points 0 ∈ span_s := mem_affineSpan ℝ (Set.mem_range_self _)
   have hd₁ :
     dist p₁ s.circumcenter * dist p₁ s.circumcenter = r * r - s.circumradius * s.circumradius :=
@@ -1101,14 +1101,14 @@ theorem eq_or_eq_reflection_of_dist_eq {n : ℕ} {s : Simplex ℝ P n} {p p₁ p
   rw [← hd₂, hp₁, hp₂, dist_eq_norm_vsub V _ s.circumcenter, dist_eq_norm_vsub V _ s.circumcenter,
     vadd_vsub, vadd_vsub, ← real_inner_self_eq_norm_mul_norm, ← real_inner_self_eq_norm_mul_norm,
     real_inner_smul_left, real_inner_smul_left, real_inner_smul_right, real_inner_smul_right, ←
-    mul_assoc, ← mul_assoc] at hd₁ 
+    mul_assoc, ← mul_assoc] at hd₁
   by_cases hp : p = s.orthogonal_projection_span p
-  · rw [simplex.orthogonal_projection_span] at hp 
+  · rw [simplex.orthogonal_projection_span] at hp
     rw [hp₁, hp₂, ← hp]
     simp only [true_or_iff, eq_self_iff_true, smul_zero, vsub_self]
   · have hz : ⟪p -ᵥ orthogonalProjection span_s p, p -ᵥ orthogonalProjection span_s p⟫ ≠ 0 := by
       simpa only [Ne.def, vsub_eq_zero_iff_eq, inner_self_eq_zero] using hp
-    rw [mul_left_inj' hz, mul_self_eq_mul_self_iff] at hd₁ 
+    rw [mul_left_inj' hz, mul_self_eq_mul_self_iff] at hd₁
     rw [hp₁, hp₂]
     cases hd₁
     · left
Diff
@@ -131,7 +131,7 @@ theorem existsUnique_dist_eq_of_insert {s : AffineSubspace ℝ P} [CompleteSpace
             (Set.mem_insert_of_mem _ (orthogonal_projection_mem _)))
     · intro p1 hp1
       rw [sphere.mem_coe, mem_sphere, ← mul_self_inj_of_nonneg dist_nonneg (Real.sqrt_nonneg _),
-        Real.mul_self_sqrt (add_nonneg (mul_self_nonneg _) (mul_self_nonneg _))]
+        Real.mul_self_sqrt (add_nonneg (hMul_self_nonneg _) (hMul_self_nonneg _))]
       cases hp1
       · rw [hp1]
         rw [hpo,
@@ -167,7 +167,7 @@ theorem existsUnique_dist_eq_of_insert {s : AffineSubspace ℝ P} [CompleteSpace
       have h' : ↑(⟨cc₃', hcc₃'⟩ : s) = cc₃' := rfl
       rw [← dist_of_mem_subset_mk_sphere (Set.mem_insert_of_mem _ hp0) hcr₃, hcc₃'', ←
         mul_self_inj_of_nonneg dist_nonneg (Real.sqrt_nonneg _),
-        Real.mul_self_sqrt (add_nonneg (mul_self_nonneg _) (mul_self_nonneg _)),
+        Real.mul_self_sqrt (add_nonneg (hMul_self_nonneg _) (hMul_self_nonneg _)),
         dist_sq_eq_dist_orthogonal_projection_sq_add_dist_orthogonal_projection_sq _ (hps hp0),
         orthogonal_projection_vadd_smul_vsub_orthogonal_projection _ _ hcc₃', h',
         dist_of_mem_subset_mk_sphere hp0 hcr, dist_eq_norm_vsub V _ cc₃', vadd_vsub, norm_smul, ←
@@ -179,7 +179,7 @@ theorem existsUnique_dist_eq_of_insert {s : AffineSubspace ℝ P} [CompleteSpace
       dist_sq_smul_orthogonal_vadd_smul_orthogonal_vadd (orthogonal_projection_mem p) hcc₃' _ _
         (vsub_orthogonal_projection_mem_direction_orthogonal s p),
       dist_comm, ← dist_eq_norm_vsub V p,
-      Real.mul_self_sqrt (add_nonneg (mul_self_nonneg _) (mul_self_nonneg _))] at hcr₃ 
+      Real.mul_self_sqrt (add_nonneg (hMul_self_nonneg _) (hMul_self_nonneg _))] at hcr₃ 
     change x * x + _ * (y * y) = _ at hcr₃ 
     rw [show
         x * x + (1 - t₃) * (1 - t₃) * (y * y) = x * x + y * y - 2 * y * (t₃ * y) + t₃ * y * (t₃ * y)
Diff
@@ -725,7 +725,7 @@ theorem sum_centroidWeightsWithCircumcenter {n : ℕ} {fs : Finset (Fin (n + 1))
     ∑ i, centroidWeightsWithCircumcenter fs i = 1 :=
   by
   simp_rw [sum_points_with_circumcenter, centroid_weights_with_circumcenter, add_zero, ←
-    fs.sum_centroid_weights_eq_one_of_nonempty ℝ h, Set.sum_indicator_subset _ fs.subset_univ]
+    fs.sum_centroid_weights_eq_one_of_nonempty ℝ h, Finset.sum_indicator_subset _ fs.subset_univ]
   rcongr
 #align affine.simplex.sum_centroid_weights_with_circumcenter Affine.Simplex.sum_centroidWeightsWithCircumcenter
 -/
@@ -742,7 +742,7 @@ theorem centroid_eq_affineCombination_of_pointsWithCircumcenter {n : ℕ} (s : S
   simp_rw [centroid_def, affine_combination_apply, weighted_vsub_of_point_apply,
     sum_points_with_circumcenter, centroid_weights_with_circumcenter,
     points_with_circumcenter_point, zero_smul, add_zero, centroid_weights,
-    Set.sum_indicator_subset_of_eq_zero (Function.const (Fin (n + 1)) (card fs : ℝ)⁻¹)
+    Finset.sum_indicator_subset_of_eq_zero (Function.const (Fin (n + 1)) (card fs : ℝ)⁻¹)
       (fun i wi => wi • (s.points i -ᵥ Classical.choice AddTorsor.nonempty)) fs.subset_univ fun i =>
       zero_smul ℝ _,
     Set.indicator_apply]
Diff
@@ -604,14 +604,14 @@ open PointsWithCircumcenterIndex
 
 #print Affine.Simplex.pointsWithCircumcenterIndexInhabited /-
 instance pointsWithCircumcenterIndexInhabited (n : ℕ) : Inhabited (PointsWithCircumcenterIndex n) :=
-  ⟨circumcenter_index⟩
+  ⟨circumcenterIndex⟩
 #align affine.simplex.points_with_circumcenter_index_inhabited Affine.Simplex.pointsWithCircumcenterIndexInhabited
 -/
 
 #print Affine.Simplex.pointIndexEmbedding /-
 /-- `point_index` as an embedding. -/
 def pointIndexEmbedding (n : ℕ) : Fin (n + 1) ↪ PointsWithCircumcenterIndex n :=
-  ⟨fun i => point_index i, fun _ _ h => by injection h⟩
+  ⟨fun i => pointIndex i, fun _ _ h => by injection h⟩
 #align affine.simplex.point_index_embedding Affine.Simplex.pointIndexEmbedding
 -/
 
@@ -619,7 +619,7 @@ def pointIndexEmbedding (n : ℕ) : Fin (n + 1) ↪ PointsWithCircumcenterIndex
 /-- The sum of a function over `points_with_circumcenter_index`. -/
 theorem sum_pointsWithCircumcenter {α : Type _} [AddCommMonoid α] {n : ℕ}
     (f : PointsWithCircumcenterIndex n → α) :
-    ∑ i, f i = ∑ i : Fin (n + 1), f (point_index i) + f circumcenter_index :=
+    ∑ i, f i = ∑ i : Fin (n + 1), f (pointIndex i) + f circumcenterIndex :=
   by
   have h : univ = insert circumcenter_index (univ.map (point_index_embedding n)) :=
     by
@@ -649,7 +649,7 @@ def pointsWithCircumcenter {n : ℕ} (s : Simplex ℝ P n) : PointsWithCircumcen
 equals `points` applied to that value. -/
 @[simp]
 theorem pointsWithCircumcenter_point {n : ℕ} (s : Simplex ℝ P n) (i : Fin (n + 1)) :
-    s.pointsWithCircumcenter (point_index i) = s.points i :=
+    s.pointsWithCircumcenter (pointIndex i) = s.points i :=
   rfl
 #align affine.simplex.points_with_circumcenter_point Affine.Simplex.pointsWithCircumcenter_point
 -/
@@ -659,7 +659,7 @@ theorem pointsWithCircumcenter_point {n : ℕ} (s : Simplex ℝ P n) (i : Fin (n
 circumcenter. -/
 @[simp]
 theorem pointsWithCircumcenter_eq_circumcenter {n : ℕ} (s : Simplex ℝ P n) :
-    s.pointsWithCircumcenter circumcenter_index = s.circumcenter :=
+    s.pointsWithCircumcenter circumcenterIndex = s.circumcenter :=
   rfl
 #align affine.simplex.points_with_circumcenter_eq_circumcenter Affine.Simplex.pointsWithCircumcenter_eq_circumcenter
 -/
Diff
@@ -3,9 +3,9 @@ Copyright (c) 2020 Joseph Myers. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Joseph Myers
 -/
-import Mathbin.Geometry.Euclidean.Sphere.Basic
-import Mathbin.LinearAlgebra.AffineSpace.FiniteDimensional
-import Mathbin.Tactic.DeriveFintype
+import Geometry.Euclidean.Sphere.Basic
+import LinearAlgebra.AffineSpace.FiniteDimensional
+import Tactic.DeriveFintype
 
 #align_import geometry.euclidean.circumcenter from "leanprover-community/mathlib"@"8af7091a43227e179939ba132e54e54e9f3b089a"
 
Diff
@@ -117,7 +117,7 @@ theorem existsUnique_dist_eq_of_insert {s : AffineSubspace ℝ P} [CompleteSpace
   let ycc₂ := (x * x + y * y - cr * cr) / (2 * y)
   let cc₂ := (ycc₂ / y) • (p -ᵥ orthogonalProjection s p : V) +ᵥ cc
   let cr₂ := Real.sqrt (cr * cr + ycc₂ * ycc₂)
-  use ⟨cc₂, cr₂⟩
+  use⟨cc₂, cr₂⟩
   simp only
   have hpo : p = (1 : ℝ) • (p -ᵥ orthogonalProjection s p : V) +ᵥ orthogonalProjection s p := by
     simp
@@ -216,7 +216,7 @@ theorem AffineIndependent.existsUnique_dist_eq {ι : Type _} [hne : Nonempty ι]
     · rw [Fintype.card_eq_one_iff] at hn 
       cases' hn with i hi
       haveI : Unique ι := ⟨⟨i⟩, hi⟩
-      use ⟨p i, 0⟩
+      use⟨p i, 0⟩
       simp only [Set.range_unique, AffineSubspace.mem_affineSpan_singleton]
       constructor
       · simp_rw [hi default, Set.singleton_subset_iff, sphere.mem_coe, mem_sphere, dist_self]
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
-
-! This file was ported from Lean 3 source module geometry.euclidean.circumcenter
-! leanprover-community/mathlib commit 8af7091a43227e179939ba132e54e54e9f3b089a
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Geometry.Euclidean.Sphere.Basic
 import Mathbin.LinearAlgebra.AffineSpace.FiniteDimensional
 import Mathbin.Tactic.DeriveFintype
 
+#align_import geometry.euclidean.circumcenter from "leanprover-community/mathlib"@"8af7091a43227e179939ba132e54e54e9f3b089a"
+
 /-!
 # Circumcenter and circumradius
 
Diff
@@ -174,7 +174,7 @@ theorem existsUnique_dist_eq_of_insert {s : AffineSubspace ℝ P} [CompleteSpace
         dist_sq_eq_dist_orthogonal_projection_sq_add_dist_orthogonal_projection_sq _ (hps hp0),
         orthogonal_projection_vadd_smul_vsub_orthogonal_projection _ _ hcc₃', h',
         dist_of_mem_subset_mk_sphere hp0 hcr, dist_eq_norm_vsub V _ cc₃', vadd_vsub, norm_smul, ←
-        dist_eq_norm_vsub V p, Real.norm_eq_abs, ← mul_assoc, mul_comm _ (|t₃|), ← mul_assoc,
+        dist_eq_norm_vsub V p, Real.norm_eq_abs, ← mul_assoc, mul_comm _ |t₃|, ← mul_assoc,
         abs_mul_abs_self]
       ring
     replace hcr₃ := dist_of_mem_subset_mk_sphere (Set.mem_insert _ _) hcr₃
Diff
@@ -51,6 +51,7 @@ variable {V : Type _} {P : Type _} [NormedAddCommGroup V] [InnerProductSpace ℝ
 
 open AffineSubspace
 
+#print EuclideanGeometry.dist_eq_iff_dist_orthogonalProjection_eq /-
 /-- `p` is equidistant from two points in `s` if and only if its
 `orthogonal_projection` is. -/
 theorem dist_eq_iff_dist_orthogonalProjection_eq {s : AffineSubspace ℝ P} [Nonempty s]
@@ -64,7 +65,9 @@ theorem dist_eq_iff_dist_orthogonalProjection_eq {s : AffineSubspace ℝ P} [Non
     dist_sq_eq_dist_orthogonal_projection_sq_add_dist_orthogonal_projection_sq p3 hp2]
   simp
 #align euclidean_geometry.dist_eq_iff_dist_orthogonal_projection_eq EuclideanGeometry.dist_eq_iff_dist_orthogonalProjection_eq
+-/
 
+#print EuclideanGeometry.dist_set_eq_iff_dist_orthogonalProjection_eq /-
 /-- `p` is equidistant from a set of points in `s` if and only if its
 `orthogonal_projection` is. -/
 theorem dist_set_eq_iff_dist_orthogonalProjection_eq {s : AffineSubspace ℝ P} [Nonempty s]
@@ -77,7 +80,9 @@ theorem dist_set_eq_iff_dist_orthogonalProjection_eq {s : AffineSubspace ℝ P}
     fun h p1 hp1 p2 hp2 hne =>
     (dist_eq_iff_dist_orthogonalProjection_eq p (hps hp1) (hps hp2)).2 (h hp1 hp2 hne)⟩
 #align euclidean_geometry.dist_set_eq_iff_dist_orthogonal_projection_eq EuclideanGeometry.dist_set_eq_iff_dist_orthogonalProjection_eq
+-/
 
+#print EuclideanGeometry.exists_dist_eq_iff_exists_dist_orthogonalProjection_eq /-
 /-- There exists `r` such that `p` has distance `r` from all the
 points of a set of points in `s` if and only if there exists (possibly
 different) `r` such that its `orthogonal_projection` has that distance
@@ -90,7 +95,9 @@ theorem exists_dist_eq_iff_exists_dist_orthogonalProjection_eq {s : AffineSubspa
   simp_rw [Set.pairwise_eq_iff_exists_eq] at h 
   exact h
 #align euclidean_geometry.exists_dist_eq_iff_exists_dist_orthogonal_projection_eq EuclideanGeometry.exists_dist_eq_iff_exists_dist_orthogonalProjection_eq
+-/
 
+#print EuclideanGeometry.existsUnique_dist_eq_of_insert /-
 /-- The induction step for the existence and uniqueness of the
 circumcenter.  Given a nonempty set of points in a nonempty affine
 subspace whose direction is complete, such that there is a unique
@@ -192,7 +199,9 @@ theorem existsUnique_dist_eq_of_insert {s : AffineSubspace ℝ P} [CompleteSpace
     field_simp [hy0]
     ring
 #align euclidean_geometry.exists_unique_dist_eq_of_insert EuclideanGeometry.existsUnique_dist_eq_of_insert
+-/
 
+#print AffineIndependent.existsUnique_dist_eq /-
 /-- Given a finite nonempty affinely independent family of points,
 there is a unique (circumcenter, circumradius) pair for those points
 in the affine subspace they span. -/
@@ -248,6 +257,7 @@ theorem AffineIndependent.existsUnique_dist_eq {ι : Type _} [hne : Nonempty ι]
       rw [← Set.image_eq_range]
       congr with j; simp; rfl
 #align affine_independent.exists_unique_dist_eq AffineIndependent.existsUnique_dist_eq
+-/
 
 end EuclideanGeometry
 
@@ -260,11 +270,14 @@ open Finset AffineSubspace EuclideanGeometry
 variable {V : Type _} {P : Type _} [NormedAddCommGroup V] [InnerProductSpace ℝ V] [MetricSpace P]
   [NormedAddTorsor V P]
 
+#print Affine.Simplex.circumsphere /-
 /-- The circumsphere of a simplex. -/
 def circumsphere {n : ℕ} (s : Simplex ℝ P n) : Sphere P :=
   s.Independent.existsUnique_dist_eq.some
 #align affine.simplex.circumsphere Affine.Simplex.circumsphere
+-/
 
+#print Affine.Simplex.circumsphere_unique_dist_eq /-
 /-- The property satisfied by the circumsphere. -/
 theorem circumsphere_unique_dist_eq {n : ℕ} (s : Simplex ℝ P n) :
     (s.circumsphere.center ∈ affineSpan ℝ (Set.range s.points) ∧
@@ -274,35 +287,47 @@ theorem circumsphere_unique_dist_eq {n : ℕ} (s : Simplex ℝ P n) :
           cs = s.circumsphere :=
   s.Independent.existsUnique_dist_eq.choose_spec
 #align affine.simplex.circumsphere_unique_dist_eq Affine.Simplex.circumsphere_unique_dist_eq
+-/
 
+#print Affine.Simplex.circumcenter /-
 /-- The circumcenter of a simplex. -/
 def circumcenter {n : ℕ} (s : Simplex ℝ P n) : P :=
   s.circumsphere.center
 #align affine.simplex.circumcenter Affine.Simplex.circumcenter
+-/
 
+#print Affine.Simplex.circumradius /-
 /-- The circumradius of a simplex. -/
 def circumradius {n : ℕ} (s : Simplex ℝ P n) : ℝ :=
   s.circumsphere.radius
 #align affine.simplex.circumradius Affine.Simplex.circumradius
+-/
 
+#print Affine.Simplex.circumsphere_center /-
 /-- The center of the circumsphere is the circumcenter. -/
 @[simp]
 theorem circumsphere_center {n : ℕ} (s : Simplex ℝ P n) : s.circumsphere.center = s.circumcenter :=
   rfl
 #align affine.simplex.circumsphere_center Affine.Simplex.circumsphere_center
+-/
 
+#print Affine.Simplex.circumsphere_radius /-
 /-- The radius of the circumsphere is the circumradius. -/
 @[simp]
 theorem circumsphere_radius {n : ℕ} (s : Simplex ℝ P n) : s.circumsphere.radius = s.circumradius :=
   rfl
 #align affine.simplex.circumsphere_radius Affine.Simplex.circumsphere_radius
+-/
 
+#print Affine.Simplex.circumcenter_mem_affineSpan /-
 /-- The circumcenter lies in the affine span. -/
 theorem circumcenter_mem_affineSpan {n : ℕ} (s : Simplex ℝ P n) :
     s.circumcenter ∈ affineSpan ℝ (Set.range s.points) :=
   s.circumsphere_unique_dist_eq.1.1
 #align affine.simplex.circumcenter_mem_affine_span Affine.Simplex.circumcenter_mem_affineSpan
+-/
 
+#print Affine.Simplex.dist_circumcenter_eq_circumradius /-
 /-- All points have distance from the circumcenter equal to the
 circumradius. -/
 @[simp]
@@ -310,13 +335,17 @@ theorem dist_circumcenter_eq_circumradius {n : ℕ} (s : Simplex ℝ P n) (i : F
     dist (s.points i) s.circumcenter = s.circumradius :=
   dist_of_mem_subset_sphere (Set.mem_range_self _) s.circumsphere_unique_dist_eq.1.2
 #align affine.simplex.dist_circumcenter_eq_circumradius Affine.Simplex.dist_circumcenter_eq_circumradius
+-/
 
+#print Affine.Simplex.mem_circumsphere /-
 /-- All points lie in the circumsphere. -/
 theorem mem_circumsphere {n : ℕ} (s : Simplex ℝ P n) (i : Fin (n + 1)) :
     s.points i ∈ s.circumsphere :=
   s.dist_circumcenter_eq_circumradius i
 #align affine.simplex.mem_circumsphere Affine.Simplex.mem_circumsphere
+-/
 
+#print Affine.Simplex.dist_circumcenter_eq_circumradius' /-
 /-- All points have distance to the circumcenter equal to the
 circumradius. -/
 @[simp]
@@ -327,7 +356,9 @@ theorem dist_circumcenter_eq_circumradius' {n : ℕ} (s : Simplex ℝ P n) :
   rw [dist_comm]
   exact dist_circumcenter_eq_circumradius _ _
 #align affine.simplex.dist_circumcenter_eq_circumradius' Affine.Simplex.dist_circumcenter_eq_circumradius'
+-/
 
+#print Affine.Simplex.eq_circumcenter_of_dist_eq /-
 /-- Given a point in the affine span from which all the points are
 equidistant, that point is the circumcenter. -/
 theorem eq_circumcenter_of_dist_eq {n : ℕ} (s : Simplex ℝ P n) {p : P}
@@ -339,7 +370,9 @@ theorem eq_circumcenter_of_dist_eq {n : ℕ} (s : Simplex ℝ P n) {p : P}
     Set.forall_range_iff, mem_sphere, true_and_iff] at h 
   exact h.1
 #align affine.simplex.eq_circumcenter_of_dist_eq Affine.Simplex.eq_circumcenter_of_dist_eq
+-/
 
+#print Affine.Simplex.eq_circumradius_of_dist_eq /-
 /-- Given a point in the affine span from which all the points are
 equidistant, that distance is the circumradius. -/
 theorem eq_circumradius_of_dist_eq {n : ℕ} (s : Simplex ℝ P n) {p : P}
@@ -351,12 +384,16 @@ theorem eq_circumradius_of_dist_eq {n : ℕ} (s : Simplex ℝ P n) {p : P}
     Set.forall_range_iff, mem_sphere, true_and_iff] at h 
   exact h.2
 #align affine.simplex.eq_circumradius_of_dist_eq Affine.Simplex.eq_circumradius_of_dist_eq
+-/
 
+#print Affine.Simplex.circumradius_nonneg /-
 /-- The circumradius is non-negative. -/
 theorem circumradius_nonneg {n : ℕ} (s : Simplex ℝ P n) : 0 ≤ s.circumradius :=
   s.dist_circumcenter_eq_circumradius 0 ▸ dist_nonneg
 #align affine.simplex.circumradius_nonneg Affine.Simplex.circumradius_nonneg
+-/
 
+#print Affine.Simplex.circumradius_pos /-
 /-- The circumradius of a simplex with at least two points is
 positive. -/
 theorem circumradius_pos {n : ℕ} (s : Simplex ℝ P (n + 1)) : 0 < s.circumradius :=
@@ -368,7 +405,9 @@ theorem circumradius_pos {n : ℕ} (s : Simplex ℝ P (n + 1)) : 0 < s.circumrad
   have h01 := s.independent.injective.ne (by decide : (0 : Fin (n + 2)) ≠ 1)
   simpa [hr] using h01
 #align affine.simplex.circumradius_pos Affine.Simplex.circumradius_pos
+-/
 
+#print Affine.Simplex.circumcenter_eq_point /-
 /-- The circumcenter of a 0-simplex equals its unique point. -/
 theorem circumcenter_eq_point (s : Simplex ℝ P 0) (i : Fin 1) : s.circumcenter = s.points i :=
   by
@@ -377,7 +416,9 @@ theorem circumcenter_eq_point (s : Simplex ℝ P 0) (i : Fin 1) : s.circumcenter
   rw [h]
   congr
 #align affine.simplex.circumcenter_eq_point Affine.Simplex.circumcenter_eq_point
+-/
 
+#print Affine.Simplex.circumcenter_eq_centroid /-
 /-- The circumcenter of a 1-simplex equals its centroid. -/
 theorem circumcenter_eq_centroid (s : Simplex ℝ P 1) :
     s.circumcenter = Finset.univ.centroid ℝ s.points :=
@@ -399,7 +440,9 @@ theorem circumcenter_eq_centroid (s : Simplex ℝ P 1) :
         (centroid_mem_affineSpan_of_card_eq_add_one ℝ _ (Finset.card_fin 2)) fun i =>
         hr i (Set.mem_univ _)).symm
 #align affine.simplex.circumcenter_eq_centroid Affine.Simplex.circumcenter_eq_centroid
+-/
 
+#print Affine.Simplex.circumsphere_reindex /-
 /-- Reindexing a simplex along an `equiv` of index types does not change the circumsphere. -/
 @[simp]
 theorem circumsphere_reindex {m n : ℕ} (s : Simplex ℝ P m) (e : Fin (m + 1) ≃ Fin (n + 1)) :
@@ -409,44 +452,56 @@ theorem circumsphere_reindex {m n : ℕ} (s : Simplex ℝ P m) (e : Fin (m + 1)
   · exact (s.reindex e).circumsphere_unique_dist_eq.1.1
   · exact (s.reindex e).circumsphere_unique_dist_eq.1.2
 #align affine.simplex.circumsphere_reindex Affine.Simplex.circumsphere_reindex
+-/
 
+#print Affine.Simplex.circumcenter_reindex /-
 /-- Reindexing a simplex along an `equiv` of index types does not change the circumcenter. -/
 @[simp]
 theorem circumcenter_reindex {m n : ℕ} (s : Simplex ℝ P m) (e : Fin (m + 1) ≃ Fin (n + 1)) :
     (s.reindex e).circumcenter = s.circumcenter := by simp_rw [← circumcenter, circumsphere_reindex]
 #align affine.simplex.circumcenter_reindex Affine.Simplex.circumcenter_reindex
+-/
 
+#print Affine.Simplex.circumradius_reindex /-
 /-- Reindexing a simplex along an `equiv` of index types does not change the circumradius. -/
 @[simp]
 theorem circumradius_reindex {m n : ℕ} (s : Simplex ℝ P m) (e : Fin (m + 1) ≃ Fin (n + 1)) :
     (s.reindex e).circumradius = s.circumradius := by simp_rw [← circumradius, circumsphere_reindex]
 #align affine.simplex.circumradius_reindex Affine.Simplex.circumradius_reindex
+-/
 
 attribute [local instance] AffineSubspace.toAddTorsor
 
+#print Affine.Simplex.orthogonalProjectionSpan /-
 /-- The orthogonal projection of a point `p` onto the hyperplane spanned by the simplex's points. -/
 def orthogonalProjectionSpan {n : ℕ} (s : Simplex ℝ P n) :
     P →ᵃ[ℝ] affineSpan ℝ (Set.range s.points) :=
   orthogonalProjection (affineSpan ℝ (Set.range s.points))
 #align affine.simplex.orthogonal_projection_span Affine.Simplex.orthogonalProjectionSpan
+-/
 
+#print Affine.Simplex.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
 from that point. -/
-theorem orthogonal_projection_vadd_smul_vsub_orthogonal_projection {n : ℕ} (s : Simplex ℝ P n)
+theorem orthogonalProjection_vadd_smul_vsub_orthogonalProjection {n : ℕ} (s : Simplex ℝ P n)
     {p1 : P} (p2 : P) (r : ℝ) (hp : p1 ∈ affineSpan ℝ (Set.range s.points)) :
     s.orthogonalProjectionSpan (r • (p2 -ᵥ s.orthogonalProjectionSpan p2 : V) +ᵥ p1) = ⟨p1, hp⟩ :=
   orthogonalProjection_vadd_smul_vsub_orthogonalProjection _ _ _
-#align affine.simplex.orthogonal_projection_vadd_smul_vsub_orthogonal_projection Affine.Simplex.orthogonal_projection_vadd_smul_vsub_orthogonal_projection
+#align affine.simplex.orthogonal_projection_vadd_smul_vsub_orthogonal_projection Affine.Simplex.orthogonalProjection_vadd_smul_vsub_orthogonalProjection
+-/
 
-theorem coe_orthogonal_projection_vadd_smul_vsub_orthogonal_projection {n : ℕ} {r₁ : ℝ}
+#print Affine.Simplex.coe_orthogonalProjection_vadd_smul_vsub_orthogonalProjection /-
+theorem coe_orthogonalProjection_vadd_smul_vsub_orthogonalProjection {n : ℕ} {r₁ : ℝ}
     (s : Simplex ℝ P n) {p p₁o : P} (hp₁o : p₁o ∈ affineSpan ℝ (Set.range s.points)) :
     ↑(s.orthogonalProjectionSpan (r₁ • (p -ᵥ ↑(s.orthogonalProjectionSpan p)) +ᵥ p₁o)) = p₁o :=
-  congr_arg coe (orthogonal_projection_vadd_smul_vsub_orthogonal_projection _ _ _ hp₁o)
-#align affine.simplex.coe_orthogonal_projection_vadd_smul_vsub_orthogonal_projection Affine.Simplex.coe_orthogonal_projection_vadd_smul_vsub_orthogonal_projection
+  congr_arg coe (orthogonalProjection_vadd_smul_vsub_orthogonalProjection _ _ _ hp₁o)
+#align affine.simplex.coe_orthogonal_projection_vadd_smul_vsub_orthogonal_projection Affine.Simplex.coe_orthogonalProjection_vadd_smul_vsub_orthogonalProjection
+-/
 
-theorem dist_sq_eq_dist_orthogonal_projection_sq_add_dist_orthogonal_projection_sq {n : ℕ}
+#print Affine.Simplex.dist_sq_eq_dist_orthogonalProjection_sq_add_dist_orthogonalProjection_sq /-
+theorem dist_sq_eq_dist_orthogonalProjection_sq_add_dist_orthogonalProjection_sq {n : ℕ}
     (s : Simplex ℝ P n) {p1 : P} (p2 : P) (hp1 : p1 ∈ affineSpan ℝ (Set.range s.points)) :
     dist p1 p2 * dist p1 p2 =
       dist p1 (s.orthogonalProjectionSpan p2) * dist p1 (s.orthogonalProjectionSpan p2) +
@@ -458,8 +513,10 @@ theorem dist_sq_eq_dist_orthogonal_projection_sq_add_dist_orthogonal_projection_
   exact
     Submodule.inner_right_of_mem_orthogonal (vsub_orthogonal_projection_mem_direction p2 hp1)
       (orthogonal_projection_vsub_mem_direction_orthogonal _ p2)
-#align affine.simplex.dist_sq_eq_dist_orthogonal_projection_sq_add_dist_orthogonal_projection_sq Affine.Simplex.dist_sq_eq_dist_orthogonal_projection_sq_add_dist_orthogonal_projection_sq
+#align affine.simplex.dist_sq_eq_dist_orthogonal_projection_sq_add_dist_orthogonal_projection_sq Affine.Simplex.dist_sq_eq_dist_orthogonalProjection_sq_add_dist_orthogonalProjection_sq
+-/
 
+#print Affine.Simplex.dist_circumcenter_sq_eq_sq_sub_circumradius /-
 theorem dist_circumcenter_sq_eq_sq_sub_circumradius {n : ℕ} {r : ℝ} (s : Simplex ℝ P n) {p₁ : P}
     (h₁ : ∀ i : Fin (n + 1), dist (s.points i) p₁ = r)
     (h₁' : ↑(s.orthogonalProjectionSpan p₁) = s.circumcenter)
@@ -470,11 +527,13 @@ theorem dist_circumcenter_sq_eq_sq_sub_circumradius {n : ℕ} {r : ℝ} (s : Sim
     s.dist_sq_eq_dist_orthogonal_projection_sq_add_dist_orthogonal_projection_sq p₁ h]
   simp only [h₁', dist_comm p₁, add_sub_cancel', simplex.dist_circumcenter_eq_circumradius]
 #align affine.simplex.dist_circumcenter_sq_eq_sq_sub_circumradius Affine.Simplex.dist_circumcenter_sq_eq_sq_sub_circumradius
+-/
 
+#print Affine.Simplex.orthogonalProjection_eq_circumcenter_of_exists_dist_eq /-
 /-- If there exists a distance that a point has from all vertices of a
 simplex, the orthogonal projection of that point onto the subspace
 spanned by that simplex is its circumcenter.  -/
-theorem orthogonal_projection_eq_circumcenter_of_exists_dist_eq {n : ℕ} (s : Simplex ℝ P n) {p : P}
+theorem orthogonalProjection_eq_circumcenter_of_exists_dist_eq {n : ℕ} (s : Simplex ℝ P n) {p : P}
     (hr : ∃ r, ∀ i, dist (s.points i) p = r) : ↑(s.orthogonalProjectionSpan p) = s.circumcenter :=
   by
   change ∃ r : ℝ, ∀ i, (fun x => dist x p = r) (s.points i) at hr 
@@ -486,19 +545,23 @@ theorem orthogonal_projection_eq_circumcenter_of_exists_dist_eq {n : ℕ} (s : S
   cases' hr with r hr
   exact
     s.eq_circumcenter_of_dist_eq (orthogonal_projection_mem p) fun i => hr _ (Set.mem_range_self i)
-#align affine.simplex.orthogonal_projection_eq_circumcenter_of_exists_dist_eq Affine.Simplex.orthogonal_projection_eq_circumcenter_of_exists_dist_eq
+#align affine.simplex.orthogonal_projection_eq_circumcenter_of_exists_dist_eq Affine.Simplex.orthogonalProjection_eq_circumcenter_of_exists_dist_eq
+-/
 
+#print Affine.Simplex.orthogonalProjection_eq_circumcenter_of_dist_eq /-
 /-- If a point has the same distance from all vertices of a simplex,
 the orthogonal projection of that point onto the subspace spanned by
 that simplex is its circumcenter.  -/
-theorem orthogonal_projection_eq_circumcenter_of_dist_eq {n : ℕ} (s : Simplex ℝ P n) {p : P} {r : ℝ}
+theorem orthogonalProjection_eq_circumcenter_of_dist_eq {n : ℕ} (s : Simplex ℝ P n) {p : P} {r : ℝ}
     (hr : ∀ i, dist (s.points i) p = r) : ↑(s.orthogonalProjectionSpan p) = s.circumcenter :=
-  s.orthogonal_projection_eq_circumcenter_of_exists_dist_eq ⟨r, hr⟩
-#align affine.simplex.orthogonal_projection_eq_circumcenter_of_dist_eq Affine.Simplex.orthogonal_projection_eq_circumcenter_of_dist_eq
+  s.orthogonalProjection_eq_circumcenter_of_exists_dist_eq ⟨r, hr⟩
+#align affine.simplex.orthogonal_projection_eq_circumcenter_of_dist_eq Affine.Simplex.orthogonalProjection_eq_circumcenter_of_dist_eq
+-/
 
+#print Affine.Simplex.orthogonalProjection_circumcenter /-
 /-- The orthogonal projection of the circumcenter onto a face is the
 circumcenter of that face. -/
-theorem orthogonal_projection_circumcenter {n : ℕ} (s : Simplex ℝ P n) {fs : Finset (Fin (n + 1))}
+theorem orthogonalProjection_circumcenter {n : ℕ} (s : Simplex ℝ P n) {fs : Finset (Fin (n + 1))}
     {m : ℕ} (h : fs.card = m + 1) :
     ↑((s.face h).orthogonalProjectionSpan s.circumcenter) = (s.face h).circumcenter :=
   haveI hr : ∃ r, ∀ i, dist ((s.face h).points i) s.circumcenter = r :=
@@ -506,8 +569,10 @@ theorem orthogonal_projection_circumcenter {n : ℕ} (s : Simplex ℝ P n) {fs :
     use s.circumradius
     simp [face_points]
   orthogonal_projection_eq_circumcenter_of_exists_dist_eq _ hr
-#align affine.simplex.orthogonal_projection_circumcenter Affine.Simplex.orthogonal_projection_circumcenter
+#align affine.simplex.orthogonal_projection_circumcenter Affine.Simplex.orthogonalProjection_circumcenter
+-/
 
+#print Affine.Simplex.circumcenter_eq_of_range_eq /-
 /-- Two simplices with the same points have the same circumcenter. -/
 theorem circumcenter_eq_of_range_eq {n : ℕ} {s₁ s₂ : Simplex ℝ P n}
     (h : Set.range s₁.points = Set.range s₂.points) : s₁.circumcenter = s₂.circumcenter :=
@@ -523,7 +588,9 @@ theorem circumcenter_eq_of_range_eq {n : ℕ} {s₁ s₂ : Simplex ℝ P n}
     rw [← hj, s₁.dist_circumcenter_eq_circumradius j]
   exact s₂.eq_circumcenter_of_dist_eq hs hr
 #align affine.simplex.circumcenter_eq_of_range_eq Affine.Simplex.circumcenter_eq_of_range_eq
+-/
 
+#print Affine.Simplex.PointsWithCircumcenterIndex /-
 /-- An index type for the vertices of a simplex plus its circumcenter.
 This is for use in calculations where it is convenient to work with
 affine combinations of vertices together with the circumcenter.  (An
@@ -534,20 +601,26 @@ inductive PointsWithCircumcenterIndex (n : ℕ)
   | circumcenter_index : points_with_circumcenter_index
   deriving Fintype
 #align affine.simplex.points_with_circumcenter_index Affine.Simplex.PointsWithCircumcenterIndex
+-/
 
 open PointsWithCircumcenterIndex
 
+#print Affine.Simplex.pointsWithCircumcenterIndexInhabited /-
 instance pointsWithCircumcenterIndexInhabited (n : ℕ) : Inhabited (PointsWithCircumcenterIndex n) :=
   ⟨circumcenter_index⟩
 #align affine.simplex.points_with_circumcenter_index_inhabited Affine.Simplex.pointsWithCircumcenterIndexInhabited
+-/
 
+#print Affine.Simplex.pointIndexEmbedding /-
 /-- `point_index` as an embedding. -/
 def pointIndexEmbedding (n : ℕ) : Fin (n + 1) ↪ PointsWithCircumcenterIndex n :=
   ⟨fun i => point_index i, fun _ _ h => by injection h⟩
 #align affine.simplex.point_index_embedding Affine.Simplex.pointIndexEmbedding
+-/
 
+#print Affine.Simplex.sum_pointsWithCircumcenter /-
 /-- The sum of a function over `points_with_circumcenter_index`. -/
-theorem sum_points_with_circumcenter {α : Type _} [AddCommMonoid α] {n : ℕ}
+theorem sum_pointsWithCircumcenter {α : Type _} [AddCommMonoid α] {n : ℕ}
     (f : PointsWithCircumcenterIndex n → α) :
     ∑ i, f i = ∑ i : Fin (n + 1), f (point_index i) + f circumcenter_index :=
   by
@@ -563,14 +636,18 @@ theorem sum_points_with_circumcenter {α : Type _} [AddCommMonoid α] {n : ℕ}
   simp_rw [Finset.mem_map, not_exists]
   intro x hx h
   injection h
-#align affine.simplex.sum_points_with_circumcenter Affine.Simplex.sum_points_with_circumcenter
+#align affine.simplex.sum_points_with_circumcenter Affine.Simplex.sum_pointsWithCircumcenter
+-/
 
+#print Affine.Simplex.pointsWithCircumcenter /-
 /-- The vertices of a simplex plus its circumcenter. -/
 def pointsWithCircumcenter {n : ℕ} (s : Simplex ℝ P n) : PointsWithCircumcenterIndex n → P
   | point_index i => s.points i
   | circumcenter_index => s.circumcenter
 #align affine.simplex.points_with_circumcenter Affine.Simplex.pointsWithCircumcenter
+-/
 
+#print Affine.Simplex.pointsWithCircumcenter_point /-
 /-- `points_with_circumcenter`, applied to a `point_index` value,
 equals `points` applied to that value. -/
 @[simp]
@@ -578,7 +655,9 @@ theorem pointsWithCircumcenter_point {n : ℕ} (s : Simplex ℝ P n) (i : Fin (n
     s.pointsWithCircumcenter (point_index i) = s.points i :=
   rfl
 #align affine.simplex.points_with_circumcenter_point Affine.Simplex.pointsWithCircumcenter_point
+-/
 
+#print Affine.Simplex.pointsWithCircumcenter_eq_circumcenter /-
 /-- `points_with_circumcenter`, applied to `circumcenter_index`, equals the
 circumcenter. -/
 @[simp]
@@ -586,14 +665,18 @@ theorem pointsWithCircumcenter_eq_circumcenter {n : ℕ} (s : Simplex ℝ P n) :
     s.pointsWithCircumcenter circumcenter_index = s.circumcenter :=
   rfl
 #align affine.simplex.points_with_circumcenter_eq_circumcenter Affine.Simplex.pointsWithCircumcenter_eq_circumcenter
+-/
 
+#print Affine.Simplex.pointWeightsWithCircumcenter /-
 /-- The weights for a single vertex of a simplex, in terms of
 `points_with_circumcenter`. -/
 def pointWeightsWithCircumcenter {n : ℕ} (i : Fin (n + 1)) : PointsWithCircumcenterIndex n → ℝ
   | point_index j => if j = i then 1 else 0
   | circumcenter_index => 0
 #align affine.simplex.point_weights_with_circumcenter Affine.Simplex.pointWeightsWithCircumcenter
+-/
 
+#print Affine.Simplex.sum_pointWeightsWithCircumcenter /-
 /-- `point_weights_with_circumcenter` sums to 1. -/
 @[simp]
 theorem sum_pointWeightsWithCircumcenter {n : ℕ} (i : Fin (n + 1)) :
@@ -604,7 +687,9 @@ theorem sum_pointWeightsWithCircumcenter {n : ℕ} (i : Fin (n + 1)) :
     cases j <;> simp [point_weights_with_circumcenter]
   · simp
 #align affine.simplex.sum_point_weights_with_circumcenter Affine.Simplex.sum_pointWeightsWithCircumcenter
+-/
 
+#print Affine.Simplex.point_eq_affineCombination_of_pointsWithCircumcenter /-
 /-- A single vertex, in terms of `points_with_circumcenter`. -/
 theorem point_eq_affineCombination_of_pointsWithCircumcenter {n : ℕ} (s : Simplex ℝ P n)
     (i : Fin (n + 1)) :
@@ -623,7 +708,9 @@ theorem point_eq_affineCombination_of_pointsWithCircumcenter {n : ℕ} (s : Simp
     simp [point_weights_with_circumcenter, h]
   · rfl
 #align affine.simplex.point_eq_affine_combination_of_points_with_circumcenter Affine.Simplex.point_eq_affineCombination_of_pointsWithCircumcenter
+-/
 
+#print Affine.Simplex.centroidWeightsWithCircumcenter /-
 /-- The weights for the centroid of some vertices of a simplex, in
 terms of `points_with_circumcenter`. -/
 def centroidWeightsWithCircumcenter {n : ℕ} (fs : Finset (Fin (n + 1))) :
@@ -631,7 +718,9 @@ def centroidWeightsWithCircumcenter {n : ℕ} (fs : Finset (Fin (n + 1))) :
   | point_index i => if i ∈ fs then (card fs : ℝ)⁻¹ else 0
   | circumcenter_index => 0
 #align affine.simplex.centroid_weights_with_circumcenter Affine.Simplex.centroidWeightsWithCircumcenter
+-/
 
+#print Affine.Simplex.sum_centroidWeightsWithCircumcenter /-
 /-- `centroid_weights_with_circumcenter` sums to 1, if the `finset` is
 nonempty. -/
 @[simp]
@@ -642,7 +731,9 @@ theorem sum_centroidWeightsWithCircumcenter {n : ℕ} {fs : Finset (Fin (n + 1))
     fs.sum_centroid_weights_eq_one_of_nonempty ℝ h, Set.sum_indicator_subset _ fs.subset_univ]
   rcongr
 #align affine.simplex.sum_centroid_weights_with_circumcenter Affine.Simplex.sum_centroidWeightsWithCircumcenter
+-/
 
+#print Affine.Simplex.centroid_eq_affineCombination_of_pointsWithCircumcenter /-
 /-- The centroid of some vertices of a simplex, in terms of
 `points_with_circumcenter`. -/
 theorem centroid_eq_affineCombination_of_pointsWithCircumcenter {n : ℕ} (s : Simplex ℝ P n)
@@ -660,14 +751,18 @@ theorem centroid_eq_affineCombination_of_pointsWithCircumcenter {n : ℕ} (s : S
     Set.indicator_apply]
   congr
 #align affine.simplex.centroid_eq_affine_combination_of_points_with_circumcenter Affine.Simplex.centroid_eq_affineCombination_of_pointsWithCircumcenter
+-/
 
+#print Affine.Simplex.circumcenterWeightsWithCircumcenter /-
 /-- The weights for the circumcenter of a simplex, in terms of
 `points_with_circumcenter`. -/
 def circumcenterWeightsWithCircumcenter (n : ℕ) : PointsWithCircumcenterIndex n → ℝ
   | point_index i => 0
   | circumcenter_index => 1
 #align affine.simplex.circumcenter_weights_with_circumcenter Affine.Simplex.circumcenterWeightsWithCircumcenter
+-/
 
+#print Affine.Simplex.sum_circumcenterWeightsWithCircumcenter /-
 /-- `circumcenter_weights_with_circumcenter` sums to 1. -/
 @[simp]
 theorem sum_circumcenterWeightsWithCircumcenter (n : ℕ) :
@@ -677,7 +772,9 @@ theorem sum_circumcenterWeightsWithCircumcenter (n : ℕ) :
   · ext ⟨j⟩ <;> simp [circumcenter_weights_with_circumcenter]
   · simp
 #align affine.simplex.sum_circumcenter_weights_with_circumcenter Affine.Simplex.sum_circumcenterWeightsWithCircumcenter
+-/
 
+#print Affine.Simplex.circumcenter_eq_affineCombination_of_pointsWithCircumcenter /-
 /-- The circumcenter of a simplex, in terms of
 `points_with_circumcenter`. -/
 theorem circumcenter_eq_affineCombination_of_pointsWithCircumcenter {n : ℕ} (s : Simplex ℝ P n) :
@@ -690,7 +787,9 @@ theorem circumcenter_eq_affineCombination_of_pointsWithCircumcenter {n : ℕ} (s
   refine' affine_combination_of_eq_one_of_eq_zero _ _ _ (mem_univ _) rfl _
   rintro ⟨i⟩ hi hn <;> tauto
 #align affine.simplex.circumcenter_eq_affine_combination_of_points_with_circumcenter Affine.Simplex.circumcenter_eq_affineCombination_of_pointsWithCircumcenter
+-/
 
+#print Affine.Simplex.reflectionCircumcenterWeightsWithCircumcenter /-
 /-- The weights for the reflection of the circumcenter in an edge of a
 simplex.  This definition is only valid with `i₁ ≠ i₂`. -/
 def reflectionCircumcenterWeightsWithCircumcenter {n : ℕ} (i₁ i₂ : Fin (n + 1)) :
@@ -698,7 +797,9 @@ def reflectionCircumcenterWeightsWithCircumcenter {n : ℕ} (i₁ i₂ : Fin (n
   | point_index i => if i = i₁ ∨ i = i₂ then 1 else 0
   | circumcenter_index => -1
 #align affine.simplex.reflection_circumcenter_weights_with_circumcenter Affine.Simplex.reflectionCircumcenterWeightsWithCircumcenter
+-/
 
+#print Affine.Simplex.sum_reflectionCircumcenterWeightsWithCircumcenter /-
 /-- `reflection_circumcenter_weights_with_circumcenter` sums to 1. -/
 @[simp]
 theorem sum_reflectionCircumcenterWeightsWithCircumcenter {n : ℕ} {i₁ i₂ : Fin (n + 1)}
@@ -710,7 +811,9 @@ theorem sum_reflectionCircumcenterWeightsWithCircumcenter {n : ℕ} {i₁ i₂ :
   · simp
   · simpa only [if_true, mem_univ, disjoint_singleton] using h
 #align affine.simplex.sum_reflection_circumcenter_weights_with_circumcenter Affine.Simplex.sum_reflectionCircumcenterWeightsWithCircumcenter
+-/
 
+#print Affine.Simplex.reflection_circumcenter_eq_affineCombination_of_pointsWithCircumcenter /-
 /-- The reflection of the circumcenter of a simplex in an edge, in
 terms of `points_with_circumcenter`. -/
 theorem reflection_circumcenter_eq_affineCombination_of_pointsWithCircumcenter {n : ℕ}
@@ -741,6 +844,7 @@ theorem reflection_circumcenter_eq_affineCombination_of_pointsWithCircumcenter {
   convert sum_const_zero
   norm_num
 #align affine.simplex.reflection_circumcenter_eq_affine_combination_of_points_with_circumcenter Affine.Simplex.reflection_circumcenter_eq_affineCombination_of_pointsWithCircumcenter
+-/
 
 end Simplex
 
@@ -753,6 +857,7 @@ open Affine AffineSubspace FiniteDimensional
 variable {V : Type _} {P : Type _} [NormedAddCommGroup V] [InnerProductSpace ℝ V] [MetricSpace P]
   [NormedAddTorsor V P]
 
+#print EuclideanGeometry.cospherical_iff_exists_mem_of_complete /-
 /-- Given a nonempty affine subspace, whose direction is complete,
 that contains a set of points, those points are cospherical if and
 only if they are equidistant from some point in that subspace. -/
@@ -766,7 +871,9 @@ theorem cospherical_iff_exists_mem_of_complete {s : AffineSubspace ℝ P} {ps :
     exact ⟨orthogonalProjection s c, orthogonal_projection_mem _, hcr⟩
   · exact fun ⟨c, hc, hd⟩ => ⟨c, hd⟩
 #align euclidean_geometry.cospherical_iff_exists_mem_of_complete EuclideanGeometry.cospherical_iff_exists_mem_of_complete
+-/
 
+#print EuclideanGeometry.cospherical_iff_exists_mem_of_finiteDimensional /-
 /-- Given a nonempty affine subspace, whose direction is
 finite-dimensional, that contains a set of points, those points are
 cospherical if and only if they are equidistant from some point in
@@ -776,7 +883,9 @@ theorem cospherical_iff_exists_mem_of_finiteDimensional {s : AffineSubspace ℝ
     Cospherical ps ↔ ∃ center ∈ s, ∃ radius : ℝ, ∀ p ∈ ps, dist p center = radius :=
   cospherical_iff_exists_mem_of_complete h
 #align euclidean_geometry.cospherical_iff_exists_mem_of_finite_dimensional EuclideanGeometry.cospherical_iff_exists_mem_of_finiteDimensional
+-/
 
+#print EuclideanGeometry.exists_circumradius_eq_of_cospherical_subset /-
 /-- All n-simplices among cospherical points in an n-dimensional
 subspace have the same circumradius. -/
 theorem exists_circumradius_eq_of_cospherical_subset {s : AffineSubspace ℝ P} {ps : Set P}
@@ -799,7 +908,9 @@ theorem exists_circumradius_eq_of_cospherical_subset {s : AffineSubspace ℝ P}
     (sx.eq_circumradius_of_dist_eq hc fun i =>
         hcr (sx.points i) (hsxps (Set.mem_range_self i))).symm
 #align euclidean_geometry.exists_circumradius_eq_of_cospherical_subset EuclideanGeometry.exists_circumradius_eq_of_cospherical_subset
+-/
 
+#print EuclideanGeometry.circumradius_eq_of_cospherical_subset /-
 /-- Two n-simplices among cospherical points in an n-dimensional
 subspace have the same circumradius. -/
 theorem circumradius_eq_of_cospherical_subset {s : AffineSubspace ℝ P} {ps : Set P} (h : ps ⊆ s)
@@ -810,7 +921,9 @@ theorem circumradius_eq_of_cospherical_subset {s : AffineSubspace ℝ P} {ps : S
   rcases exists_circumradius_eq_of_cospherical_subset h hd hc with ⟨r, hr⟩
   rw [hr sx₁ hsx₁, hr sx₂ hsx₂]
 #align euclidean_geometry.circumradius_eq_of_cospherical_subset EuclideanGeometry.circumradius_eq_of_cospherical_subset
+-/
 
+#print EuclideanGeometry.exists_circumradius_eq_of_cospherical /-
 /-- All n-simplices among cospherical points in n-space have the same
 circumradius. -/
 theorem exists_circumradius_eq_of_cospherical {ps : Set P} {n : ℕ} [FiniteDimensional ℝ V]
@@ -822,7 +935,9 @@ theorem exists_circumradius_eq_of_cospherical {ps : Set P} {n : ℕ} [FiniteDime
   refine' exists_circumradius_eq_of_cospherical_subset _ hd hc
   exact Set.subset_univ _
 #align euclidean_geometry.exists_circumradius_eq_of_cospherical EuclideanGeometry.exists_circumradius_eq_of_cospherical
+-/
 
+#print EuclideanGeometry.circumradius_eq_of_cospherical /-
 /-- Two n-simplices among cospherical points in n-space have the same
 circumradius. -/
 theorem circumradius_eq_of_cospherical {ps : Set P} {n : ℕ} [FiniteDimensional ℝ V]
@@ -833,7 +948,9 @@ theorem circumradius_eq_of_cospherical {ps : Set P} {n : ℕ} [FiniteDimensional
   rcases exists_circumradius_eq_of_cospherical hd hc with ⟨r, hr⟩
   rw [hr sx₁ hsx₁, hr sx₂ hsx₂]
 #align euclidean_geometry.circumradius_eq_of_cospherical EuclideanGeometry.circumradius_eq_of_cospherical
+-/
 
+#print EuclideanGeometry.exists_circumcenter_eq_of_cospherical_subset /-
 /-- All n-simplices among cospherical points in an n-dimensional
 subspace have the same circumcenter. -/
 theorem exists_circumcenter_eq_of_cospherical_subset {s : AffineSubspace ℝ P} {ps : Set P}
@@ -856,7 +973,9 @@ theorem exists_circumcenter_eq_of_cospherical_subset {s : AffineSubspace ℝ P}
     (sx.eq_circumcenter_of_dist_eq hc fun i =>
         hcr (sx.points i) (hsxps (Set.mem_range_self i))).symm
 #align euclidean_geometry.exists_circumcenter_eq_of_cospherical_subset EuclideanGeometry.exists_circumcenter_eq_of_cospherical_subset
+-/
 
+#print EuclideanGeometry.circumcenter_eq_of_cospherical_subset /-
 /-- Two n-simplices among cospherical points in an n-dimensional
 subspace have the same circumcenter. -/
 theorem circumcenter_eq_of_cospherical_subset {s : AffineSubspace ℝ P} {ps : Set P} (h : ps ⊆ s)
@@ -867,7 +986,9 @@ theorem circumcenter_eq_of_cospherical_subset {s : AffineSubspace ℝ P} {ps : S
   rcases exists_circumcenter_eq_of_cospherical_subset h hd hc with ⟨r, hr⟩
   rw [hr sx₁ hsx₁, hr sx₂ hsx₂]
 #align euclidean_geometry.circumcenter_eq_of_cospherical_subset EuclideanGeometry.circumcenter_eq_of_cospherical_subset
+-/
 
+#print EuclideanGeometry.exists_circumcenter_eq_of_cospherical /-
 /-- All n-simplices among cospherical points in n-space have the same
 circumcenter. -/
 theorem exists_circumcenter_eq_of_cospherical {ps : Set P} {n : ℕ} [FiniteDimensional ℝ V]
@@ -879,7 +1000,9 @@ theorem exists_circumcenter_eq_of_cospherical {ps : Set P} {n : ℕ} [FiniteDime
   refine' exists_circumcenter_eq_of_cospherical_subset _ hd hc
   exact Set.subset_univ _
 #align euclidean_geometry.exists_circumcenter_eq_of_cospherical EuclideanGeometry.exists_circumcenter_eq_of_cospherical
+-/
 
+#print EuclideanGeometry.circumcenter_eq_of_cospherical /-
 /-- Two n-simplices among cospherical points in n-space have the same
 circumcenter. -/
 theorem circumcenter_eq_of_cospherical {ps : Set P} {n : ℕ} [FiniteDimensional ℝ V]
@@ -890,7 +1013,9 @@ theorem circumcenter_eq_of_cospherical {ps : Set P} {n : ℕ} [FiniteDimensional
   rcases exists_circumcenter_eq_of_cospherical hd hc with ⟨r, hr⟩
   rw [hr sx₁ hsx₁, hr sx₂ hsx₂]
 #align euclidean_geometry.circumcenter_eq_of_cospherical EuclideanGeometry.circumcenter_eq_of_cospherical
+-/
 
+#print EuclideanGeometry.exists_circumsphere_eq_of_cospherical_subset /-
 /-- All n-simplices among cospherical points in an n-dimensional
 subspace have the same circumsphere. -/
 theorem exists_circumsphere_eq_of_cospherical_subset {s : AffineSubspace ℝ P} {ps : Set P}
@@ -902,7 +1027,9 @@ theorem exists_circumsphere_eq_of_cospherical_subset {s : AffineSubspace ℝ P}
   obtain ⟨c, hc⟩ := exists_circumcenter_eq_of_cospherical_subset h hd hc
   exact ⟨⟨c, r⟩, fun sx hsx => sphere.ext _ _ (hc sx hsx) (hr sx hsx)⟩
 #align euclidean_geometry.exists_circumsphere_eq_of_cospherical_subset EuclideanGeometry.exists_circumsphere_eq_of_cospherical_subset
+-/
 
+#print EuclideanGeometry.circumsphere_eq_of_cospherical_subset /-
 /-- Two n-simplices among cospherical points in an n-dimensional
 subspace have the same circumsphere. -/
 theorem circumsphere_eq_of_cospherical_subset {s : AffineSubspace ℝ P} {ps : Set P} (h : ps ⊆ s)
@@ -913,7 +1040,9 @@ theorem circumsphere_eq_of_cospherical_subset {s : AffineSubspace ℝ P} {ps : S
   rcases exists_circumsphere_eq_of_cospherical_subset h hd hc with ⟨r, hr⟩
   rw [hr sx₁ hsx₁, hr sx₂ hsx₂]
 #align euclidean_geometry.circumsphere_eq_of_cospherical_subset EuclideanGeometry.circumsphere_eq_of_cospherical_subset
+-/
 
+#print EuclideanGeometry.exists_circumsphere_eq_of_cospherical /-
 /-- All n-simplices among cospherical points in n-space have the same
 circumsphere. -/
 theorem exists_circumsphere_eq_of_cospherical {ps : Set P} {n : ℕ} [FiniteDimensional ℝ V]
@@ -925,7 +1054,9 @@ theorem exists_circumsphere_eq_of_cospherical {ps : Set P} {n : ℕ} [FiniteDime
   refine' exists_circumsphere_eq_of_cospherical_subset _ hd hc
   exact Set.subset_univ _
 #align euclidean_geometry.exists_circumsphere_eq_of_cospherical EuclideanGeometry.exists_circumsphere_eq_of_cospherical
+-/
 
+#print EuclideanGeometry.circumsphere_eq_of_cospherical /-
 /-- Two n-simplices among cospherical points in n-space have the same
 circumsphere. -/
 theorem circumsphere_eq_of_cospherical {ps : Set P} {n : ℕ} [FiniteDimensional ℝ V]
@@ -936,7 +1067,9 @@ theorem circumsphere_eq_of_cospherical {ps : Set P} {n : ℕ} [FiniteDimensional
   rcases exists_circumsphere_eq_of_cospherical hd hc with ⟨r, hr⟩
   rw [hr sx₁ hsx₁, hr sx₂ hsx₂]
 #align euclidean_geometry.circumsphere_eq_of_cospherical EuclideanGeometry.circumsphere_eq_of_cospherical
+-/
 
+#print EuclideanGeometry.eq_or_eq_reflection_of_dist_eq /-
 /-- Suppose all distances from `p₁` and `p₂` to the points of a
 simplex are equal, and that `p₁` and `p₂` lie in the affine span of
 `p` with the vertices of that simplex.  Then `p₁` and `p₂` are equal
@@ -987,6 +1120,7 @@ theorem eq_or_eq_reflection_of_dist_eq {n : ℕ} {s : Simplex ℝ P n} {p p₁ p
       rw [hd₁, reflection_vadd_smul_vsub_orthogonal_projection p r₂ s.circumcenter_mem_affine_span,
         neg_smul]
 #align euclidean_geometry.eq_or_eq_reflection_of_dist_eq EuclideanGeometry.eq_or_eq_reflection_of_dist_eq
+-/
 
 end EuclideanGeometry
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Joseph Myers
 
 ! This file was ported from Lean 3 source module geometry.euclidean.circumcenter
-! leanprover-community/mathlib commit 2de9c37fa71dde2f1c6feff19876dd6a7b1519f0
+! leanprover-community/mathlib commit 8af7091a43227e179939ba132e54e54e9f3b089a
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -15,6 +15,9 @@ import Mathbin.Tactic.DeriveFintype
 /-!
 # Circumcenter and circumradius
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 This file proves some lemmas on points equidistant from a set of
 points, and defines the circumradius and circumcenter of a simplex.
 There are also some definitions for use in calculations where it is
Diff
@@ -46,8 +46,6 @@ namespace EuclideanGeometry
 variable {V : Type _} {P : Type _} [NormedAddCommGroup V] [InnerProductSpace ℝ V] [MetricSpace P]
   [NormedAddTorsor V P]
 
-include V
-
 open AffineSubspace
 
 /-- `p` is equidistant from two points in `s` if and only if its
@@ -259,8 +257,6 @@ open Finset AffineSubspace EuclideanGeometry
 variable {V : Type _} {P : Type _} [NormedAddCommGroup V] [InnerProductSpace ℝ V] [MetricSpace P]
   [NormedAddTorsor V P]
 
-include V
-
 /-- The circumsphere of a simplex. -/
 def circumsphere {n : ℕ} (s : Simplex ℝ P n) : Sphere P :=
   s.Independent.existsUnique_dist_eq.some
@@ -525,8 +521,6 @@ theorem circumcenter_eq_of_range_eq {n : ℕ} {s₁ s₂ : Simplex ℝ P n}
   exact s₂.eq_circumcenter_of_dist_eq hs hr
 #align affine.simplex.circumcenter_eq_of_range_eq Affine.Simplex.circumcenter_eq_of_range_eq
 
-omit V
-
 /-- An index type for the vertices of a simplex plus its circumcenter.
 This is for use in calculations where it is convenient to work with
 affine combinations of vertices together with the circumcenter.  (An
@@ -568,8 +562,6 @@ theorem sum_points_with_circumcenter {α : Type _} [AddCommMonoid α] {n : ℕ}
   injection h
 #align affine.simplex.sum_points_with_circumcenter Affine.Simplex.sum_points_with_circumcenter
 
-include V
-
 /-- The vertices of a simplex plus its circumcenter. -/
 def pointsWithCircumcenter {n : ℕ} (s : Simplex ℝ P n) : PointsWithCircumcenterIndex n → P
   | point_index i => s.points i
@@ -592,8 +584,6 @@ theorem pointsWithCircumcenter_eq_circumcenter {n : ℕ} (s : Simplex ℝ P n) :
   rfl
 #align affine.simplex.points_with_circumcenter_eq_circumcenter Affine.Simplex.pointsWithCircumcenter_eq_circumcenter
 
-omit V
-
 /-- The weights for a single vertex of a simplex, in terms of
 `points_with_circumcenter`. -/
 def pointWeightsWithCircumcenter {n : ℕ} (i : Fin (n + 1)) : PointsWithCircumcenterIndex n → ℝ
@@ -612,8 +602,6 @@ theorem sum_pointWeightsWithCircumcenter {n : ℕ} (i : Fin (n + 1)) :
   · simp
 #align affine.simplex.sum_point_weights_with_circumcenter Affine.Simplex.sum_pointWeightsWithCircumcenter
 
-include V
-
 /-- A single vertex, in terms of `points_with_circumcenter`. -/
 theorem point_eq_affineCombination_of_pointsWithCircumcenter {n : ℕ} (s : Simplex ℝ P n)
     (i : Fin (n + 1)) :
@@ -633,8 +621,6 @@ theorem point_eq_affineCombination_of_pointsWithCircumcenter {n : ℕ} (s : Simp
   · rfl
 #align affine.simplex.point_eq_affine_combination_of_points_with_circumcenter Affine.Simplex.point_eq_affineCombination_of_pointsWithCircumcenter
 
-omit V
-
 /-- The weights for the centroid of some vertices of a simplex, in
 terms of `points_with_circumcenter`. -/
 def centroidWeightsWithCircumcenter {n : ℕ} (fs : Finset (Fin (n + 1))) :
@@ -654,8 +640,6 @@ theorem sum_centroidWeightsWithCircumcenter {n : ℕ} {fs : Finset (Fin (n + 1))
   rcongr
 #align affine.simplex.sum_centroid_weights_with_circumcenter Affine.Simplex.sum_centroidWeightsWithCircumcenter
 
-include V
-
 /-- The centroid of some vertices of a simplex, in terms of
 `points_with_circumcenter`. -/
 theorem centroid_eq_affineCombination_of_pointsWithCircumcenter {n : ℕ} (s : Simplex ℝ P n)
@@ -674,8 +658,6 @@ theorem centroid_eq_affineCombination_of_pointsWithCircumcenter {n : ℕ} (s : S
   congr
 #align affine.simplex.centroid_eq_affine_combination_of_points_with_circumcenter Affine.Simplex.centroid_eq_affineCombination_of_pointsWithCircumcenter
 
-omit V
-
 /-- The weights for the circumcenter of a simplex, in terms of
 `points_with_circumcenter`. -/
 def circumcenterWeightsWithCircumcenter (n : ℕ) : PointsWithCircumcenterIndex n → ℝ
@@ -693,8 +675,6 @@ theorem sum_circumcenterWeightsWithCircumcenter (n : ℕ) :
   · simp
 #align affine.simplex.sum_circumcenter_weights_with_circumcenter Affine.Simplex.sum_circumcenterWeightsWithCircumcenter
 
-include V
-
 /-- The circumcenter of a simplex, in terms of
 `points_with_circumcenter`. -/
 theorem circumcenter_eq_affineCombination_of_pointsWithCircumcenter {n : ℕ} (s : Simplex ℝ P n) :
@@ -708,8 +688,6 @@ theorem circumcenter_eq_affineCombination_of_pointsWithCircumcenter {n : ℕ} (s
   rintro ⟨i⟩ hi hn <;> tauto
 #align affine.simplex.circumcenter_eq_affine_combination_of_points_with_circumcenter Affine.Simplex.circumcenter_eq_affineCombination_of_pointsWithCircumcenter
 
-omit V
-
 /-- The weights for the reflection of the circumcenter in an edge of a
 simplex.  This definition is only valid with `i₁ ≠ i₂`. -/
 def reflectionCircumcenterWeightsWithCircumcenter {n : ℕ} (i₁ i₂ : Fin (n + 1)) :
@@ -730,8 +708,6 @@ theorem sum_reflectionCircumcenterWeightsWithCircumcenter {n : ℕ} {i₁ i₂ :
   · simpa only [if_true, mem_univ, disjoint_singleton] using h
 #align affine.simplex.sum_reflection_circumcenter_weights_with_circumcenter Affine.Simplex.sum_reflectionCircumcenterWeightsWithCircumcenter
 
-include V
-
 /-- The reflection of the circumcenter of a simplex in an edge, in
 terms of `points_with_circumcenter`. -/
 theorem reflection_circumcenter_eq_affineCombination_of_pointsWithCircumcenter {n : ℕ}
@@ -774,8 +750,6 @@ open Affine AffineSubspace FiniteDimensional
 variable {V : Type _} {P : Type _} [NormedAddCommGroup V] [InnerProductSpace ℝ V] [MetricSpace P]
   [NormedAddTorsor V P]
 
-include V
-
 /-- Given a nonempty affine subspace, whose direction is complete,
 that contains a set of points, those points are cospherical if and
 only if they are equidistant from some point in that subspace. -/
Diff
@@ -552,7 +552,7 @@ def pointIndexEmbedding (n : ℕ) : Fin (n + 1) ↪ PointsWithCircumcenterIndex
 /-- The sum of a function over `points_with_circumcenter_index`. -/
 theorem sum_points_with_circumcenter {α : Type _} [AddCommMonoid α] {n : ℕ}
     (f : PointsWithCircumcenterIndex n → α) :
-    (∑ i, f i) = (∑ i : Fin (n + 1), f (point_index i)) + f circumcenter_index :=
+    ∑ i, f i = ∑ i : Fin (n + 1), f (point_index i) + f circumcenter_index :=
   by
   have h : univ = insert circumcenter_index (univ.map (point_index_embedding n)) :=
     by
@@ -561,7 +561,7 @@ theorem sum_points_with_circumcenter {α : Type _} [AddCommMonoid α] {n : ℕ}
     cases' x with i
     · exact mem_insert_of_mem (mem_map_of_mem _ (mem_univ i))
     · exact mem_insert_self _ _
-  change _ = (∑ i, f (point_index_embedding n i)) + _
+  change _ = ∑ i, f (point_index_embedding n i) + _
   rw [add_comm, h, ← sum_map, sum_insert]
   simp_rw [Finset.mem_map, not_exists]
   intro x hx h
@@ -604,7 +604,7 @@ def pointWeightsWithCircumcenter {n : ℕ} (i : Fin (n + 1)) : PointsWithCircumc
 /-- `point_weights_with_circumcenter` sums to 1. -/
 @[simp]
 theorem sum_pointWeightsWithCircumcenter {n : ℕ} (i : Fin (n + 1)) :
-    (∑ j, pointWeightsWithCircumcenter i j) = 1 :=
+    ∑ j, pointWeightsWithCircumcenter i j = 1 :=
   by
   convert sum_ite_eq' univ (point_index i) (Function.const _ (1 : ℝ))
   · ext j
@@ -647,7 +647,7 @@ def centroidWeightsWithCircumcenter {n : ℕ} (fs : Finset (Fin (n + 1))) :
 nonempty. -/
 @[simp]
 theorem sum_centroidWeightsWithCircumcenter {n : ℕ} {fs : Finset (Fin (n + 1))} (h : fs.Nonempty) :
-    (∑ i, centroidWeightsWithCircumcenter fs i) = 1 :=
+    ∑ i, centroidWeightsWithCircumcenter fs i = 1 :=
   by
   simp_rw [sum_points_with_circumcenter, centroid_weights_with_circumcenter, add_zero, ←
     fs.sum_centroid_weights_eq_one_of_nonempty ℝ h, Set.sum_indicator_subset _ fs.subset_univ]
@@ -686,7 +686,7 @@ def circumcenterWeightsWithCircumcenter (n : ℕ) : PointsWithCircumcenterIndex
 /-- `circumcenter_weights_with_circumcenter` sums to 1. -/
 @[simp]
 theorem sum_circumcenterWeightsWithCircumcenter (n : ℕ) :
-    (∑ i, circumcenterWeightsWithCircumcenter n i) = 1 :=
+    ∑ i, circumcenterWeightsWithCircumcenter n i = 1 :=
   by
   convert sum_ite_eq' univ circumcenter_index (Function.const _ (1 : ℝ))
   · ext ⟨j⟩ <;> simp [circumcenter_weights_with_circumcenter]
@@ -721,7 +721,7 @@ def reflectionCircumcenterWeightsWithCircumcenter {n : ℕ} (i₁ i₂ : Fin (n
 /-- `reflection_circumcenter_weights_with_circumcenter` sums to 1. -/
 @[simp]
 theorem sum_reflectionCircumcenterWeightsWithCircumcenter {n : ℕ} {i₁ i₂ : Fin (n + 1)}
-    (h : i₁ ≠ i₂) : (∑ i, reflectionCircumcenterWeightsWithCircumcenter i₁ i₂ i) = 1 :=
+    (h : i₁ ≠ i₂) : ∑ i, reflectionCircumcenterWeightsWithCircumcenter i₁ i₂ i = 1 :=
   by
   simp_rw [sum_points_with_circumcenter, reflection_circumcenter_weights_with_circumcenter, sum_ite,
     sum_const, filter_or, filter_eq']
Diff
@@ -236,14 +236,14 @@ theorem AffineIndependent.existsUnique_dist_eq {ι : Type _} [hne : Nonempty ι]
       replace hm := hm ha2 _ hc
       have hr : Set.range p = insert (p i) (Set.range fun i2 : ι2 => p i2) :=
         by
-        change _ = insert _ (Set.range fun i2 : { x | x ≠ i } => p i2)
+        change _ = insert _ (Set.range fun i2 : {x | x ≠ i} => p i2)
         rw [← Set.image_eq_range, ← Set.image_univ, ← Set.image_insert_eq]
         congr with j
         simp [Classical.em]
       rw [hr, ← affineSpan_insert_affineSpan]
       refine' exists_unique_dist_eq_of_insert (Set.range_nonempty _) (subset_spanPoints ℝ _) _ hm
       convert ha.not_mem_affine_span_diff i Set.univ
-      change (Set.range fun i2 : { x | x ≠ i } => p i2) = _
+      change (Set.range fun i2 : {x | x ≠ i} => p i2) = _
       rw [← Set.image_eq_range]
       congr with j; simp; rfl
 #align affine_independent.exists_unique_dist_eq AffineIndependent.existsUnique_dist_eq
Diff
@@ -86,7 +86,7 @@ theorem exists_dist_eq_iff_exists_dist_orthogonalProjection_eq {s : AffineSubspa
     (∃ r, ∀ p1 ∈ ps, dist p1 p = r) ↔ ∃ r, ∀ p1 ∈ ps, dist p1 ↑(orthogonalProjection s p) = r :=
   by
   have h := dist_set_eq_iff_dist_orthogonal_projection_eq hps p
-  simp_rw [Set.pairwise_eq_iff_exists_eq] at h
+  simp_rw [Set.pairwise_eq_iff_exists_eq] at h 
   exact h
 #align euclidean_geometry.exists_dist_eq_iff_exists_dist_orthogonal_projection_eq EuclideanGeometry.exists_dist_eq_iff_exists_dist_orthogonalProjection_eq
 
@@ -105,7 +105,7 @@ theorem existsUnique_dist_eq_of_insert {s : AffineSubspace ℝ P} [CompleteSpace
   by
   haveI : Nonempty s := Set.Nonempty.to_subtype (hnps.mono hps)
   rcases hu with ⟨⟨cc, cr⟩, ⟨hcc, hcr⟩, hcccru⟩
-  simp only at hcc hcr hcccru
+  simp only at hcc hcr hcccru 
   let x := dist cc (orthogonalProjection s p)
   let y := dist p (orthogonalProjection s p)
   have hy0 : y ≠ 0 := dist_orthogonal_projection_ne_zero_of_not_mem hp
@@ -142,17 +142,17 @@ theorem existsUnique_dist_eq_of_insert {s : AffineSubspace ℝ P} [CompleteSpace
           dist_eq_norm_vsub V, Real.norm_eq_abs, abs_div, abs_of_nonneg dist_nonneg,
           div_mul_cancel _ hy0, abs_mul_abs_self]
   · rintro ⟨cc₃, cr₃⟩ ⟨hcc₃, hcr₃⟩
-    simp only at hcc₃ hcr₃
+    simp only at hcc₃ hcr₃ 
     obtain ⟨t₃, cc₃', hcc₃', hcc₃''⟩ :
-      ∃ (r : ℝ)(p0 : P)(hp0 : p0 ∈ s), cc₃ = r • (p -ᵥ ↑((orthogonalProjection s) p)) +ᵥ p0 := by
-      rwa [mem_affine_span_insert_iff (orthogonal_projection_mem p)] at hcc₃
+      ∃ (r : ℝ) (p0 : P) (hp0 : p0 ∈ s), cc₃ = r • (p -ᵥ ↑((orthogonalProjection s) p)) +ᵥ p0 := by
+      rwa [mem_affine_span_insert_iff (orthogonal_projection_mem p)] at hcc₃ 
     have hcr₃' : ∃ r, ∀ p1 ∈ ps, dist p1 cc₃ = r :=
       ⟨cr₃, fun p1 hp1 => dist_of_mem_subset_mk_sphere (Set.mem_insert_of_mem _ hp1) hcr₃⟩
     rw [exists_dist_eq_iff_exists_dist_orthogonal_projection_eq hps cc₃, hcc₃'',
-      orthogonal_projection_vadd_smul_vsub_orthogonal_projection _ _ hcc₃'] at hcr₃'
+      orthogonal_projection_vadd_smul_vsub_orthogonal_projection _ _ hcc₃'] at hcr₃' 
     cases' hcr₃' with cr₃' hcr₃'
     have hu := hcccru ⟨cc₃', cr₃'⟩
-    simp only at hu
+    simp only at hu 
     replace hu := hu ⟨hcc₃', hcr₃'⟩
     cases' hu with hucc hucr
     substs hucc hucr
@@ -174,17 +174,17 @@ theorem existsUnique_dist_eq_of_insert {s : AffineSubspace ℝ P} [CompleteSpace
       dist_sq_smul_orthogonal_vadd_smul_orthogonal_vadd (orthogonal_projection_mem p) hcc₃' _ _
         (vsub_orthogonal_projection_mem_direction_orthogonal s p),
       dist_comm, ← dist_eq_norm_vsub V p,
-      Real.mul_self_sqrt (add_nonneg (mul_self_nonneg _) (mul_self_nonneg _))] at hcr₃
-    change x * x + _ * (y * y) = _ at hcr₃
+      Real.mul_self_sqrt (add_nonneg (mul_self_nonneg _) (mul_self_nonneg _))] at hcr₃ 
+    change x * x + _ * (y * y) = _ at hcr₃ 
     rw [show
         x * x + (1 - t₃) * (1 - t₃) * (y * y) = x * x + y * y - 2 * y * (t₃ * y) + t₃ * y * (t₃ * y)
         by ring,
-      add_left_inj] at hcr₃
+      add_left_inj] at hcr₃ 
     have ht₃ : t₃ = ycc₂ / y := by
       field_simp [← hcr₃, hy0]
       ring
     subst ht₃
-    change cc₃ = cc₂ at hcc₃''
+    change cc₃ = cc₂ at hcc₃'' 
     congr
     rw [hcr₃val]
     congr 2
@@ -203,10 +203,10 @@ theorem AffineIndependent.existsUnique_dist_eq {ι : Type _} [hne : Nonempty ι]
   induction' hn : Fintype.card ι with m hm generalizing ι
   · exfalso
     have h := Fintype.card_pos_iff.2 hne
-    rw [hn] at h
+    rw [hn] at h 
     exact lt_irrefl 0 h
   · cases m
-    · rw [Fintype.card_eq_one_iff] at hn
+    · rw [Fintype.card_eq_one_iff] at hn 
       cases' hn with i hi
       haveI : Unique ι := ⟨⟨i⟩, hi⟩
       use ⟨p i, 0⟩
@@ -217,7 +217,7 @@ theorem AffineIndependent.existsUnique_dist_eq {ι : Type _} [hne : Nonempty ι]
       · rintro ⟨cc, cr⟩
         simp only
         rintro ⟨rfl, hdist⟩
-        simp_rw [Set.singleton_subset_iff, sphere.mem_coe, mem_sphere, dist_self] at hdist
+        simp_rw [Set.singleton_subset_iff, sphere.mem_coe, mem_sphere, dist_self] at hdist 
         rw [hi default, hdist]
         exact ⟨rfl, rfl⟩
     · have i := hne.some
@@ -337,7 +337,7 @@ theorem eq_circumcenter_of_dist_eq {n : ℕ} (s : Simplex ℝ P n) {p : P}
   by
   have h := s.circumsphere_unique_dist_eq.2 ⟨p, r⟩
   simp only [hp, hr, forall_const, eq_self_iff_true, subset_sphere, sphere.ext_iff,
-    Set.forall_range_iff, mem_sphere, true_and_iff] at h
+    Set.forall_range_iff, mem_sphere, true_and_iff] at h 
   exact h.1
 #align affine.simplex.eq_circumcenter_of_dist_eq Affine.Simplex.eq_circumcenter_of_dist_eq
 
@@ -349,7 +349,7 @@ theorem eq_circumradius_of_dist_eq {n : ℕ} (s : Simplex ℝ P n) {p : P}
   by
   have h := s.circumsphere_unique_dist_eq.2 ⟨p, r⟩
   simp only [hp, hr, forall_const, eq_self_iff_true, subset_sphere, sphere.ext_iff,
-    Set.forall_range_iff, mem_sphere, true_and_iff] at h
+    Set.forall_range_iff, mem_sphere, true_and_iff] at h 
   exact h.2
 #align affine.simplex.eq_circumradius_of_dist_eq Affine.Simplex.eq_circumradius_of_dist_eq
 
@@ -365,7 +365,7 @@ theorem circumradius_pos {n : ℕ} (s : Simplex ℝ P (n + 1)) : 0 < s.circumrad
   refine' lt_of_le_of_ne s.circumradius_nonneg _
   intro h
   have hr := s.dist_circumcenter_eq_circumradius
-  simp_rw [← h, dist_eq_zero] at hr
+  simp_rw [← h, dist_eq_zero] at hr 
   have h01 := s.independent.injective.ne (by decide : (0 : Fin (n + 2)) ≠ 1)
   simpa [hr] using h01
 #align affine.simplex.circumradius_pos Affine.Simplex.circumradius_pos
@@ -374,7 +374,7 @@ theorem circumradius_pos {n : ℕ} (s : Simplex ℝ P (n + 1)) : 0 < s.circumrad
 theorem circumcenter_eq_point (s : Simplex ℝ P 0) (i : Fin 1) : s.circumcenter = s.points i :=
   by
   have h := s.circumcenter_mem_affine_span
-  rw [Set.range_unique, mem_affine_span_singleton] at h
+  rw [Set.range_unique, mem_affine_span_singleton] at h 
   rw [h]
   congr
 #align affine.simplex.circumcenter_eq_point Affine.Simplex.circumcenter_eq_point
@@ -393,7 +393,7 @@ theorem circumcenter_eq_centroid (s : Simplex ℝ P 1) :
       dist_eq_norm_vsub V (s.points j), vsub_vadd_eq_vsub_sub, vsub_vadd_eq_vsub_sub, ←
       one_smul ℝ (s.points i -ᵥ s.points 0), ← one_smul ℝ (s.points j -ᵥ s.points 0)]
     fin_cases i <;> fin_cases j <;> simp [-one_smul, ← sub_smul] <;> norm_num
-  rw [Set.pairwise_eq_iff_exists_eq] at hr
+  rw [Set.pairwise_eq_iff_exists_eq] at hr 
   cases' hr with r hr
   exact
     (s.eq_circumcenter_of_dist_eq
@@ -478,12 +478,12 @@ spanned by that simplex is its circumcenter.  -/
 theorem orthogonal_projection_eq_circumcenter_of_exists_dist_eq {n : ℕ} (s : Simplex ℝ P n) {p : P}
     (hr : ∃ r, ∀ i, dist (s.points i) p = r) : ↑(s.orthogonalProjectionSpan p) = s.circumcenter :=
   by
-  change ∃ r : ℝ, ∀ i, (fun x => dist x p = r) (s.points i) at hr
+  change ∃ r : ℝ, ∀ i, (fun x => dist x p = r) (s.points i) at hr 
   conv at hr =>
     congr
     ext
     rw [← Set.forall_range_iff]
-  rw [exists_dist_eq_iff_exists_dist_orthogonal_projection_eq (subset_affineSpan ℝ _) p] at hr
+  rw [exists_dist_eq_iff_exists_dist_orthogonal_projection_eq (subset_affineSpan ℝ _) p] at hr 
   cases' hr with r hr
   exact
     s.eq_circumcenter_of_dist_eq (orthogonal_projection_mem p) fun i => hr _ (Set.mem_range_self i)
@@ -519,7 +519,7 @@ theorem circumcenter_eq_of_range_eq {n : ℕ} {s₁ s₂ : Simplex ℝ P n}
     by
     intro i
     have hi : s₂.points i ∈ Set.range s₂.points := Set.mem_range_self _
-    rw [← h, Set.mem_range] at hi
+    rw [← h, Set.mem_range] at hi 
     rcases hi with ⟨j, hj⟩
     rw [← hj, s₁.dist_circumcenter_eq_circumradius j]
   exact s₂.eq_circumcenter_of_dist_eq hs hr
@@ -785,7 +785,7 @@ theorem cospherical_iff_exists_mem_of_complete {s : AffineSubspace ℝ P} {ps :
   by
   constructor
   · rintro ⟨c, hcr⟩
-    rw [exists_dist_eq_iff_exists_dist_orthogonal_projection_eq h c] at hcr
+    rw [exists_dist_eq_iff_exists_dist_orthogonal_projection_eq h c] at hcr 
     exact ⟨orthogonalProjection s c, orthogonal_projection_mem _, hcr⟩
   · exact fun ⟨c, hc, hd⟩ => ⟨c, hd⟩
 #align euclidean_geometry.cospherical_iff_exists_mem_of_complete EuclideanGeometry.cospherical_iff_exists_mem_of_complete
@@ -807,7 +807,7 @@ theorem exists_circumradius_eq_of_cospherical_subset {s : AffineSubspace ℝ P}
     (hd : finrank ℝ s.direction = n) (hc : Cospherical ps) :
     ∃ r : ℝ, ∀ sx : Simplex ℝ P n, Set.range sx.points ⊆ ps → sx.circumradius = r :=
   by
-  rw [cospherical_iff_exists_mem_of_finite_dimensional h] at hc
+  rw [cospherical_iff_exists_mem_of_finite_dimensional h] at hc 
   rcases hc with ⟨c, hc, r, hcr⟩
   use r
   intro sx hsxps
@@ -841,7 +841,7 @@ theorem exists_circumradius_eq_of_cospherical {ps : Set P} {n : ℕ} [FiniteDime
     ∃ r : ℝ, ∀ sx : Simplex ℝ P n, Set.range sx.points ⊆ ps → sx.circumradius = r :=
   by
   haveI : Nonempty (⊤ : AffineSubspace ℝ P) := Set.univ.nonempty
-  rw [← finrank_top, ← direction_top ℝ V P] at hd
+  rw [← finrank_top, ← direction_top ℝ V P] at hd 
   refine' exists_circumradius_eq_of_cospherical_subset _ hd hc
   exact Set.subset_univ _
 #align euclidean_geometry.exists_circumradius_eq_of_cospherical EuclideanGeometry.exists_circumradius_eq_of_cospherical
@@ -864,7 +864,7 @@ theorem exists_circumcenter_eq_of_cospherical_subset {s : AffineSubspace ℝ P}
     (hd : finrank ℝ s.direction = n) (hc : Cospherical ps) :
     ∃ c : P, ∀ sx : Simplex ℝ P n, Set.range sx.points ⊆ ps → sx.circumcenter = c :=
   by
-  rw [cospherical_iff_exists_mem_of_finite_dimensional h] at hc
+  rw [cospherical_iff_exists_mem_of_finite_dimensional h] at hc 
   rcases hc with ⟨c, hc, r, hcr⟩
   use c
   intro sx hsxps
@@ -898,7 +898,7 @@ theorem exists_circumcenter_eq_of_cospherical {ps : Set P} {n : ℕ} [FiniteDime
     ∃ c : P, ∀ sx : Simplex ℝ P n, Set.range sx.points ⊆ ps → sx.circumcenter = c :=
   by
   haveI : Nonempty (⊤ : AffineSubspace ℝ P) := Set.univ.nonempty
-  rw [← finrank_top, ← direction_top ℝ V P] at hd
+  rw [← finrank_top, ← direction_top ℝ V P] at hd 
   refine' exists_circumcenter_eq_of_cospherical_subset _ hd hc
   exact Set.subset_univ _
 #align euclidean_geometry.exists_circumcenter_eq_of_cospherical EuclideanGeometry.exists_circumcenter_eq_of_cospherical
@@ -944,7 +944,7 @@ theorem exists_circumsphere_eq_of_cospherical {ps : Set P} {n : ℕ} [FiniteDime
     ∃ c : Sphere P, ∀ sx : Simplex ℝ P n, Set.range sx.points ⊆ ps → sx.circumsphere = c :=
   by
   haveI : Nonempty (⊤ : AffineSubspace ℝ P) := Set.univ.nonempty
-  rw [← finrank_top, ← direction_top ℝ V P] at hd
+  rw [← finrank_top, ← direction_top ℝ V P] at hd 
   refine' exists_circumsphere_eq_of_cospherical_subset _ hd hc
   exact Set.subset_univ _
 #align euclidean_geometry.exists_circumsphere_eq_of_cospherical EuclideanGeometry.exists_circumsphere_eq_of_cospherical
@@ -975,15 +975,15 @@ theorem eq_or_eq_reflection_of_dist_eq {n : ℕ} {s : Simplex ℝ P n} {p p₁ p
   have h₁' := s.orthogonal_projection_eq_circumcenter_of_dist_eq h₁
   have h₂' := s.orthogonal_projection_eq_circumcenter_of_dist_eq h₂
   rw [← affineSpan_insert_affineSpan, mem_affine_span_insert_iff (orthogonal_projection_mem p)] at
-    hp₁ hp₂
+    hp₁ hp₂ 
   obtain ⟨r₁, p₁o, hp₁o, hp₁⟩ := hp₁
   obtain ⟨r₂, p₂o, hp₂o, hp₂⟩ := hp₂
   obtain rfl : ↑(s.orthogonal_projection_span p₁) = p₁o := by subst hp₁;
     exact s.coe_orthogonal_projection_vadd_smul_vsub_orthogonal_projection hp₁o
-  rw [h₁'] at hp₁
+  rw [h₁'] at hp₁ 
   obtain rfl : ↑(s.orthogonal_projection_span p₂) = p₂o := by subst hp₂;
     exact s.coe_orthogonal_projection_vadd_smul_vsub_orthogonal_projection hp₂o
-  rw [h₂'] at hp₂
+  rw [h₂'] at hp₂ 
   have h : s.points 0 ∈ span_s := mem_affineSpan ℝ (Set.mem_range_self _)
   have hd₁ :
     dist p₁ s.circumcenter * dist p₁ s.circumcenter = r * r - s.circumradius * s.circumradius :=
@@ -994,14 +994,14 @@ theorem eq_or_eq_reflection_of_dist_eq {n : ℕ} {s : Simplex ℝ P n} {p p₁ p
   rw [← hd₂, hp₁, hp₂, dist_eq_norm_vsub V _ s.circumcenter, dist_eq_norm_vsub V _ s.circumcenter,
     vadd_vsub, vadd_vsub, ← real_inner_self_eq_norm_mul_norm, ← real_inner_self_eq_norm_mul_norm,
     real_inner_smul_left, real_inner_smul_left, real_inner_smul_right, real_inner_smul_right, ←
-    mul_assoc, ← mul_assoc] at hd₁
+    mul_assoc, ← mul_assoc] at hd₁ 
   by_cases hp : p = s.orthogonal_projection_span p
-  · rw [simplex.orthogonal_projection_span] at hp
+  · rw [simplex.orthogonal_projection_span] at hp 
     rw [hp₁, hp₂, ← hp]
     simp only [true_or_iff, eq_self_iff_true, smul_zero, vsub_self]
   · have hz : ⟪p -ᵥ orthogonalProjection span_s p, p -ᵥ orthogonalProjection span_s p⟫ ≠ 0 := by
       simpa only [Ne.def, vsub_eq_zero_iff_eq, inner_self_eq_zero] using hp
-    rw [mul_left_inj' hz, mul_self_eq_mul_self_iff] at hd₁
+    rw [mul_left_inj' hz, mul_self_eq_mul_self_iff] at hd₁ 
     rw [hp₁, hp₂]
     cases hd₁
     · left
Diff
@@ -35,11 +35,11 @@ the circumcenter.
 
 noncomputable section
 
-open BigOperators
+open scoped BigOperators
 
-open Classical
+open scoped Classical
 
-open RealInnerProductSpace
+open scoped RealInnerProductSpace
 
 namespace EuclideanGeometry
 
Diff
@@ -245,9 +245,7 @@ theorem AffineIndependent.existsUnique_dist_eq {ι : Type _} [hne : Nonempty ι]
       convert ha.not_mem_affine_span_diff i Set.univ
       change (Set.range fun i2 : { x | x ≠ i } => p i2) = _
       rw [← Set.image_eq_range]
-      congr with j
-      simp
-      rfl
+      congr with j; simp; rfl
 #align affine_independent.exists_unique_dist_eq AffineIndependent.existsUnique_dist_eq
 
 end EuclideanGeometry
@@ -980,14 +978,10 @@ theorem eq_or_eq_reflection_of_dist_eq {n : ℕ} {s : Simplex ℝ P n} {p p₁ p
     hp₁ hp₂
   obtain ⟨r₁, p₁o, hp₁o, hp₁⟩ := hp₁
   obtain ⟨r₂, p₂o, hp₂o, hp₂⟩ := hp₂
-  obtain rfl : ↑(s.orthogonal_projection_span p₁) = p₁o :=
-    by
-    subst hp₁
+  obtain rfl : ↑(s.orthogonal_projection_span p₁) = p₁o := by subst hp₁;
     exact s.coe_orthogonal_projection_vadd_smul_vsub_orthogonal_projection hp₁o
   rw [h₁'] at hp₁
-  obtain rfl : ↑(s.orthogonal_projection_span p₂) = p₂o :=
-    by
-    subst hp₂
+  obtain rfl : ↑(s.orthogonal_projection_span p₂) = p₂o := by subst hp₂;
     exact s.coe_orthogonal_projection_vadd_smul_vsub_orthogonal_projection hp₂o
   rw [h₂'] at hp₂
   have h : s.points 0 ∈ span_s := mem_affineSpan ℝ (Set.mem_range_self _)
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Joseph Myers
 
 ! This file was ported from Lean 3 source module geometry.euclidean.circumcenter
-! 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.
 -/
@@ -620,7 +620,7 @@ include V
 theorem point_eq_affineCombination_of_pointsWithCircumcenter {n : ℕ} (s : Simplex ℝ P n)
     (i : Fin (n + 1)) :
     s.points i =
-      (univ : Finset (PointsWithCircumcenterIndex n)).affineCombination s.pointsWithCircumcenter
+      (univ : Finset (PointsWithCircumcenterIndex n)).affineCombination ℝ s.pointsWithCircumcenter
         (pointWeightsWithCircumcenter i) :=
   by
   rw [← points_with_circumcenter_point]
@@ -663,7 +663,7 @@ include V
 theorem centroid_eq_affineCombination_of_pointsWithCircumcenter {n : ℕ} (s : Simplex ℝ P n)
     (fs : Finset (Fin (n + 1))) :
     fs.centroid ℝ s.points =
-      (univ : Finset (PointsWithCircumcenterIndex n)).affineCombination s.pointsWithCircumcenter
+      (univ : Finset (PointsWithCircumcenterIndex n)).affineCombination ℝ s.pointsWithCircumcenter
         (centroidWeightsWithCircumcenter fs) :=
   by
   simp_rw [centroid_def, affine_combination_apply, weighted_vsub_of_point_apply,
@@ -701,7 +701,7 @@ include V
 `points_with_circumcenter`. -/
 theorem circumcenter_eq_affineCombination_of_pointsWithCircumcenter {n : ℕ} (s : Simplex ℝ P n) :
     s.circumcenter =
-      (univ : Finset (PointsWithCircumcenterIndex n)).affineCombination s.pointsWithCircumcenter
+      (univ : Finset (PointsWithCircumcenterIndex n)).affineCombination ℝ s.pointsWithCircumcenter
         (circumcenterWeightsWithCircumcenter n) :=
   by
   rw [← points_with_circumcenter_eq_circumcenter]
@@ -739,7 +739,7 @@ terms of `points_with_circumcenter`. -/
 theorem reflection_circumcenter_eq_affineCombination_of_pointsWithCircumcenter {n : ℕ}
     (s : Simplex ℝ P n) {i₁ i₂ : Fin (n + 1)} (h : i₁ ≠ i₂) :
     reflection (affineSpan ℝ (s.points '' {i₁, i₂})) s.circumcenter =
-      (univ : Finset (PointsWithCircumcenterIndex n)).affineCombination s.pointsWithCircumcenter
+      (univ : Finset (PointsWithCircumcenterIndex n)).affineCombination ℝ s.pointsWithCircumcenter
         (reflectionCircumcenterWeightsWithCircumcenter i₁ i₂) :=
   by
   have hc : card ({i₁, i₂} : Finset (Fin (n + 1))) = 2 := by simp [h]
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Joseph Myers
 
 ! This file was ported from Lean 3 source module geometry.euclidean.circumcenter
-! 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.
 -/
@@ -43,7 +43,8 @@ open RealInnerProductSpace
 
 namespace EuclideanGeometry
 
-variable {V : Type _} {P : Type _} [InnerProductSpace ℝ V] [MetricSpace P] [NormedAddTorsor V P]
+variable {V : Type _} {P : Type _} [NormedAddCommGroup V] [InnerProductSpace ℝ V] [MetricSpace P]
+  [NormedAddTorsor V P]
 
 include V
 
@@ -257,7 +258,8 @@ namespace Simplex
 
 open Finset AffineSubspace EuclideanGeometry
 
-variable {V : Type _} {P : Type _} [InnerProductSpace ℝ V] [MetricSpace P] [NormedAddTorsor V P]
+variable {V : Type _} {P : Type _} [NormedAddCommGroup V] [InnerProductSpace ℝ V] [MetricSpace P]
+  [NormedAddTorsor V P]
 
 include V
 
@@ -771,7 +773,8 @@ namespace EuclideanGeometry
 
 open Affine AffineSubspace FiniteDimensional
 
-variable {V : Type _} {P : Type _} [InnerProductSpace ℝ V] [MetricSpace P] [NormedAddTorsor V P]
+variable {V : Type _} {P : Type _} [NormedAddCommGroup V] [InnerProductSpace ℝ V] [MetricSpace P]
+  [NormedAddTorsor V P]
 
 include V
 
Diff
@@ -4,11 +4,11 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Joseph Myers
 
 ! This file was ported from Lean 3 source module geometry.euclidean.circumcenter
-! leanprover-community/mathlib commit 509de852e1de55e1efa8eacfa11df0823f26f226
+! 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.Geometry.Euclidean.Basic
+import Mathbin.Geometry.Euclidean.Sphere.Basic
 import Mathbin.LinearAlgebra.AffineSpace.FiniteDimensional
 import Mathbin.Tactic.DeriveFintype
 

Changes in mathlib4

mathlib3
mathlib4
feat: Axiomatise b ≠ 0 → a * b / b = a (#12424)

This lets us unify a few lemmas between GroupWithZero and EuclideanDomain and two lemmas that were previously proved separately for Nat, Int, Polynomial.

Diff
@@ -172,9 +172,7 @@ theorem existsUnique_dist_eq_of_insert {s : AffineSubspace ℝ P}
         x * x + (1 - t₃) * (1 - t₃) * (y * y) = x * x + y * y - 2 * y * (t₃ * y) + t₃ * y * (t₃ * y)
         by ring,
       add_left_inj] at hcr₃
-    have ht₃ : t₃ = ycc₂ / y := by
-      field_simp [ycc₂, ← hcr₃, hy0]
-      ring
+    have ht₃ : t₃ = ycc₂ / y := by field_simp [ycc₂, ← hcr₃, hy0]
     subst ht₃
     change cc₃ = cc₂ at hcc₃''
     congr
feat: add notation for Real.sqrt (#12056)

This adds the notation √r for Real.sqrt r. The precedence is such that √x⁻¹ is parsed as √(x⁻¹); not because this is particularly desirable, but because it's the default and the choice doesn't really matter.

This is extracted from #7907, which adds a more general nth root typeclass. The idea is to perform all the boring substitutions downstream quickly, so that we can play around with custom elaborators with a much slower rate of code-rot. This PR also won't rot as quickly, as it does not forbid writing x.sqrt as that PR does.

While perhaps claiming for Real.sqrt is greedy; it:

  • Is far more common thatn NNReal.sqrt and Nat.sqrt
  • Is far more interesting to mathlib than sqrt on Float
  • Can be overloaded anyway, so this does not prevent downstream code using the notation on their own types.
  • Will be replaced by a more general typeclass in a future PR.

Zulip

Co-authored-by: Yury G. Kudryashov <urkud@urkud.name>

Diff
@@ -103,7 +103,7 @@ theorem existsUnique_dist_eq_of_insert {s : AffineSubspace ℝ P}
   have hy0 : y ≠ 0 := dist_orthogonalProjection_ne_zero_of_not_mem hp
   let ycc₂ := (x * x + y * y - cr * cr) / (2 * y)
   let cc₂ := (ycc₂ / y) • (p -ᵥ orthogonalProjection s p : V) +ᵥ cc
-  let cr₂ := Real.sqrt (cr * cr + ycc₂ * ycc₂)
+  let cr₂ := √(cr * cr + ycc₂ * ycc₂)
   use ⟨cc₂, cr₂⟩
   simp (config := { zeta := false, proj := false }) only
   have hpo : p = (1 : ℝ) • (p -ᵥ orthogonalProjection s p : V) +ᵥ (orthogonalProjection s p : P) :=
@@ -149,7 +149,7 @@ theorem existsUnique_dist_eq_of_insert {s : AffineSubspace ℝ P}
     -- cases' hu with hucc hucr
     -- substs hucc hucr
     cases' hu
-    have hcr₃val : cr₃ = Real.sqrt (cr * cr + t₃ * y * (t₃ * y)) := by
+    have hcr₃val : cr₃ = √(cr * cr + t₃ * y * (t₃ * y)) := by
       cases' hnps with p0 hp0
       have h' : ↑(⟨cc, hcc₃'⟩ : s) = cc := rfl
       rw [← dist_of_mem_subset_mk_sphere (Set.mem_insert_of_mem _ hp0) hcr₃, hcc₃'', ←
chore: avoid Ne.def (adaptation for nightly-2024-03-27) (#11801)
Diff
@@ -936,7 +936,7 @@ theorem eq_or_eq_reflection_of_dist_eq {n : ℕ} {s : Simplex ℝ P n} {p p₁ p
     rw [hp₁, hp₂, ← hp]
     simp only [true_or_iff, eq_self_iff_true, smul_zero, vsub_self]
   · have hz : ⟪p -ᵥ orthogonalProjection span_s p, p -ᵥ orthogonalProjection span_s p⟫ ≠ 0 := by
-      simpa only [Ne.def, vsub_eq_zero_iff_eq, inner_self_eq_zero] using hp
+      simpa only [Ne, vsub_eq_zero_iff_eq, inner_self_eq_zero] using hp
     rw [mul_left_inj' hz, mul_self_eq_mul_self_iff] at hd₁
     rw [hp₁, hp₂]
     cases' hd₁ with hd₁ hd₁
chore: Rename mul-div cancellation lemmas (#11530)

Lemma names around cancellation of multiplication and division are a mess.

This PR renames a handful of them according to the following table (each big row contains the multiplicative statement, then the three rows contain the GroupWithZero lemma name, the Group lemma, the AddGroup lemma name).

| Statement | New name | Old name | |

Diff
@@ -131,7 +131,7 @@ theorem existsUnique_dist_eq_of_insert {s : AffineSubspace ℝ P}
           orthogonalProjection_vadd_smul_vsub_orthogonalProjection _ _ hcc, Subtype.coe_mk,
           dist_of_mem_subset_mk_sphere hp1 hcr, dist_eq_norm_vsub V cc₂ cc, vadd_vsub, norm_smul, ←
           dist_eq_norm_vsub V, Real.norm_eq_abs, abs_div, abs_of_nonneg dist_nonneg,
-          div_mul_cancel _ hy0, abs_mul_abs_self]
+          div_mul_cancel₀ _ hy0, abs_mul_abs_self]
   · rintro ⟨cc₃, cr₃⟩ ⟨hcc₃, hcr₃⟩
     simp only at hcc₃ hcr₃
     obtain ⟨t₃, cc₃', hcc₃', hcc₃''⟩ :
@@ -456,7 +456,7 @@ theorem dist_circumcenter_sq_eq_sq_sub_circumradius {n : ℕ} {r : ℝ} (s : Sim
     dist p₁ s.circumcenter * dist p₁ s.circumcenter = r * r - s.circumradius * s.circumradius := by
   rw [dist_comm, ← h₁ 0,
     s.dist_sq_eq_dist_orthogonalProjection_sq_add_dist_orthogonalProjection_sq p₁ h]
-  simp only [h₁', dist_comm p₁, add_sub_cancel', Simplex.dist_circumcenter_eq_circumradius]
+  simp only [h₁', dist_comm p₁, add_sub_cancel_left, Simplex.dist_circumcenter_eq_circumradius]
 #align affine.simplex.dist_circumcenter_sq_eq_sq_sub_circumradius Affine.Simplex.dist_circumcenter_sq_eq_sq_sub_circumradius
 
 /-- If there exists a distance that a point has from all vertices of a
chore: Remove ball and bex from lemma names (#10816)

ball for "bounded forall" and bex for "bounded exists" are from experience very confusing abbreviations. This PR renames them to forall_mem and exists_mem in the few Set lemma names that mention them.

Also deprecate ball_image_of_ball, mem_image_elim, mem_image_elim_on since those lemmas are duplicates of the renamed lemmas (apart from argument order and implicitness, which I am also fixing by making the binder in the RHS of forall_mem_image semi-implicit), have obscure names and are completely unused.

Diff
@@ -322,11 +322,11 @@ theorem eq_circumcenter_of_dist_eq {n : ℕ} (s : Simplex ℝ P n) {p : P}
     p = s.circumcenter := by
   have h := s.circumsphere_unique_dist_eq.2 ⟨p, r⟩
   simp only [hp, hr, forall_const, eq_self_iff_true, subset_sphere, Sphere.ext_iff,
-    Set.forall_range_iff, mem_sphere, true_and] at h
+    Set.forall_mem_range, mem_sphere, true_and] at h
   -- Porting note: added the next three lines (`simp` less powerful)
   rw [subset_sphere (s := ⟨p, r⟩)] at h
   simp only [hp, hr, forall_const, eq_self_iff_true, subset_sphere, Sphere.ext_iff,
-    Set.forall_range_iff, mem_sphere, true_and] at h
+    Set.forall_mem_range, mem_sphere, true_and] at h
   exact h.1
 #align affine.simplex.eq_circumcenter_of_dist_eq Affine.Simplex.eq_circumcenter_of_dist_eq
 
@@ -337,11 +337,11 @@ theorem eq_circumradius_of_dist_eq {n : ℕ} (s : Simplex ℝ P n) {p : P}
     r = s.circumradius := by
   have h := s.circumsphere_unique_dist_eq.2 ⟨p, r⟩
   simp only [hp, hr, forall_const, eq_self_iff_true, subset_sphere, Sphere.ext_iff,
-    Set.forall_range_iff, mem_sphere, true_and_iff] at h
+    Set.forall_mem_range, mem_sphere, true_and_iff] at h
   -- Porting note: added the next three lines (`simp` less powerful)
   rw [subset_sphere (s := ⟨p, r⟩)] at h
   simp only [hp, hr, forall_const, eq_self_iff_true, subset_sphere, Sphere.ext_iff,
-    Set.forall_range_iff, mem_sphere, true_and_iff] at h
+    Set.forall_mem_range, mem_sphere, true_and_iff] at h
   exact h.2
 #align affine.simplex.eq_circumradius_of_dist_eq Affine.Simplex.eq_circumradius_of_dist_eq
 
@@ -470,7 +470,7 @@ theorem orthogonalProjection_eq_circumcenter_of_exists_dist_eq {n : ℕ} (s : Si
       a ∈ Set.range (fun (i : Fin (n + 1)) => s.points i) → dist a p = r := by
     cases' hr with r hr
     use r
-    refine' Set.forall_range_iff.mpr _
+    refine' Set.forall_mem_range.mpr _
     exact hr
   rw [exists_dist_eq_iff_exists_dist_orthogonalProjection_eq (subset_affineSpan ℝ _) p] at hr
   cases' hr with r hr
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
@@ -34,7 +34,7 @@ noncomputable section
 
 open BigOperators
 
-open Classical
+open scoped Classical
 
 open RealInnerProductSpace
 
chore: move Mathlib to v4.7.0-rc1 (#11162)

This is a very large PR, but it has been reviewed piecemeal already in PRs to the bump/v4.7.0 branch as we update to intermediate nightlies.

Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Kyle Miller <kmill31415@gmail.com> Co-authored-by: damiano <adomani@gmail.com>

Diff
@@ -125,7 +125,7 @@ theorem existsUnique_dist_eq_of_insert {s : AffineSubspace ℝ P}
           dist_sq_smul_orthogonal_vadd_smul_orthogonal_vadd (orthogonalProjection_mem p) hcc _ _
             (vsub_orthogonalProjection_mem_direction_orthogonal s p),
           ← dist_eq_norm_vsub V p, dist_comm _ cc]
-        field_simp [hy0]
+        field_simp [ycc₂, hy0]
         ring
       · rw [dist_sq_eq_dist_orthogonalProjection_sq_add_dist_orthogonalProjection_sq _ (hps hp1),
           orthogonalProjection_vadd_smul_vsub_orthogonalProjection _ _ hcc, Subtype.coe_mk,
@@ -173,7 +173,7 @@ theorem existsUnique_dist_eq_of_insert {s : AffineSubspace ℝ P}
         by ring,
       add_left_inj] at hcr₃
     have ht₃ : t₃ = ycc₂ / y := by
-      field_simp [← hcr₃, hy0]
+      field_simp [ycc₂, ← hcr₃, hy0]
       ring
     subst ht₃
     change cc₃ = cc₂ at hcc₃''
@@ -181,7 +181,6 @@ theorem existsUnique_dist_eq_of_insert {s : AffineSubspace ℝ P}
     rw [hcr₃val]
     congr 2
     field_simp [hy0]
-    ring
 #align euclidean_geometry.exists_unique_dist_eq_of_insert EuclideanGeometry.existsUnique_dist_eq_of_insert
 
 /-- Given a finite nonempty affinely independent family of points,
feat: (s ∩ t).card = s.card + t.card - (s ∪ t).card (#10224)

once coerced to an AddGroupWithOne. Also unify Finset.card_disjoint_union and Finset.card_union_eq

From LeanAPAP

Diff
@@ -680,7 +680,7 @@ theorem sum_reflectionCircumcenterWeightsWithCircumcenter {n : ℕ} {i₁ i₂ :
     (h : i₁ ≠ i₂) : ∑ i, reflectionCircumcenterWeightsWithCircumcenter i₁ i₂ i = 1 := by
   simp_rw [sum_pointsWithCircumcenter, reflectionCircumcenterWeightsWithCircumcenter, sum_ite,
     sum_const, filter_or, filter_eq']
-  rw [card_union_eq]
+  rw [card_union_of_disjoint]
   · set_option simprocs false in simp
   · simpa only [if_true, mem_univ, disjoint_singleton] using h
 #align affine.simplex.sum_reflection_circumcenter_weights_with_circumcenter Affine.Simplex.sum_reflectionCircumcenterWeightsWithCircumcenter
chore: move to v4.6.0-rc1, merging adaptations from bump/v4.6.0 (#10176)

Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Joachim Breitner <mail@joachim-breitner.de>

Diff
@@ -681,7 +681,7 @@ theorem sum_reflectionCircumcenterWeightsWithCircumcenter {n : ℕ} {i₁ i₂ :
   simp_rw [sum_pointsWithCircumcenter, reflectionCircumcenterWeightsWithCircumcenter, sum_ite,
     sum_const, filter_or, filter_eq']
   rw [card_union_eq]
-  · simp
+  · set_option simprocs false in simp
   · simpa only [if_true, mem_univ, disjoint_singleton] using h
 #align affine.simplex.sum_reflection_circumcenter_weights_with_circumcenter Affine.Simplex.sum_reflectionCircumcenterWeightsWithCircumcenter
 
chore(*): use ∃ x ∈ s, p x instead of ∃ x (_ : x ∈ s), p x (#9326)

This is a follow-up to #9215. It changes the following theorems and definitions:

  • IsOpen.exists_subset_affineIndependent_span_eq_top
  • IsConformalMap
  • SimpleGraph.induce_connected_of_patches
  • Submonoid.exists_list_of_mem_closure
  • AddSubmonoid.exists_list_of_mem_closure
  • AffineSubspace.mem_affineSpan_insert_iff
  • AffineBasis.exists_affine_subbasis
  • exists_affineIndependent
  • LinearMap.mem_submoduleImage
  • Basis.basis_singleton_iff
  • atom_iff_nonzero_span
  • finrank_eq_one_iff'
  • Submodule.basis_of_pid_aux
  • exists_linearIndependent_extension
  • exists_linearIndependent
  • countable_cover_nhdsWithin_of_sigma_compact
  • mem_residual

Also deprecate ENNReal.exists_ne_top'.

Diff
@@ -135,7 +135,7 @@ theorem existsUnique_dist_eq_of_insert {s : AffineSubspace ℝ P}
   · rintro ⟨cc₃, cr₃⟩ ⟨hcc₃, hcr₃⟩
     simp only at hcc₃ hcr₃
     obtain ⟨t₃, cc₃', hcc₃', hcc₃''⟩ :
-      ∃ (r : ℝ)(p0 : P)(_ : p0 ∈ s), cc₃ = r • (p -ᵥ ↑((orthogonalProjection s) p)) +ᵥ p0 := by
+      ∃ r : ℝ, ∃ p0 ∈ s, cc₃ = r • (p -ᵥ ↑((orthogonalProjection s) p)) +ᵥ p0 := by
       rwa [mem_affineSpan_insert_iff (orthogonalProjection_mem p)] at hcc₃
     have hcr₃' : ∃ r, ∀ p1 ∈ ps, dist p1 cc₃ = r :=
       ⟨cr₃, fun p1 hp1 => dist_of_mem_subset_mk_sphere (Set.mem_insert_of_mem _ hp1) hcr₃⟩
chore: Remove nonterminal simp at (#7795)

Removes nonterminal uses of simp at. Replaces most of these with instances of simp? ... says.

Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Mario Carneiro <di.gama@gmail.com>

Diff
@@ -208,7 +208,8 @@ theorem _root_.AffineIndependent.existsUnique_dist_eq {ι : Type*} [hne : Nonemp
       · rintro ⟨cc, cr⟩
         simp only
         rintro ⟨rfl, hdist⟩
-        simp [Set.singleton_subset_iff] at hdist
+        simp? [Set.singleton_subset_iff] at hdist says
+          simp only [Set.singleton_subset_iff, Metric.mem_sphere, dist_self] at hdist
         rw [hi default, hdist]
     · have i := hne.some
       let ι2 := { x // x ≠ i }
chore: Sink Algebra.Support down the import tree (#8919)

Function.support is a very basic definition. Nevertheless, it is a pretty heavy import because it imports most objects a support lemma can be written about.

This PR reverses the dependencies between those objects and Function.support, so that the latter can become a much more lightweight import.

Only two import could not easily be reversed, namely the ones to Data.Set.Finite and Order.ConditionallyCompleteLattice.Basic, so I created two new files instead.

I credit:

Diff
@@ -619,7 +619,7 @@ def centroidWeightsWithCircumcenter {n : ℕ} (fs : Finset (Fin (n + 1))) :
 theorem sum_centroidWeightsWithCircumcenter {n : ℕ} {fs : Finset (Fin (n + 1))} (h : fs.Nonempty) :
     ∑ i, centroidWeightsWithCircumcenter fs i = 1 := by
   simp_rw [sum_pointsWithCircumcenter, centroidWeightsWithCircumcenter, add_zero, ←
-    fs.sum_centroidWeights_eq_one_of_nonempty ℝ h, Set.sum_indicator_subset _ fs.subset_univ]
+    fs.sum_centroidWeights_eq_one_of_nonempty ℝ h, ← sum_indicator_subset _ fs.subset_univ]
   rcongr
 #align affine.simplex.sum_centroid_weights_with_circumcenter Affine.Simplex.sum_centroidWeightsWithCircumcenter
 
@@ -632,7 +632,7 @@ theorem centroid_eq_affineCombination_of_pointsWithCircumcenter {n : ℕ} (s : S
   simp_rw [centroid_def, affineCombination_apply, weightedVSubOfPoint_apply,
     sum_pointsWithCircumcenter, centroidWeightsWithCircumcenter,
     pointsWithCircumcenter_point, zero_smul, add_zero, centroidWeights,
-    Set.sum_indicator_subset_of_eq_zero (Function.const (Fin (n + 1)) (card fs : ℝ)⁻¹)
+    ← sum_indicator_subset_of_eq_zero (Function.const (Fin (n + 1)) (card fs : ℝ)⁻¹)
       (fun i wi => wi • (s.points i -ᵥ Classical.choice AddTorsor.nonempty)) fs.subset_univ fun _ =>
       zero_smul ℝ _,
     Set.indicator_apply]
fix: lean4-ify names of inductive constructors (#8652)

These inductive types carry data, so these should be functionCase not theorem_case.

It seems that mathport didn't do this.

Diff
@@ -517,27 +517,27 @@ affine combinations of vertices together with the circumcenter.  (An
 equivalent form sometimes used in the literature is placing the
 circumcenter at the origin and working with vectors for the vertices.) -/
 inductive PointsWithCircumcenterIndex (n : ℕ)
-  | point_index : Fin (n + 1) → PointsWithCircumcenterIndex n
-  | circumcenter_index : PointsWithCircumcenterIndex n
+  | pointIndex : Fin (n + 1) → PointsWithCircumcenterIndex n
+  | circumcenterIndex : PointsWithCircumcenterIndex n
   deriving Fintype
 #align affine.simplex.points_with_circumcenter_index Affine.Simplex.PointsWithCircumcenterIndex
 
 open PointsWithCircumcenterIndex
 
 instance pointsWithCircumcenterIndexInhabited (n : ℕ) : Inhabited (PointsWithCircumcenterIndex n) :=
-  ⟨circumcenter_index⟩
+  ⟨circumcenterIndex⟩
 #align affine.simplex.points_with_circumcenter_index_inhabited Affine.Simplex.pointsWithCircumcenterIndexInhabited
 
-/-- `point_index` as an embedding. -/
+/-- `pointIndex` as an embedding. -/
 def pointIndexEmbedding (n : ℕ) : Fin (n + 1) ↪ PointsWithCircumcenterIndex n :=
-  ⟨fun i => point_index i, fun _ _ h => by injection h⟩
+  ⟨fun i => pointIndex i, fun _ _ h => by injection h⟩
 #align affine.simplex.point_index_embedding Affine.Simplex.pointIndexEmbedding
 
 /-- The sum of a function over `PointsWithCircumcenterIndex`. -/
 theorem sum_pointsWithCircumcenter {α : Type*} [AddCommMonoid α] {n : ℕ}
     (f : PointsWithCircumcenterIndex n → α) :
-    ∑ i, f i = (∑ i : Fin (n + 1), f (point_index i)) + f circumcenter_index := by
-  have h : univ = insert circumcenter_index (univ.map (pointIndexEmbedding n)) := by
+    ∑ i, f i = (∑ i : Fin (n + 1), f (pointIndex i)) + f circumcenterIndex := by
+  have h : univ = insert circumcenterIndex (univ.map (pointIndexEmbedding n)) := by
     ext x
     refine' ⟨fun h => _, fun _ => mem_univ _⟩
     cases' x with i
@@ -552,38 +552,38 @@ theorem sum_pointsWithCircumcenter {α : Type*} [AddCommMonoid α] {n : ℕ}
 
 /-- The vertices of a simplex plus its circumcenter. -/
 def pointsWithCircumcenter {n : ℕ} (s : Simplex ℝ P n) : PointsWithCircumcenterIndex n → P
-  | point_index i => s.points i
-  | circumcenter_index => s.circumcenter
+  | pointIndex i => s.points i
+  | circumcenterIndex => s.circumcenter
 #align affine.simplex.points_with_circumcenter Affine.Simplex.pointsWithCircumcenter
 
-/-- `pointsWithCircumcenter`, applied to a `point_index` value,
+/-- `pointsWithCircumcenter`, applied to a `pointIndex` value,
 equals `points` applied to that value. -/
 @[simp]
 theorem pointsWithCircumcenter_point {n : ℕ} (s : Simplex ℝ P n) (i : Fin (n + 1)) :
-    s.pointsWithCircumcenter (point_index i) = s.points i :=
+    s.pointsWithCircumcenter (pointIndex i) = s.points i :=
   rfl
 #align affine.simplex.points_with_circumcenter_point Affine.Simplex.pointsWithCircumcenter_point
 
-/-- `pointsWithCircumcenter`, applied to `circumcenter_index`, equals the
+/-- `pointsWithCircumcenter`, applied to `circumcenterIndex`, equals the
 circumcenter. -/
 @[simp]
 theorem pointsWithCircumcenter_eq_circumcenter {n : ℕ} (s : Simplex ℝ P n) :
-    s.pointsWithCircumcenter circumcenter_index = s.circumcenter :=
+    s.pointsWithCircumcenter circumcenterIndex = s.circumcenter :=
   rfl
 #align affine.simplex.points_with_circumcenter_eq_circumcenter Affine.Simplex.pointsWithCircumcenter_eq_circumcenter
 
 /-- The weights for a single vertex of a simplex, in terms of
 `pointsWithCircumcenter`. -/
 def pointWeightsWithCircumcenter {n : ℕ} (i : Fin (n + 1)) : PointsWithCircumcenterIndex n → ℝ
-  | point_index j => if j = i then 1 else 0
-  | circumcenter_index => 0
+  | pointIndex j => if j = i then 1 else 0
+  | circumcenterIndex => 0
 #align affine.simplex.point_weights_with_circumcenter Affine.Simplex.pointWeightsWithCircumcenter
 
 /-- `point_weights_with_circumcenter` sums to 1. -/
 @[simp]
 theorem sum_pointWeightsWithCircumcenter {n : ℕ} (i : Fin (n + 1)) :
     ∑ j, pointWeightsWithCircumcenter i j = 1 := by
-  convert sum_ite_eq' univ (point_index i) (Function.const _ (1 : ℝ)) with j
+  convert sum_ite_eq' univ (pointIndex i) (Function.const _ (1 : ℝ)) with j
   · cases j <;> simp [pointWeightsWithCircumcenter]
   · simp
 #align affine.simplex.sum_point_weights_with_circumcenter Affine.Simplex.sum_pointWeightsWithCircumcenter
@@ -610,8 +610,8 @@ theorem point_eq_affineCombination_of_pointsWithCircumcenter {n : ℕ} (s : Simp
 terms of `pointsWithCircumcenter`. -/
 def centroidWeightsWithCircumcenter {n : ℕ} (fs : Finset (Fin (n + 1))) :
     PointsWithCircumcenterIndex n → ℝ
-  | point_index i => if i ∈ fs then (card fs : ℝ)⁻¹ else 0
-  | circumcenter_index => 0
+  | pointIndex i => if i ∈ fs then (card fs : ℝ)⁻¹ else 0
+  | circumcenterIndex => 0
 #align affine.simplex.centroid_weights_with_circumcenter Affine.Simplex.centroidWeightsWithCircumcenter
 
 /-- `centroidWeightsWithCircumcenter` sums to 1, if the `Finset` is nonempty. -/
@@ -641,15 +641,15 @@ theorem centroid_eq_affineCombination_of_pointsWithCircumcenter {n : ℕ} (s : S
 
 /-- The weights for the circumcenter of a simplex, in terms of `pointsWithCircumcenter`. -/
 def circumcenterWeightsWithCircumcenter (n : ℕ) : PointsWithCircumcenterIndex n → ℝ
-  | point_index _ => 0
-  | circumcenter_index => 1
+  | pointIndex _ => 0
+  | circumcenterIndex => 1
 #align affine.simplex.circumcenter_weights_with_circumcenter Affine.Simplex.circumcenterWeightsWithCircumcenter
 
 /-- `circumcenterWeightsWithCircumcenter` sums to 1. -/
 @[simp]
 theorem sum_circumcenterWeightsWithCircumcenter (n : ℕ) :
     ∑ i, circumcenterWeightsWithCircumcenter n i = 1 := by
-  convert sum_ite_eq' univ circumcenter_index (Function.const _ (1 : ℝ)) with j
+  convert sum_ite_eq' univ circumcenterIndex (Function.const _ (1 : ℝ)) with j
   · cases j <;> simp [circumcenterWeightsWithCircumcenter]
   · simp
 #align affine.simplex.sum_circumcenter_weights_with_circumcenter Affine.Simplex.sum_circumcenterWeightsWithCircumcenter
@@ -669,8 +669,8 @@ theorem circumcenter_eq_affineCombination_of_pointsWithCircumcenter {n : ℕ} (s
 simplex.  This definition is only valid with `i₁ ≠ i₂`. -/
 def reflectionCircumcenterWeightsWithCircumcenter {n : ℕ} (i₁ i₂ : Fin (n + 1)) :
     PointsWithCircumcenterIndex n → ℝ
-  | point_index i => if i = i₁ ∨ i = i₂ then 1 else 0
-  | circumcenter_index => -1
+  | pointIndex i => if i = i₁ ∨ i = i₂ then 1 else 0
+  | circumcenterIndex => -1
 #align affine.simplex.reflection_circumcenter_weights_with_circumcenter Affine.Simplex.reflectionCircumcenterWeightsWithCircumcenter
 
 /-- `reflectionCircumcenterWeightsWithCircumcenter` sums to 1. -/
fix: decapitalize names of proof-valued fields (#8509)

Only Prop-values fields should be capitalized, not P-valued fields where P is Prop-valued.

Rather than fixing Nonempty := in constructors, I just deleted the line as the instance can almost always be found automatically.

Diff
@@ -633,7 +633,7 @@ theorem centroid_eq_affineCombination_of_pointsWithCircumcenter {n : ℕ} (s : S
     sum_pointsWithCircumcenter, centroidWeightsWithCircumcenter,
     pointsWithCircumcenter_point, zero_smul, add_zero, centroidWeights,
     Set.sum_indicator_subset_of_eq_zero (Function.const (Fin (n + 1)) (card fs : ℝ)⁻¹)
-      (fun i wi => wi • (s.points i -ᵥ Classical.choice AddTorsor.Nonempty)) fs.subset_univ fun _ =>
+      (fun i wi => wi • (s.points i -ᵥ Classical.choice AddTorsor.nonempty)) fs.subset_univ fun _ =>
       zero_smul ℝ _,
     Set.indicator_apply]
   congr
fix(LinearAlgebra/AffineSpace/Independent): fix case of Simplex.Independent (#8419)

This holds a proof not a Prop, so should be lowercase.

Diff
@@ -250,7 +250,7 @@ variable {V : Type*} {P : Type*} [NormedAddCommGroup V] [InnerProductSpace ℝ V
 
 /-- The circumsphere of a simplex. -/
 def circumsphere {n : ℕ} (s : Simplex ℝ P n) : Sphere P :=
-  s.Independent.existsUnique_dist_eq.choose
+  s.independent.existsUnique_dist_eq.choose
 #align affine.simplex.circumsphere Affine.Simplex.circumsphere
 
 /-- The property satisfied by the circumsphere. -/
@@ -260,7 +260,7 @@ theorem circumsphere_unique_dist_eq {n : ℕ} (s : Simplex ℝ P n) :
       ∀ cs : Sphere P,
         cs.center ∈ affineSpan ℝ (Set.range s.points) ∧ Set.range s.points ⊆ cs →
           cs = s.circumsphere :=
-  s.Independent.existsUnique_dist_eq.choose_spec
+  s.independent.existsUnique_dist_eq.choose_spec
 #align affine.simplex.circumsphere_unique_dist_eq Affine.Simplex.circumsphere_unique_dist_eq
 
 /-- The circumcenter of a simplex. -/
@@ -357,7 +357,7 @@ theorem circumradius_pos {n : ℕ} (s : Simplex ℝ P (n + 1)) : 0 < s.circumrad
   intro h
   have hr := s.dist_circumcenter_eq_circumradius
   simp_rw [← h, dist_eq_zero] at hr
-  have h01 := s.Independent.injective.ne (by simp : (0 : Fin (n + 2)) ≠ 1)
+  have h01 := s.independent.injective.ne (by simp : (0 : Fin (n + 2)) ≠ 1)
   simp [hr] at h01
 #align affine.simplex.circumradius_pos Affine.Simplex.circumradius_pos
 
@@ -761,7 +761,7 @@ theorem exists_circumradius_eq_of_cospherical_subset {s : AffineSubspace ℝ P}
   intro sx hsxps
   have hsx : affineSpan ℝ (Set.range sx.points) = s := by
     refine'
-      sx.Independent.affineSpan_eq_of_le_of_card_eq_finrank_add_one
+      sx.independent.affineSpan_eq_of_le_of_card_eq_finrank_add_one
         (spanPoints_subset_coe_of_subset_coe (hsxps.trans h)) _
     simp [hd]
   have hc : c ∈ affineSpan ℝ (Set.range sx.points) := hsx.symm ▸ hc
@@ -813,7 +813,7 @@ theorem exists_circumcenter_eq_of_cospherical_subset {s : AffineSubspace ℝ P}
   intro sx hsxps
   have hsx : affineSpan ℝ (Set.range sx.points) = s := by
     refine'
-      sx.Independent.affineSpan_eq_of_le_of_card_eq_finrank_add_one
+      sx.independent.affineSpan_eq_of_le_of_card_eq_finrank_add_one
         (spanPoints_subset_coe_of_subset_coe (hsxps.trans h)) _
     simp [hd]
   have hc : c ∈ affineSpan ℝ (Set.range sx.points) := hsx.symm ▸ hc
chore: remove unused simps (#6632)

Co-authored-by: Eric Wieser <wieser.eric@gmail.com>

Diff
@@ -203,12 +203,12 @@ theorem _root_.AffineIndependent.existsUnique_dist_eq {ι : Type*} [hne : Nonemp
       use ⟨p i, 0⟩
       simp only [Set.range_unique, AffineSubspace.mem_affineSpan_singleton]
       constructor
-      · simp_rw [hi default, Set.singleton_subset_iff, Sphere.mem_coe, mem_sphere, dist_self]
+      · simp_rw [hi default, Set.singleton_subset_iff]
         exact ⟨⟨⟩, by simp only [Metric.sphere_zero, Set.mem_singleton_iff]⟩
       · rintro ⟨cc, cr⟩
         simp only
         rintro ⟨rfl, hdist⟩
-        simp [Set.singleton_subset_iff, Sphere.mem_coe, mem_sphere, dist_self] at hdist
+        simp [Set.singleton_subset_iff] at hdist
         rw [hi default, hdist]
     · have i := hne.some
       let ι2 := { x // x ≠ i }
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
@@ -40,7 +40,7 @@ open RealInnerProductSpace
 
 namespace EuclideanGeometry
 
-variable {V : Type _} {P : Type _} [NormedAddCommGroup V] [InnerProductSpace ℝ V] [MetricSpace P]
+variable {V : Type*} {P : Type*} [NormedAddCommGroup V] [InnerProductSpace ℝ V] [MetricSpace P]
   [NormedAddTorsor V P]
 
 open AffineSubspace
@@ -187,7 +187,7 @@ theorem existsUnique_dist_eq_of_insert {s : AffineSubspace ℝ P}
 /-- Given a finite nonempty affinely independent family of points,
 there is a unique (circumcenter, circumradius) pair for those points
 in the affine subspace they span. -/
-theorem _root_.AffineIndependent.existsUnique_dist_eq {ι : Type _} [hne : Nonempty ι] [Finite ι]
+theorem _root_.AffineIndependent.existsUnique_dist_eq {ι : Type*} [hne : Nonempty ι] [Finite ι]
     {p : ι → P} (ha : AffineIndependent ℝ p) :
     ∃! cs : Sphere P, cs.center ∈ affineSpan ℝ (Set.range p) ∧ Set.range p ⊆ (cs : Set P) := by
   cases nonempty_fintype ι
@@ -245,7 +245,7 @@ namespace Simplex
 
 open Finset AffineSubspace EuclideanGeometry
 
-variable {V : Type _} {P : Type _} [NormedAddCommGroup V] [InnerProductSpace ℝ V] [MetricSpace P]
+variable {V : Type*} {P : Type*} [NormedAddCommGroup V] [InnerProductSpace ℝ V] [MetricSpace P]
   [NormedAddTorsor V P]
 
 /-- The circumsphere of a simplex. -/
@@ -534,7 +534,7 @@ def pointIndexEmbedding (n : ℕ) : Fin (n + 1) ↪ PointsWithCircumcenterIndex
 #align affine.simplex.point_index_embedding Affine.Simplex.pointIndexEmbedding
 
 /-- The sum of a function over `PointsWithCircumcenterIndex`. -/
-theorem sum_pointsWithCircumcenter {α : Type _} [AddCommMonoid α] {n : ℕ}
+theorem sum_pointsWithCircumcenter {α : Type*} [AddCommMonoid α] {n : ℕ}
     (f : PointsWithCircumcenterIndex n → α) :
     ∑ i, f i = (∑ i : Fin (n + 1), f (point_index i)) + f circumcenter_index := by
   have h : univ = insert circumcenter_index (univ.map (pointIndexEmbedding n)) := by
@@ -723,7 +723,7 @@ namespace EuclideanGeometry
 
 open Affine AffineSubspace FiniteDimensional
 
-variable {V : Type _} {P : Type _} [NormedAddCommGroup V] [InnerProductSpace ℝ V] [MetricSpace P]
+variable {V : Type*} {P : Type*} [NormedAddCommGroup V] [InnerProductSpace ℝ V] [MetricSpace P]
   [NormedAddTorsor V P]
 
 /-- Given a nonempty affine subspace, whose direction is complete,
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
-
-! This file was ported from Lean 3 source module geometry.euclidean.circumcenter
-! 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.Geometry.Euclidean.Sphere.Basic
 import Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional
 import Mathlib.Tactic.DeriveFintype
 
+#align_import geometry.euclidean.circumcenter from "leanprover-community/mathlib"@"2de9c37fa71dde2f1c6feff19876dd6a7b1519f0"
+
 /-!
 # Circumcenter and circumradius
 
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
@@ -51,7 +51,7 @@ open AffineSubspace
 /-- `p` is equidistant from two points in `s` if and only if its
 `orthogonalProjection` is. -/
 theorem dist_eq_iff_dist_orthogonalProjection_eq {s : AffineSubspace ℝ P} [Nonempty s]
-    [CompleteSpace s.direction] {p1 p2 : P} (p3 : P) (hp1 : p1 ∈ s) (hp2 : p2 ∈ s) :
+    [HasOrthogonalProjection s.direction] {p1 p2 : P} (p3 : P) (hp1 : p1 ∈ s) (hp2 : p2 ∈ s) :
     dist p1 p3 = dist p2 p3 ↔
       dist p1 (orthogonalProjection s p3) = dist p2 (orthogonalProjection s p3) := by
   rw [← mul_self_inj_of_nonneg dist_nonneg dist_nonneg, ←
@@ -64,7 +64,7 @@ theorem dist_eq_iff_dist_orthogonalProjection_eq {s : AffineSubspace ℝ P} [Non
 /-- `p` is equidistant from a set of points in `s` if and only if its
 `orthogonalProjection` is. -/
 theorem dist_set_eq_iff_dist_orthogonalProjection_eq {s : AffineSubspace ℝ P} [Nonempty s]
-    [CompleteSpace s.direction] {ps : Set P} (hps : ps ⊆ s) (p : P) :
+    [HasOrthogonalProjection s.direction] {ps : Set P} (hps : ps ⊆ s) (p : P) :
     (Set.Pairwise ps fun p1 p2 => dist p1 p = dist p2 p) ↔
       Set.Pairwise ps fun p1 p2 =>
         dist p1 (orthogonalProjection s p) = dist p2 (orthogonalProjection s p) :=
@@ -79,7 +79,7 @@ points of a set of points in `s` if and only if there exists (possibly
 different) `r` such that its `orthogonalProjection` has that distance
 from all the points in that set. -/
 theorem exists_dist_eq_iff_exists_dist_orthogonalProjection_eq {s : AffineSubspace ℝ P} [Nonempty s]
-    [CompleteSpace s.direction] {ps : Set P} (hps : ps ⊆ s) (p : P) :
+    [HasOrthogonalProjection s.direction] {ps : Set P} (hps : ps ⊆ s) (p : P) :
     (∃ r, ∀ p1 ∈ ps, dist p1 p = r) ↔ ∃ r, ∀ p1 ∈ ps, dist p1 ↑(orthogonalProjection s p) = r := by
   have h := dist_set_eq_iff_dist_orthogonalProjection_eq hps p
   simp_rw [Set.pairwise_eq_iff_exists_eq] at h
@@ -93,9 +93,9 @@ subspace whose direction is complete, such that there is a unique
 and a point `p` not in that subspace, there is a unique (circumcenter,
 circumradius) pair for the set with `p` added, in the span of the
 subspace with `p` added. -/
-theorem existsUnique_dist_eq_of_insert {s : AffineSubspace ℝ P} [CompleteSpace s.direction]
-    {ps : Set P} (hnps : ps.Nonempty) {p : P} (hps : ps ⊆ s) (hp : p ∉ s)
-    (hu : ∃! cs : Sphere P, cs.center ∈ s ∧ ps ⊆ (cs : Set P)) :
+theorem existsUnique_dist_eq_of_insert {s : AffineSubspace ℝ P}
+    [HasOrthogonalProjection s.direction] {ps : Set P} (hnps : ps.Nonempty) {p : P} (hps : ps ⊆ s)
+    (hp : p ∉ s) (hu : ∃! cs : Sphere P, cs.center ∈ s ∧ ps ⊆ (cs : Set P)) :
     ∃! cs₂ : Sphere P,
       cs₂.center ∈ affineSpan ℝ (insert p (s : Set P)) ∧ insert p ps ⊆ (cs₂ : Set P) := by
   haveI : Nonempty s := Set.Nonempty.to_subtype (hnps.mono hps)
@@ -733,7 +733,7 @@ variable {V : Type _} {P : Type _} [NormedAddCommGroup V] [InnerProductSpace ℝ
 that contains a set of points, those points are cospherical if and
 only if they are equidistant from some point in that subspace. -/
 theorem cospherical_iff_exists_mem_of_complete {s : AffineSubspace ℝ P} {ps : Set P} (h : ps ⊆ s)
-    [Nonempty s] [CompleteSpace s.direction] :
+    [Nonempty s] [HasOrthogonalProjection s.direction] :
     Cospherical ps ↔ ∃ center ∈ s, ∃ radius : ℝ, ∀ p ∈ ps, dist p center = radius := by
   constructor
   · rintro ⟨c, hcr⟩
fix: precedence of , and abs (#5619)
Diff
@@ -161,7 +161,7 @@ theorem existsUnique_dist_eq_of_insert {s : AffineSubspace ℝ P} [CompleteSpace
         dist_sq_eq_dist_orthogonalProjection_sq_add_dist_orthogonalProjection_sq _ (hps hp0),
         orthogonalProjection_vadd_smul_vsub_orthogonalProjection _ _ hcc₃', h',
         dist_of_mem_subset_mk_sphere hp0 hcr, dist_eq_norm_vsub V _ cc, vadd_vsub, norm_smul, ←
-        dist_eq_norm_vsub V p, Real.norm_eq_abs, ← mul_assoc, mul_comm _ (|t₃|), ← mul_assoc,
+        dist_eq_norm_vsub V p, Real.norm_eq_abs, ← mul_assoc, mul_comm _ |t₃|, ← mul_assoc,
         abs_mul_abs_self]
       ring
     replace hcr₃ := dist_of_mem_subset_mk_sphere (Set.mem_insert _ _) hcr₃
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
@@ -539,7 +539,7 @@ def pointIndexEmbedding (n : ℕ) : Fin (n + 1) ↪ PointsWithCircumcenterIndex
 /-- The sum of a function over `PointsWithCircumcenterIndex`. -/
 theorem sum_pointsWithCircumcenter {α : Type _} [AddCommMonoid α] {n : ℕ}
     (f : PointsWithCircumcenterIndex n → α) :
-    (∑ i, f i) = (∑ i : Fin (n + 1), f (point_index i)) + f circumcenter_index := by
+    ∑ i, f i = (∑ i : Fin (n + 1), f (point_index i)) + f circumcenter_index := by
   have h : univ = insert circumcenter_index (univ.map (pointIndexEmbedding n)) := by
     ext x
     refine' ⟨fun h => _, fun _ => mem_univ _⟩
@@ -585,7 +585,7 @@ def pointWeightsWithCircumcenter {n : ℕ} (i : Fin (n + 1)) : PointsWithCircumc
 /-- `point_weights_with_circumcenter` sums to 1. -/
 @[simp]
 theorem sum_pointWeightsWithCircumcenter {n : ℕ} (i : Fin (n + 1)) :
-    (∑ j, pointWeightsWithCircumcenter i j) = 1 := by
+    ∑ j, pointWeightsWithCircumcenter i j = 1 := by
   convert sum_ite_eq' univ (point_index i) (Function.const _ (1 : ℝ)) with j
   · cases j <;> simp [pointWeightsWithCircumcenter]
   · simp
@@ -620,7 +620,7 @@ def centroidWeightsWithCircumcenter {n : ℕ} (fs : Finset (Fin (n + 1))) :
 /-- `centroidWeightsWithCircumcenter` sums to 1, if the `Finset` is nonempty. -/
 @[simp]
 theorem sum_centroidWeightsWithCircumcenter {n : ℕ} {fs : Finset (Fin (n + 1))} (h : fs.Nonempty) :
-    (∑ i, centroidWeightsWithCircumcenter fs i) = 1 := by
+    ∑ i, centroidWeightsWithCircumcenter fs i = 1 := by
   simp_rw [sum_pointsWithCircumcenter, centroidWeightsWithCircumcenter, add_zero, ←
     fs.sum_centroidWeights_eq_one_of_nonempty ℝ h, Set.sum_indicator_subset _ fs.subset_univ]
   rcongr
@@ -651,7 +651,7 @@ def circumcenterWeightsWithCircumcenter (n : ℕ) : PointsWithCircumcenterIndex
 /-- `circumcenterWeightsWithCircumcenter` sums to 1. -/
 @[simp]
 theorem sum_circumcenterWeightsWithCircumcenter (n : ℕ) :
-    (∑ i, circumcenterWeightsWithCircumcenter n i) = 1 := by
+    ∑ i, circumcenterWeightsWithCircumcenter n i = 1 := by
   convert sum_ite_eq' univ circumcenter_index (Function.const _ (1 : ℝ)) with j
   · cases j <;> simp [circumcenterWeightsWithCircumcenter]
   · simp
@@ -679,7 +679,7 @@ def reflectionCircumcenterWeightsWithCircumcenter {n : ℕ} (i₁ i₂ : Fin (n
 /-- `reflectionCircumcenterWeightsWithCircumcenter` sums to 1. -/
 @[simp]
 theorem sum_reflectionCircumcenterWeightsWithCircumcenter {n : ℕ} {i₁ i₂ : Fin (n + 1)}
-    (h : i₁ ≠ i₂) : (∑ i, reflectionCircumcenterWeightsWithCircumcenter i₁ i₂ i) = 1 := by
+    (h : i₁ ≠ i₂) : ∑ i, reflectionCircumcenterWeightsWithCircumcenter i₁ i₂ i = 1 := by
   simp_rw [sum_pointsWithCircumcenter, reflectionCircumcenterWeightsWithCircumcenter, sum_ite,
     sum_const, filter_or, filter_eq']
   rw [card_union_eq]
chore: tidy various files (#5469)

Co-authored-by: Scott Morrison <scott@tqft.net>

Diff
@@ -130,8 +130,7 @@ theorem existsUnique_dist_eq_of_insert {s : AffineSubspace ℝ P} [CompleteSpace
           ← dist_eq_norm_vsub V p, dist_comm _ cc]
         field_simp [hy0]
         ring
-      ·
-        rw [dist_sq_eq_dist_orthogonalProjection_sq_add_dist_orthogonalProjection_sq _ (hps hp1),
+      · rw [dist_sq_eq_dist_orthogonalProjection_sq_add_dist_orthogonalProjection_sq _ (hps hp1),
           orthogonalProjection_vadd_smul_vsub_orthogonalProjection _ _ hcc, Subtype.coe_mk,
           dist_of_mem_subset_mk_sphere hp1 hcr, dist_eq_norm_vsub V cc₂ cc, vadd_vsub, norm_smul, ←
           dist_eq_norm_vsub V, Real.norm_eq_abs, abs_div, abs_of_nonneg dist_nonneg,
@@ -395,7 +394,7 @@ theorem circumcenter_eq_centroid (s : Simplex ℝ P 1) :
         hr i (Set.mem_univ _)).symm
 #align affine.simplex.circumcenter_eq_centroid Affine.Simplex.circumcenter_eq_centroid
 
-/-- Reindexing a simplex along an `equiv` of index types does not change the circumsphere. -/
+/-- Reindexing a simplex along an `Equiv` of index types does not change the circumsphere. -/
 @[simp]
 theorem circumsphere_reindex {m n : ℕ} (s : Simplex ℝ P m) (e : Fin (m + 1) ≃ Fin (n + 1)) :
     (s.reindex e).circumsphere = s.circumsphere := by
@@ -404,13 +403,13 @@ theorem circumsphere_reindex {m n : ℕ} (s : Simplex ℝ P m) (e : Fin (m + 1)
   · exact (s.reindex e).circumsphere_unique_dist_eq.1.2
 #align affine.simplex.circumsphere_reindex Affine.Simplex.circumsphere_reindex
 
-/-- Reindexing a simplex along an `equiv` of index types does not change the circumcenter. -/
+/-- Reindexing a simplex along an `Equiv` of index types does not change the circumcenter. -/
 @[simp]
 theorem circumcenter_reindex {m n : ℕ} (s : Simplex ℝ P m) (e : Fin (m + 1) ≃ Fin (n + 1)) :
     (s.reindex e).circumcenter = s.circumcenter := by simp_rw [circumcenter, circumsphere_reindex]
 #align affine.simplex.circumcenter_reindex Affine.Simplex.circumcenter_reindex
 
-/-- Reindexing a simplex along an `equiv` of index types does not change the circumradius. -/
+/-- Reindexing a simplex along an `Equiv` of index types does not change the circumradius. -/
 @[simp]
 theorem circumradius_reindex {m n : ℕ} (s : Simplex ℝ P m) (e : Fin (m + 1) ≃ Fin (n + 1)) :
     (s.reindex e).circumradius = s.circumradius := by simp_rw [circumradius, circumsphere_reindex]
@@ -618,8 +617,7 @@ def centroidWeightsWithCircumcenter {n : ℕ} (fs : Finset (Fin (n + 1))) :
   | circumcenter_index => 0
 #align affine.simplex.centroid_weights_with_circumcenter Affine.Simplex.centroidWeightsWithCircumcenter
 
-/-- `centroid_weights_with_circumcenter` sums to 1, if the `finset` is
-nonempty. -/
+/-- `centroidWeightsWithCircumcenter` sums to 1, if the `Finset` is nonempty. -/
 @[simp]
 theorem sum_centroidWeightsWithCircumcenter {n : ℕ} {fs : Finset (Fin (n + 1))} (h : fs.Nonempty) :
     (∑ i, centroidWeightsWithCircumcenter fs i) = 1 := by
@@ -628,8 +626,7 @@ theorem sum_centroidWeightsWithCircumcenter {n : ℕ} {fs : Finset (Fin (n + 1))
   rcongr
 #align affine.simplex.sum_centroid_weights_with_circumcenter Affine.Simplex.sum_centroidWeightsWithCircumcenter
 
-/-- The centroid of some vertices of a simplex, in terms of
-`pointsWithCircumcenter`. -/
+/-- The centroid of some vertices of a simplex, in terms of `pointsWithCircumcenter`. -/
 theorem centroid_eq_affineCombination_of_pointsWithCircumcenter {n : ℕ} (s : Simplex ℝ P n)
     (fs : Finset (Fin (n + 1))) :
     fs.centroid ℝ s.points =
@@ -645,8 +642,7 @@ theorem centroid_eq_affineCombination_of_pointsWithCircumcenter {n : ℕ} (s : S
   congr
 #align affine.simplex.centroid_eq_affine_combination_of_points_with_circumcenter Affine.Simplex.centroid_eq_affineCombination_of_pointsWithCircumcenter
 
-/-- The weights for the circumcenter of a simplex, in terms of
-`pointsWithCircumcenter`. -/
+/-- The weights for the circumcenter of a simplex, in terms of `pointsWithCircumcenter`. -/
 def circumcenterWeightsWithCircumcenter (n : ℕ) : PointsWithCircumcenterIndex n → ℝ
   | point_index _ => 0
   | circumcenter_index => 1
@@ -661,8 +657,7 @@ theorem sum_circumcenterWeightsWithCircumcenter (n : ℕ) :
   · simp
 #align affine.simplex.sum_circumcenter_weights_with_circumcenter Affine.Simplex.sum_circumcenterWeightsWithCircumcenter
 
-/-- The circumcenter of a simplex, in terms of
-`pointsWithCircumcenter`. -/
+/-- The circumcenter of a simplex, in terms of `pointsWithCircumcenter`. -/
 theorem circumcenter_eq_affineCombination_of_pointsWithCircumcenter {n : ℕ} (s : Simplex ℝ P n) :
     s.circumcenter =
       (univ : Finset (PointsWithCircumcenterIndex n)).affineCombination ℝ s.pointsWithCircumcenter
feat: port Geometry.Euclidean.Circumcenter (#4446)

Co-authored-by: Ruben Van de Velde <65514131+Ruben-VandeVelde@users.noreply.github.com> Co-authored-by: qawbecrdtey <qawbecrdtey@naver.com> Co-authored-by: Moritz Firsching <firsching@google.com>

Dependencies 12 + 874

875 files ported (98.6%)
389902 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