# Documentation

## Mathlib.Geometry.Euclidean.Circumcenter

This file proves some lemmas on points equidistant from a set of points, and defines the circumradius and circumcenter of a simplex. There are also some definitions for use in calculations where it is convenient to work with affine combinations of vertices together with the circumcenter.

## Main definitions #

• circumcenter and circumradius are the circumcenter and circumradius of a simplex.

## References #

theorem EuclideanGeometry.dist_eq_iff_dist_orthogonalProjection_eq {V : Type u_1} {P : Type u_2} [] [] [] {s : } [Nonempty s] [HasOrthogonalProjection s.direction] {p1 : P} {p2 : P} (p3 : P) (hp1 : p1 s) (hp2 : p2 s) :
dist p1 p3 = dist p2 p3 dist p1 = dist p2

p is equidistant from two points in s if and only if its orthogonalProjection is.

theorem EuclideanGeometry.dist_set_eq_iff_dist_orthogonalProjection_eq {V : Type u_1} {P : Type u_2} [] [] [] {s : } [Nonempty s] [HasOrthogonalProjection s.direction] {ps : Set P} (hps : ps s) (p : P) :
(ps.Pairwise fun (p1 p2 : P) => dist p1 p = dist p2 p) ps.Pairwise fun (p1 p2 : P) => dist p1 = dist p2

p is equidistant from a set of points in s if and only if its orthogonalProjection is.

theorem EuclideanGeometry.exists_dist_eq_iff_exists_dist_orthogonalProjection_eq {V : Type u_1} {P : Type u_2} [] [] [] {s : } [Nonempty s] [HasOrthogonalProjection s.direction] {ps : Set P} (hps : ps s) (p : P) :
(∃ (r : ), p1ps, dist p1 p = r) ∃ (r : ), p1ps, dist p1 = r

There exists r such that p has distance r from all the points of a set of points in s if and only if there exists (possibly different) r such that its orthogonalProjection has that distance from all the points in that set.

theorem EuclideanGeometry.existsUnique_dist_eq_of_insert {V : Type u_1} {P : Type u_2} [] [] [] {s : } [HasOrthogonalProjection s.direction] {ps : Set P} (hnps : ps.Nonempty) {p : P} (hps : ps s) (hp : ps) (hu : ∃! cs : , cs.center s ps Metric.sphere cs.center cs.radius) :
∃! cs₂ : , cs₂.center affineSpan (insert p s) insert p ps Metric.sphere cs₂.center cs₂.radius

The induction step for the existence and uniqueness of the circumcenter. Given a nonempty set of points in a nonempty affine subspace whose direction is complete, such that there is a unique (circumcenter, circumradius) pair for those points in that subspace, and a point p not in that subspace, there is a unique (circumcenter, circumradius) pair for the set with p added, in the span of the subspace with p added.

theorem AffineIndependent.existsUnique_dist_eq {V : Type u_1} {P : Type u_2} [] [] [] {ι : Type u_3} [hne : ] [] {p : ιP} (ha : ) :
∃! cs : , cs.center Metric.sphere cs.center cs.radius

Given a finite nonempty affinely independent family of points, there is a unique (circumcenter, circumradius) pair for those points in the affine subspace they span.

def Affine.Simplex.circumsphere {V : Type u_1} {P : Type u_2} [] [] [] {n : } (s : ) :

The circumsphere of a simplex.

Equations
• s.circumsphere =
Instances For
theorem Affine.Simplex.circumsphere_unique_dist_eq {V : Type u_1} {P : Type u_2} [] [] [] {n : } (s : ) :
(s.circumsphere.center affineSpan (Set.range s.points) Set.range s.points Metric.sphere s.circumsphere.center s.circumsphere.radius) ∀ (cs : ), cs.center affineSpan (Set.range s.points) Set.range s.points Metric.sphere cs.center cs.radiuscs = s.circumsphere

The property satisfied by the circumsphere.

def Affine.Simplex.circumcenter {V : Type u_1} {P : Type u_2} [] [] [] {n : } (s : ) :
P

The circumcenter of a simplex.

Equations
• s.circumcenter = s.circumsphere.center
Instances For
def Affine.Simplex.circumradius {V : Type u_1} {P : Type u_2} [] [] [] {n : } (s : ) :

