The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V22. Affine, Euclidean and convex geometry

Mathlib.LinearAlgebra.AffineSpace.Simplex.Centroid

55 declarations. Mathlib docs · Source

Centroid of a simplex in affine space

This file proves some basic properties of the centroid of a simplex in affine space. The definition of the centroid is based on Finset.univ.centroid applied to the set of vertices. For convenience, we use Simplex.centroid as an abbreviation.

This file also defines faceOppositeCentroid, which is the centroid of the facet of the simplex obtained by removing one vertex.

We prove several relations among the centroid, the faceOppositeCentroid, and the vertices of the simplex. In particular, we prove a version of Commandino's theorem in arbitrary dimensions: the centroid lies on each median, dividing it in a ratio of n : 1, where n is the dimension of the simplex.

Main definitions

  • centroid is the centroid of a simplex, defined via Finset.univ.centroid on its vertices.

  • faceOppositeCentroid is the centroid of the facet obtained by removing one vertex from the simplex.

  • median is the line connecting a vertex to the corresponding faceOppositeCentroid.

  • medial is the simplex formed by all faceOppositeCentroid.

References

  • https://en.wikipedia.org/wiki/Median_(geometry)
  • https://en.wikipedia.org/wiki/Commandino%27s_theorem

theorem Affine.Simplex.medial.congr_simp E1 #

∀ {k : Type u_1} {V : Type u_2} {P : Type u_3} [inst : DivisionRing k] [inst_1 : AddCommGroup V] [inst_2 : Module k V]
  [inst_3 : AddTorsor V P] {n : ℕ} [inst_4 : NeZero n] [inst_5 : CharZero k] (s s_1 : Affine.Simplex k P n),
  s = s_1 → s.medial = s_1.medial

theorem Affine.Simplex.median.congr_simp E1 #

∀ {k : Type u_1} {V : Type u_2} {P : Type u_3} [inst : DivisionRing k] [inst_1 : AddCommGroup V] [inst_2 : Module k V]
  [inst_3 : AddTorsor V P] {n : ℕ} [inst_4 : NeZero n] (s s_1 : Affine.Simplex k P n),
  s = s_1 → ∀ (i i_1 : Fin (n + 1)), i = i_1 → s.median i = s_1.median i_1

theorem Affine.Simplex.faceOppositeCentroid.congr_simp E1 #

∀ {k : Type u_1} {V : Type u_2} {P : Type u_3} [inst : DivisionRing k] [inst_1 : AddCommGroup V] [inst_2 : Module k V]
  [inst_3 : AddTorsor V P] {n : ℕ} [inst_4 : NeZero n] (s s_1 : Affine.Simplex k P n),
  s = s_1 → ∀ (i i_1 : Fin (n + 1)), i = i_1 → s.faceOppositeCentroid i = s_1.faceOppositeCentroid i_1

abbrev Affine.Simplex.centroid E3 #

{k : Type u_1} →
  {V : Type u_2} →
    {P : Type u_3} →
      [inst : DivisionRing k] →
        [inst_1 : AddCommGroup V] →
          [inst_2 : Module k V] → [inst_3 : AddTorsor V P] → {n : ℕ} → Affine.Simplex k P n → P

The centroid of a simplex is the Finset.centroid of the set of all its vertices.

theorem Affine.Simplex.univ_centroid_eq E0 #

∀ {k : Type u_1} {V : Type u_2} {P : Type u_3} [inst : DivisionRing k] [inst_1 : AddCommGroup V] [inst_2 : Module k V]
  [inst_3 : AddTorsor V P] {n : ℕ} (s : Affine.Simplex k P n), Finset.centroid k Finset.univ s.points = s.centroid

theorem Affine.Simplex.centroid_mem_affineSpan E1 #

∀ {k : Type u_1} {V : Type u_2} {P : Type u_3} [inst : DivisionRing k] [inst_1 : AddCommGroup V] [inst_2 : Module k V]
  [inst_3 : AddTorsor V P] [CharZero k] {n : ℕ} (s : Affine.Simplex k P n),
  s.centroid ∈ affineSpan k (Set.range s.points)

The centroid lines in the affine span of the simplex's vertices.

theorem Affine.Simplex.centroid_eq_affineCombination E1 #

