geometry.euclidean.inversionMathlib.Geometry.Euclidean.Inversion.Basic

This file has been ported!

Changes since the initial port

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

Changes in mathlib3

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(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
@@ -101,7 +101,7 @@ theorem inversion_inversion (c : P) {R : ℝ} (hR : R ≠ 0) (x : P) :
   rcases eq_or_ne x c with (rfl | hne)
   · rw [inversion_self, inversion_self]
   · rw [inversion, dist_inversion_center, inversion_vsub_center, smul_smul, ← mul_pow,
-      div_mul_div_comm, div_mul_cancel _ (dist_ne_zero.2 hne), ← sq, div_self, one_pow, one_smul,
+      div_mul_div_comm, div_mul_cancel₀ _ (dist_ne_zero.2 hne), ← sq, div_self, one_pow, one_smul,
       vsub_vadd]
     exact pow_ne_zero _ hR
 #align euclidean_geometry.inversion_inversion EuclideanGeometry.inversion_inversion
Diff
@@ -162,8 +162,8 @@ theorem mul_dist_le_mul_dist_add_mul_dist (a b c d : P) :
     `euclidean_geometry.inversion a 1 c`, and `euclidean_geometry.inversion a 1 d`. -/
   have H := dist_triangle (inversion a 1 b) (inversion a 1 c) (inversion a 1 d)
   rw [dist_inversion_inversion hb hd, dist_inversion_inversion hb hc,
-    dist_inversion_inversion hc hd, one_pow] at H 
-  rw [← dist_pos] at hb hc hd 
+    dist_inversion_inversion hc hd, one_pow] at H
+  rw [← dist_pos] at hb hc hd
   rw [← div_le_div_right (mul_pos hb (mul_pos hc hd))]
   convert H <;> · field_simp [hb.ne', hc.ne', hd.ne', dist_comm a]; ring
 #align euclidean_geometry.mul_dist_le_mul_dist_add_mul_dist EuclideanGeometry.mul_dist_le_mul_dist_add_mul_dist
Diff
@@ -3,7 +3,7 @@ Copyright (c) 2022 Yury G. Kudryashov. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yury G. Kudryashov
 -/
-import Mathbin.Analysis.InnerProductSpace.Basic
+import Analysis.InnerProductSpace.Basic
 
 #align_import geometry.euclidean.inversion from "leanprover-community/mathlib"@"0b7c740e25651db0ba63648fbae9f9d6f941e31b"
 
Diff
@@ -2,14 +2,11 @@
 Copyright (c) 2022 Yury G. Kudryashov. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yury G. Kudryashov
-
-! This file was ported from Lean 3 source module geometry.euclidean.inversion
-! leanprover-community/mathlib commit 0b7c740e25651db0ba63648fbae9f9d6f941e31b
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Analysis.InnerProductSpace.Basic
 
+#align_import geometry.euclidean.inversion from "leanprover-community/mathlib"@"0b7c740e25651db0ba63648fbae9f9d6f941e31b"
+
 /-!
 # Inversion in an affine space
 
Diff
@@ -38,8 +38,6 @@ namespace EuclideanGeometry
 variable {V P : Type _} [NormedAddCommGroup V] [InnerProductSpace ℝ V] [MetricSpace P]
   [NormedAddTorsor V P] {a b c d x y z : P} {R : ℝ}
 
-include V
-
 #print EuclideanGeometry.inversion /-
 /-- Inversion in a sphere in an affine space. This map sends each point `x` to the point `y` such
 that `y -ᵥ c = (R / dist x c) ^ 2 • (x -ᵥ c)`, where `c` and `R` are the center and the radius the
@@ -49,10 +47,12 @@ def inversion (c : P) (R : ℝ) (x : P) : P :=
 #align euclidean_geometry.inversion EuclideanGeometry.inversion
 -/
 
+#print EuclideanGeometry.inversion_vsub_center /-
 theorem inversion_vsub_center (c : P) (R : ℝ) (x : P) :
     inversion c R x -ᵥ c = (R / dist x c) ^ 2 • (x -ᵥ c) :=
   vadd_vsub _ _
 #align euclidean_geometry.inversion_vsub_center EuclideanGeometry.inversion_vsub_center
+-/
 
 #print EuclideanGeometry.inversion_self /-
 @[simp]
@@ -77,6 +77,7 @@ theorem inversion_of_mem_sphere (h : x ∈ Metric.sphere c R) : inversion c R x
 #align euclidean_geometry.inversion_of_mem_sphere EuclideanGeometry.inversion_of_mem_sphere
 -/
 
+#print EuclideanGeometry.dist_inversion_center /-
 /-- Distance from the image of a point under inversion to the center. This formula accidentally
 works for `x = c`. -/
 theorem dist_inversion_center (c x : P) (R : ℝ) : dist (inversion c R x) c = R ^ 2 / dist x c :=
@@ -85,13 +86,17 @@ theorem dist_inversion_center (c x : P) (R : ℝ) : dist (inversion c R x) c = R
   have : dist x c ≠ 0 := dist_ne_zero.2 hx
   field_simp [inversion, norm_smul, abs_div, ← dist_eq_norm_vsub, sq, mul_assoc]
 #align euclidean_geometry.dist_inversion_center EuclideanGeometry.dist_inversion_center
+-/
 
+#print EuclideanGeometry.dist_center_inversion /-
 /-- Distance from the center of an inversion to the image of a point under the inversion. This
 formula accidentally works for `x = c`. -/
 theorem dist_center_inversion (c x : P) (R : ℝ) : dist c (inversion c R x) = R ^ 2 / dist c x := by
   rw [dist_comm c, dist_comm c, dist_inversion_center]
 #align euclidean_geometry.dist_center_inversion EuclideanGeometry.dist_center_inversion
+-/
 
+#print EuclideanGeometry.inversion_inversion /-
 @[simp]
 theorem inversion_inversion (c : P) {R : ℝ} (hR : R ≠ 0) (x : P) :
     inversion c R (inversion c R x) = x :=
@@ -103,23 +108,33 @@ theorem inversion_inversion (c : P) {R : ℝ} (hR : R ≠ 0) (x : P) :
       vsub_vadd]
     exact pow_ne_zero _ hR
 #align euclidean_geometry.inversion_inversion EuclideanGeometry.inversion_inversion
+-/
 
+#print EuclideanGeometry.inversion_involutive /-
 theorem inversion_involutive (c : P) {R : ℝ} (hR : R ≠ 0) : Involutive (inversion c R) :=
   inversion_inversion c hR
 #align euclidean_geometry.inversion_involutive EuclideanGeometry.inversion_involutive
+-/
 
+#print EuclideanGeometry.inversion_surjective /-
 theorem inversion_surjective (c : P) {R : ℝ} (hR : R ≠ 0) : Surjective (inversion c R) :=
   (inversion_involutive c hR).Surjective
 #align euclidean_geometry.inversion_surjective EuclideanGeometry.inversion_surjective
+-/
 
+#print EuclideanGeometry.inversion_injective /-
 theorem inversion_injective (c : P) {R : ℝ} (hR : R ≠ 0) : Injective (inversion c R) :=
   (inversion_involutive c hR).Injective
 #align euclidean_geometry.inversion_injective EuclideanGeometry.inversion_injective
+-/
 
+#print EuclideanGeometry.inversion_bijective /-
 theorem inversion_bijective (c : P) {R : ℝ} (hR : R ≠ 0) : Bijective (inversion c R) :=
   (inversion_involutive c hR).Bijective
 #align euclidean_geometry.inversion_bijective EuclideanGeometry.inversion_bijective
+-/
 
+#print EuclideanGeometry.dist_inversion_inversion /-
 /-- Distance between the images of two points under an inversion. -/
 theorem dist_inversion_inversion (hx : x ≠ c) (hy : y ≠ c) (R : ℝ) :
     dist (inversion c R x) (inversion c R y) = R ^ 2 / (dist x c * dist y c) * dist x y :=
@@ -129,7 +144,9 @@ theorem dist_inversion_inversion (hx : x ≠ c) (hy : y ≠ c) (R : ℝ) :
   simpa only [dist_vsub_cancel_right] using
     dist_div_norm_sq_smul (vsub_ne_zero.2 hx) (vsub_ne_zero.2 hy) R
 #align euclidean_geometry.dist_inversion_inversion EuclideanGeometry.dist_inversion_inversion
+-/
 
+#print EuclideanGeometry.mul_dist_le_mul_dist_add_mul_dist /-
 /-- **Ptolemy's inequality**: in a quadrangle `ABCD`, `|AC| * |BD| ≤ |AB| * |CD| + |BC| * |AD|`. If
 `ABCD` is a convex cyclic polygon, then this inequality becomes an equality, see
 `euclidean_geometry.mul_dist_add_mul_dist_eq_mul_dist_of_cospherical`.  -/
@@ -153,6 +170,7 @@ theorem mul_dist_le_mul_dist_add_mul_dist (a b c d : P) :
   rw [← div_le_div_right (mul_pos hb (mul_pos hc hd))]
   convert H <;> · field_simp [hb.ne', hc.ne', hd.ne', dist_comm a]; ring
 #align euclidean_geometry.mul_dist_le_mul_dist_add_mul_dist EuclideanGeometry.mul_dist_le_mul_dist_add_mul_dist
+-/
 
 end EuclideanGeometry
 
Diff
@@ -148,10 +148,10 @@ theorem mul_dist_le_mul_dist_add_mul_dist (a b c d : P) :
     `euclidean_geometry.inversion a 1 c`, and `euclidean_geometry.inversion a 1 d`. -/
   have H := dist_triangle (inversion a 1 b) (inversion a 1 c) (inversion a 1 d)
   rw [dist_inversion_inversion hb hd, dist_inversion_inversion hb hc,
-    dist_inversion_inversion hc hd, one_pow] at H
-  rw [← dist_pos] at hb hc hd
+    dist_inversion_inversion hc hd, one_pow] at H 
+  rw [← dist_pos] at hb hc hd 
   rw [← div_le_div_right (mul_pos hb (mul_pos hc hd))]