Equations
Instances For
@[simp]
theorem Affine.Simplex.circumsphere_center {V : Type u_1} {P : Type u_2} [] [] [] {n : } (s : ) :
s.circumsphere.center = s.circumcenter

The center of the circumsphere is the circumcenter.

@[simp]
theorem Affine.Simplex.circumsphere_radius {V : Type u_1} {P : Type u_2} [] [] [] {n : } (s : ) :

theorem Affine.Simplex.circumcenter_mem_affineSpan {V : Type u_1} {P : Type u_2} [] [] [] {n : } (s : ) :
s.circumcenter affineSpan (Set.range s.points)

The circumcenter lies in the affine span.

@[simp]
theorem Affine.Simplex.dist_circumcenter_eq_circumradius {V : Type u_1} {P : Type u_2} [] [] [] {n : } (s : ) (i : Fin (n + 1)) :
dist (s.points i) s.circumcenter = s.circumradius

All points have distance from the circumcenter equal to the circumradius.

theorem Affine.Simplex.mem_circumsphere {V : Type u_1} {P : Type u_2} [] [] [] {n : } (s : ) (i : Fin (n + 1)) :
s.points i s.circumsphere

All points lie in the circumsphere.

@[simp]
theorem Affine.Simplex.dist_circumcenter_eq_circumradius' {V : Type u_1} {P : Type u_2} [] [] [] {n : } (s : ) (i : Fin (n + 1)) :
dist s.circumcenter (s.points i) = s.circumradius

All points have distance to the circumcenter equal to the circumradius.

theorem Affine.Simplex.eq_circumcenter_of_dist_eq {V : Type u_1} {P : Type u_2} [] [] [] {n : } (s : ) {p : P} (hp : p affineSpan (Set.range s.points)) {r : } (hr : ∀ (i : Fin (n + 1)), dist (s.points i) p = r) :
p = s.circumcenter

Given a point in the affine span from which all the points are equidistant, that point is the circumcenter.

theorem Affine.Simplex.eq_circumradius_of_dist_eq {V : Type u_1} {P : Type u_2} [] [] [] {n : } (s : ) {p : P} (hp : p affineSpan (Set.range s.points)) {r : } (hr : ∀ (i : Fin (n + 1)), dist (s.points i) p = r) :

Given a point in the affine span from which all the points are equidistant, that distance is the circumradius.

theorem Affine.Simplex.circumradius_nonneg {V : Type u_1} {P : Type u_2} [] [] [] {n : } (s : ) :

theorem Affine.Simplex.circumradius_pos {V : Type u_1} {P : Type u_2} [] [] [] {n : } (s : Affine.Simplex P (n + 1)) :

The circumradius of a simplex with at least two points is positive.

theorem Affine.Simplex.circumcenter_eq_point {V : Type u_1} {P : Type u_2} [] [] [] (s : ) (i : Fin 1) :
s.circumcenter = s.points i

The circumcenter of a 0-simplex equals its unique point.

theorem Affine.Simplex.circumcenter_eq_centroid {V : Type u_1} {P : Type u_2} [] [] [] (s : ) :
s.circumcenter = Finset.centroid Finset.univ s.points

The circumcenter of a 1-simplex equals its centroid.

@[simp]
theorem Affine.Simplex.circumsphere_reindex {V : Type u_1} {P : Type u_2} [] [] [] {m : } {n : } (s : ) (e : Fin (m + 1) Fin (n + 1)) :
(s.reindex e).circumsphere = s.circumsphere

Reindexing a simplex along an Equiv of index types does not change the circumsphere.

@[simp]
theorem Affine.Simplex.circumcenter_reindex {V : Type u_1} {P : Type u_2} [] [] [] {m : } {n : } (s : ) (e : Fin (m + 1) Fin (n + 1)) :
(s.reindex e).circumcenter = s.circumcenter

Reindexing a simplex along an Equiv of index types does not change the circumcenter.

@[simp]
theorem Affine.Simplex.circumradius_reindex {V : Type u_1} {P : Type u_2} [] [] [] {m : } {n : } (s : ) (e : Fin (m + 1) Fin (n + 1)) :