∀ {k : Type u_1} {V : Type u_2} {P : Type u_3} [inst : DivisionRing k] [inst_1 : AddCommGroup V] [inst_2 : Module k V]
  [inst_3 : AddTorsor V P] {n : ℕ} (s : Affine.Simplex k P n),
  s.centroid = (Finset.affineCombination k Finset.univ s.points) (Finset.centroidWeights k Finset.univ)

The centroid is equal to the affine combination of the points with centroidWeights.

theorem Affine.Simplex.centroid_notMem_affineSpan_of_ne_univ E1 #

∀ {k : Type u_1} {V : Type u_2} {P : Type u_3} [inst : DivisionRing k] [inst_1 : AddCommGroup V] [inst_2 : Module k V]
  [inst_3 : AddTorsor V P] {n : ℕ} [CharZero k] (s : Affine.Simplex k P n) {t : Set (Fin (n + 1))},
  t ≠ Set.univ → s.centroid ∉ affineSpan k (s.points '' t)

The centroid of a simplex does not lie in the affine span of any proper subset of its vertices.

theorem Affine.Simplex.centroid_vsub_eq E0 #

∀ {k : Type u_1} {V : Type u_2} {P : Type u_3} [inst : DivisionRing k] [inst_1 : AddCommGroup V] [inst_2 : Module k V]
  [inst_3 : AddTorsor V P] {n : ℕ} [CharZero k] (s : Affine.Simplex k P n) (p : P),
  s.centroid -ᵥ p = (↑n + 1)⁻¹ • ∑ x, (s.points x -ᵥ p)

The vector from any point to the centroid is the average of vectors to the simplex vertices.

theorem Affine.Simplex.vsub_centroid_eq E0 #

∀ {k : Type u_1} {V : Type u_2} {P : Type u_3} [inst : DivisionRing k] [inst_1 : AddCommGroup V] [inst_2 : Module k V]
  [inst_3 : AddTorsor V P] {n : ℕ} [CharZero k] (s : Affine.Simplex k P n) (p : P),
  p -ᵥ s.centroid = (↑n + 1)⁻¹ • ∑ x, (p -ᵥ s.points x)

theorem Affine.Simplex.centroid_eq_smul_sum_vsub_vadd E1 #

∀ {k : Type u_1} {V : Type u_2} {P : Type u_3} [inst : DivisionRing k] [inst_1 : AddCommGroup V] [inst_2 : Module k V]
  [inst_3 : AddTorsor V P] {n : ℕ} [CharZero k] (s : Affine.Simplex k P n) (i : Fin (n + 1)),
  s.centroid = (↑n + 1)⁻¹ • ∑ x, (s.points x -ᵥ s.points i) +ᵥ s.points i

theorem Affine.Simplex.smul_centroid_vsub_point_eq_sum_vsub E1 #

∀ {k : Type u_1} {V : Type u_2} {P : Type u_3} [inst : DivisionRing k] [inst_1 : AddCommGroup V] [inst_2 : Module k V]
  [inst_3 : AddTorsor V P] {n : ℕ} [CharZero k] (s : Affine.Simplex k P n) (i : Fin (n + 1)),
  (↑n + 1) • (s.centroid -ᵥ s.points i) = ∑ x, (s.points x -ᵥ s.points i)

theorem Affine.Simplex.centroid_weighted_vsub_eq_zero E1 #

∀ {k : Type u_1} {V : Type u_2} {P : Type u_3} [inst : DivisionRing k] [inst_1 : AddCommGroup V] [inst_2 : Module k V]
  [inst_3 : AddTorsor V P] {n : ℕ} [CharZero k] (s : Affine.Simplex k P n), ∑ i, (s.points i -ᵥ s.centroid) = 0

The sum of vectors from the centroid to each vertex is zero.

theorem Affine.Simplex.face_centroid_eq_centroid E1 #

∀ {k : Type u_1} {V : Type u_2} {P : Type u_3} [inst : DivisionRing k] [inst_1 : AddCommGroup V] [inst_2 : Module k V]
  [inst_3 : AddTorsor V P] {n : ℕ} (s : Affine.Simplex k P n) {fs : Finset (Fin (n + 1))} {m : ℕ} (h : fs.card = m + 1),
  Finset.centroid k Finset.univ (s.face h).points = Finset.centroid k fs s.points

The centroid of a face of a simplex as the centroid of a subset of the points.