-  convert H <;> · field_simp [hb.ne', hc.ne', hd.ne', dist_comm a] ; ring
+  convert H <;> · field_simp [hb.ne', hc.ne', hd.ne', dist_comm a]; ring
 #align euclidean_geometry.mul_dist_le_mul_dist_add_mul_dist EuclideanGeometry.mul_dist_le_mul_dist_add_mul_dist
 
 end EuclideanGeometry
Diff
@@ -49,12 +49,6 @@ def inversion (c : P) (R : ℝ) (x : P) : P :=
 #align euclidean_geometry.inversion EuclideanGeometry.inversion
 -/
 
-/- warning: euclidean_geometry.inversion_vsub_center -> EuclideanGeometry.inversion_vsub_center is a dubious translation:
-lean 3 declaration is
-  forall {V : Type.{u1}} {P : Type.{u2}} [_inst_1 : NormedAddCommGroup.{u1} V] [_inst_2 : InnerProductSpace.{0, u1} Real V Real.isROrC _inst_1] [_inst_3 : MetricSpace.{u2} P] [_inst_4 : NormedAddTorsor.{u1, u2} V P (NormedAddCommGroup.toSeminormedAddCommGroup.{u1} V _inst_1) (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)] (c : P) (R : Real) (x : P), Eq.{succ u1} V (VSub.vsub.{u1, u2} V P (AddTorsor.toHasVsub.{u1, u2} V P (NormedAddGroup.toAddGroup.{u1} V (NormedAddCommGroup.toNormedAddGroup.{u1} V _inst_1)) (NormedAddTorsor.toAddTorsor'.{u1, u2} V P _inst_1 _inst_3 _inst_4)) (EuclideanGeometry.inversion.{u1, u2} V P _inst_1 _inst_2 _inst_3 _inst_4 c R x) c) (SMul.smul.{0, u1} Real V (SMulZeroClass.toHasSmul.{0, u1} Real V (AddZeroClass.toHasZero.{u1} V (AddMonoid.toAddZeroClass.{u1} V (AddCommMonoid.toAddMonoid.{u1} V (AddCommGroup.toAddCommMonoid.{u1} V (SeminormedAddCommGroup.toAddCommGroup.{u1} V (NormedAddCommGroup.toSeminormedAddCommGroup.{u1} V _inst_1)))))) (SMulWithZero.toSmulZeroClass.{0, u1} Real V (MulZeroClass.toHasZero.{0} Real (MulZeroOneClass.toMulZeroClass.{0} Real (MonoidWithZero.toMulZeroOneClass.{0} Real (Semiring.toMonoidWithZero.{0} Real (Ring.toSemiring.{0} Real (NormedRing.toRing.{0} Real (NormedCommRing.toNormedRing.{0} Real (NormedField.toNormedCommRing.{0} Real (DenselyNormedField.toNormedField.{0} Real (IsROrC.toDenselyNormedField.{0} Real Real.isROrC)))))))))) (AddZeroClass.toHasZero.{u1} V (AddMonoid.toAddZeroClass.{u1} V (AddCommMonoid.toAddMonoid.{u1} V (AddCommGroup.toAddCommMonoid.{u1} V (SeminormedAddCommGroup.toAddCommGroup.{u1} V (NormedAddCommGroup.toSeminormedAddCommGroup.{u1} V _inst_1)))))) (MulActionWithZero.toSMulWithZero.{0, u1} Real V (Semiring.toMonoidWithZero.{0} Real (Ring.toSemiring.{0} Real (NormedRing.toRing.{0} Real (NormedCommRing.toNormedRing.{0} Real (NormedField.toNormedCommRing.{0} Real (DenselyNormedField.toNormedField.{0} Real (IsROrC.toDenselyNormedField.{0} Real Real.isROrC))))))) (AddZeroClass.toHasZero.{u1} V (AddMonoid.toAddZeroClass.{u1} V (AddCommMonoid.toAddMonoid.{u1} V (AddCommGroup.toAddCommMonoid.{u1} V (SeminormedAddCommGroup.toAddCommGroup.{u1} V (NormedAddCommGroup.toSeminormedAddCommGroup.{u1} V _inst_1)))))) (Module.toMulActionWithZero.{0, u1} Real V (Ring.toSemiring.{0} Real (NormedRing.toRing.{0} Real (NormedCommRing.toNormedRing.{0} Real (NormedField.toNormedCommRing.{0} Real (DenselyNormedField.toNormedField.{0} Real (IsROrC.toDenselyNormedField.{0} Real Real.isROrC)))))) (AddCommGroup.toAddCommMonoid.{u1} V (SeminormedAddCommGroup.toAddCommGroup.{u1} V (NormedAddCommGroup.toSeminormedAddCommGroup.{u1} V _inst_1))) (NormedSpace.toModule.{0, u1} Real V (DenselyNormedField.toNormedField.{0} Real (IsROrC.toDenselyNormedField.{0} Real Real.isROrC)) (NormedAddCommGroup.toSeminormedAddCommGroup.{u1} V _inst_1) (InnerProductSpace.toNormedSpace.{0, u1} Real V Real.isROrC _inst_1 _inst_2)))))) (HPow.hPow.{0, 0, 0} Real Nat Real (instHPow.{0, 0} Real Nat (Monoid.Pow.{0} Real Real.monoid)) (HDiv.hDiv.{0, 0, 0} Real Real Real (instHDiv.{0} Real (DivInvMonoid.toHasDiv.{0} Real (DivisionRing.toDivInvMonoid.{0} Real Real.divisionRing))) R (Dist.dist.{u2} P (PseudoMetricSpace.toHasDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) x c)) (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) (VSub.vsub.{u1, u2} V P (AddTorsor.toHasVsub.{u1, u2} V P (NormedAddGroup.toAddGroup.{u1} V (NormedAddCommGroup.toNormedAddGroup.{u1} V _inst_1)) (NormedAddTorsor.toAddTorsor'.{u1, u2} V P _inst_1 _inst_3 _inst_4)) x c))
-but is expected to have type
-  forall {V : Type.{u2}} {P : Type.{u1}} [_inst_1 : NormedAddCommGroup.{u2} V] [_inst_2 : InnerProductSpace.{0, u2} Real V Real.isROrC _inst_1] [_inst_3 : MetricSpace.{u1} P] [_inst_4 : NormedAddTorsor.{u2, u1} V P (NormedAddCommGroup.toSeminormedAddCommGroup.{u2} V _inst_1) (MetricSpace.toPseudoMetricSpace.{u1} P _inst_3)] (c : P) (R : Real) (x : P), Eq.{succ u2} V (VSub.vsub.{u2, u1} V P (AddTorsor.toVSub.{u2, u1} V P (SeminormedAddGroup.toAddGroup.{u2} V (SeminormedAddCommGroup.toSeminormedAddGroup.{u2} V (NormedAddCommGroup.toSeminormedAddCommGroup.{u2} V _inst_1))) (NormedAddTorsor.toAddTorsor.{u2, u1} V P (NormedAddCommGroup.toSeminormedAddCommGroup.{u2} V _inst_1) (MetricSpace.toPseudoMetricSpace.{u1} P _inst_3) _inst_4)) (EuclideanGeometry.inversion.{u2, u1} V P _inst_1 _inst_2 _inst_3 _inst_4 c R x) c) (HSMul.hSMul.{0, u2, u2} Real V V (instHSMul.{0, u2} Real V (SMulZeroClass.toSMul.{0, u2} Real V (NegZeroClass.toZero.{u2} V (SubNegZeroMonoid.toNegZeroClass.{u2} V (SubtractionMonoid.toSubNegZeroMonoid.{u2} V (SubtractionCommMonoid.toSubtractionMonoid.{u2} V (AddCommGroup.toDivisionAddCommMonoid.{u2} V (NormedAddCommGroup.toAddCommGroup.{u2} V _inst_1)))))) (SMulWithZero.toSMulZeroClass.{0, u2} Real V Real.instZeroReal (NegZeroClass.toZero.{u2} V (SubNegZeroMonoid.toNegZeroClass.{u2} V (SubtractionMonoid.toSubNegZeroMonoid.{u2} V (SubtractionCommMonoid.toSubtractionMonoid.{u2} V (AddCommGroup.toDivisionAddCommMonoid.{u2} V (NormedAddCommGroup.toAddCommGroup.{u2} V _inst_1)))))) (MulActionWithZero.toSMulWithZero.{0, u2} Real V Real.instMonoidWithZeroReal (NegZeroClass.toZero.{u2} V (SubNegZeroMonoid.toNegZeroClass.{u2} V (SubtractionMonoid.toSubNegZeroMonoid.{u2} V (SubtractionCommMonoid.toSubtractionMonoid.{u2} V (AddCommGroup.toDivisionAddCommMonoid.{u2} V (NormedAddCommGroup.toAddCommGroup.{u2} V _inst_1)))))) (Module.toMulActionWithZero.{0, u2} Real V Real.semiring (AddCommGroup.toAddCommMonoid.{u2} V (NormedAddCommGroup.toAddCommGroup.{u2} V _inst_1)) (NormedSpace.toModule.{0, u2} Real V Real.normedField (NormedAddCommGroup.toSeminormedAddCommGroup.{u2} V _inst_1) (InnerProductSpace.toNormedSpace.{0, u2} Real V Real.isROrC _inst_1 _inst_2))))))) (HPow.hPow.{0, 0, 0} Real Nat Real (instHPow.{0, 0} Real Nat (Monoid.Pow.{0} Real Real.instMonoidReal)) (HDiv.hDiv.{0, 0, 0} Real Real Real (instHDiv.{0} Real (LinearOrderedField.toDiv.{0} Real Real.instLinearOrderedFieldReal)) R (Dist.dist.{u1} P (PseudoMetricSpace.toDist.{u1} P (MetricSpace.toPseudoMetricSpace.{u1} P _inst_3)) x c)) (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) (VSub.vsub.{u2, u1} V P (AddTorsor.toVSub.{u2, u1} V P (SeminormedAddGroup.toAddGroup.{u2} V (SeminormedAddCommGroup.toSeminormedAddGroup.{u2} V (NormedAddCommGroup.toSeminormedAddCommGroup.{u2} V _inst_1))) (NormedAddTorsor.toAddTorsor.{u2, u1} V P (NormedAddCommGroup.toSeminormedAddCommGroup.{u2} V _inst_1) (MetricSpace.toPseudoMetricSpace.{u1} P _inst_3) _inst_4)) x c))
-Case conversion may be inaccurate. Consider using '#align euclidean_geometry.inversion_vsub_center EuclideanGeometry.inversion_vsub_centerₓ'. -/
 theorem inversion_vsub_center (c : P) (R : ℝ) (x : P) :
     inversion c R x -ᵥ c = (R / dist x c) ^ 2 • (x -ᵥ c) :=
   vadd_vsub _ _
@@ -83,12 +77,6 @@ theorem inversion_of_mem_sphere (h : x ∈ Metric.sphere c R) : inversion c R x
 #align euclidean_geometry.inversion_of_mem_sphere EuclideanGeometry.inversion_of_mem_sphere
 -/
 
-/- warning: euclidean_geometry.dist_inversion_center -> EuclideanGeometry.dist_inversion_center is a dubious translation:
-lean 3 declaration is
-  forall {V : Type.{u1}} {P : Type.{u2}} [_inst_1 : NormedAddCommGroup.{u1} V] [_inst_2 : InnerProductSpace.{0, u1} Real V Real.isROrC _inst_1] [_inst_3 : MetricSpace.{u2} P] [_inst_4 : NormedAddTorsor.{u1, u2} V P (NormedAddCommGroup.toSeminormedAddCommGroup.{u1} V _inst_1) (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)] (c : P) (x : P) (R : Real), Eq.{1} Real (Dist.dist.{u2} P (PseudoMetricSpace.toHasDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) (EuclideanGeometry.inversion.{u1, u2} V P _inst_1 _inst_2 _inst_3 _inst_4 c R x) c) (HDiv.hDiv.{0, 0, 0} Real Real Real (instHDiv.{0} Real (DivInvMonoid.toHasDiv.{0} Real (DivisionRing.toDivInvMonoid.{0} Real Real.divisionRing))) (HPow.hPow.{0, 0, 0} Real Nat Real (instHPow.{0, 0} Real Nat (Monoid.Pow.{0} Real Real.monoid)) R (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) (Dist.dist.{u2} P (PseudoMetricSpace.toHasDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) x c))
-but is expected to have type
-  forall {V : Type.{u1}} {P : Type.{u2}} [_inst_1 : NormedAddCommGroup.{u1} V] [_inst_2 : InnerProductSpace.{0, u1} Real V Real.isROrC _inst_1] [_inst_3 : MetricSpace.{u2} P] [_inst_4 : NormedAddTorsor.{u1, u2} V P (NormedAddCommGroup.toSeminormedAddCommGroup.{u1} V _inst_1) (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)] (c : P) (x : P) (R : Real), Eq.{1} Real (Dist.dist.{u2} P (PseudoMetricSpace.toDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) (EuclideanGeometry.inversion.{u1, u2} V P _inst_1 _inst_2 _inst_3 _inst_4 c R x) c) (HDiv.hDiv.{0, 0, 0} Real Real Real (instHDiv.{0} Real (LinearOrderedField.toDiv.{0} Real Real.instLinearOrderedFieldReal)) (HPow.hPow.{0, 0, 0} Real Nat Real (instHPow.{0, 0} Real Nat (Monoid.Pow.{0} Real Real.instMonoidReal)) R (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) (Dist.dist.{u2} P (PseudoMetricSpace.toDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) x c))
-Case conversion may be inaccurate. Consider using '#align euclidean_geometry.dist_inversion_center EuclideanGeometry.dist_inversion_centerₓ'. -/
 /-- Distance from the image of a point under inversion to the center. This formula accidentally
 works for `x = c`. -/
 theorem dist_inversion_center (c x : P) (R : ℝ) : dist (inversion c R x) c = R ^ 2 / dist x c :=
@@ -98,24 +86,12 @@ theorem dist_inversion_center (c x : P) (R : ℝ) : dist (inversion c R x) c = R
   field_simp [inversion, norm_smul, abs_div, ← dist_eq_norm_vsub, sq, mul_assoc]
 #align euclidean_geometry.dist_inversion_center EuclideanGeometry.dist_inversion_center
 
-/- warning: euclidean_geometry.dist_center_inversion -> EuclideanGeometry.dist_center_inversion is a dubious translation:
-lean 3 declaration is
-  forall {V : Type.{u1}} {P : Type.{u2}} [_inst_1 : NormedAddCommGroup.{u1} V] [_inst_2 : InnerProductSpace.{0, u1} Real V Real.isROrC _inst_1] [_inst_3 : MetricSpace.{u2} P] [_inst_4 : NormedAddTorsor.{u1, u2} V P (NormedAddCommGroup.toSeminormedAddCommGroup.{u1} V _inst_1) (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)] (c : P) (x : P) (R : Real), Eq.{1} Real (Dist.dist.{u2} P (PseudoMetricSpace.toHasDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) c (EuclideanGeometry.inversion.{u1, u2} V P _inst_1 _inst_2 _inst_3 _inst_4 c R x)) (HDiv.hDiv.{0, 0, 0} Real Real Real (instHDiv.{0} Real (DivInvMonoid.toHasDiv.{0} Real (DivisionRing.toDivInvMonoid.{0} Real Real.divisionRing))) (HPow.hPow.{0, 0, 0} Real Nat Real (instHPow.{0, 0} Real Nat (Monoid.Pow.{0} Real Real.monoid)) R (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) (Dist.dist.{u2} P (PseudoMetricSpace.toHasDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) c x))
-but is expected to have type
-  forall {V : Type.{u1}} {P : Type.{u2}} [_inst_1 : NormedAddCommGroup.{u1} V] [_inst_2 : InnerProductSpace.{0, u1} Real V Real.isROrC _inst_1] [_inst_3 : MetricSpace.{u2} P] [_inst_4 : NormedAddTorsor.{u1, u2} V P (NormedAddCommGroup.toSeminormedAddCommGroup.{u1} V _inst_1) (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)] (c : P) (x : P) (R : Real), Eq.{1} Real (Dist.dist.{u2} P (PseudoMetricSpace.toDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) c (EuclideanGeometry.inversion.{u1, u2} V P _inst_1 _inst_2 _inst_3 _inst_4 c R x)) (HDiv.hDiv.{0, 0, 0} Real Real Real (instHDiv.{0} Real (LinearOrderedField.toDiv.{0} Real Real.instLinearOrderedFieldReal)) (HPow.hPow.{0, 0, 0} Real Nat Real (instHPow.{0, 0} Real Nat (Monoid.Pow.{0} Real Real.instMonoidReal)) R (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) (Dist.dist.{u2} P (PseudoMetricSpace.toDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) c x))
-Case conversion may be inaccurate. Consider using '#align euclidean_geometry.dist_center_inversion EuclideanGeometry.dist_center_inversionₓ'. -/
 /-- Distance from the center of an inversion to the image of a point under the inversion. This
 formula accidentally works for `x = c`. -/
 theorem dist_center_inversion (c x : P) (R : ℝ) : dist c (inversion c R x) = R ^ 2 / dist c x := by
   rw [dist_comm c, dist_comm c, dist_inversion_center]
 #align euclidean_geometry.dist_center_inversion EuclideanGeometry.dist_center_inversion
 
-/- warning: euclidean_geometry.inversion_inversion -> EuclideanGeometry.inversion_inversion is a dubious translation:
-lean 3 declaration is
-  forall {V : Type.{u1}} {P : Type.{u2}} [_inst_1 : NormedAddCommGroup.{u1} V] [_inst_2 : InnerProductSpace.{0, u1} Real V Real.isROrC _inst_1] [_inst_3 : MetricSpace.{u2} P] [_inst_4 : NormedAddTorsor.{u1, u2} V P (NormedAddCommGroup.toSeminormedAddCommGroup.{u1} V _inst_1) (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)] (c : P) {R : Real}, (Ne.{1} Real R (OfNat.ofNat.{0} Real 0 (OfNat.mk.{0} Real 0 (Zero.zero.{0} Real Real.hasZero)))) -> (forall (x : P), Eq.{succ u2} P (EuclideanGeometry.inversion.{u1, u2} V P _inst_1 _inst_2 _inst_3 _inst_4 c R (EuclideanGeometry.inversion.{u1, u2} V P _inst_1 _inst_2 _inst_3 _inst_4 c R x)) x)
-but is expected to have type
-  forall {V : Type.{u1}} {P : Type.{u2}} [_inst_1 : NormedAddCommGroup.{u1} V] [_inst_2 : InnerProductSpace.{0, u1} Real V Real.isROrC _inst_1] [_inst_3 : MetricSpace.{u2} P] [_inst_4 : NormedAddTorsor.{u1, u2} V P (NormedAddCommGroup.toSeminormedAddCommGroup.{u1} V _inst_1) (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)] (c : P) {R : Real}, (Ne.{1} Real R (OfNat.ofNat.{0} Real 0 (Zero.toOfNat0.{0} Real Real.instZeroReal))) -> (forall (x : P), Eq.{succ u2} P (EuclideanGeometry.inversion.{u1, u2} V P _inst_1 _inst_2 _inst_3 _inst_4 c R (EuclideanGeometry.inversion.{u1, u2} V P _inst_1 _inst_2 _inst_3 _inst_4 c R x)) x)
-Case conversion may be inaccurate. Consider using '#align euclidean_geometry.inversion_inversion EuclideanGeometry.inversion_inversionₓ'. -/
 @[simp]
 theorem inversion_inversion (c : P) {R : ℝ} (hR : R ≠ 0) (x : P) :
     inversion c R (inversion c R x) = x :=
@@ -128,52 +104,22 @@ theorem inversion_inversion (c : P) {R : ℝ} (hR : R ≠ 0) (x : P) :
     exact pow_ne_zero _ hR
 #align euclidean_geometry.inversion_inversion EuclideanGeometry.inversion_inversion
 
-/- warning: euclidean_geometry.inversion_involutive -> EuclideanGeometry.inversion_involutive is a dubious translation:
-lean 3 declaration is
-  forall {V : Type.{u1}} {P : Type.{u2}} [_inst_1 : NormedAddCommGroup.{u1} V] [_inst_2 : InnerProductSpace.{0, u1} Real V Real.isROrC _inst_1] [_inst_3 : MetricSpace.{u2} P] [_inst_4 : NormedAddTorsor.{u1, u2} V P (NormedAddCommGroup.toSeminormedAddCommGroup.{u1} V _inst_1) (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)] (c : P) {R : Real}, (Ne.{1} Real R (OfNat.ofNat.{0} Real 0 (OfNat.mk.{0} Real 0 (Zero.zero.{0} Real Real.hasZero)))) -> (Function.Involutive.{succ u2} P (EuclideanGeometry.inversion.{u1, u2} V P _inst_1 _inst_2 _inst_3 _inst_4 c R))
-but is expected to have type
-  forall {V : Type.{u1}} {P : Type.{u2}} [_inst_1 : NormedAddCommGroup.{u1} V] [_inst_2 : InnerProductSpace.{0, u1} Real V Real.isROrC _inst_1] [_inst_3 : MetricSpace.{u2} P] [_inst_4 : NormedAddTorsor.{u1, u2} V P (NormedAddCommGroup.toSeminormedAddCommGroup.{u1} V _inst_1) (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)] (c : P) {R : Real}, (Ne.{1} Real R (OfNat.ofNat.{0} Real 0 (Zero.toOfNat0.{0} Real Real.instZeroReal))) -> (Function.Involutive.{succ u2} P (EuclideanGeometry.inversion.{u1, u2} V P _inst_1 _inst_2 _inst_3 _inst_4 c R))
-Case conversion may be inaccurate. Consider using '#align euclidean_geometry.inversion_involutive EuclideanGeometry.inversion_involutiveₓ'. -/
 theorem inversion_involutive (c : P) {R : ℝ} (hR : R ≠ 0) : Involutive (inversion c R) :=
   inversion_inversion c hR
 #align euclidean_geometry.inversion_involutive EuclideanGeometry.inversion_involutive
 
-/- warning: euclidean_geometry.inversion_surjective -> EuclideanGeometry.inversion_surjective is a dubious translation:
-lean 3 declaration is
-  forall {V : Type.{u1}} {P : Type.{u2}} [_inst_1 : NormedAddCommGroup.{u1} V] [_inst_2 : InnerProductSpace.{0, u1} Real V Real.isROrC _inst_1] [_inst_3 : MetricSpace.{u2} P] [_inst_4 : NormedAddTorsor.{u1, u2} V P (NormedAddCommGroup.toSeminormedAddCommGroup.{u1} V _inst_1) (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)] (c : P) {R : Real}, (Ne.{1} Real R (OfNat.ofNat.{0} Real 0 (OfNat.mk.{0} Real 0 (Zero.zero.{0} Real Real.hasZero)))) -> (Function.Surjective.{succ u2, succ u2} P P (EuclideanGeometry.inversion.{u1, u2} V P _inst_1 _inst_2 _inst_3 _inst_4 c R))
-but is expected to have type
-  forall {V : Type.{u1}} {P : Type.{u2}} [_inst_1 : NormedAddCommGroup.{u1} V] [_inst_2 : InnerProductSpace.{0, u1} Real V Real.isROrC _inst_1] [_inst_3 : MetricSpace.{u2} P] [_inst_4 : NormedAddTorsor.{u1, u2} V P (NormedAddCommGroup.toSeminormedAddCommGroup.{u1} V _inst_1) (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)] (c : P) {R : Real}, (Ne.{1} Real R (OfNat.ofNat.{0} Real 0 (Zero.toOfNat0.{0} Real Real.instZeroReal))) -> (Function.Surjective.{succ u2, succ u2} P P (EuclideanGeometry.inversion.{u1, u2} V P _inst_1 _inst_2 _inst_3 _inst_4 c R))
-Case conversion may be inaccurate. Consider using '#align euclidean_geometry.inversion_surjective EuclideanGeometry.inversion_surjectiveₓ'. -/
 theorem inversion_surjective (c : P) {R : ℝ} (hR : R ≠ 0) : Surjective (inversion c R) :=
   (inversion_involutive c hR).Surjective
 #align euclidean_geometry.inversion_surjective EuclideanGeometry.inversion_surjective
 
-/- warning: euclidean_geometry.inversion_injective -> EuclideanGeometry.inversion_injective is a dubious translation:
-lean 3 declaration is
-  forall {V : Type.{u1}} {P : Type.{u2}} [_inst_1 : NormedAddCommGroup.{u1} V] [_inst_2 : InnerProductSpace.{0, u1} Real V Real.isROrC _inst_1] [_inst_3 : MetricSpace.{u2} P] [_inst_4 : NormedAddTorsor.{u1, u2} V P (NormedAddCommGroup.toSeminormedAddCommGroup.{u1} V _inst_1) (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)] (c : P) {R : Real}, (Ne.{1} Real R (OfNat.ofNat.{0} Real 0 (OfNat.mk.{0} Real 0 (Zero.zero.{0} Real Real.hasZero)))) -> (Function.Injective.{succ u2, succ u2} P P (EuclideanGeometry.inversion.{u1, u2} V P _inst_1 _inst_2 _inst_3 _inst_4 c R))
-but is expected to have type
-  forall {V : Type.{u1}} {P : Type.{u2}} [_inst_1 : NormedAddCommGroup.{u1} V] [_inst_2 : InnerProductSpace.{0, u1} Real V Real.isROrC _inst_1] [_inst_3 : MetricSpace.{u2} P] [_inst_4 : NormedAddTorsor.{u1, u2} V P (NormedAddCommGroup.toSeminormedAddCommGroup.{u1} V _inst_1) (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)] (c : P) {R : Real}, (Ne.{1} Real R (OfNat.ofNat.{0} Real 0 (Zero.toOfNat0.{0} Real Real.instZeroReal))) -> (Function.Injective.{succ u2, succ u2} P P (EuclideanGeometry.inversion.{u1, u2} V P _inst_1 _inst_2 _inst_3 _inst_4 c R))
-Case conversion may be inaccurate. Consider using '#align euclidean_geometry.inversion_injective EuclideanGeometry.inversion_injectiveₓ'. -/
 theorem inversion_injective (c : P) {R : ℝ} (hR : R ≠ 0) : Injective (inversion c R) :=
   (inversion_involutive c hR).Injective
 #align euclidean_geometry.inversion_injective EuclideanGeometry.inversion_injective
 
-/- warning: euclidean_geometry.inversion_bijective -> EuclideanGeometry.inversion_bijective is a dubious translation:
-lean 3 declaration is
-  forall {V : Type.{u1}} {P : Type.{u2}} [_inst_1 : NormedAddCommGroup.{u1} V] [_inst_2 : InnerProductSpace.{0, u1} Real V Real.isROrC _inst_1] [_inst_3 : MetricSpace.{u2} P] [_inst_4 : NormedAddTorsor.{u1, u2} V P (NormedAddCommGroup.toSeminormedAddCommGroup.{u1} V _inst_1) (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)] (c : P) {R : Real}, (Ne.{1} Real R (OfNat.ofNat.{0} Real 0 (OfNat.mk.{0} Real 0 (Zero.zero.{0} Real Real.hasZero)))) -> (Function.Bijective.{succ u2, succ u2} P P (EuclideanGeometry.inversion.{u1, u2} V P _inst_1 _inst_2 _inst_3 _inst_4 c R))
-but is expected to have type
-  forall {V : Type.{u1}} {P : Type.{u2}} [_inst_1 : NormedAddCommGroup.{u1} V] [_inst_2 : InnerProductSpace.{0, u1} Real V Real.isROrC _inst_1] [_inst_3 : MetricSpace.{u2} P] [_inst_4 : NormedAddTorsor.{u1, u2} V P (NormedAddCommGroup.toSeminormedAddCommGroup.{u1} V _inst_1) (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)] (c : P) {R : Real}, (Ne.{1} Real R (OfNat.ofNat.{0} Real 0 (Zero.toOfNat0.{0} Real Real.instZeroReal))) -> (Function.Bijective.{succ u2, succ u2} P P (EuclideanGeometry.inversion.{u1, u2} V P _inst_1 _inst_2 _inst_3 _inst_4 c R))
-Case conversion may be inaccurate. Consider using '#align euclidean_geometry.inversion_bijective EuclideanGeometry.inversion_bijectiveₓ'. -/
 theorem inversion_bijective (c : P) {R : ℝ} (hR : R ≠ 0) : Bijective (inversion c R) :=
   (inversion_involutive c hR).Bijective
 #align euclidean_geometry.inversion_bijective EuclideanGeometry.inversion_bijective
 
-/- warning: euclidean_geometry.dist_inversion_inversion -> EuclideanGeometry.dist_inversion_inversion is a dubious translation:
-lean 3 declaration is
-  forall {V : Type.{u1}} {P : Type.{u2}} [_inst_1 : NormedAddCommGroup.{u1} V] [_inst_2 : InnerProductSpace.{0, u1} Real V Real.isROrC _inst_1] [_inst_3 : MetricSpace.{u2} P] [_inst_4 : NormedAddTorsor.{u1, u2} V P (NormedAddCommGroup.toSeminormedAddCommGroup.{u1} V _inst_1) (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)] {c : P} {x : P} {y : P}, (Ne.{succ u2} P x c) -> (Ne.{succ u2} P y c) -> (forall (R : Real), Eq.{1} Real (Dist.dist.{u2} P (PseudoMetricSpace.toHasDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) (EuclideanGeometry.inversion.{u1, u2} V P _inst_1 _inst_2 _inst_3 _inst_4 c R x) (EuclideanGeometry.inversion.{u1, u2} V P _inst_1 _inst_2 _inst_3 _inst_4 c R y)) (HMul.hMul.{0, 0, 0} Real Real Real (instHMul.{0} Real Real.hasMul) (HDiv.hDiv.{0, 0, 0} Real Real Real (instHDiv.{0} Real (DivInvMonoid.toHasDiv.{0} Real (DivisionRing.toDivInvMonoid.{0} Real Real.divisionRing))) (HPow.hPow.{0, 0, 0} Real Nat Real (instHPow.{0, 0} Real Nat (Monoid.Pow.{0} Real Real.monoid)) R (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) (HMul.hMul.{0, 0, 0} Real Real Real (instHMul.{0} Real Real.hasMul) (Dist.dist.{u2} P (PseudoMetricSpace.toHasDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) x c) (Dist.dist.{u2} P (PseudoMetricSpace.toHasDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) y c))) (Dist.dist.{u2} P (PseudoMetricSpace.toHasDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) x y)))
-but is expected to have type
-  forall {V : Type.{u1}} {P : Type.{u2}} [_inst_1 : NormedAddCommGroup.{u1} V] [_inst_2 : InnerProductSpace.{0, u1} Real V Real.isROrC _inst_1] [_inst_3 : MetricSpace.{u2} P] [_inst_4 : NormedAddTorsor.{u1, u2} V P (NormedAddCommGroup.toSeminormedAddCommGroup.{u1} V _inst_1) (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)] {c : P} {x : P} {y : P}, (Ne.{succ u2} P x c) -> (Ne.{succ u2} P y c) -> (forall (R : Real), Eq.{1} Real (Dist.dist.{u2} P (PseudoMetricSpace.toDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) (EuclideanGeometry.inversion.{u1, u2} V P _inst_1 _inst_2 _inst_3 _inst_4 c R x) (EuclideanGeometry.inversion.{u1, u2} V P _inst_1 _inst_2 _inst_3 _inst_4 c R y)) (HMul.hMul.{0, 0, 0} Real Real Real (instHMul.{0} Real Real.instMulReal) (HDiv.hDiv.{0, 0, 0} Real Real Real (instHDiv.{0} Real (LinearOrderedField.toDiv.{0} Real Real.instLinearOrderedFieldReal)) (HPow.hPow.{0, 0, 0} Real Nat Real (instHPow.{0, 0} Real Nat (Monoid.Pow.{0} Real Real.instMonoidReal)) R (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) (HMul.hMul.{0, 0, 0} Real Real Real (instHMul.{0} Real Real.instMulReal) (Dist.dist.{u2} P (PseudoMetricSpace.toDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) x c) (Dist.dist.{u2} P (PseudoMetricSpace.toDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) y c))) (Dist.dist.{u2} P (PseudoMetricSpace.toDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) x y)))
-Case conversion may be inaccurate. Consider using '#align euclidean_geometry.dist_inversion_inversion EuclideanGeometry.dist_inversion_inversionₓ'. -/
 /-- Distance between the images of two points under an inversion. -/
 theorem dist_inversion_inversion (hx : x ≠ c) (hy : y ≠ c) (R : ℝ) :
     dist (inversion c R x) (inversion c R y) = R ^ 2 / (dist x c * dist y c) * dist x y :=
@@ -184,12 +130,6 @@ theorem dist_inversion_inversion (hx : x ≠ c) (hy : y ≠ c) (R : ℝ) :
     dist_div_norm_sq_smul (vsub_ne_zero.2 hx) (vsub_ne_zero.2 hy) R
 #align euclidean_geometry.dist_inversion_inversion EuclideanGeometry.dist_inversion_inversion
 
-/- warning: euclidean_geometry.mul_dist_le_mul_dist_add_mul_dist -> EuclideanGeometry.mul_dist_le_mul_dist_add_mul_dist is a dubious translation:
-lean 3 declaration is
-  forall {V : Type.{u1}} {P : Type.{u2}} [_inst_1 : NormedAddCommGroup.{u1} V] [_inst_2 : InnerProductSpace.{0, u1} Real V Real.isROrC _inst_1] [_inst_3 : MetricSpace.{u2} P] [_inst_4 : NormedAddTorsor.{u1, u2} V P (NormedAddCommGroup.toSeminormedAddCommGroup.{u1} V _inst_1) (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)] (a : P) (b : P) (c : P) (d : P), LE.le.{0} Real Real.hasLe (HMul.hMul.{0, 0, 0} Real Real Real (instHMul.{0} Real Real.hasMul) (Dist.dist.{u2} P (PseudoMetricSpace.toHasDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) a c) (Dist.dist.{u2} P (PseudoMetricSpace.toHasDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) b d)) (HAdd.hAdd.{0, 0, 0} Real Real Real (instHAdd.{0} Real Real.hasAdd) (HMul.hMul.{0, 0, 0} Real Real Real (instHMul.{0} Real Real.hasMul) (Dist.dist.{u2} P (PseudoMetricSpace.toHasDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) a b) (Dist.dist.{u2} P (PseudoMetricSpace.toHasDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) c d)) (HMul.hMul.{0, 0, 0} Real Real Real (instHMul.{0} Real Real.hasMul) (Dist.dist.{u2} P (PseudoMetricSpace.toHasDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) b c) (Dist.dist.{u2} P (PseudoMetricSpace.toHasDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) a d)))
-but is expected to have type
-  forall {V : Type.{u2}} {P : Type.{u1}} [_inst_1 : NormedAddCommGroup.{u2} V] [_inst_2 : InnerProductSpace.{0, u2} Real V Real.isROrC _inst_1] [_inst_3 : MetricSpace.{u1} P] [_inst_4 : NormedAddTorsor.{u2, u1} V P (NormedAddCommGroup.toSeminormedAddCommGroup.{u2} V _inst_1) (MetricSpace.toPseudoMetricSpace.{u1} P _inst_3)] (a : P) (b : P) (c : P) (d : P), LE.le.{0} Real Real.instLEReal (HMul.hMul.{0, 0, 0} Real Real Real (instHMul.{0} Real Real.instMulReal) (Dist.dist.{u1} P (PseudoMetricSpace.toDist.{u1} P (MetricSpace.toPseudoMetricSpace.{u1} P _inst_3)) a c) (Dist.dist.{u1} P (PseudoMetricSpace.toDist.{u1} P (MetricSpace.toPseudoMetricSpace.{u1} P _inst_3)) b d)) (HAdd.hAdd.{0, 0, 0} Real Real Real (instHAdd.{0} Real Real.instAddReal) (HMul.hMul.{0, 0, 0} Real Real Real (instHMul.{0} Real Real.instMulReal) (Dist.dist.{u1} P (PseudoMetricSpace.toDist.{u1} P (MetricSpace.toPseudoMetricSpace.{u1} P _inst_3)) a b) (Dist.dist.{u1} P (PseudoMetricSpace.toDist.{u1} P (MetricSpace.toPseudoMetricSpace.{u1} P _inst_3)) c d)) (HMul.hMul.{0, 0, 0} Real Real Real (instHMul.{0} Real Real.instMulReal) (Dist.dist.{u1} P (PseudoMetricSpace.toDist.{u1} P (MetricSpace.toPseudoMetricSpace.{u1} P _inst_3)) b c) (Dist.dist.{u1} P (PseudoMetricSpace.toDist.{u1} P (MetricSpace.toPseudoMetricSpace.{u1} P _inst_3)) a d)))
-Case conversion may be inaccurate. Consider using '#align euclidean_geometry.mul_dist_le_mul_dist_add_mul_dist EuclideanGeometry.mul_dist_le_mul_dist_add_mul_distₓ'. -/
 /-- **Ptolemy's inequality**: in a quadrangle `ABCD`, `|AC| * |BD| ≤ |AB| * |CD| + |BC| * |AD|`. If
 `ABCD` is a convex cyclic polygon, then this inequality becomes an equality, see
 `euclidean_geometry.mul_dist_add_mul_dist_eq_mul_dist_of_cospherical`.  -/
Diff
@@ -93,8 +93,7 @@ Case conversion may be inaccurate. Consider using '#align euclidean_geometry.dis
 works for `x = c`. -/
 theorem dist_inversion_center (c x : P) (R : ℝ) : dist (inversion c R x) c = R ^ 2 / dist x c :=
   by
-  rcases eq_or_ne x c with (rfl | hx)
-  · simp
+  rcases eq_or_ne x c with (rfl | hx); · simp
   have : dist x c ≠ 0 := dist_ne_zero.2 hx
   field_simp [inversion, norm_smul, abs_div, ← dist_eq_norm_vsub, sq, mul_assoc]
 #align euclidean_geometry.dist_inversion_center EuclideanGeometry.dist_inversion_center
@@ -212,9 +211,7 @@ theorem mul_dist_le_mul_dist_add_mul_dist (a b c d : P) :
     dist_inversion_inversion hc hd, one_pow] at H
   rw [← dist_pos] at hb hc hd
   rw [← div_le_div_right (mul_pos hb (mul_pos hc hd))]
-  convert H <;>
-    · field_simp [hb.ne', hc.ne', hd.ne', dist_comm a]
-      ring
+  convert H <;> · field_simp [hb.ne', hc.ne', hd.ne', dist_comm a] ; ring
 #align euclidean_geometry.mul_dist_le_mul_dist_add_mul_dist EuclideanGeometry.mul_dist_le_mul_dist_add_mul_dist
 
 end EuclideanGeometry
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yury G. Kudryashov
 
 ! This file was ported from Lean 3 source module geometry.euclidean.inversion
-! leanprover-community/mathlib commit 46b633fd842bef9469441c0209906f6dddd2b4f5
+! leanprover-community/mathlib commit 0b7c740e25651db0ba63648fbae9f9d6f941e31b
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -13,6 +13,9 @@ import Mathbin.Analysis.InnerProductSpace.Basic
 /-!
 # Inversion in an affine space
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 In this file we define inversion in a sphere in an affine space. This map sends each point `x` to
 the point `y` such that `y -ᵥ c = (R / dist x c) ^ 2 • (x -ᵥ c)`, where `c` and `R` are the center
 and the radius the sphere.
Diff
@@ -37,22 +37,33 @@ variable {V P : Type _} [NormedAddCommGroup V] [InnerProductSpace ℝ V] [Metric
 
 include V
 
+#print EuclideanGeometry.inversion /-
 /-- Inversion in a sphere in an affine space. This map sends each point `x` to the point `y` such
 that `y -ᵥ c = (R / dist x c) ^ 2 • (x -ᵥ c)`, where `c` and `R` are the center and the radius the
 sphere. -/
 def inversion (c : P) (R : ℝ) (x : P) : P :=
   (R / dist x c) ^ 2 • (x -ᵥ c) +ᵥ c
 #align euclidean_geometry.inversion EuclideanGeometry.inversion
+-/
 
+/- warning: euclidean_geometry.inversion_vsub_center -> EuclideanGeometry.inversion_vsub_center is a dubious translation:
+lean 3 declaration is
+  forall {V : Type.{u1}} {P : Type.{u2}} [_inst_1 : NormedAddCommGroup.{u1} V] [_inst_2 : InnerProductSpace.{0, u1} Real V Real.isROrC _inst_1] [_inst_3 : MetricSpace.{u2} P] [_inst_4 : NormedAddTorsor.{u1, u2} V P (NormedAddCommGroup.toSeminormedAddCommGroup.{u1} V _inst_1) (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)] (c : P) (R : Real) (x : P), Eq.{succ u1} V (VSub.vsub.{u1, u2} V P (AddTorsor.toHasVsub.{u1, u2} V P (NormedAddGroup.toAddGroup.{u1} V (NormedAddCommGroup.toNormedAddGroup.{u1} V _inst_1)) (NormedAddTorsor.toAddTorsor'.{u1, u2} V P _inst_1 _inst_3 _inst_4)) (EuclideanGeometry.inversion.{u1, u2} V P _inst_1 _inst_2 _inst_3 _inst_4 c R x) c) (SMul.smul.{0, u1} Real V (SMulZeroClass.toHasSmul.{0, u1} Real V (AddZeroClass.toHasZero.{u1} V (AddMonoid.toAddZeroClass.{u1} V (AddCommMonoid.toAddMonoid.{u1} V (AddCommGroup.toAddCommMonoid.{u1} V (SeminormedAddCommGroup.toAddCommGroup.{u1} V (NormedAddCommGroup.toSeminormedAddCommGroup.{u1} V _inst_1)))))) (SMulWithZero.toSmulZeroClass.{0, u1} Real V (MulZeroClass.toHasZero.{0} Real (MulZeroOneClass.toMulZeroClass.{0} Real (MonoidWithZero.toMulZeroOneClass.{0} Real (Semiring.toMonoidWithZero.{0} Real (Ring.toSemiring.{0} Real (NormedRing.toRing.{0} Real (NormedCommRing.toNormedRing.{0} Real (NormedField.toNormedCommRing.{0} Real (DenselyNormedField.toNormedField.{0} Real (IsROrC.toDenselyNormedField.{0} Real Real.isROrC)))))))))) (AddZeroClass.toHasZero.{u1} V (AddMonoid.toAddZeroClass.{u1} V (AddCommMonoid.toAddMonoid.{u1} V (AddCommGroup.toAddCommMonoid.{u1} V (SeminormedAddCommGroup.toAddCommGroup.{u1} V (NormedAddCommGroup.toSeminormedAddCommGroup.{u1} V _inst_1)))))) (MulActionWithZero.toSMulWithZero.{0, u1} Real V (Semiring.toMonoidWithZero.{0} Real (Ring.toSemiring.{0} Real (NormedRing.toRing.{0} Real (NormedCommRing.toNormedRing.{0} Real (NormedField.toNormedCommRing.{0} Real (DenselyNormedField.toNormedField.{0} Real (IsROrC.toDenselyNormedField.{0} Real Real.isROrC))))))) (AddZeroClass.toHasZero.{u1} V (AddMonoid.toAddZeroClass.{u1} V (AddCommMonoid.toAddMonoid.{u1} V (AddCommGroup.toAddCommMonoid.{u1} V (SeminormedAddCommGroup.toAddCommGroup.{u1} V (NormedAddCommGroup.toSeminormedAddCommGroup.{u1} V _inst_1)))))) (Module.toMulActionWithZero.{0, u1} Real V (Ring.toSemiring.{0} Real (NormedRing.toRing.{0} Real (NormedCommRing.toNormedRing.{0} Real (NormedField.toNormedCommRing.{0} Real (DenselyNormedField.toNormedField.{0} Real (IsROrC.toDenselyNormedField.{0} Real Real.isROrC)))))) (AddCommGroup.toAddCommMonoid.{u1} V (SeminormedAddCommGroup.toAddCommGroup.{u1} V (NormedAddCommGroup.toSeminormedAddCommGroup.{u1} V _inst_1))) (NormedSpace.toModule.{0, u1} Real V (DenselyNormedField.toNormedField.{0} Real (IsROrC.toDenselyNormedField.{0} Real Real.isROrC)) (NormedAddCommGroup.toSeminormedAddCommGroup.{u1} V _inst_1) (InnerProductSpace.toNormedSpace.{0, u1} Real V Real.isROrC _inst_1 _inst_2)))))) (HPow.hPow.{0, 0, 0} Real Nat Real (instHPow.{0, 0} Real Nat (Monoid.Pow.{0} Real Real.monoid)) (HDiv.hDiv.{0, 0, 0} Real Real Real (instHDiv.{0} Real (DivInvMonoid.toHasDiv.{0} Real (DivisionRing.toDivInvMonoid.{0} Real Real.divisionRing))) R (Dist.dist.{u2} P (PseudoMetricSpace.toHasDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) x c)) (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) (VSub.vsub.{u1, u2} V P (AddTorsor.toHasVsub.{u1, u2} V P (NormedAddGroup.toAddGroup.{u1} V (NormedAddCommGroup.toNormedAddGroup.{u1} V _inst_1)) (NormedAddTorsor.toAddTorsor'.{u1, u2} V P _inst_1 _inst_3 _inst_4)) x c))
+but is expected to have type
+  forall {V : Type.{u2}} {P : Type.{u1}} [_inst_1 : NormedAddCommGroup.{u2} V] [_inst_2 : InnerProductSpace.{0, u2} Real V Real.isROrC _inst_1] [_inst_3 : MetricSpace.{u1} P] [_inst_4 : NormedAddTorsor.{u2, u1} V P (NormedAddCommGroup.toSeminormedAddCommGroup.{u2} V _inst_1) (MetricSpace.toPseudoMetricSpace.{u1} P _inst_3)] (c : P) (R : Real) (x : P), Eq.{succ u2} V (VSub.vsub.{u2, u1} V P (AddTorsor.toVSub.{u2, u1} V P (SeminormedAddGroup.toAddGroup.{u2} V (SeminormedAddCommGroup.toSeminormedAddGroup.{u2} V (NormedAddCommGroup.toSeminormedAddCommGroup.{u2} V _inst_1))) (NormedAddTorsor.toAddTorsor.{u2, u1} V P (NormedAddCommGroup.toSeminormedAddCommGroup.{u2} V _inst_1) (MetricSpace.toPseudoMetricSpace.{u1} P _inst_3) _inst_4)) (EuclideanGeometry.inversion.{u2, u1} V P _inst_1 _inst_2 _inst_3 _inst_4 c R x) c) (HSMul.hSMul.{0, u2, u2} Real V V (instHSMul.{0, u2} Real V (SMulZeroClass.toSMul.{0, u2} Real V (NegZeroClass.toZero.{u2} V (SubNegZeroMonoid.toNegZeroClass.{u2} V (SubtractionMonoid.toSubNegZeroMonoid.{u2} V (SubtractionCommMonoid.toSubtractionMonoid.{u2} V (AddCommGroup.toDivisionAddCommMonoid.{u2} V (NormedAddCommGroup.toAddCommGroup.{u2} V _inst_1)))))) (SMulWithZero.toSMulZeroClass.{0, u2} Real V Real.instZeroReal (NegZeroClass.toZero.{u2} V (SubNegZeroMonoid.toNegZeroClass.{u2} V (SubtractionMonoid.toSubNegZeroMonoid.{u2} V (SubtractionCommMonoid.toSubtractionMonoid.{u2} V (AddCommGroup.toDivisionAddCommMonoid.{u2} V (NormedAddCommGroup.toAddCommGroup.{u2} V _inst_1)))))) (MulActionWithZero.toSMulWithZero.{0, u2} Real V Real.instMonoidWithZeroReal (NegZeroClass.toZero.{u2} V (SubNegZeroMonoid.toNegZeroClass.{u2} V (SubtractionMonoid.toSubNegZeroMonoid.{u2} V (SubtractionCommMonoid.toSubtractionMonoid.{u2} V (AddCommGroup.toDivisionAddCommMonoid.{u2} V (NormedAddCommGroup.toAddCommGroup.{u2} V _inst_1)))))) (Module.toMulActionWithZero.{0, u2} Real V Real.semiring (AddCommGroup.toAddCommMonoid.{u2} V (NormedAddCommGroup.toAddCommGroup.{u2} V _inst_1)) (NormedSpace.toModule.{0, u2} Real V Real.normedField (NormedAddCommGroup.toSeminormedAddCommGroup.{u2} V _inst_1) (InnerProductSpace.toNormedSpace.{0, u2} Real V Real.isROrC _inst_1 _inst_2))))))) (HPow.hPow.{0, 0, 0} Real Nat Real (instHPow.{0, 0} Real Nat (Monoid.Pow.{0} Real Real.instMonoidReal)) (HDiv.hDiv.{0, 0, 0} Real Real Real (instHDiv.{0} Real (LinearOrderedField.toDiv.{0} Real Real.instLinearOrderedFieldReal)) R (Dist.dist.{u1} P (PseudoMetricSpace.toDist.{u1} P (MetricSpace.toPseudoMetricSpace.{u1} P _inst_3)) x c)) (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) (VSub.vsub.{u2, u1} V P (AddTorsor.toVSub.{u2, u1} V P (SeminormedAddGroup.toAddGroup.{u2} V (SeminormedAddCommGroup.toSeminormedAddGroup.{u2} V (NormedAddCommGroup.toSeminormedAddCommGroup.{u2} V _inst_1))) (NormedAddTorsor.toAddTorsor.{u2, u1} V P (NormedAddCommGroup.toSeminormedAddCommGroup.{u2} V _inst_1) (MetricSpace.toPseudoMetricSpace.{u1} P _inst_3) _inst_4)) x c))
+Case conversion may be inaccurate. Consider using '#align euclidean_geometry.inversion_vsub_center EuclideanGeometry.inversion_vsub_centerₓ'. -/
 theorem inversion_vsub_center (c : P) (R : ℝ) (x : P) :
     inversion c R x -ᵥ c = (R / dist x c) ^ 2 • (x -ᵥ c) :=
   vadd_vsub _ _
 #align euclidean_geometry.inversion_vsub_center EuclideanGeometry.inversion_vsub_center
 
+#print EuclideanGeometry.inversion_self /-
 @[simp]
 theorem inversion_self (c : P) (R : ℝ) : inversion c R c = c := by simp [inversion]
 #align euclidean_geometry.inversion_self EuclideanGeometry.inversion_self
+-/
 
+#print EuclideanGeometry.inversion_dist_center /-
 @[simp]
 theorem inversion_dist_center (c x : P) : inversion c (dist x c) x = x :=
   by
@@ -61,11 +72,20 @@ theorem inversion_dist_center (c x : P) : inversion c (dist x c) x = x :=
   · rw [inversion, div_self, one_pow, one_smul, vsub_vadd]
     rwa [dist_ne_zero]
 #align euclidean_geometry.inversion_dist_center EuclideanGeometry.inversion_dist_center
+-/
 
+#print EuclideanGeometry.inversion_of_mem_sphere /-
 theorem inversion_of_mem_sphere (h : x ∈ Metric.sphere c R) : inversion c R x = x :=
   h.out ▸ inversion_dist_center c x
 #align euclidean_geometry.inversion_of_mem_sphere EuclideanGeometry.inversion_of_mem_sphere
+-/
 
+/- warning: euclidean_geometry.dist_inversion_center -> EuclideanGeometry.dist_inversion_center is a dubious translation:
+lean 3 declaration is
+  forall {V : Type.{u1}} {P : Type.{u2}} [_inst_1 : NormedAddCommGroup.{u1} V] [_inst_2 : InnerProductSpace.{0, u1} Real V Real.isROrC _inst_1] [_inst_3 : MetricSpace.{u2} P] [_inst_4 : NormedAddTorsor.{u1, u2} V P (NormedAddCommGroup.toSeminormedAddCommGroup.{u1} V _inst_1) (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)] (c : P) (x : P) (R : Real), Eq.{1} Real (Dist.dist.{u2} P (PseudoMetricSpace.toHasDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) (EuclideanGeometry.inversion.{u1, u2} V P _inst_1 _inst_2 _inst_3 _inst_4 c R x) c) (HDiv.hDiv.{0, 0, 0} Real Real Real (instHDiv.{0} Real (DivInvMonoid.toHasDiv.{0} Real (DivisionRing.toDivInvMonoid.{0} Real Real.divisionRing))) (HPow.hPow.{0, 0, 0} Real Nat Real (instHPow.{0, 0} Real Nat (Monoid.Pow.{0} Real Real.monoid)) R (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) (Dist.dist.{u2} P (PseudoMetricSpace.toHasDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) x c))
+but is expected to have type
+  forall {V : Type.{u1}} {P : Type.{u2}} [_inst_1 : NormedAddCommGroup.{u1} V] [_inst_2 : InnerProductSpace.{0, u1} Real V Real.isROrC _inst_1] [_inst_3 : MetricSpace.{u2} P] [_inst_4 : NormedAddTorsor.{u1, u2} V P (NormedAddCommGroup.toSeminormedAddCommGroup.{u1} V _inst_1) (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)] (c : P) (x : P) (R : Real), Eq.{1} Real (Dist.dist.{u2} P (PseudoMetricSpace.toDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) (EuclideanGeometry.inversion.{u1, u2} V P _inst_1 _inst_2 _inst_3 _inst_4 c R x) c) (HDiv.hDiv.{0, 0, 0} Real Real Real (instHDiv.{0} Real (LinearOrderedField.toDiv.{0} Real Real.instLinearOrderedFieldReal)) (HPow.hPow.{0, 0, 0} Real Nat Real (instHPow.{0, 0} Real Nat (Monoid.Pow.{0} Real Real.instMonoidReal)) R (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) (Dist.dist.{u2} P (PseudoMetricSpace.toDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) x c))
+Case conversion may be inaccurate. Consider using '#align euclidean_geometry.dist_inversion_center EuclideanGeometry.dist_inversion_centerₓ'. -/
 /-- Distance from the image of a point under inversion to the center. This formula accidentally
 works for `x = c`. -/
 theorem dist_inversion_center (c x : P) (R : ℝ) : dist (inversion c R x) c = R ^ 2 / dist x c :=
@@ -76,12 +96,24 @@ theorem dist_inversion_center (c x : P) (R : ℝ) : dist (inversion c R x) c = R
   field_simp [inversion, norm_smul, abs_div, ← dist_eq_norm_vsub, sq, mul_assoc]
 #align euclidean_geometry.dist_inversion_center EuclideanGeometry.dist_inversion_center
 
+/- warning: euclidean_geometry.dist_center_inversion -> EuclideanGeometry.dist_center_inversion is a dubious translation:
+lean 3 declaration is
+  forall {V : Type.{u1}} {P : Type.{u2}} [_inst_1 : NormedAddCommGroup.{u1} V] [_inst_2 : InnerProductSpace.{0, u1} Real V Real.isROrC _inst_1] [_inst_3 : MetricSpace.{u2} P] [_inst_4 : NormedAddTorsor.{u1, u2} V P (NormedAddCommGroup.toSeminormedAddCommGroup.{u1} V _inst_1) (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)] (c : P) (x : P) (R : Real), Eq.{1} Real (Dist.dist.{u2} P (PseudoMetricSpace.toHasDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) c (EuclideanGeometry.inversion.{u1, u2} V P _inst_1 _inst_2 _inst_3 _inst_4 c R x)) (HDiv.hDiv.{0, 0, 0} Real Real Real (instHDiv.{0} Real (DivInvMonoid.toHasDiv.{0} Real (DivisionRing.toDivInvMonoid.{0} Real Real.divisionRing))) (HPow.hPow.{0, 0, 0} Real Nat Real (instHPow.{0, 0} Real Nat (Monoid.Pow.{0} Real Real.monoid)) R (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) (Dist.dist.{u2} P (PseudoMetricSpace.toHasDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) c x))
+but is expected to have type
+  forall {V : Type.{u1}} {P : Type.{u2}} [_inst_1 : NormedAddCommGroup.{u1} V] [_inst_2 : InnerProductSpace.{0, u1} Real V Real.isROrC _inst_1] [_inst_3 : MetricSpace.{u2} P] [_inst_4 : NormedAddTorsor.{u1, u2} V P (NormedAddCommGroup.toSeminormedAddCommGroup.{u1} V _inst_1) (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)] (c : P) (x : P) (R : Real), Eq.{1} Real (Dist.dist.{u2} P (PseudoMetricSpace.toDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) c (EuclideanGeometry.inversion.{u1, u2} V P _inst_1 _inst_2 _inst_3 _inst_4 c R x)) (HDiv.hDiv.{0, 0, 0} Real Real Real (instHDiv.{0} Real (LinearOrderedField.toDiv.{0} Real Real.instLinearOrderedFieldReal)) (HPow.hPow.{0, 0, 0} Real Nat Real (instHPow.{0, 0} Real Nat (Monoid.Pow.{0} Real Real.instMonoidReal)) R (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) (Dist.dist.{u2} P (PseudoMetricSpace.toDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) c x))
+Case conversion may be inaccurate. Consider using '#align euclidean_geometry.dist_center_inversion EuclideanGeometry.dist_center_inversionₓ'. -/
 /-- Distance from the center of an inversion to the image of a point under the inversion. This
 formula accidentally works for `x = c`. -/
 theorem dist_center_inversion (c x : P) (R : ℝ) : dist c (inversion c R x) = R ^ 2 / dist c x := by
   rw [dist_comm c, dist_comm c, dist_inversion_center]
 #align euclidean_geometry.dist_center_inversion EuclideanGeometry.dist_center_inversion
 
+/- warning: euclidean_geometry.inversion_inversion -> EuclideanGeometry.inversion_inversion is a dubious translation:
+lean 3 declaration is
+  forall {V : Type.{u1}} {P : Type.{u2}} [_inst_1 : NormedAddCommGroup.{u1} V] [_inst_2 : InnerProductSpace.{0, u1} Real V Real.isROrC _inst_1] [_inst_3 : MetricSpace.{u2} P] [_inst_4 : NormedAddTorsor.{u1, u2} V P (NormedAddCommGroup.toSeminormedAddCommGroup.{u1} V _inst_1) (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)] (c : P) {R : Real}, (Ne.{1} Real R (OfNat.ofNat.{0} Real 0 (OfNat.mk.{0} Real 0 (Zero.zero.{0} Real Real.hasZero)))) -> (forall (x : P), Eq.{succ u2} P (EuclideanGeometry.inversion.{u1, u2} V P _inst_1 _inst_2 _inst_3 _inst_4 c R (EuclideanGeometry.inversion.{u1, u2} V P _inst_1 _inst_2 _inst_3 _inst_4 c R x)) x)
+but is expected to have type
+  forall {V : Type.{u1}} {P : Type.{u2}} [_inst_1 : NormedAddCommGroup.{u1} V] [_inst_2 : InnerProductSpace.{0, u1} Real V Real.isROrC _inst_1] [_inst_3 : MetricSpace.{u2} P] [_inst_4 : NormedAddTorsor.{u1, u2} V P (NormedAddCommGroup.toSeminormedAddCommGroup.{u1} V _inst_1) (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)] (c : P) {R : Real}, (Ne.{1} Real R (OfNat.ofNat.{0} Real 0 (Zero.toOfNat0.{0} Real Real.instZeroReal))) -> (forall (x : P), Eq.{succ u2} P (EuclideanGeometry.inversion.{u1, u2} V P _inst_1 _inst_2 _inst_3 _inst_4 c R (EuclideanGeometry.inversion.{u1, u2} V P _inst_1 _inst_2 _inst_3 _inst_4 c R x)) x)
+Case conversion may be inaccurate. Consider using '#align euclidean_geometry.inversion_inversion EuclideanGeometry.inversion_inversionₓ'. -/
 @[simp]
 theorem inversion_inversion (c : P) {R : ℝ} (hR : R ≠ 0) (x : P) :
     inversion c R (inversion c R x) = x :=
@@ -94,22 +126,52 @@ theorem inversion_inversion (c : P) {R : ℝ} (hR : R ≠ 0) (x : P) :
     exact pow_ne_zero _ hR
 #align euclidean_geometry.inversion_inversion EuclideanGeometry.inversion_inversion
 
+/- warning: euclidean_geometry.inversion_involutive -> EuclideanGeometry.inversion_involutive is a dubious translation:
+lean 3 declaration is
+  forall {V : Type.{u1}} {P : Type.{u2}} [_inst_1 : NormedAddCommGroup.{u1} V] [_inst_2 : InnerProductSpace.{0, u1} Real V Real.isROrC _inst_1] [_inst_3 : MetricSpace.{u2} P] [_inst_4 : NormedAddTorsor.{u1, u2} V P (NormedAddCommGroup.toSeminormedAddCommGroup.{u1} V _inst_1) (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)] (c : P) {R : Real}, (Ne.{1} Real R (OfNat.ofNat.{0} Real 0 (OfNat.mk.{0} Real 0 (Zero.zero.{0} Real Real.hasZero)))) -> (Function.Involutive.{succ u2} P (EuclideanGeometry.inversion.{u1, u2} V P _inst_1 _inst_2 _inst_3 _inst_4 c R))
+but is expected to have type
+  forall {V : Type.{u1}} {P : Type.{u2}} [_inst_1 : NormedAddCommGroup.{u1} V] [_inst_2 : InnerProductSpace.{0, u1} Real V Real.isROrC _inst_1] [_inst_3 : MetricSpace.{u2} P] [_inst_4 : NormedAddTorsor.{u1, u2} V P (NormedAddCommGroup.toSeminormedAddCommGroup.{u1} V _inst_1) (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)] (c : P) {R : Real}, (Ne.{1} Real R (OfNat.ofNat.{0} Real 0 (Zero.toOfNat0.{0} Real Real.instZeroReal))) -> (Function.Involutive.{succ u2} P (EuclideanGeometry.inversion.{u1, u2} V P _inst_1 _inst_2 _inst_3 _inst_4 c R))
+Case conversion may be inaccurate. Consider using '#align euclidean_geometry.inversion_involutive EuclideanGeometry.inversion_involutiveₓ'. -/
 theorem inversion_involutive (c : P) {R : ℝ} (hR : R ≠ 0) : Involutive (inversion c R) :=
   inversion_inversion c hR
 #align euclidean_geometry.inversion_involutive EuclideanGeometry.inversion_involutive
 
+/- warning: euclidean_geometry.inversion_surjective -> EuclideanGeometry.inversion_surjective is a dubious translation:
+lean 3 declaration is
+  forall {V : Type.{u1}} {P : Type.{u2}} [_inst_1 : NormedAddCommGroup.{u1} V] [_inst_2 : InnerProductSpace.{0, u1} Real V Real.isROrC _inst_1] [_inst_3 : MetricSpace.{u2} P] [_inst_4 : NormedAddTorsor.{u1, u2} V P (NormedAddCommGroup.toSeminormedAddCommGroup.{u1} V _inst_1) (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)] (c : P) {R : Real}, (Ne.{1} Real R (OfNat.ofNat.{0} Real 0 (OfNat.mk.{0} Real 0 (Zero.zero.{0} Real Real.hasZero)))) -> (Function.Surjective.{succ u2, succ u2} P P (EuclideanGeometry.inversion.{u1, u2} V P _inst_1 _inst_2 _inst_3 _inst_4 c R))
+but is expected to have type
+  forall {V : Type.{u1}} {P : Type.{u2}} [_inst_1 : NormedAddCommGroup.{u1} V] [_inst_2 : InnerProductSpace.{0, u1} Real V Real.isROrC _inst_1] [_inst_3 : MetricSpace.{u2} P] [_inst_4 : NormedAddTorsor.{u1, u2} V P (NormedAddCommGroup.toSeminormedAddCommGroup.{u1} V _inst_1) (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)] (c : P) {R : Real}, (Ne.{1} Real R (OfNat.ofNat.{0} Real 0 (Zero.toOfNat0.{0} Real Real.instZeroReal))) -> (Function.Surjective.{succ u2, succ u2} P P (EuclideanGeometry.inversion.{u1, u2} V P _inst_1 _inst_2 _inst_3 _inst_4 c R))
+Case conversion may be inaccurate. Consider using '#align euclidean_geometry.inversion_surjective EuclideanGeometry.inversion_surjectiveₓ'. -/
 theorem inversion_surjective (c : P) {R : ℝ} (hR : R ≠ 0) : Surjective (inversion c R) :=
   (inversion_involutive c hR).Surjective
 #align euclidean_geometry.inversion_surjective EuclideanGeometry.inversion_surjective
 
+/- warning: euclidean_geometry.inversion_injective -> EuclideanGeometry.inversion_injective is a dubious translation:
+lean 3 declaration is
+  forall {V : Type.{u1}} {P : Type.{u2}} [_inst_1 : NormedAddCommGroup.{u1} V] [_inst_2 : InnerProductSpace.{0, u1} Real V Real.isROrC _inst_1] [_inst_3 : MetricSpace.{u2} P] [_inst_4 : NormedAddTorsor.{u1, u2} V P (NormedAddCommGroup.toSeminormedAddCommGroup.{u1} V _inst_1) (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)] (c : P) {R : Real}, (Ne.{1} Real R (OfNat.ofNat.{0} Real 0 (OfNat.mk.{0} Real 0 (Zero.zero.{0} Real Real.hasZero)))) -> (Function.Injective.{succ u2, succ u2} P P (EuclideanGeometry.inversion.{u1, u2} V P _inst_1 _inst_2 _inst_3 _inst_4 c R))
+but is expected to have type
+  forall {V : Type.{u1}} {P : Type.{u2}} [_inst_1 : NormedAddCommGroup.{u1} V] [_inst_2 : InnerProductSpace.{0, u1} Real V Real.isROrC _inst_1] [_inst_3 : MetricSpace.{u2} P] [_inst_4 : NormedAddTorsor.{u1, u2} V P (NormedAddCommGroup.toSeminormedAddCommGroup.{u1} V _inst_1) (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)] (c : P) {R : Real}, (Ne.{1} Real R (OfNat.ofNat.{0} Real 0 (Zero.toOfNat0.{0} Real Real.instZeroReal))) -> (Function.Injective.{succ u2, succ u2} P P (EuclideanGeometry.inversion.{u1, u2} V P _inst_1 _inst_2 _inst_3 _inst_4 c R))
+Case conversion may be inaccurate. Consider using '#align euclidean_geometry.inversion_injective EuclideanGeometry.inversion_injectiveₓ'. -/
 theorem inversion_injective (c : P) {R : ℝ} (hR : R ≠ 0) : Injective (inversion c R) :=
   (inversion_involutive c hR).Injective
 #align euclidean_geometry.inversion_injective EuclideanGeometry.inversion_injective
 
+/- warning: euclidean_geometry.inversion_bijective -> EuclideanGeometry.inversion_bijective is a dubious translation:
+lean 3 declaration is
+  forall {V : Type.{u1}} {P : Type.{u2}} [_inst_1 : NormedAddCommGroup.{u1} V] [_inst_2 : InnerProductSpace.{0, u1} Real V Real.isROrC _inst_1] [_inst_3 : MetricSpace.{u2} P] [_inst_4 : NormedAddTorsor.{u1, u2} V P (NormedAddCommGroup.toSeminormedAddCommGroup.{u1} V _inst_1) (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)] (c : P) {R : Real}, (Ne.{1} Real R (OfNat.ofNat.{0} Real 0 (OfNat.mk.{0} Real 0 (Zero.zero.{0} Real Real.hasZero)))) -> (Function.Bijective.{succ u2, succ u2} P P (EuclideanGeometry.inversion.{u1, u2} V P _inst_1 _inst_2 _inst_3 _inst_4 c R))
+but is expected to have type
+  forall {V : Type.{u1}} {P : Type.{u2}} [_inst_1 : NormedAddCommGroup.{u1} V] [_inst_2 : InnerProductSpace.{0, u1} Real V Real.isROrC _inst_1] [_inst_3 : MetricSpace.{u2} P] [_inst_4 : NormedAddTorsor.{u1, u2} V P (NormedAddCommGroup.toSeminormedAddCommGroup.{u1} V _inst_1) (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)] (c : P) {R : Real}, (Ne.{1} Real R (OfNat.ofNat.{0} Real 0 (Zero.toOfNat0.{0} Real Real.instZeroReal))) -> (Function.Bijective.{succ u2, succ u2} P P (EuclideanGeometry.inversion.{u1, u2} V P _inst_1 _inst_2 _inst_3 _inst_4 c R))
+Case conversion may be inaccurate. Consider using '#align euclidean_geometry.inversion_bijective EuclideanGeometry.inversion_bijectiveₓ'. -/
 theorem inversion_bijective (c : P) {R : ℝ} (hR : R ≠ 0) : Bijective (inversion c R) :=
   (inversion_involutive c hR).Bijective
 #align euclidean_geometry.inversion_bijective EuclideanGeometry.inversion_bijective
 
+/- warning: euclidean_geometry.dist_inversion_inversion -> EuclideanGeometry.dist_inversion_inversion is a dubious translation:
+lean 3 declaration is
+  forall {V : Type.{u1}} {P : Type.{u2}} [_inst_1 : NormedAddCommGroup.{u1} V] [_inst_2 : InnerProductSpace.{0, u1} Real V Real.isROrC _inst_1] [_inst_3 : MetricSpace.{u2} P] [_inst_4 : NormedAddTorsor.{u1, u2} V P (NormedAddCommGroup.toSeminormedAddCommGroup.{u1} V _inst_1) (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)] {c : P} {x : P} {y : P}, (Ne.{succ u2} P x c) -> (Ne.{succ u2} P y c) -> (forall (R : Real), Eq.{1} Real (Dist.dist.{u2} P (PseudoMetricSpace.toHasDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) (EuclideanGeometry.inversion.{u1, u2} V P _inst_1 _inst_2 _inst_3 _inst_4 c R x) (EuclideanGeometry.inversion.{u1, u2} V P _inst_1 _inst_2 _inst_3 _inst_4 c R y)) (HMul.hMul.{0, 0, 0} Real Real Real (instHMul.{0} Real Real.hasMul) (HDiv.hDiv.{0, 0, 0} Real Real Real (instHDiv.{0} Real (DivInvMonoid.toHasDiv.{0} Real (DivisionRing.toDivInvMonoid.{0} Real Real.divisionRing))) (HPow.hPow.{0, 0, 0} Real Nat Real (instHPow.{0, 0} Real Nat (Monoid.Pow.{0} Real Real.monoid)) R (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) (HMul.hMul.{0, 0, 0} Real Real Real (instHMul.{0} Real Real.hasMul) (Dist.dist.{u2} P (PseudoMetricSpace.toHasDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) x c) (Dist.dist.{u2} P (PseudoMetricSpace.toHasDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) y c))) (Dist.dist.{u2} P (PseudoMetricSpace.toHasDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) x y)))
+but is expected to have type
+  forall {V : Type.{u1}} {P : Type.{u2}} [_inst_1 : NormedAddCommGroup.{u1} V] [_inst_2 : InnerProductSpace.{0, u1} Real V Real.isROrC _inst_1] [_inst_3 : MetricSpace.{u2} P] [_inst_4 : NormedAddTorsor.{u1, u2} V P (NormedAddCommGroup.toSeminormedAddCommGroup.{u1} V _inst_1) (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)] {c : P} {x : P} {y : P}, (Ne.{succ u2} P x c) -> (Ne.{succ u2} P y c) -> (forall (R : Real), Eq.{1} Real (Dist.dist.{u2} P (PseudoMetricSpace.toDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) (EuclideanGeometry.inversion.{u1, u2} V P _inst_1 _inst_2 _inst_3 _inst_4 c R x) (EuclideanGeometry.inversion.{u1, u2} V P _inst_1 _inst_2 _inst_3 _inst_4 c R y)) (HMul.hMul.{0, 0, 0} Real Real Real (instHMul.{0} Real Real.instMulReal) (HDiv.hDiv.{0, 0, 0} Real Real Real (instHDiv.{0} Real (LinearOrderedField.toDiv.{0} Real Real.instLinearOrderedFieldReal)) (HPow.hPow.{0, 0, 0} Real Nat Real (instHPow.{0, 0} Real Nat (Monoid.Pow.{0} Real Real.instMonoidReal)) R (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) (HMul.hMul.{0, 0, 0} Real Real Real (instHMul.{0} Real Real.instMulReal) (Dist.dist.{u2} P (PseudoMetricSpace.toDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) x c) (Dist.dist.{u2} P (PseudoMetricSpace.toDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) y c))) (Dist.dist.{u2} P (PseudoMetricSpace.toDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) x y)))
+Case conversion may be inaccurate. Consider using '#align euclidean_geometry.dist_inversion_inversion EuclideanGeometry.dist_inversion_inversionₓ'. -/
 /-- Distance between the images of two points under an inversion. -/
 theorem dist_inversion_inversion (hx : x ≠ c) (hy : y ≠ c) (R : ℝ) :
     dist (inversion c R x) (inversion c R y) = R ^ 2 / (dist x c * dist y c) * dist x y :=
@@ -120,6 +182,12 @@ theorem dist_inversion_inversion (hx : x ≠ c) (hy : y ≠ c) (R : ℝ) :
     dist_div_norm_sq_smul (vsub_ne_zero.2 hx) (vsub_ne_zero.2 hy) R
 #align euclidean_geometry.dist_inversion_inversion EuclideanGeometry.dist_inversion_inversion
 
+/- warning: euclidean_geometry.mul_dist_le_mul_dist_add_mul_dist -> EuclideanGeometry.mul_dist_le_mul_dist_add_mul_dist is a dubious translation:
+lean 3 declaration is
+  forall {V : Type.{u1}} {P : Type.{u2}} [_inst_1 : NormedAddCommGroup.{u1} V] [_inst_2 : InnerProductSpace.{0, u1} Real V Real.isROrC _inst_1] [_inst_3 : MetricSpace.{u2} P] [_inst_4 : NormedAddTorsor.{u1, u2} V P (NormedAddCommGroup.toSeminormedAddCommGroup.{u1} V _inst_1) (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)] (a : P) (b : P) (c : P) (d : P), LE.le.{0} Real Real.hasLe (HMul.hMul.{0, 0, 0} Real Real Real (instHMul.{0} Real Real.hasMul) (Dist.dist.{u2} P (PseudoMetricSpace.toHasDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) a c) (Dist.dist.{u2} P (PseudoMetricSpace.toHasDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) b d)) (HAdd.hAdd.{0, 0, 0} Real Real Real (instHAdd.{0} Real Real.hasAdd) (HMul.hMul.{0, 0, 0} Real Real Real (instHMul.{0} Real Real.hasMul) (Dist.dist.{u2} P (PseudoMetricSpace.toHasDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) a b) (Dist.dist.{u2} P (PseudoMetricSpace.toHasDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) c d)) (HMul.hMul.{0, 0, 0} Real Real Real (instHMul.{0} Real Real.hasMul) (Dist.dist.{u2} P (PseudoMetricSpace.toHasDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) b c) (Dist.dist.{u2} P (PseudoMetricSpace.toHasDist.{u2} P (MetricSpace.toPseudoMetricSpace.{u2} P _inst_3)) a d)))
+but is expected to have type
+  forall {V : Type.{u2}} {P : Type.{u1}} [_inst_1 : NormedAddCommGroup.{u2} V] [_inst_2 : InnerProductSpace.{0, u2} Real V Real.isROrC _inst_1] [_inst_3 : MetricSpace.{u1} P] [_inst_4 : NormedAddTorsor.{u2, u1} V P (NormedAddCommGroup.toSeminormedAddCommGroup.{u2} V _inst_1) (MetricSpace.toPseudoMetricSpace.{u1} P _inst_3)] (a : P) (b : P) (c : P) (d : P), LE.le.{0} Real Real.instLEReal (HMul.hMul.{0, 0, 0} Real Real Real (instHMul.{0} Real Real.instMulReal) (Dist.dist.{u1} P (PseudoMetricSpace.toDist.{u1} P (MetricSpace.toPseudoMetricSpace.{u1} P _inst_3)) a c) (Dist.dist.{u1} P (PseudoMetricSpace.toDist.{u1} P (MetricSpace.toPseudoMetricSpace.{u1} P _inst_3)) b d)) (HAdd.hAdd.{0, 0, 0} Real Real Real (instHAdd.{0} Real Real.instAddReal) (HMul.hMul.{0, 0, 0} Real Real Real (instHMul.{0} Real Real.instMulReal) (Dist.dist.{u1} P (PseudoMetricSpace.toDist.{u1} P (MetricSpace.toPseudoMetricSpace.{u1} P _inst_3)) a b) (Dist.dist.{u1} P (PseudoMetricSpace.toDist.{u1} P (MetricSpace.toPseudoMetricSpace.{u1} P _inst_3)) c d)) (HMul.hMul.{0, 0, 0} Real Real Real (instHMul.{0} Real Real.instMulReal) (Dist.dist.{u1} P (PseudoMetricSpace.toDist.{u1} P (MetricSpace.toPseudoMetricSpace.{u1} P _inst_3)) b c) (Dist.dist.{u1} P (PseudoMetricSpace.toDist.{u1} P (MetricSpace.toPseudoMetricSpace.{u1} P _inst_3)) a d)))
+Case conversion may be inaccurate. Consider using '#align euclidean_geometry.mul_dist_le_mul_dist_add_mul_dist EuclideanGeometry.mul_dist_le_mul_dist_add_mul_distₓ'. -/
 /-- **Ptolemy's inequality**: in a quadrangle `ABCD`, `|AC| * |BD| ≤ |AB| * |CD| + |BC| * |AD|`. If
 `ABCD` is a convex cyclic polygon, then this inequality becomes an equality, see
 `euclidean_geometry.mul_dist_add_mul_dist_eq_mul_dist_of_cospherical`.  -/
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yury G. Kudryashov
 
 ! This file was ported from Lean 3 source module geometry.euclidean.inversion
-! leanprover-community/mathlib commit 70fd9563a21e7b963887c9360bd29b2393e6225a
+! leanprover-community/mathlib commit 46b633fd842bef9469441c0209906f6dddd2b4f5
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -32,8 +32,8 @@ open Metric Real Function
 
 namespace EuclideanGeometry
 
-variable {V P : Type _} [InnerProductSpace ℝ V] [MetricSpace P] [NormedAddTorsor V P]
-  {a b c d x y z : P} {R : ℝ}
+variable {V P : Type _} [NormedAddCommGroup V] [InnerProductSpace ℝ V] [MetricSpace P]
+  [NormedAddTorsor V P] {a b c d x y z : P} {R : ℝ}
 
 include V
 
Diff
@@ -128,12 +128,12 @@ theorem mul_dist_le_mul_dist_add_mul_dist (a b c d : P) :
   by
   -- If one of the points `b`, `c`, `d` is equal to `a`, then the inequality is trivial.
   rcases eq_or_ne b a with (rfl | hb)
-  · rw [dist_self, zero_mul, zero_add]
+  · rw [dist_self, MulZeroClass.zero_mul, zero_add]
   rcases eq_or_ne c a with (rfl | hc)
-  · rw [dist_self, zero_mul]
+  · rw [dist_self, MulZeroClass.zero_mul]
     apply_rules [add_nonneg, mul_nonneg, dist_nonneg]
   rcases eq_or_ne d a with (rfl | hd)
-  · rw [dist_self, mul_zero, add_zero, dist_comm d, dist_comm d, mul_comm]
+  · rw [dist_self, MulZeroClass.mul_zero, add_zero, dist_comm d, dist_comm d, mul_comm]
   /- Otherwise, we apply the triangle inequality to `euclidean_geometry.inversion a 1 b`,
     `euclidean_geometry.inversion a 1 c`, and `euclidean_geometry.inversion a 1 d`. -/
   have H := dist_triangle (inversion a 1 b) (inversion a 1 c) (inversion a 1 d)

Changes in mathlib4

mathlib3
mathlib4
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
@@ -113,7 +113,7 @@ theorem inversion_inversion (c : P) {R : ℝ} (hR : R ≠ 0) (x : P) :
   rcases eq_or_ne x c with (rfl | hne)
   · rw [inversion_self, inversion_self]
   · rw [inversion, dist_inversion_center, inversion_vsub_center, smul_smul, ← mul_pow,
-      div_mul_div_comm, div_mul_cancel _ (dist_ne_zero.2 hne), ← sq, div_self, one_pow, one_smul,
+      div_mul_div_comm, div_mul_cancel₀ _ (dist_ne_zero.2 hne), ← sq, div_self, one_pow, one_smul,
       vsub_vadd]
     exact pow_ne_zero _ hR
 #align euclidean_geometry.inversion_inversion EuclideanGeometry.inversion_inversion
chore: work around simp issues in future nightlies (#11546)
Diff
@@ -42,6 +42,11 @@ def inversion (c : P) (R : ℝ) (x : P) : P :=
   (R / dist x c) ^ 2 • (x -ᵥ c) +ᵥ c
 #align euclidean_geometry.inversion EuclideanGeometry.inversion
 
+-- Adaptation note: nightly-2024-03-16: added to replace simp [inversion]
+theorem inversion_def :
+    inversion = fun (c : P) (R : ℝ) (x : P) => (R / dist x c) ^ 2 • (x -ᵥ c) +ᵥ c :=
+  rfl
+
 /-!
 ### Basic properties
 
chore: shake some imports (#10341)
Diff
@@ -3,6 +3,7 @@ Copyright (c) 2022 Yury G. Kudryashov. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yury G. Kudryashov
 -/
+import Mathlib.Analysis.Normed.Group.AddTorsor
 import Mathlib.Analysis.InnerProductSpace.Basic
 
 #align_import geometry.euclidean.inversion from "leanprover-community/mathlib"@"46b633fd842bef9469441c0209906f6dddd2b4f5"
chore(Analysis,Geometry): remove almost all autoImplicit (#9691)

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

Diff
@@ -22,8 +22,6 @@ Currently, we prove only a few basic lemmas needed to prove Ptolemy's inequality
 `EuclideanGeometry.mul_dist_le_mul_dist_add_mul_dist`.
 -/
 
-set_option autoImplicit true
-
 noncomputable section
 
 open Metric Function AffineMap Set AffineSubspace
@@ -206,9 +204,9 @@ open EuclideanGeometry
 ### Continuity of inversion
 -/
 
-protected theorem Filter.Tendsto.inversion {l : Filter α} {fc fx : α → P} {fR : α → ℝ}
-    (hc : Tendsto fc l (𝓝 c)) (hR : Tendsto fR l (𝓝 R)) (hx : Tendsto fx l (𝓝 x))
-    (hne : x ≠ c) :
+protected theorem Filter.Tendsto.inversion {α : Type*} {x c : P} {R : ℝ} {l : Filter α}
+    {fc fx : α → P} {fR : α → ℝ} (hc : Tendsto fc l (𝓝 c)) (hR : Tendsto fR l (𝓝 R))
+    (hx : Tendsto fx l (𝓝 x)) (hne : x ≠ c) :
     Tendsto (fun a ↦ inversion (fc a) (fR a) (fx a)) l (𝓝 (inversion c R x)) :=
   (((hR.div (hx.dist hc) <| dist_ne_zero.2 hne).pow 2).smul (hx.vsub hc)).vadd hc
 
chore: drop MulZeroClass. in mul_zero/zero_mul (#6682)

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

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

Diff
@@ -182,12 +182,12 @@ theorem mul_dist_le_mul_dist_add_mul_dist (a b c d : P) :
     dist a c * dist b d ≤ dist a b * dist c d + dist b c * dist a d := by
   -- If one of the points `b`, `c`, `d` is equal to `a`, then the inequality is trivial.
   rcases eq_or_ne b a with (rfl | hb)
-  · rw [dist_self, MulZeroClass.zero_mul, zero_add]
+  · rw [dist_self, zero_mul, zero_add]
   rcases eq_or_ne c a with (rfl | hc)
-  · rw [dist_self, MulZeroClass.zero_mul]
+  · rw [dist_self, zero_mul]
     apply_rules [add_nonneg, mul_nonneg, dist_nonneg]
   rcases eq_or_ne d a with (rfl | hd)
-  · rw [dist_self, MulZeroClass.mul_zero, add_zero, dist_comm d, dist_comm d, mul_comm]
+  · rw [dist_self, mul_zero, add_zero, dist_comm d, dist_comm d, mul_comm]
   /- Otherwise, we apply the triangle inequality to `EuclideanGeometry.inversion a 1 b`,
     `EuclideanGeometry.inversion a 1 c`, and `EuclideanGeometry.inversion a 1 d`. -/
   have H := dist_triangle (inversion a 1 b) (inversion a 1 c) (inversion a 1 d)
fix: disable autoImplicit globally (#6528)

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

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

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

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

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

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

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

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

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

Diff
@@ -22,6 +22,8 @@ Currently, we prove only a few basic lemmas needed to prove Ptolemy's inequality
 `EuclideanGeometry.mul_dist_le_mul_dist_add_mul_dist`.
 -/
 
+set_option autoImplicit true
+
 noncomputable section
 
 open Metric Function AffineMap Set AffineSubspace
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
@@ -27,7 +27,7 @@ noncomputable section
 open Metric Function AffineMap Set AffineSubspace
 open scoped Topology
 
-variable {V P : Type _} [NormedAddCommGroup V] [InnerProductSpace ℝ V] [MetricSpace P]
+variable {V P : Type*} [NormedAddCommGroup V] [InnerProductSpace ℝ V] [MetricSpace P]
   [NormedAddTorsor V P]
 
 namespace EuclideanGeometry
@@ -210,7 +210,7 @@ protected theorem Filter.Tendsto.inversion {l : Filter α} {fc fx : α → P} {f
     Tendsto (fun a ↦ inversion (fc a) (fR a) (fx a)) l (𝓝 (inversion c R x)) :=
   (((hR.div (hx.dist hc) <| dist_ne_zero.2 hne).pow 2).smul (hx.vsub hc)).vadd hc
 
-variable {X : Type _} [TopologicalSpace X] {c x : X → P} {R : X → ℝ} {a₀ : X} {s : Set X}
+variable {X : Type*} [TopologicalSpace X] {c x : X → P} {R : X → ℝ} {a₀ : X} {s : Set X}
 
 protected nonrec theorem ContinuousWithinAt.inversion (hc : ContinuousWithinAt c s a₀)
     (hR : ContinuousWithinAt R s a₀) (hx : ContinuousWithinAt x s a₀) (hne : x a₀ ≠ c a₀) :
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,14 +2,11 @@
 Copyright (c) 2022 Yury G. Kudryashov. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yury G. Kudryashov
-
-! This file was ported from Lean 3 source module geometry.euclidean.inversion
-! leanprover-community/mathlib commit 46b633fd842bef9469441c0209906f6dddd2b4f5
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Analysis.InnerProductSpace.Basic
 
+#align_import geometry.euclidean.inversion from "leanprover-community/mathlib"@"46b633fd842bef9469441c0209906f6dddd2b4f5"
+
 /-!
 # Inversion in an affine space
 
chore: split Mathlib.Geometry.Euclidean.Inversion (#5868)

Move theorems about image of a sphere passing through the center to a new file.

Diff
@@ -9,7 +9,6 @@ Authors: Yury G. Kudryashov
 ! if you have ported upstream changes.
 -/
 import Mathlib.Analysis.InnerProductSpace.Basic
-import Mathlib.Geometry.Euclidean.PerpBisector
 
 /-!
 # Inversion in an affine space
@@ -200,58 +199,6 @@ theorem mul_dist_le_mul_dist_add_mul_dist (a b c d : P) :
   convert H using 1 <;> (field_simp [hb.ne', hc.ne', hd.ne', dist_comm a]; ring)
 #align euclidean_geometry.mul_dist_le_mul_dist_add_mul_dist EuclideanGeometry.mul_dist_le_mul_dist_add_mul_dist
 
-/-!
-### Images of spheres and hyperplanes
-
-In this section we prove that the inversion with center `c` and radius `R ≠ 0` maps a sphere passing
-through the center to a hyperplane. More precisely, it maps a sphere with center `y ≠ c` and radius
-`dist y c` to the hyperplane `AffineSubspace.perpBisector c (EuclideanGeometry.inversion c R y)`.
-
--/
-
-/-- The inversion with center `c` and radius `R` maps a sphere passing through the center to a
-hyperplane. -/
-theorem inversion_mem_perpBisector_inversion_iff (hR : R ≠ 0) (hx : x ≠ c) (hy : y ≠ c) :
-    inversion c R x ∈ perpBisector c (inversion c R y) ↔ dist x y = dist y c := by
-  rw [mem_perpBisector_iff_dist_eq, dist_inversion_inversion hx hy, dist_inversion_center]
-  have hx' := dist_ne_zero.2 hx
-  have hy' := dist_ne_zero.2 hy
-  field_simp [mul_assoc, mul_comm, hx, hx.symm, eq_comm]
-
-/-- The inversion with center `c` and radius `R` maps a sphere passing through the center to a
-hyperplane. -/
-theorem inversion_mem_perpBisector_inversion_iff' (hR : R ≠ 0) (hy : y ≠ c) :
-    inversion c R x ∈ perpBisector c (inversion c R y) ↔ dist x y = dist y c ∧ x ≠ c := by
-  rcases eq_or_ne x c with rfl | hx
-  · simp [*]
-  · simp [inversion_mem_perpBisector_inversion_iff hR hx hy, hx]
-
-theorem preimage_inversion_perpBisector_inversion (hR : R ≠ 0) (hy : y ≠ c) :
-    inversion c R ⁻¹' perpBisector c (inversion c R y) = sphere y (dist y c) \ {c} :=
-  Set.ext fun _ ↦ inversion_mem_perpBisector_inversion_iff' hR hy
-
-theorem preimage_inversion_perpBisector (hR : R ≠ 0) (hy : y ≠ c) :
-    inversion c R ⁻¹' perpBisector c y = sphere (inversion c R y) (R ^ 2 / dist y c) \ {c} := by
-  rw [← dist_inversion_center, ← preimage_inversion_perpBisector_inversion hR,
-    inversion_inversion] <;> simp [*]
-
-theorem image_inversion_perpBisector (hR : R ≠ 0) (hy : y ≠ c) :
-    inversion c R '' perpBisector c y = sphere (inversion c R y) (R ^ 2 / dist y c) \ {c} := by
-  rw [image_eq_preimage_of_inverse (inversion_involutive _ hR) (inversion_involutive _ hR),
-    preimage_inversion_perpBisector hR hy]
-
-theorem preimage_inversion_sphere_dist_center (hR : R ≠ 0) (hy : y ≠ c) :
-    inversion c R ⁻¹' sphere y (dist y c) =
-      insert c (perpBisector c (inversion c R y) : Set P) := by
-  ext x
-  rcases eq_or_ne x c with rfl | hx; · simp [dist_comm]
-  rw [mem_preimage, mem_sphere, ← inversion_mem_perpBisector_inversion_iff hR] <;> simp [*]
-
-theorem image_inversion_sphere_dist_center (hR : R ≠ 0) (hy : y ≠ c) :
-    inversion c R '' sphere y (dist y c) = insert c (perpBisector c (inversion c R y) : Set P) := by
-  rw [image_eq_preimage_of_inverse (inversion_involutive _ hR) (inversion_involutive _ hR),
-    preimage_inversion_sphere_dist_center hR hy]
-
 end EuclideanGeometry
 
 open EuclideanGeometry
feat: lemmas about inversion (#5667)
Diff
@@ -9,6 +9,7 @@ Authors: Yury G. Kudryashov
 ! if you have ported upstream changes.
 -/
 import Mathlib.Analysis.InnerProductSpace.Basic
+import Mathlib.Geometry.Euclidean.PerpBisector
 
 /-!
 # Inversion in an affine space
@@ -25,15 +26,17 @@ Currently, we prove only a few basic lemmas needed to prove Ptolemy's inequality
 `EuclideanGeometry.mul_dist_le_mul_dist_add_mul_dist`.
 -/
 
-
 noncomputable section
 
-open Metric Real Function
+open Metric Function AffineMap Set AffineSubspace
+open scoped Topology
+
+variable {V P : Type _} [NormedAddCommGroup V] [InnerProductSpace ℝ V] [MetricSpace P]
+  [NormedAddTorsor V P]
 
 namespace EuclideanGeometry
 
-variable {V P : Type _} [NormedAddCommGroup V] [InnerProductSpace ℝ V] [MetricSpace P]
-  [NormedAddTorsor V P] {a b c d x y z : P} {R : ℝ}
+variable {a b c d x y z : P} {r R : ℝ}
 
 /-- Inversion in a sphere in an affine space. This map sends each point `x` to the point `y` such
 that `y -ᵥ c = (R / dist x c) ^ 2 • (x -ᵥ c)`, where `c` and `R` are the center and the radius the
@@ -42,6 +45,18 @@ def inversion (c : P) (R : ℝ) (x : P) : P :=
   (R / dist x c) ^ 2 • (x -ᵥ c) +ᵥ c
 #align euclidean_geometry.inversion EuclideanGeometry.inversion
 
+/-!
+### Basic properties
+
+In this section we prove that `EuclideanGeometry.inversion c R` is involutive and preserves the
+sphere `Metric.sphere c R`. We also prove that the distance to the center of the image of `x` under
+this inversion is given by `R ^ 2 / dist x c`.
+-/
+
+theorem inversion_eq_lineMap (c : P) (R : ℝ) (x : P) :
+    inversion c R x = lineMap c x ((R / dist x c) ^ 2) :=
+  rfl
+
 theorem inversion_vsub_center (c : P) (R : ℝ) (x : P) :
     inversion c R x -ᵥ c = (R / dist x c) ^ 2 • (x -ᵥ c) :=
   vadd_vsub _ _
@@ -51,6 +66,14 @@ theorem inversion_vsub_center (c : P) (R : ℝ) (x : P) :
 theorem inversion_self (c : P) (R : ℝ) : inversion c R c = c := by simp [inversion]
 #align euclidean_geometry.inversion_self EuclideanGeometry.inversion_self
 
+@[simp]
+theorem inversion_zero_radius (c x : P) : inversion c 0 x = c := by simp [inversion]
+
+theorem inversion_mul (c : P) (a R : ℝ) (x : P) :
+    inversion c (a * R) x = homothety c (a ^ 2) (inversion c R x) := by
+  simp only [inversion_eq_lineMap, ← homothety_eq_lineMap, ← homothety_mul_apply, mul_div_assoc,
+    mul_pow]
+
 @[simp]
 theorem inversion_dist_center (c x : P) : inversion c (dist x c) x = x := by
   rcases eq_or_ne x c with (rfl | hne)
@@ -59,6 +82,10 @@ theorem inversion_dist_center (c x : P) : inversion c (dist x c) x = x := by
     rwa [dist_ne_zero]
 #align euclidean_geometry.inversion_dist_center EuclideanGeometry.inversion_dist_center
 
+@[simp]
+theorem inversion_dist_center' (c x : P) : inversion c (dist c x) x = x := by
+  rw [dist_comm, inversion_dist_center]
+
 theorem inversion_of_mem_sphere (h : x ∈ Metric.sphere c R) : inversion c R x = x :=
   h.out ▸ inversion_dist_center c x
 #align euclidean_geometry.inversion_of_mem_sphere EuclideanGeometry.inversion_of_mem_sphere
@@ -105,6 +132,29 @@ theorem inversion_bijective (c : P) {R : ℝ} (hR : R ≠ 0) : Bijective (invers
   (inversion_involutive c hR).bijective
 #align euclidean_geometry.inversion_bijective EuclideanGeometry.inversion_bijective
 
+theorem inversion_eq_center (hR : R ≠ 0) : inversion c R x = c ↔ x = c :=
+  (inversion_injective c hR).eq_iff' <| inversion_self _ _
+
+@[simp]
+theorem inversion_eq_center' : inversion c R x = c ↔ x = c ∨ R = 0 := by
+  by_cases hR : R = 0 <;> simp [inversion_eq_center, hR]
+
+theorem center_eq_inversion (hR : R ≠ 0) : c = inversion c R x ↔ x = c :=
+  eq_comm.trans (inversion_eq_center hR)
+
+@[simp]
+theorem center_eq_inversion' : c = inversion c R x ↔ x = c ∨ R = 0 :=
+  eq_comm.trans inversion_eq_center'
+
+/-!
+### Similarity of triangles
+
+If inversion with center `O` sends `A` to `A'` and `B` to `B'`, then the triangle `OB'A'` is similar
+to the triangle `OAB` with coefficient `R ^ 2 / (|OA|*|OB|)` and the triangle `OA'B` is similar to
+the triangle `OAB'` with coefficient `|OB|/|OA|`. We formulate these statements in terms of ratios
+of the lengths of their sides.
+-/
+
 /-- Distance between the images of two points under an inversion. -/
 theorem dist_inversion_inversion (hx : x ≠ c) (hy : y ≠ c) (R : ℝ) :
     dist (inversion c R x) (inversion c R y) = R ^ 2 / (dist x c * dist y c) * dist x y := by
@@ -114,6 +164,19 @@ theorem dist_inversion_inversion (hx : x ≠ c) (hy : y ≠ c) (R : ℝ) :
     dist_div_norm_sq_smul (vsub_ne_zero.2 hx) (vsub_ne_zero.2 hy) R
 #align euclidean_geometry.dist_inversion_inversion EuclideanGeometry.dist_inversion_inversion
 
+theorem dist_inversion_mul_dist_center_eq (hx : x ≠ c) (hy : y ≠ c) :
+    dist (inversion c R x) y * dist x c = dist x (inversion c R y) * dist y c := by
+  rcases eq_or_ne R 0 with rfl | hR; · simp [dist_comm, mul_comm]
+  have hy' : inversion c R y ≠ c := by simp [*]
+  conv in dist _ y => rw [← inversion_inversion c hR y]
+  rw [dist_inversion_inversion hx hy', dist_inversion_center]
+  have : dist x c ≠ 0 := dist_ne_zero.2 hx
+  field_simp; ring
+
+/-!
+### Ptolemy's inequality
+-/
+
 /-- **Ptolemy's inequality**: in a quadrangle `ABCD`, `|AC| * |BD| ≤ |AB| * |CD| + |BC| * |AD|`. If
 `ABCD` is a convex cyclic polygon, then this inequality becomes an equality, see
 `EuclideanGeometry.mul_dist_add_mul_dist_eq_mul_dist_of_cospherical`. -/
@@ -137,4 +200,90 @@ theorem mul_dist_le_mul_dist_add_mul_dist (a b c d : P) :
   convert H using 1 <;> (field_simp [hb.ne', hc.ne', hd.ne', dist_comm a]; ring)
 #align euclidean_geometry.mul_dist_le_mul_dist_add_mul_dist EuclideanGeometry.mul_dist_le_mul_dist_add_mul_dist
 
+/-!
+### Images of spheres and hyperplanes
+
+In this section we prove that the inversion with center `c` and radius `R ≠ 0` maps a sphere passing
+through the center to a hyperplane. More precisely, it maps a sphere with center `y ≠ c` and radius
+`dist y c` to the hyperplane `AffineSubspace.perpBisector c (EuclideanGeometry.inversion c R y)`.
+
+-/
+
+/-- The inversion with center `c` and radius `R` maps a sphere passing through the center to a
+hyperplane. -/
+theorem inversion_mem_perpBisector_inversion_iff (hR : R ≠ 0) (hx : x ≠ c) (hy : y ≠ c) :
+    inversion c R x ∈ perpBisector c (inversion c R y) ↔ dist x y = dist y c := by
+  rw [mem_perpBisector_iff_dist_eq, dist_inversion_inversion hx hy, dist_inversion_center]
+  have hx' := dist_ne_zero.2 hx
+  have hy' := dist_ne_zero.2 hy
+  field_simp [mul_assoc, mul_comm, hx, hx.symm, eq_comm]
+
+/-- The inversion with center `c` and radius `R` maps a sphere passing through the center to a
+hyperplane. -/
+theorem inversion_mem_perpBisector_inversion_iff' (hR : R ≠ 0) (hy : y ≠ c) :
+    inversion c R x ∈ perpBisector c (inversion c R y) ↔ dist x y = dist y c ∧ x ≠ c := by
+  rcases eq_or_ne x c with rfl | hx
+  · simp [*]
+  · simp [inversion_mem_perpBisector_inversion_iff hR hx hy, hx]
+
+theorem preimage_inversion_perpBisector_inversion (hR : R ≠ 0) (hy : y ≠ c) :
+    inversion c R ⁻¹' perpBisector c (inversion c R y) = sphere y (dist y c) \ {c} :=
+  Set.ext fun _ ↦ inversion_mem_perpBisector_inversion_iff' hR hy
+
+theorem preimage_inversion_perpBisector (hR : R ≠ 0) (hy : y ≠ c) :
+    inversion c R ⁻¹' perpBisector c y = sphere (inversion c R y) (R ^ 2 / dist y c) \ {c} := by
+  rw [← dist_inversion_center, ← preimage_inversion_perpBisector_inversion hR,
+    inversion_inversion] <;> simp [*]
+
+theorem image_inversion_perpBisector (hR : R ≠ 0) (hy : y ≠ c) :
+    inversion c R '' perpBisector c y = sphere (inversion c R y) (R ^ 2 / dist y c) \ {c} := by
+  rw [image_eq_preimage_of_inverse (inversion_involutive _ hR) (inversion_involutive _ hR),
+    preimage_inversion_perpBisector hR hy]
+
+theorem preimage_inversion_sphere_dist_center (hR : R ≠ 0) (hy : y ≠ c) :
+    inversion c R ⁻¹' sphere y (dist y c) =
+      insert c (perpBisector c (inversion c R y) : Set P) := by
+  ext x
+  rcases eq_or_ne x c with rfl | hx; · simp [dist_comm]
+  rw [mem_preimage, mem_sphere, ← inversion_mem_perpBisector_inversion_iff hR] <;> simp [*]
+
+theorem image_inversion_sphere_dist_center (hR : R ≠ 0) (hy : y ≠ c) :
+    inversion c R '' sphere y (dist y c) = insert c (perpBisector c (inversion c R y) : Set P) := by
+  rw [image_eq_preimage_of_inverse (inversion_involutive _ hR) (inversion_involutive _ hR),
+    preimage_inversion_sphere_dist_center hR hy]
+
 end EuclideanGeometry
+
+open EuclideanGeometry
+
+/-!
+### Continuity of inversion
+-/
+
+protected theorem Filter.Tendsto.inversion {l : Filter α} {fc fx : α → P} {fR : α → ℝ}
+    (hc : Tendsto fc l (𝓝 c)) (hR : Tendsto fR l (𝓝 R)) (hx : Tendsto fx l (𝓝 x))
+    (hne : x ≠ c) :
+    Tendsto (fun a ↦ inversion (fc a) (fR a) (fx a)) l (𝓝 (inversion c R x)) :=
+  (((hR.div (hx.dist hc) <| dist_ne_zero.2 hne).pow 2).smul (hx.vsub hc)).vadd hc
+
+variable {X : Type _} [TopologicalSpace X] {c x : X → P} {R : X → ℝ} {a₀ : X} {s : Set X}
+
+protected nonrec theorem ContinuousWithinAt.inversion (hc : ContinuousWithinAt c s a₀)
+    (hR : ContinuousWithinAt R s a₀) (hx : ContinuousWithinAt x s a₀) (hne : x a₀ ≠ c a₀) :
+    ContinuousWithinAt (fun a ↦ inversion (c a) (R a) (x a)) s a₀ :=
+  hc.inversion hR hx hne
+
+protected nonrec theorem ContinuousAt.inversion (hc : ContinuousAt c a₀) (hR : ContinuousAt R a₀)
+    (hx : ContinuousAt x a₀) (hne : x a₀ ≠ c a₀) :
+    ContinuousAt (fun a ↦ inversion (c a) (R a) (x a)) a₀ :=
+  hc.inversion hR hx hne
+
+protected theorem ContinuousOn.inversion (hc : ContinuousOn c s) (hR : ContinuousOn R s)
+    (hx : ContinuousOn x s) (hne : ∀ a ∈ s, x a ≠ c a) :
+    ContinuousOn (fun a ↦ inversion (c a) (R a) (x a)) s := fun a ha ↦
+  (hc a ha).inversion (hR a ha) (hx a ha) (hne a ha)
+
+protected theorem Continuous.inversion (hc : Continuous c) (hR : Continuous R) (hx : Continuous x)
+    (hne : ∀ a, x a ≠ c a) : Continuous (fun a ↦ inversion (c a) (R a) (x a)) :=
+  continuous_iff_continuousAt.2 fun _ ↦
+    hc.continuousAt.inversion hR.continuousAt hx.continuousAt (hne _)
fix: recover convert proof in Geometry.Euclidean.Inversion (#4421)

During porting a convert proof was converted to calc. This switches to a more direct translation of the original.

We need using now because convert is happy to descend into the expressions and equate (HMul.hMul : ℝ → ℝ → ℝ) = (HDiv.hDiv : ℝ → ℝ → ℝ) since these involve the same types. The old convert wouldn't do this because it used simp's congr lemmas, and these require that the functions be defeq rather than just equal.

Diff
@@ -134,10 +134,7 @@ theorem mul_dist_le_mul_dist_add_mul_dist (a b c d : P) :
     dist_inversion_inversion hc hd, one_pow] at H
   rw [← dist_pos] at hb hc hd
   rw [← div_le_div_right (mul_pos hb (mul_pos hc hd))]
-  calc
-    _ = _ := by field_simp [hb.ne', hc.ne', hd.ne', dist_comm a]; ring
-    _ ≤ _ := H
-    _ = _ := by field_simp [hb.ne', hc.ne', hd.ne', dist_comm a]; ring
+  convert H using 1 <;> (field_simp [hb.ne', hc.ne', hd.ne', dist_comm a]; ring)
 #align euclidean_geometry.mul_dist_le_mul_dist_add_mul_dist EuclideanGeometry.mul_dist_le_mul_dist_add_mul_dist
 
 end EuclideanGeometry
feat: port Geometry.Euclidean.Inversion (#4375)

Dependencies 12 + 774

775 files ported (98.5%)
346549 lines ported (98.4%)
Show graph

The unported dependencies are

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