Reindexing a simplex along an Equiv of index types does not change the circumradius.

def Affine.Simplex.orthogonalProjectionSpan {V : Type u_1} {P : Type u_2} [] [] [] {n : } (s : ) :

The orthogonal projection of a point p onto the hyperplane spanned by the simplex's points.

Equations
Instances For
theorem Affine.Simplex.orthogonalProjection_vadd_smul_vsub_orthogonalProjection {V : Type u_1} {P : Type u_2} [] [] [] {n : } (s : ) {p1 : P} (p2 : P) (r : ) (hp : p1 affineSpan (Set.range s.points)) :
s.orthogonalProjectionSpan (r (p2 -ᵥ (s.orthogonalProjectionSpan p2)) +ᵥ p1) = p1, hp

Adding a vector to a point in the given subspace, then taking the orthogonal projection, produces the original point if the vector is a multiple of the result of subtracting a point's orthogonal projection from that point.

theorem Affine.Simplex.coe_orthogonalProjection_vadd_smul_vsub_orthogonalProjection {V : Type u_1} {P : Type u_2} [] [] [] {n : } {r₁ : } (s : ) {p : P} {p₁o : P} (hp₁o : p₁o affineSpan (Set.range s.points)) :
(s.orthogonalProjectionSpan (r₁ (p -ᵥ (s.orthogonalProjectionSpan p)) +ᵥ p₁o)) = p₁o
theorem Affine.Simplex.dist_sq_eq_dist_orthogonalProjection_sq_add_dist_orthogonalProjection_sq {V : Type u_1} {P : Type u_2} [] [] [] {n : } (s : ) {p1 : P} (p2 : P) (hp1 : p1 affineSpan (Set.range s.points)) :
dist p1 p2 * dist p1 p2 = dist p1 (s.orthogonalProjectionSpan p2) * dist p1 (s.orthogonalProjectionSpan p2) + dist p2 (s.orthogonalProjectionSpan p2) * dist p2 (s.orthogonalProjectionSpan p2)
theorem Affine.Simplex.dist_circumcenter_sq_eq_sq_sub_circumradius {V : Type u_1} {P : Type u_2} [] [] [] {n : } {r : } (s : ) {p₁ : P} (h₁ : ∀ (i : Fin (n + 1)), dist (s.points i) p₁ = r) (h₁' : (s.orthogonalProjectionSpan p₁) = s.circumcenter) (h : s.points 0 affineSpan (Set.range s.points)) :
dist p₁ s.circumcenter * dist p₁ s.circumcenter = r * r - s.circumradius * s.circumradius
theorem Affine.Simplex.orthogonalProjection_eq_circumcenter_of_exists_dist_eq {V : Type u_1} {P : Type u_2} [] [] [] {n : } (s : ) {p : P} (hr : ∃ (r : ), ∀ (i : Fin (n + 1)), dist (s.points i) p = r) :
(s.orthogonalProjectionSpan p) = s.circumcenter

If there exists a distance that a point has from all vertices of a simplex, the orthogonal projection of that point onto the subspace spanned by that simplex is its circumcenter.

theorem Affine.Simplex.orthogonalProjection_eq_circumcenter_of_dist_eq {V : Type u_1} {P : Type u_2} [] [] [] {n : } (s : ) {p : P} {r : } (hr : ∀ (i : Fin (n + 1)), dist (s.points i) p = r) :
(s.orthogonalProjectionSpan p) = s.circumcenter

If a point has the same distance from all vertices of a simplex, the orthogonal projection of that point onto the subspace spanned by that simplex is its circumcenter.

theorem Affine.Simplex.orthogonalProjection_circumcenter {V : Type u_1} {P : Type u_2} [] [] [] {n : } (s : ) {fs : Finset (Fin (n + 1))} {m : } (h : fs.card = m + 1) :
((s.face h).orthogonalProjectionSpan s.circumcenter) = (s.face h).circumcenter

The orthogonal projection of the circumcenter onto a face is the circumcenter of that face.

theorem Affine.Simplex.circumcenter_eq_of_range_eq {V : Type u_1} {P : Type u_2} [] [] [] {n : } {s₁ : } {s₂ : } (h : Set.range s₁.points = Set.range s₂.points) :
s₁.circumcenter = s₂.circumcenter

Two simplices with the same points have the same circumcenter.

An index type for the vertices of a simplex plus its circumcenter. This is for use in calculations where it is convenient to work with affine combinations of vertices together with the circumcenter. (An equivalent form sometimes used in the literature is placing the circumcenter at the origin and working with vectors for the vertices.)

• pointIndex: {n : } →
• circumcenterIndex:
Instances For
Equations
• Affine.Simplex.instFintypePointsWithCircumcenterIndex =
Equations
• = { default := Affine.Simplex.PointsWithCircumcenterIndex.circumcenterIndex }

pointIndex as an embedding.

Equations
• = { toFun := fun (i : Fin (n + 1)) => , inj' := }
Instances For
theorem Affine.Simplex.sum_pointsWithCircumcenter {α : Type u_3} [] {n : } (f : ) :
= i : Fin (n + 1), + f Affine.Simplex.PointsWithCircumcenterIndex.circumcenterIndex

The sum of a function over PointsWithCircumcenterIndex.

def Affine.Simplex.pointsWithCircumcenter {V : Type u_1} {P : Type u_2} [] [] [] {n : } (s : ) :

The vertices of a simplex plus its circumcenter.

Equations
• One or more equations did not get rendered due to their size.
Instances For
@[simp]
theorem Affine.Simplex.pointsWithCircumcenter_point {V : Type u_1} {P : Type u_2} [] [] [] {n : } (s : ) (i : Fin (n + 1)) :
s.pointsWithCircumcenter = s.points i

pointsWithCircumcenter, applied to a pointIndex value, equals points applied to that value.

@[simp]
theorem Affine.Simplex.pointsWithCircumcenter_eq_circumcenter {V : Type u_1} {P : Type u_2} [] [] [] {n : } (s : ) :
s.pointsWithCircumcenter Affine.Simplex.PointsWithCircumcenterIndex.circumcenterIndex = s.circumcenter

pointsWithCircumcenter, applied to circumcenterIndex, equals the circumcenter.

The weights for a single vertex of a simplex, in terms of pointsWithCircumcenter.

Equations
• One or more equations did not get rendered due to their size.
Instances For
@[simp]

point_weights_with_circumcenter sums to 1.

theorem Affine.Simplex.point_eq_affineCombination_of_pointsWithCircumcenter {V : Type u_1} {P : Type u_2} [] [] [] {n : } (s : ) (i : Fin (n + 1)) :
s.points i = (Finset.affineCombination Finset.univ s.pointsWithCircumcenter)

A single vertex, in terms of pointsWithCircumcenter.

The weights for the centroid of some vertices of a simplex, in terms of pointsWithCircumcenter.

Equations
• One or more equations did not get rendered due to their size.
Instances For
@[simp]
theorem Affine.Simplex.sum_centroidWeightsWithCircumcenter {n : } {fs : Finset (Fin (n + 1))} (h : fs.Nonempty) :

centroidWeightsWithCircumcenter sums to 1, if the Finset is nonempty.

theorem Affine.Simplex.centroid_eq_affineCombination_of_pointsWithCircumcenter {V : Type u_1} {P : Type u_2} [] [] [] {n : } (s : ) (fs : Finset (Fin (n + 1))) :
Finset.centroid fs s.points = (Finset.affineCombination Finset.univ s.pointsWithCircumcenter)

The centroid of some vertices of a simplex, in terms of pointsWithCircumcenter.

The weights for the circumcenter of a simplex, in terms of pointsWithCircumcenter.

Equations
• One or more equations did not get rendered due to their size.
Instances For
@[simp]

circumcenterWeightsWithCircumcenter sums to 1.

theorem Affine.Simplex.circumcenter_eq_affineCombination_of_pointsWithCircumcenter {V : Type u_1} {P : Type u_2} [] [] [] {n : } (s : ) :
s.circumcenter = (Finset.affineCombination Finset.univ s.pointsWithCircumcenter)

The circumcenter of a simplex, in terms of pointsWithCircumcenter.

The weights for the reflection of the circumcenter in an edge of a simplex. This definition is only valid with i₁ ≠ i₂.

Equations
• One or more equations did not get rendered due to their size.
Instances For
@[simp]
theorem Affine.Simplex.sum_reflectionCircumcenterWeightsWithCircumcenter {n : } {i₁ : Fin (n + 1)} {i₂ : Fin (n + 1)} (h : i₁ i₂) :

reflectionCircumcenterWeightsWithCircumcenter sums to 1.

theorem Affine.Simplex.reflection_circumcenter_eq_affineCombination_of_pointsWithCircumcenter {V : Type u_1} {P : Type u_2} [] [] [] {n : } (s : ) {i₁ : Fin (n + 1)} {i₂ : Fin (n + 1)} (h : i₁ i₂) :
(EuclideanGeometry.reflection (affineSpan (s.points '' {i₁, i₂}))) s.circumcenter = (Finset.affineCombination Finset.univ s.pointsWithCircumcenter)

The reflection of the circumcenter of a simplex in an edge, in terms of pointsWithCircumcenter.

theorem EuclideanGeometry.cospherical_iff_exists_mem_of_complete {V : Type u_1} {P : Type u_2} [] [] [] {s : } {ps : Set P} (h : ps s) [Nonempty s] [HasOrthogonalProjection s.direction] :

Given a nonempty affine subspace, whose direction is complete, that contains a set of points, those points are cospherical if and only if they are equidistant from some point in that subspace.

theorem EuclideanGeometry.cospherical_iff_exists_mem_of_finiteDimensional {V : Type u_1} {P : Type u_2} [] [] [] {s : } {ps : Set P} (h : ps s) [Nonempty s] [FiniteDimensional s.direction] :

Given a nonempty affine subspace, whose direction is finite-dimensional, that contains a set of points, those points are cospherical if and only if they are equidistant from some point in that subspace.

theorem EuclideanGeometry.exists_circumradius_eq_of_cospherical_subset {V : Type u_1} {P : Type u_2} [] [] [] {s : } {ps : Set P} (h : ps s) [Nonempty s] {n : } [FiniteDimensional s.direction] (hd : FiniteDimensional.finrank s.direction = n) (hc : ) :
∃ (r : ), ∀ (sx : ), Set.range sx.points pssx.circumradius = r

All n-simplices among cospherical points in an n-dimensional subspace have the same circumradius.

theorem EuclideanGeometry.circumradius_eq_of_cospherical_subset {V : Type u_1} {P : Type u_2} [] [] [] {s : } {ps : Set P} (h : ps s) [Nonempty s] {n : } [FiniteDimensional s.direction] (hd : FiniteDimensional.finrank s.direction = n) (hc : ) {sx₁ : } {sx₂ : } (hsx₁ : Set.range sx₁.points ps) (hsx₂ : Set.range sx₂.points ps) :

Two n-simplices among cospherical points in an n-dimensional subspace have the same circumradius.

theorem EuclideanGeometry.exists_circumradius_eq_of_cospherical {V : Type u_1} {P : Type u_2} [] [] [] {ps : Set P} {n : } [] (hd : ) (hc : ) :
∃ (r : ), ∀ (sx : ), Set.range sx.points pssx.circumradius = r

All n-simplices among cospherical points in n-space have the same circumradius.

theorem EuclideanGeometry.circumradius_eq_of_cospherical {V : Type u_1} {P : Type u_2} [] [] [] {ps : Set P} {n : } [] (hd : ) (hc : ) {sx₁ : } {sx₂ : } (hsx₁ : Set.range sx₁.points ps) (hsx₂ : Set.range sx₂.points ps) :

Two n-simplices among cospherical points in n-space have the same circumradius.

theorem EuclideanGeometry.exists_circumcenter_eq_of_cospherical_subset {V : Type u_1} {P : Type u_2} [] [] [] {s : } {ps : Set P} (h : ps s) [Nonempty s] {n : } [FiniteDimensional s.direction] (hd : FiniteDimensional.finrank s.direction = n) (hc : ) :
∃ (c : P), ∀ (sx : ), Set.range sx.points pssx.circumcenter = c

All n-simplices among cospherical points in an n-dimensional subspace have the same circumcenter.

theorem EuclideanGeometry.circumcenter_eq_of_cospherical_subset {V : Type u_1} {P : Type u_2} [] [] [] {s : } {ps : Set P} (h : ps s) [Nonempty s] {n : } [FiniteDimensional s.direction] (hd : FiniteDimensional.finrank s.direction = n) (hc : ) {sx₁ : } {sx₂ : } (hsx₁ : Set.range sx₁.points ps) (hsx₂ : Set.range sx₂.points ps) :
sx₁.circumcenter = sx₂.circumcenter

Two n-simplices among cospherical points in an n-dimensional subspace have the same circumcenter.

theorem EuclideanGeometry.exists_circumcenter_eq_of_cospherical {V : Type u_1} {P : Type u_2} [] [] [] {ps : Set P} {n : } [] (hd : ) (hc : ) :
∃ (c : P), ∀ (sx : ), Set.range sx.points pssx.circumcenter = c

All n-simplices among cospherical points in n-space have the same circumcenter.

theorem EuclideanGeometry.circumcenter_eq_of_cospherical {V : Type u_1} {P : Type u_2} [] [] [] {ps : Set P} {n : } [] (hd : ) (hc : ) {sx₁ : } {sx₂ : } (hsx₁ : Set.range sx₁.points ps) (hsx₂ : Set.range sx₂.points ps) :
sx₁.circumcenter = sx₂.circumcenter

Two n-simplices among cospherical points in n-space have the same circumcenter.

theorem EuclideanGeometry.exists_circumsphere_eq_of_cospherical_subset {V : Type u_1} {P : Type u_2} [] [] [] {s : } {ps : Set P} (h : ps s) [Nonempty s] {n : } [FiniteDimensional s.direction] (hd : FiniteDimensional.finrank s.direction = n) (hc : ) :
∃ (c : ), ∀ (sx : ), Set.range sx.points pssx.circumsphere = c

All n-simplices among cospherical points in an n-dimensional subspace have the same circumsphere.

theorem EuclideanGeometry.circumsphere_eq_of_cospherical_subset {V : Type u_1} {P : Type u_2} [] [] [] {s : } {ps : Set P} (h : ps s) [Nonempty s] {n : } [FiniteDimensional s.direction] (hd : FiniteDimensional.finrank s.direction = n) (hc : ) {sx₁ : } {sx₂ : } (hsx₁ : Set.range sx₁.points ps) (hsx₂ : Set.range sx₂.points ps) :
sx₁.circumsphere = sx₂.circumsphere

Two n-simplices among cospherical points in an n-dimensional subspace have the same circumsphere.

theorem EuclideanGeometry.exists_circumsphere_eq_of_cospherical {V : Type u_1} {P : Type u_2} [] [] [] {ps : Set P} {n : } [] (hd : ) (hc : ) :
∃ (c : ), ∀ (sx : ), Set.range sx.points pssx.circumsphere = c

All n-simplices among cospherical points in n-space have the same circumsphere.

theorem EuclideanGeometry.circumsphere_eq_of_cospherical {V : Type u_1} {P : Type u_2} [] [] [] {ps : Set P} {n : } [] (hd : ) (hc : ) {sx₁ : } {sx₂ : } (hsx₁ : Set.range sx₁.points ps) (hsx₂ : Set.range sx₂.points ps) :
sx₁.circumsphere = sx₂.circumsphere

Two n-simplices among cospherical points in n-space have the same circumsphere.

theorem EuclideanGeometry.eq_or_eq_reflection_of_dist_eq {V : Type u_1} {P : Type u_2} [] [] [] {n : } {s : } {p : P} {p₁ : P} {p₂ : P} {r : } (hp₁ : p₁ affineSpan (insert p (Set.range s.points))) (hp₂ : p₂ affineSpan (insert p (Set.range s.points))) (h₁ : ∀ (i : Fin (n + 1)), dist (s.points i) p₁ = r) (h₂ : ∀ (i : Fin (n + 1)), dist (s.points i) p₂ = r) :
p₁ = p₂ p₁ = (EuclideanGeometry.reflection (affineSpan (Set.range s.points))) p₂

Suppose all distances from p₁ and p₂ to the points of a simplex are equal, and that p₁ and p₂ lie in the affine span of p with the vertices of that simplex. Then p₁ and p₂ are equal or reflections of each other in the affine span of the vertices of the simplex.