theorem Affine.Simplex.centroid_eq_iff E0 #

∀ {k : Type u_1} {V : Type u_2} {P : Type u_3} [inst : DivisionRing k] [inst_1 : AddCommGroup V] [inst_2 : Module k V]
  [inst_3 : AddTorsor V P] [CharZero k] {n : ℕ} (s : Affine.Simplex k P n) {fs₁ fs₂ : Finset (Fin (n + 1))} {m₁ m₂ : ℕ},
  fs₁.card = m₁ + 1 → fs₂.card = m₂ + 1 → (Finset.centroid k fs₁ s.points = Finset.centroid k fs₂ s.points ↔ fs₁ = fs₂)

Over a characteristic-zero division ring, the centroids given by two subsets of the points of a simplex are equal if and only if those faces are given by the same subset of points.

theorem Affine.Simplex.face_centroid_eq_iff E0 #

∀ {k : Type u_1} {V : Type u_2} {P : Type u_3} [inst : DivisionRing k] [inst_1 : AddCommGroup V] [inst_2 : Module k V]
  [inst_3 : AddTorsor V P] [CharZero k] {n : ℕ} (s : Affine.Simplex k P n) {fs₁ fs₂ : Finset (Fin (n + 1))} {m₁ m₂ : ℕ}
  (h₁ : fs₁.card = m₁ + 1) (h₂ : fs₂.card = m₂ + 1),
  Finset.centroid k Finset.univ (s.face h₁).points = Finset.centroid k Finset.univ (s.face h₂).points ↔ fs₁ = fs₂

Over a characteristic-zero division ring, the centroids of two faces of a simplex are equal if and only if those faces are given by the same subset of points.

theorem Affine.Simplex.centroid_eq_of_range_eq E0 #

∀ {k : Type u_1} {V : Type u_2} {P : Type u_3} [inst : DivisionRing k] [inst_1 : AddCommGroup V] [inst_2 : Module k V]
  [inst_3 : AddTorsor V P] {n : ℕ} {s₁ s₂ : Affine.Simplex k P n},
  Set.range s₁.points = Set.range s₂.points →
    Finset.centroid k Finset.univ s₁.points = Finset.centroid k Finset.univ s₂.points

Two simplices with the same points have the same centroid.

theorem Affine.Simplex.affineIndependent_points_update_centroid E1 #

∀ {k : Type u_1} {V : Type u_2} {P : Type u_3} [inst : DivisionRing k] [inst_1 : AddCommGroup V] [inst_2 : Module k V]
  [inst_3 : AddTorsor V P] {n : ℕ} [CharZero k] (s : Affine.Simplex k P n) (i : Fin (n + 1)),
  AffineIndependent k (Function.update s.points i s.centroid)

Replacing a vertex of a simplex by its centroid preserves affine independence.

theorem Affine.Simplex.centroid_map E1 #

∀ {k : Type u_1} {V : Type u_2} {P : Type u_3} [inst : DivisionRing k] [inst_1 : AddCommGroup V] [inst_2 : Module k V]
  [inst_3 : AddTorsor V P] [CharZero k] {V₂ : Type u_4} {P₂ : Type u_5} [inst_5 : AddCommGroup V₂]
  [inst_6 : Module k V₂] [inst_7 : AddTorsor V₂ P₂] {n : ℕ} (s : Affine.Simplex k P n) (f : P →ᵃ[k] P₂)
  (hf : Function.Injective ⇑f), (s.map f hf).centroid = f s.centroid

theorem Affine.Simplex.centroid_reindex E1 #

∀ {k : Type u_1} {V : Type u_2} {P : Type u_3} [inst : DivisionRing k] [inst_1 : AddCommGroup V] [inst_2 : Module k V]
  [inst_3 : AddTorsor V P] {m n : ℕ} (s : Affine.Simplex k P m) (e : Fin (m + 1) ≃ Fin (n + 1)),
  (s.reindex e).centroid = s.centroid

theorem Affine.Simplex.centroid_restrict E1 #

∀ {k : Type u_1} {V : Type u_2} {P : Type u_3} [inst : DivisionRing k] [inst_1 : AddCommGroup V] [inst_2 : Module k V]
  [inst_3 : AddTorsor V P] [CharZero k] {n : ℕ} (s : Affine.Simplex k P n) (S : AffineSubspace k P)
  (hS : affineSpan k (Set.range s.points) ≤ S), ↑(s.restrict S hS).centroid = s.centroid

