Documentation

Mathlib.LinearAlgebra.AffineSpace.Simplex.Basic

Simplex in affine space #

This file defines n-dimensional simplices in affine space.

Main definitions #

References #

structure Affine.Simplex (k : Type u_1) {V : Type u_2} (P : Type u_5) [Ring k] [AddCommGroup V] [Module k V] [AddTorsor V P] (n : ) :
Type u_5

A Simplex k P n is a collection of n + 1 affinely independent points.

Instances For
    @[reducible, inline]
    abbrev Affine.Triangle (k : Type u_1) {V : Type u_2} (P : Type u_5) [Ring k] [AddCommGroup V] [Module k V] [AddTorsor V P] :
    Type u_5

    A Triangle k P is a collection of three affinely independent points.

    Equations
    Instances For
      def Affine.Simplex.mkOfPoint (k : Type u_1) {V : Type u_2} {P : Type u_5} [Ring k] [AddCommGroup V] [Module k V] [AddTorsor V P] (p : P) :
      Simplex k P 0

      Construct a 0-simplex from a point.

      Equations
      Instances For
        @[simp]
        theorem Affine.Simplex.mkOfPoint_points (k : Type u_1) {V : Type u_2} {P : Type u_5} [Ring k] [AddCommGroup V] [Module k V] [AddTorsor V P] (p : P) (i : Fin 1) :
        (mkOfPoint k p).points i = p

        The point in a simplex constructed with mkOfPoint.

        instance Affine.Simplex.nonempty (k : Type u_1) {V : Type u_2} {P : Type u_5} [Ring k] [AddCommGroup V] [Module k V] [AddTorsor V P] :
        theorem Affine.Simplex.ext {k : Type u_1} {V : Type u_2} {P : Type u_5} [Ring k] [AddCommGroup V] [Module k V] [AddTorsor V P] {n : } {s1 s2 : Simplex k P n} (h : ∀ (i : Fin (n + 1)), s1.points i = s2.points i) :
        s1 = s2

        Two simplices are equal if they have the same points.

        theorem Affine.Simplex.ext_iff {k : Type u_1} {V : Type u_2} {P : Type u_5} [Ring k] [AddCommGroup V] [Module k V] [AddTorsor V P] {n : } {s1 s2 : Simplex k P n} :
        s1 = s2 ∀ (i : Fin (n + 1)), s1.points i = s2.points i

        Two simplices are equal if and only if they have the same points.

        def Affine.Simplex.face {k : Type u_1} {V : Type u_2} {P : Type u_5} [Ring k] [AddCommGroup V] [Module k V] [AddTorsor V P] {n : } (s : Simplex k P n) {fs : Finset (Fin (n + 1))} {m : } (h : fs.card = m + 1) :
        Simplex k P m

        A face of a simplex is a simplex with the given subset of points.

        Equations
        Instances For
          theorem Affine.Simplex.face_points {k : Type u_1} {V : Type u_2} {P : Type u_5} [Ring k] [AddCommGroup V] [Module k V] [AddTorsor V P] {n : } (s : Simplex k P n) {fs : Finset (Fin (n + 1))} {m : } (h : fs.card = m + 1) (i : Fin (m + 1)) :
          (s.face h).points i = s.points ((fs.orderEmbOfFin h) i)

          The points of a face of a simplex are given by mono_of_fin.

          theorem Affine.Simplex.face_points' {k : Type u_1} {V : Type u_2} {P : Type u_5} [Ring k] [AddCommGroup V] [Module k V] [AddTorsor V P] {n : } (s : Simplex k P n) {fs : Finset (Fin (n + 1))} {m : } (h : fs.card = m + 1) :
          (s.face h).points = s.points (fs.orderEmbOfFin h)

          The points of a face of a simplex are given by mono_of_fin.

          @[simp]
          theorem Affine.Simplex.face_eq_mkOfPoint {k : Type u_1} {V : Type u_2} {P : Type u_5} [Ring k] [AddCommGroup V] [Module k V] [AddTorsor V P] {n : } (s : Simplex k P n) (i : Fin (n + 1)) :
          s.face = mkOfPoint k (s.points i)

          A single-point face equals the 0-simplex constructed with mkOfPoint.

          @[simp]
          theorem Affine.Simplex.range_face_points {k : Type u_1} {V : Type u_2} {P : Type u_5} [Ring k] [AddCommGroup V] [Module k V] [AddTorsor V P] {n : } (s : Simplex k P n) {fs : Finset (Fin (n + 1))} {m : } (h : fs.card = m + 1) :
          Set.range (s.face h).points = s.points '' fs

          The set of points of a face.

          def Affine.Simplex.faceOpposite {k : Type u_1} {V : Type u_2} {P : Type u_5} [Ring k] [AddCommGroup V] [Module k V] [AddTorsor V P] {n : } [NeZero n] (s : Simplex k P n) (i : Fin (n + 1)) :
          Simplex k P (n - 1)

          The face of a simplex with all but one point.

          Equations
          Instances For
            @[simp]
            theorem Affine.Simplex.range_faceOpposite_points {k : Type u_1} {V : Type u_2} {P : Type u_5} [Ring k] [AddCommGroup V] [Module k V] [AddTorsor V P] {n : } [NeZero n] (s : Simplex k P n) (i : Fin (n + 1)) :
            theorem Affine.Simplex.faceOpposite_point_eq_point_succAbove {k : Type u_1} {V : Type u_2} {P : Type u_5} [Ring k] [AddCommGroup V] [Module k V] [AddTorsor V P] {n : } [NeZero n] (s : Simplex k P n) (i : Fin (n + 1)) (j : Fin (n - 1 + 1)) :
            theorem Affine.Simplex.faceOpposite_point_eq_point_rev {k : Type u_1} {V : Type u_2} {P : Type u_5} [Ring k] [AddCommGroup V] [Module k V] [AddTorsor V P] (s : Simplex k P 1) (i : Fin 2) (n : Fin 1) :
            @[simp]
            theorem Affine.Simplex.faceOpposite_point_eq_point_one {k : Type u_1} {V : Type u_2} {P : Type u_5} [Ring k] [AddCommGroup V] [Module k V] [AddTorsor V P] (s : Simplex k P 1) (n : Fin 1) :
            @[simp]
            theorem Affine.Simplex.faceOpposite_point_eq_point_zero {k : Type u_1} {V : Type u_2} {P : Type u_5} [Ring k] [AddCommGroup V] [Module k V] [AddTorsor V P] (s : Simplex k P 1) (n : Fin 1) :

            Needed to make affineSpan (s.points '' {i}ᶜ) nonempty.

            @[simp]
            theorem Affine.Simplex.mem_affineSpan_image_iff {k : Type u_1} {V : Type u_2} {P : Type u_5} [Ring k] [AddCommGroup V] [Module k V] [AddTorsor V P] [Nontrivial k] {n : } (s : Simplex k P n) {fs : Set (Fin (n + 1))} {i : Fin (n + 1)} :
            s.points i affineSpan k (s.points '' fs) i fs
            @[deprecated Affine.Simplex.mem_affineSpan_image_iff (since := "2025-05-18")]
            theorem Affine.Simplex.mem_affineSpan_range_face_points_iff {k : Type u_1} {V : Type u_2} {P : Type u_5} [Ring k] [AddCommGroup V] [Module k V] [AddTorsor V P] [Nontrivial k] {n : } (s : Simplex k P n) {fs : Finset (Fin (n + 1))} {m : } (h : fs.card = m + 1) {i : Fin (n + 1)} :
            @[deprecated Affine.Simplex.mem_affineSpan_image_iff (since := "2025-05-18")]
            theorem Affine.Simplex.mem_affineSpan_range_faceOpposite_points_iff {k : Type u_1} {V : Type u_2} {P : Type u_5} [Ring k] [AddCommGroup V] [Module k V] [AddTorsor V P] [Nontrivial k] {n : } [NeZero n] (s : Simplex k P n) {i j : Fin (n + 1)} :
            def Affine.Simplex.map {k : Type u_1} {V : Type u_2} {V₂ : Type u_3} {P : Type u_5} {P₂ : Type u_6} [Ring k] [AddCommGroup V] [AddCommGroup V₂] [Module k V] [Module k V₂] [AddTorsor V P] [AddTorsor V₂ P₂] {n : } (s : Simplex k P n) (f : P →ᵃ[k] P₂) (hf : Function.Injective f) :
            Simplex k P₂ n

            Push forward an affine simplex under an injective affine map.

            Equations
            Instances For
              @[simp]
              theorem Affine.Simplex.map_points {k : Type u_1} {V : Type u_2} {V₂ : Type u_3} {P : Type u_5} {P₂ : Type u_6} [Ring k] [AddCommGroup V] [AddCommGroup V₂] [Module k V] [Module k V₂] [AddTorsor V P] [AddTorsor V₂ P₂] {n : } (s : Simplex k P n) (f : P →ᵃ[k] P₂) (hf : Function.Injective f) :
              (s.map f hf).points = f s.points
              @[simp]
              theorem Affine.Simplex.map_id {k : Type u_1} {V : Type u_2} {P : Type u_5} [Ring k] [AddCommGroup V] [Module k V] [AddTorsor V P] {n : } (s : Simplex k P n) :
              s.map (AffineMap.id k P) = s
              theorem Affine.Simplex.map_comp {k : Type u_1} {V : Type u_2} {V₂ : Type u_3} {V₃ : Type u_4} {P : Type u_5} {P₂ : Type u_6} {P₃ : Type u_7} [Ring k] [AddCommGroup V] [AddCommGroup V₂] [AddCommGroup V₃] [Module k V] [Module k V₂] [Module k V₃] [AddTorsor V P] [AddTorsor V₂ P₂] [AddTorsor V₃ P₃] {n : } (s : Simplex k P n) (f : P →ᵃ[k] P₂) (hf : Function.Injective f) (g : P₂ →ᵃ[k] P₃) (hg : Function.Injective g) :
              s.map (g.comp f) = (s.map f hf).map g hg
              @[simp]
              theorem Affine.Simplex.face_map {k : Type u_1} {V : Type u_2} {V₂ : Type u_3} {P : Type u_5} {P₂ : Type u_6} [Ring k] [AddCommGroup V] [AddCommGroup V₂] [Module k V] [Module k V₂] [AddTorsor V P] [AddTorsor V₂ P₂] {n : } (s : Simplex k P n) (f : P →ᵃ[k] P₂) (hf : Function.Injective f) {fs : Finset (Fin (n + 1))} {m : } (h : fs.card = m + 1) :
              (s.map f hf).face h = (s.face h).map f hf
              @[simp]
              theorem Affine.Simplex.faceOpposite_map {k : Type u_1} {V : Type u_2} {V₂ : Type u_3} {P : Type u_5} {P₂ : Type u_6} [Ring k] [AddCommGroup V] [AddCommGroup V₂] [Module k V] [Module k V₂] [AddTorsor V P] [AddTorsor V₂ P₂] {n : } [NeZero n] (s : Simplex k P n) (f : P →ᵃ[k] P₂) (hf : Function.Injective f) (i : Fin (n + 1)) :
              (s.map f hf).faceOpposite i = (s.faceOpposite i).map f hf
              @[simp]
              theorem Affine.Simplex.map_mkOfPoint {k : Type u_1} {V : Type u_2} {V₂ : Type u_3} {P : Type u_5} {P₂ : Type u_6} [Ring k] [AddCommGroup V] [AddCommGroup V₂] [Module k V] [Module k V₂] [AddTorsor V P] [AddTorsor V₂ P₂] (f : P →ᵃ[k] P₂) (hf : Function.Injective f) (p : P) :
              (mkOfPoint k p).map f hf = mkOfPoint k (f p)
              def Affine.Simplex.reindex {k : Type u_1} {V : Type u_2} {P : Type u_5} [Ring k] [AddCommGroup V] [Module k V] [AddTorsor V P] {m n : } (s : Simplex k P m) (e : Fin (m + 1) Fin (n + 1)) :
              Simplex k P n

              Remap a simplex along an Equiv of index types.

              Equations
              Instances For
                @[simp]
                theorem Affine.Simplex.reindex_points {k : Type u_1} {V : Type u_2} {P : Type u_5} [Ring k] [AddCommGroup V] [Module k V] [AddTorsor V P] {m n : } (s : Simplex k P m) (e : Fin (m + 1) Fin (n + 1)) (a✝ : Fin (n + 1)) :
                (s.reindex e).points a✝ = (s.points e.symm) a✝
                @[simp]
                theorem Affine.Simplex.reindex_refl {k : Type u_1} {V : Type u_2} {P : Type u_5} [Ring k] [AddCommGroup V] [Module k V] [AddTorsor V P] {n : } (s : Simplex k P n) :
                s.reindex (Equiv.refl (Fin (n + 1))) = s

                Reindexing by Equiv.refl yields the original simplex.

                @[simp]
                theorem Affine.Simplex.reindex_trans {k : Type u_1} {V : Type u_2} {P : Type u_5} [Ring k] [AddCommGroup V] [Module k V] [AddTorsor V P] {n₁ n₂ n₃ : } (e₁₂ : Fin (n₁ + 1) Fin (n₂ + 1)) (e₂₃ : Fin (n₂ + 1) Fin (n₃ + 1)) (s : Simplex k P n₁) :
                s.reindex (e₁₂.trans e₂₃) = (s.reindex e₁₂).reindex e₂₃

                Reindexing by the composition of two equivalences is the same as reindexing twice.

                @[simp]
                theorem Affine.Simplex.reindex_reindex_symm {k : Type u_1} {V : Type u_2} {P : Type u_5} [Ring k] [AddCommGroup V] [Module k V] [AddTorsor V P] {m n : } (s : Simplex k P m) (e : Fin (m + 1) Fin (n + 1)) :
                (s.reindex e).reindex e.symm = s

                Reindexing by an equivalence and its inverse yields the original simplex.

                @[simp]
                theorem Affine.Simplex.reindex_symm_reindex {k : Type u_1} {V : Type u_2} {P : Type u_5} [Ring k] [AddCommGroup V] [Module k V] [AddTorsor V P] {m n : } (s : Simplex k P m) (e : Fin (n + 1) Fin (m + 1)) :
                (s.reindex e.symm).reindex e = s

                Reindexing by the inverse of an equivalence and that equivalence yields the original simplex.

                @[simp]
                theorem Affine.Simplex.reindex_range_points {k : Type u_1} {V : Type u_2} {P : Type u_5} [Ring k] [AddCommGroup V] [Module k V] [AddTorsor V P] {m n : } (s : Simplex k P m) (e : Fin (m + 1) Fin (n + 1)) :

                Reindexing a simplex produces one with the same set of points.

                theorem Affine.Simplex.reindex_map {k : Type u_1} {V : Type u_2} {V₂ : Type u_3} {P : Type u_5} {P₂ : Type u_6} [Ring k] [AddCommGroup V] [AddCommGroup V₂] [Module k V] [Module k V₂] [AddTorsor V P] [AddTorsor V₂ P₂] {m n : } (s : Simplex k P m) (e : Fin (m + 1) Fin (n + 1)) (f : P →ᵃ[k] P₂) (hf : Function.Injective f) :
                (s.map f hf).reindex e = (s.reindex e).map f hf
                def Affine.Simplex.restrict {k : Type u_1} {V : Type u_2} {P : Type u_5} [Ring k] [AddCommGroup V] [Module k V] [AddTorsor V P] {n : } (s : Simplex k P n) (S : AffineSubspace k P) (hS : affineSpan k (Set.range s.points) S) :
                Simplex k (↥S) n

                Restrict an affine simplex to an affine subspace that contains it.

                Equations
                Instances For
                  @[simp]
                  theorem Affine.Simplex.restrict_points_coe {k : Type u_1} {V : Type u_2} {P : Type u_5} [Ring k] [AddCommGroup V] [Module k V] [AddTorsor V P] {n : } (s : Simplex k P n) (S : AffineSubspace k P) (hS : affineSpan k (Set.range s.points) S) (i : Fin (n + 1)) :
                  ((s.restrict S hS).points i) = s.points i
                  @[simp]
                  theorem Affine.Simplex.restrict_map_inclusion {k : Type u_1} {V : Type u_2} {P : Type u_5} [Ring k] [AddCommGroup V] [Module k V] [AddTorsor V P] {n : } (s : Simplex k P n) (S₁ S₂ : AffineSubspace k P) (hS₁ : affineSpan k (Set.range s.points) S₁) (hS₂ : S₁ S₂) :
                  (s.restrict S₁ hS₁).map (AffineSubspace.inclusion hS₂) = s.restrict S₂

                  Restricting to S₁ then mapping to a larger S₂ is the same as restricting to S₂.

                  @[simp]
                  theorem Affine.Simplex.map_subtype_restrict {k : Type u_1} {V : Type u_2} {P : Type u_5} [Ring k] [AddCommGroup V] [Module k V] [AddTorsor V P] {n : } (S : AffineSubspace k P) [Nonempty S] (s : Simplex k (↥S) n) :
                  (s.map S.subtype ).restrict S = s
                  theorem Affine.Simplex.restrict_map_restrict {k : Type u_1} {V : Type u_2} {V₂ : Type u_3} {P : Type u_5} {P₂ : Type u_6} [Ring k] [AddCommGroup V] [AddCommGroup V₂] [Module k V] [Module k V₂] [AddTorsor V P] [AddTorsor V₂ P₂] {n : } (s : Simplex k P n) (f : P →ᵃ[k] P₂) (hf : Function.Injective f) (S₁ : AffineSubspace k P) (S₂ : AffineSubspace k P₂) (hS₁ : affineSpan k (Set.range s.points) S₁) (hfS : AffineSubspace.map f S₁ S₂) :
                  (s.restrict S₁ hS₁).map (f.restrict hfS) = (s.map f hf).restrict S₂

                  Restricting to S₁ then mapping through the restriction of f to S₁ →ᵃ[k] S₂ is the same as mapping through unrestricted f, then restricting to S₂.

                  @[simp]
                  theorem Affine.Simplex.restrict_map_subtype {k : Type u_1} {V : Type u_2} {P : Type u_5} [Ring k] [AddCommGroup V] [Module k V] [AddTorsor V P] {n : } (s : Simplex k P n) :

                  Restricting to affineSpan k (Set.range s.points) can be reversed by mapping through AffineSubspace.subtype.

                  def Affine.Simplex.interior {k : Type u_1} {V : Type u_2} {P : Type u_3} [Ring k] [PartialOrder k] [AddCommGroup V] [Module k V] [AddTorsor V P] {n : } (s : Simplex k P n) :
                  Set P

                  The interior of a simplex is the set of points that can be expressed as an affine combination of the vertices with weights strictly between 0 and 1. This is equivalent to the intrinsic interior of the convex hull of the vertices.

                  Equations
                  Instances For
                    theorem Affine.Simplex.affineCombination_mem_interior_iff {k : Type u_1} {V : Type u_2} {P : Type u_3} [Ring k] [PartialOrder k] [AddCommGroup V] [Module k V] [AddTorsor V P] {n : } {s : Simplex k P n} {w : Fin (n + 1)k} (hw : i : Fin (n + 1), w i = 1) :
                    def Affine.Simplex.closedInterior {k : Type u_1} {V : Type u_2} {P : Type u_3} [Ring k] [PartialOrder k] [AddCommGroup V] [Module k V] [AddTorsor V P] {n : } (s : Simplex k P n) :
                    Set P

                    s.closedInterior is the set of points that can be expressed as an affine combination of the vertices with weights between 0 and 1 inclusive. This is equivalent to the convex hull of the vertices or the closure of the interior.

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      theorem Affine.Simplex.affineCombination_mem_closedInterior_iff {k : Type u_1} {V : Type u_2} {P : Type u_3} [Ring k] [PartialOrder k] [AddCommGroup V] [Module k V] [AddTorsor V P] {n : } {s : Simplex k P n} {w : Fin (n + 1)k} (hw : i : Fin (n + 1), w i = 1) :
                      theorem Affine.Simplex.interior_subset_closedInterior {k : Type u_1} {V : Type u_2} {P : Type u_3} [Ring k] [PartialOrder k] [AddCommGroup V] [Module k V] [AddTorsor V P] {n : } (s : Simplex k P n) :
                      theorem Affine.Simplex.closedInterior_subset_affineSpan {k : Type u_1} {V : Type u_2} {P : Type u_3} [Ring k] [PartialOrder k] [AddCommGroup V] [Module k V] [AddTorsor V P] {n : } {s : Simplex k P n} :
                      @[simp]
                      theorem Affine.Simplex.interior_eq_empty {k : Type u_1} {V : Type u_2} {P : Type u_3} [Ring k] [PartialOrder k] [AddCommGroup V] [Module k V] [AddTorsor V P] (s : Simplex k P 0) :
                      @[simp]
                      theorem Affine.Simplex.closedInterior_eq_singleton {k : Type u_1} {V : Type u_2} {P : Type u_3} [Ring k] [PartialOrder k] [AddCommGroup V] [Module k V] [AddTorsor V P] [ZeroLEOneClass k] (s : Simplex k P 0) :