mathlib documentation

linear_algebra.affine_space.basis

Affine bases and barycentric coordinates #

Suppose P is an affine space modelled on the module V over the ring k, and p : ι → P is an affine-independent family of points spanning P. Given this data, each point q : P may be written uniquely as an affine combination: q = w₀ p₀ + w₁ p₁ + ⋯ for some (finitely-supported) weights wᵢ. For each i : ι, we thus have an affine map P →ᵃ[k] k, namely q ↦ wᵢ. This family of maps is known as the family of barycentric coordinates. It is defined in this file.

The construction #

Fixing i : ι, and allowing j : ι to range over the values j ≠ i, we obtain a basis bᵢ of V defined by bᵢ j = p j -ᵥ p i. Let fᵢ j : V →ₗ[k] k be the corresponding dual basis and let fᵢ = ∑ j, fᵢ j : V →ₗ[k] k be the corresponding "sum of all coordinates" form. Then the ith barycentric coordinate of q : P is 1 - fᵢ (q -ᵥ p i).

Main definitions #

TODO #

structure affine_basis (ι : Type u₁) (k : Type u₂) {V : Type u₃} (P : Type u₄) [add_comm_group V] [add_torsor V P] [ring k] [module k V] :
Type (max u₁ u₄)

An affine basis is a family of affine-independent points whose span is the top subspace.

Instances for affine_basis
@[protected, instance]

The unique point in a single-point space is the simplest example of an affine basis.

Equations
@[protected]
theorem affine_basis.nonempty {ι : Type u₁} {k : Type u₂} {V : Type u₃} {P : Type u₄} [add_comm_group V] [add_torsor V P] [ring k] [module k V] (b : affine_basis ι k P) :
def affine_basis.comp_equiv {ι : Type u₁} {k : Type u₂} {V : Type u₃} {P : Type u₄} [add_comm_group V] [add_torsor V P] [ring k] [module k V] (b : affine_basis ι k P) {ι' : Type u_1} (e : ι' ι) :
affine_basis ι' k P

Composition of an affine basis and an equivalence of index types.