def Affine.Simplex.faceOppositeCentroid E3 #

{k : Type u_1} →
  {V : Type u_2} →
    {P : Type u_3} →
      [inst : DivisionRing k] →
        [inst_1 : AddCommGroup V] →
          [inst_2 : Module k V] →
            [inst_3 : AddTorsor V P] → {n : ℕ} → [NeZero n] → Affine.Simplex k P n → Fin (n + 1) → P

The faceOppositeCentroid is the centroid of the face opposite to the vertex indexed by i.

theorem Affine.Simplex.faceOppositeCentroid_mem_affineSpan_face E1 #

∀ {k : Type u_1} {V : Type u_2} {P : Type u_3} [inst : DivisionRing k] [inst_1 : AddCommGroup V] [inst_2 : Module k V]
  [inst_3 : AddTorsor V P] {n : ℕ} [inst_4 : NeZero n] [CharZero k] (s : Affine.Simplex k P n) (i : Fin (n + 1)),
  s.faceOppositeCentroid i ∈ affineSpan k (Set.range (s.faceOpposite i).points)

The centroid of the face opposite a vertex lies in the affine span of that face.

theorem Affine.Simplex.faceOppositeCentroid_eq_affineCombination E1 #

∀ {k : Type u_1} {V : Type u_2} {P : Type u_3} [inst : DivisionRing k] [inst_1 : AddCommGroup V] [inst_2 : Module k V]
  [inst_3 : AddTorsor V P] {n : ℕ} [inst_4 : NeZero n] (s : Affine.Simplex k P n) (i : Fin (n + 1)),
  s.faceOppositeCentroid i = (Finset.affineCombination k {i}ᶜ s.points) fun x ↦ (↑n)⁻¹

The faceOppositeCentroid is the affine combination of the complement vertices with equal weights 1/n.

theorem Affine.Simplex.faceOppositeCentroid_vsub_point_eq_smul_sum_vsub E1 #

∀ {k : Type u_1} {V : Type u_2} {P : Type u_3} [inst : DivisionRing k] [inst_1 : AddCommGroup V] [inst_2 : Module k V]
  [inst_3 : AddTorsor V P] {n : ℕ} [inst_4 : NeZero n] [CharZero k] (s : Affine.Simplex k P n) (i : Fin (n + 1)),
  s.faceOppositeCentroid i -ᵥ s.points i = (↑n)⁻¹ • ∑ x, (s.points x -ᵥ s.points i)

The vector from a vertex to the corresponding faceOppositeCentroid equals the average of the displacements to the other vertices.

theorem Affine.Simplex.faceOppositeCentroid_eq_sum_vsub_vadd E1 #

∀ {k : Type u_1} {V : Type u_2} {P : Type u_3} [inst : DivisionRing k] [inst_1 : AddCommGroup V] [inst_2 : Module k V]
  [inst_3 : AddTorsor V P] {n : ℕ} [inst_4 : NeZero n] [CharZero k] (s : Affine.Simplex k P n) (i : Fin (n + 1)),
  s.faceOppositeCentroid i = (↑n)⁻¹ • ∑ x, (s.points x -ᵥ s.points i) +ᵥ s.points i

The faceOppositeCentroid equals the average displacement from a vertex plus that vertex.

theorem Affine.Simplex.point_vsub_faceOppositeCentroid_eq_smul_sum_vsub E1 #

∀ {k : Type u_1} {V : Type u_2} {P : Type u_3} [inst : DivisionRing k] [inst_1 : AddCommGroup V] [inst_2 : Module k V]
  [inst_3 : AddTorsor V P] {n : ℕ} [inst_4 : NeZero n] [CharZero k] (s : Affine.Simplex k P n) (i : Fin (n + 1)),
  s.points i -ᵥ s.faceOppositeCentroid i = (↑n)⁻¹ • ∑ x, (s.points i -ᵥ s.points x)

The vector from a vertex to its faceOppositeCentroid equals the average of reversed displacements.

theorem Affine.Simplex.smul_faceOppositeCentroid_vsub_point_eq_sum_vsub E1 #

∀ {k : Type u_1} {V : Type u_2} {P : Type u_3} [inst : DivisionRing k] [inst_1 : AddCommGroup V] [inst_2 : Module k V]
  [inst_3 : AddTorsor V P] {n : ℕ} [inst_4 : NeZero n] [CharZero k] (s : Affine.Simplex k P n) (i : Fin (n + 1)),
  ↑n • (s.faceOppositeCentroid i -ᵥ s.points i) = ∑ x, (s.points x -ᵥ s.points i)

theorem Affine.Simplex.smul_centroid_vsub_point_eq_smul_faceOppositeCentroid_vsub_point E1 #

∀ {k : Type u_1} {V : Type u_2} {P : Type u_3} [inst : DivisionRing k] [inst_1 : AddCommGroup V] [inst_2 : Module k V]
  [inst_3 : AddTorsor V P] {n : ℕ} [inst_4 : NeZero n] [CharZero k] (s : Affine.Simplex k P n) (i : Fin (n + 1)),
  (↑n + 1) • (s.centroid -ᵥ s.points i) = ↑n • (s.faceOppositeCentroid i -ᵥ s.points i)

theorem Affine.Simplex.faceOppositeCentroid_vsub_faceOppositeCentroid E1 #

∀ {k : Type u_1} {V : Type u_2} {P : Type u_3} [inst : DivisionRing k] [inst_1 : AddCommGroup V] [inst_2 : Module k V]
  [inst_3 : AddTorsor V P] {n : ℕ} [inst_4 : NeZero n] [CharZero k] (s : Affine.Simplex k P n) (i j : Fin (n + 1)),
  s.faceOppositeCentroid i -ᵥ s.faceOppositeCentroid j = (↑n)⁻¹ • (s.points j -ᵥ s.points i)

The vector between two faceOppositeCentroid equals n⁻¹ times the vector between the corresponding vertices.

theorem Affine.Simplex.faceOppositeCentroid_vsub_point_eq_smul_vsub E1 #

∀ {k : Type u_1} {V : Type u_2} {P : Type u_3} [inst : DivisionRing k] [inst_1 : AddCommGroup V] [inst_2 : Module k V]
  [inst_3 : AddTorsor V P] {n : ℕ} [inst_4 : NeZero n] [CharZero k] (s : Affine.Simplex k P n) (i : Fin (n + 1)),
  s.faceOppositeCentroid i -ᵥ s.points i = (↑n + 1) • (s.faceOppositeCentroid i -ᵥ s.centroid)

The vector from a vertex to its faceOppositeCentroid is (n+1) times the vector from the centroid to that faceOppositeCentroid.

theorem Affine.Simplex.point_vsub_faceOppositeCentroid_eq_smul_vsub E1 #

∀ {k : Type u_1} {V : Type u_2} {P : Type u_3} [inst : DivisionRing k] [inst_1 : AddCommGroup V] [inst_2 : Module k V]
  [inst_3 : AddTorsor V P] {n : ℕ} [inst_4 : NeZero n] [CharZero k] (s : Affine.Simplex k P n) (i : Fin (n + 1)),
  s.points i -ᵥ s.faceOppositeCentroid i = (↑n + 1) • (s.centroid -ᵥ s.faceOppositeCentroid i)

theorem Affine.Simplex.point_vsub_centroid_eq_smul_vsub E3 #

∀ {k : Type u_1} {V : Type u_2} {P : Type u_3} [inst : DivisionRing k] [inst_1 : AddCommGroup V] [inst_2 : Module k V]
  [inst_3 : AddTorsor V P] {n : ℕ} [inst_4 : NeZero n] [CharZero k] (s : Affine.Simplex k P n) (i : Fin (n + 1)),
  s.points i -ᵥ s.centroid = ↑n • (s.centroid -ᵥ s.faceOppositeCentroid i)

Commandino's theorem : For n-simplex, the vector from a vertex to the centroid equals n times the vector from the centroid to the corresponding faceOppositeCentroid.

theorem Affine.Simplex.centroid_vsub_point_eq_smul_vsub E1 #

∀ {k : Type u_1} {V : Type u_2} {P : Type u_3} [inst : DivisionRing k] [inst_1 : AddCommGroup V] [inst_2 : Module k V]
  [inst_3 : AddTorsor V P] {n : ℕ} [inst_4 : NeZero n] [CharZero k] (s : Affine.Simplex k P n) (i : Fin (n + 1)),
  s.centroid -ᵥ s.points i = ↑n • (s.faceOppositeCentroid i -ᵥ s.centroid)