Equations
noncomputable def affine_basis.basis_of {ι : Type u₁} {k : Type u₂} {V : Type u₃} {P : Type u₄} [add_comm_group V] [add_torsor V P] [ring k] [module k V] (b : affine_basis ι k P) (i : ι) :
basis {j // j i} k V

Given an affine basis for an affine space P, if we single out one member of the family, we obtain a linear basis for the model space V.

The linear basis correpsonding to the singled-out member i : ι is indexed by {j : ι // j ≠ i} and its jth element is points j -ᵥ points i. (See basis_of_apply.)

Equations
@[simp]
theorem affine_basis.basis_of_apply {ι : Type u₁} {k : Type u₂} {V : Type u₃} {P : Type u₄} [add_comm_group V] [add_torsor V P] [ring k] [module k V] (b : affine_basis ι k P) (i : ι) (j : {j // j i}) :
noncomputable def affine_basis.coord {ι : Type u₁} {k : Type u₂} {V : Type u₃} {P : Type u₄} [add_comm_group V] [add_torsor V P] [ring k] [module k V] (b : affine_basis ι k P) (i : ι) :

The ith barycentric coordinate of a point.

Equations
@[simp]
theorem affine_basis.linear_eq_sum_coords {ι : Type u₁} {k : Type u₂} {V : Type u₃} {P : Type u₄} [add_comm_group V] [add_torsor V P] [ring k] [module k V] (b : affine_basis ι k P) (i : ι) :
@[simp]
theorem affine_basis.coord_apply_eq {ι : Type u₁} {k : Type u₂} {V : Type u₃} {P : Type u₄} [add_comm_group V] [add_torsor V P] [ring k] [module k V] (b : affine_basis ι k P) (i : ι) :
(b.coord i) (b.points i) = 1
@[simp]
theorem affine_basis.coord_apply_neq {ι : Type u₁} {k : Type u₂} {V : Type u₃} {P : Type u₄} [add_comm_group V] [add_torsor V P] [ring k] [module k V] (b : affine_basis ι k P) (i j : ι) (h : j i) :
(b.coord i) (b.points j) = 0
theorem affine_basis.coord_apply {ι : Type u₁} {k : Type u₂} {V : Type u₃} {P : Type u₄} [add_comm_group V] [add_torsor V P] [ring k] [module k V] (b : affine_basis ι k P) [decidable_eq ι] (i j : ι) :
(b.coord i) (b.points j) = ite (i = j) 1 0
@[simp]
theorem affine_basis.coord_apply_combination_of_mem {ι : Type u₁} {k : Type u₂} {V : Type u₃} {P : Type u₄} [add_comm_group V] [add_torsor V P] [ring k] [module k V] (b : affine_basis ι k P) {s : finset ι} {i : ι} (hi : i s) {w : ι k} (hw : s.sum w = 1) :
@[simp]
theorem affine_basis.coord_apply_combination_of_not_mem {ι : Type u₁} {k : Type u₂} {V : Type u₃} {P : Type u₄} [add_comm_group V] [add_torsor V P] [ring k] [module k V] (b : affine_basis ι k P) {s : finset ι} {i : ι} (hi : i s) {w : ι k} (hw : s.sum w = 1) :
@[simp]
theorem affine_basis.sum_coord_apply_eq_one {ι : Type u₁} {k : Type u₂} {V : Type u₃} {P : Type u₄} [add_comm_group V] [add_torsor V P] [ring k] [module k V] (b : affine_basis ι k P) [fintype ι] (q : P) :
finset.univ.sum (λ (i : ι), (b.coord i) q) = 1
@[simp]
theorem affine_basis.affine_combination_coord_eq_self {ι : Type u₁} {k : Type u₂} {V : Type u₃} {P : Type u₄} [add_comm_group V] [add_torsor V P] [ring k] [module k V] (b : affine_basis ι k P) [fintype ι] (q : P) :
(finset.univ.affine_combination b.points) (λ (i : ι), (b.coord i) q) = q
@[simp]
theorem affine_basis.linear_combination_coord_eq_self {ι : Type u₁} {k : Type u₂} {V : Type u₃} [add_comm_group V] [ring k] [module k V] [fintype ι] (b : affine_basis ι k V) (v : V) :
finset.univ.sum (λ (i : ι), (b.coord i) v b.points i) = v

A variant of affine_basis.affine_combination_coord_eq_self for the special case when the affine space is a module so we can talk about linear combinations.

theorem affine_basis.ext_elem {ι : Type u₁} {k : Type u₂} {V : Type u₃} {P : Type u₄} [add_comm_group V] [add_torsor V P] [ring k] [module k V] (b : affine_basis ι k P) [fintype ι] {q₁ q₂ : P} (h : (i : ι), (b.coord i) q₁ = (b.coord i) q₂) :
q₁ = q₂
@[simp]
theorem affine_basis.coe_coord_of_subsingleton_eq_one {ι : Type u₁} {k : Type u₂} {V : Type u₃} {P : Type u₄} [add_comm_group V] [add_torsor V P] [ring k] [module k V] (b : affine_basis ι k P) [subsingleton ι] (i : ι) :
(b.coord i) = 1
theorem affine_basis.surjective_coord {ι : Type u₁} {k : Type u₂} {V : Type u₃} {P : Type u₄} [add_comm_group V] [add_torsor V P] [ring k] [module k V] (b : affine_basis ι k P) [nontrivial ι] (i : ι) :
noncomputable def affine_basis.coords {ι : Type u₁} {k : Type u₂} {V : Type u₃} {P : Type u₄} [add_comm_group V] [add_torsor V P] [ring k] [module k V] (b : affine_basis ι k P) :
P →ᵃ[k] ι k

Barycentric coordinates as an affine map.

Equations
@[simp]
theorem affine_basis.coords_apply {ι : Type u₁} {k : Type u₂} {V : Type u₃} {P : Type u₄} [add_comm_group V] [add_torsor V P] [ring k] [module k V] (b : affine_basis ι k P) (q : P) (i : ι) :
(b.coords) q i = (b.coord i) q
@[simp]
theorem affine_basis.coord_apply_centroid {ι : Type u₁} {k : Type u₂} {V : Type u₃} {P : Type u₄} [add_comm_group V] [add_torsor V P] [division_ring k] [module k V] [char_zero k] (b : affine_basis ι k P) {s : finset ι} {i : ι} (hi : i s) :
theorem affine_basis.exists_affine_subbasis {k : Type u₂} {V : Type u₃} {P : Type u₄} [add_comm_group V] [add_torsor V P] [division_ring k] [module k V] {t : set P} (ht : affine_span k t = ) :
(s : set P) (H : s t) (b : affine_basis s k P), b.points = coe
theorem affine_basis.exists_affine_basis (k : Type u₂) (V : Type u₃) (P : Type u₄) [add_comm_group V] [add_torsor V P] [division_ring k] [module k V] :
(s : set P) (b : affine_basis s k P), b.points = coe