Reverse version of point_vsub_centroid_eq_smul_vsub.

theorem Affine.Simplex.faceOppositeCentroid_vsub_centroid_eq_smul_vsub E1 #

∀ {k : Type u_1} {V : Type u_2} {P : Type u_3} [inst : DivisionRing k] [inst_1 : AddCommGroup V] [inst_2 : Module k V]
  [inst_3 : AddTorsor V P] {n : ℕ} [inst_4 : NeZero n] [CharZero k] (s : Affine.Simplex k P n) (i : Fin (n + 1)),
  s.faceOppositeCentroid i -ᵥ s.centroid = (↑n)⁻¹ • (s.centroid -ᵥ s.points i)

The vector from centroid to a vertex corresponding faceOppositeCentroid is n⁻¹ of the vector from the vertex to the centroid.

theorem Affine.Simplex.centroid_vsub_faceOppositeCentroid_eq_smul_vsub E1 #

∀ {k : Type u_1} {V : Type u_2} {P : Type u_3} [inst : DivisionRing k] [inst_1 : AddCommGroup V] [inst_2 : Module k V]
  [inst_3 : AddTorsor V P] {n : ℕ} [inst_4 : NeZero n] [CharZero k] (s : Affine.Simplex k P n) (i : Fin (n + 1)),
  s.centroid -ᵥ s.faceOppositeCentroid i = (↑n)⁻¹ • (s.points i -ᵥ s.centroid)

Reverse version of faceOppositeCentroid_vsub_centroid_eq_smul_vsub

theorem Affine.Simplex.centroid_eq_smul_vsub_vadd_point E1 #

∀ {k : Type u_1} {V : Type u_2} {P : Type u_3} [inst : DivisionRing k] [inst_1 : AddCommGroup V] [inst_2 : Module k V]
  [inst_3 : AddTorsor V P] {n : ℕ} [inst_4 : NeZero n] [CharZero k] (s : Affine.Simplex k P n) (i : Fin (n + 1)),
  s.centroid = ↑n • (s.faceOppositeCentroid i -ᵥ s.centroid) +ᵥ s.points i

The centroid of an n-simplex can be obtained from a vertex by adding n times the vector from the centroid to the faceOppositeCentroid.

theorem Affine.Simplex.faceOppositeCentroid_eq_smul_vsub_vadd_point E1 #

∀ {k : Type u_1} {V : Type u_2} {P : Type u_3} [inst : DivisionRing k] [inst_1 : AddCommGroup V] [inst_2 : Module k V]
  [inst_3 : AddTorsor V P] {n : ℕ} [inst_4 : NeZero n] [CharZero k] (s : Affine.Simplex k P n) (i : Fin (n + 1)),
  s.faceOppositeCentroid i = (↑n)⁻¹ • (s.centroid -ᵥ s.points i) +ᵥ s.centroid

The point faceOppositeCentroid of an n-simplex can be obtained from the centroid by adding n⁻¹ times the vector from the vertex to the centroid.

theorem Affine.Simplex.faceOppositeCentroid_map E0 #

∀ {k : Type u_1} {V : Type u_2} {P : Type u_3} [inst : DivisionRing k] [inst_1 : AddCommGroup V] [inst_2 : Module k V]
  [inst_3 : AddTorsor V P] [CharZero k] {V₂ : Type u_4} {P₂ : Type u_5} [inst_5 : AddCommGroup V₂]
  [inst_6 : Module k V₂] [inst_7 : AddTorsor V₂ P₂] {n : ℕ} [inst_8 : NeZero n] (s : Affine.Simplex k P n)
  (f : P →ᵃ[k] P₂) (hf : Function.Injective ⇑f) {i : Fin (n + 1)},
  (s.map f hf).faceOppositeCentroid i = f (s.faceOppositeCentroid i)

theorem Affine.Simplex.faceOppositeCentroid_restrict E0 #

∀ {k : Type u_1} {V : Type u_2} {P : Type u_3} [inst : DivisionRing k] [inst_1 : AddCommGroup V] [inst_2 : Module k V]
  [inst_3 : AddTorsor V P] {n : ℕ} [inst_4 : NeZero n] [CharZero k] (s : Affine.Simplex k P n) (S : AffineSubspace k P)
  (hS : affineSpan k (Set.range s.points) ≤ S) {i : Fin (n + 1)},
  ↑((s.restrict S hS).faceOppositeCentroid i) = s.faceOppositeCentroid i

theorem Affine.Simplex.faceOppositeCentroid_reindex E0 #

∀ {k : Type u_1} {V : Type u_2} {P : Type u_3} [inst : DivisionRing k] [inst_1 : AddCommGroup V] [inst_2 : Module k V]
  [inst_3 : AddTorsor V P] {m n : ℕ} [inst_4 : NeZero m] [inst_5 : NeZero n] (s : Affine.Simplex k P m)
  (e : Fin (m + 1) ≃ Fin (n + 1)), (s.reindex e).faceOppositeCentroid = s.faceOppositeCentroid ∘ ⇑e.symm

def Affine.Simplex.median E3 #

{k : Type u_1} →
  {V : Type u_2} →
    {P : Type u_3} →
      [inst : DivisionRing k] →
        [inst_1 : AddCommGroup V] →
          [inst_2 : Module k V] →
            [inst_3 : AddTorsor V P] → {n : ℕ} → [NeZero n] → Affine.Simplex k P n → Fin (n + 1) → AffineSubspace k P

The median of a simplex is the line through a vertex and its corresponding faceOppositeCentroid.

theorem Affine.Simplex.median_reindex E0 #

∀ {k : Type u_1} {V : Type u_2} {P : Type u_3} [inst : DivisionRing k] [inst_1 : AddCommGroup V] [inst_2 : Module k V]
  [inst_3 : AddTorsor V P] {m n : ℕ} [inst_4 : NeZero m] [inst_5 : NeZero n] (s : Affine.Simplex k P n)
  (e : Fin (n + 1) ≃ Fin (m + 1)), (s.reindex e).median = s.median ∘ ⇑e.symm

theorem Affine.Simplex.median_map E0 #

∀ {k : Type u_1} {V : Type u_2} {P : Type u_3} [inst : DivisionRing k] [inst_1 : AddCommGroup V] [inst_2 : Module k V]
  [inst_3 : AddTorsor V P] [CharZero k] {V₂ : Type u_4} {P₂ : Type u_5} [inst_5 : AddCommGroup V₂]
  [inst_6 : Module k V₂] [inst_7 : AddTorsor V₂ P₂] {n : ℕ} [inst_8 : NeZero n] (s : Affine.Simplex k P n)
  (i : Fin (n + 1)) (f : P →ᵃ[k] P₂) (hf : Function.Injective ⇑f),
  (s.map f hf).median i = AffineSubspace.map f (s.median i)

theorem Affine.Simplex.median_restrict E1 #

∀ {k : Type u_1} {V : Type u_2} {P : Type u_3} [inst : DivisionRing k] [inst_1 : AddCommGroup V] [inst_2 : Module k V]
  [inst_3 : AddTorsor V P] {n : ℕ} [inst_4 : NeZero n] [CharZero k] (s : Affine.Simplex k P n) (i : Fin (n + 1))
  (S : AffineSubspace k P) (hS : affineSpan k (Set.range s.points) ≤ S),
  AffineSubspace.map S.subtype ((s.restrict S hS).median i) = s.median i

theorem Affine.Simplex.faceOppositeCentroid_mem_median E1 #

∀ {k : Type u_1} {V : Type u_2} {P : Type u_3} [inst : DivisionRing k] [inst_1 : AddCommGroup V] [inst_2 : Module k V]
  [inst_3 : AddTorsor V P] {n : ℕ} [inst_4 : NeZero n] (s : Affine.Simplex k P n) (i : Fin (n + 1)),
  s.faceOppositeCentroid i ∈ s.median i

The faceOppositeCentroid lines on the median through the corresponding vertex.

theorem Affine.Simplex.point_mem_median E1 #

∀ {k : Type u_1} {V : Type u_2} {P : Type u_3} [inst : DivisionRing k] [inst_1 : AddCommGroup V] [inst_2 : Module k V]
  [inst_3 : AddTorsor V P] {n : ℕ} [inst_4 : NeZero n] (s : Affine.Simplex k P n) (i : Fin (n + 1)),
  s.points i ∈ s.median i

A vertex lies on its median.

theorem Affine.Simplex.centroid_mem_median E1 #

∀ {k : Type u_1} {V : Type u_2} {P : Type u_3} [inst : DivisionRing k] [inst_1 : AddCommGroup V] [inst_2 : Module k V]
  [inst_3 : AddTorsor V P] {n : ℕ} [inst_4 : NeZero n] [CharZero k] (s : Affine.Simplex k P n) (i : Fin (n + 1)),
  s.centroid ∈ s.median i

The centroid lies on the median from any vertex.

theorem Affine.Simplex.median_eq_line_point_centroid E1 #

∀ {k : Type u_1} {V : Type u_2} {P : Type u_3} [inst : DivisionRing k] [inst_1 : AddCommGroup V] [inst_2 : Module k V]
  [inst_3 : AddTorsor V P] {n : ℕ} [inst_4 : NeZero n] [CharZero k] (s : Affine.Simplex k P n) (i : Fin (n + 1)),
  s.median i = line[k, s.points i, s.centroid]

The median of a simplex is the line through the vertex and the centroid.

def Affine.Simplex.medial E3 #

{k : Type u_1} →
  {V : Type u_2} →
    {P : Type u_3} →
      [inst : DivisionRing k] →
        [inst_1 : AddCommGroup V] →
          [inst_2 : Module k V] →
            [inst_3 : AddTorsor V P] → {n : ℕ} → [NeZero n] → [CharZero k] → Affine.Simplex k P n → Affine.Simplex k P n

The medial is the simplex formed by centroids on all faces.

theorem Affine.Simplex.medial_points E1 #

∀ {k : Type u_1} {V : Type u_2} {P : Type u_3} [inst : DivisionRing k] [inst_1 : AddCommGroup V] [inst_2 : Module k V]
  [inst_3 : AddTorsor V P] {n : ℕ} [inst_4 : NeZero n] [inst_5 : CharZero k] (s : Affine.Simplex k P n)
  (i : Fin (n + 1)), s.medial.points i = s.faceOppositeCentroid i

theorem Affine.Simplex.medial_reindex E1 #

∀ {k : Type u_1} {V : Type u_2} {P : Type u_3} [inst : DivisionRing k] [inst_1 : AddCommGroup V] [inst_2 : Module k V]
  [inst_3 : AddTorsor V P] {m n : ℕ} [inst_4 : NeZero m] [inst_5 : NeZero n] [inst_6 : CharZero k]
  (s : Affine.Simplex k P n) (e : Fin (n + 1) ≃ Fin (m + 1)), (s.reindex e).medial = s.medial.reindex e

theorem Affine.Simplex.medial_map E1 #

∀ {k : Type u_1} {V : Type u_2} {P : Type u_3} [inst : DivisionRing k] [inst_1 : AddCommGroup V] [inst_2 : Module k V]
  [inst_3 : AddTorsor V P] {V₂ : Type u_4} {P₂ : Type u_5} [inst_4 : AddCommGroup V₂] [inst_5 : Module k V₂]
  [inst_6 : AddTorsor V₂ P₂] [inst_7 : CharZero k] {n : ℕ} [inst_8 : NeZero n] (s : Affine.Simplex k P n)
  (f : P →ᵃ[k] P₂) (hf : Function.Injective ⇑f), (s.map f hf).medial = s.medial.map f hf

theorem Affine.Simplex.affineSpan_range_medial E0 #

∀ {k : Type u_1} {V : Type u_2} {P : Type u_3} [inst : DivisionRing k] [inst_1 : AddCommGroup V] [inst_2 : Module k V]
  [inst_3 : AddTorsor V P] {n : ℕ} [inst_4 : NeZero n] [inst_5 : CharZero k] (s : Affine.Simplex k P n),
  affineSpan k (Set.range s.medial.points) = affineSpan k (Set.range s.points)

theorem Affine.Simplex.medial_restrict E1 #

∀ {k : Type u_1} {V : Type u_2} {P : Type u_3} [inst : DivisionRing k] [inst_1 : AddCommGroup V] [inst_2 : Module k V]
  [inst_3 : AddTorsor V P] {n : ℕ} [inst_4 : NeZero n] [inst_5 : CharZero k] (s : Affine.Simplex k P n)
  (S : AffineSubspace k P) (hS : affineSpan k (Set.range s.points) ≤ S),
  (s.restrict S hS).medial = s.medial.restrict S ⋯