File: Mathlib/LinearAlgebra/AffineSpace/Basis.lean

full_name: AffineBasis.toFun
code: /-- An affine basis is a family of affine-independent points whose span is the top subspace. -/
structure AffineBasis (ι : Type u₁) (k : Type u₂) {V : Type u₃} (P : Type u₄) [AddCommGroup V]
  [AffineSpace V P] [Ring k] [Module k V] where
  protected toFun : ι → P
  protected ind' : AffineIndependent k toFun
  protected tot' : affineSpan k (range toFun) = ⊤
goal: ι → P

full_name: AffineBasis.ind'
code: /-- An affine basis is a family of affine-independent points whose span is the top subspace. -/
structure AffineBasis (ι : Type u₁) (k : Type u₂) {V : Type u₃} (P : Type u₄) [AddCommGroup V]
  [AffineSpace V P] [Ring k] [Module k V] where
  protected toFun : ι → P
  protected ind' : AffineIndependent k toFun
  protected tot' : affineSpan k (range toFun) = ⊤
goal: AffineIndependent k self.toFun

full_name: AffineBasis.tot'
code: /-- An affine basis is a family of affine-independent points whose span is the top subspace. -/
structure AffineBasis (ι : Type u₁) (k : Type u₂) {V : Type u₃} (P : Type u₄) [AddCommGroup V]
  [AffineSpace V P] [Ring k] [Module k V] where
  protected toFun : ι → P
  protected ind' : AffineIndependent k toFun
  protected tot' : affineSpan k (range toFun) = ⊤
goal: affineSpan k (Set.range self.toFun) = ⊤

full_name: AffineBasis
code: /-- An affine basis is a family of affine-independent points whose span is the top subspace. -/
structure AffineBasis (ι : Type u₁) (k : Type u₂) {V : Type u₃} (P : Type u₄) [AddCommGroup V]
  [AffineSpace V P] [Ring k] [Module k V] where
  protected toFun : ι → P
  protected ind' : AffineIndependent k toFun
  protected tot' : affineSpan k (range toFun) = ⊤
goal: Type (max u₁ u₄)

full_name: AffineBasis.instInhabitedPUnit
code: /-- The unique point in a single-point space is the simplest example of an affine basis. -/
instance : Inhabited (AffineBasis PUnit k PUnit) 
goal: Inhabited (AffineBasis PUnit.{u_6 + 1} k PUnit.{u_6 + 1})

full_name: AffineBasis.instFunLike
code: instance instFunLike : FunLike (AffineBasis ι k P) ι P 
goal: FunLike (AffineBasis ι k P) ι P

full_name: AffineBasis.ext
code: @[ext]
theorem ext {b₁ b₂ : AffineBasis ι k P} (h : (b₁ : ι → P) = b₂) : b₁ = b₂ 
goal: b₁ = b₂

full_name: AffineBasis.ind
code: theorem ind : AffineIndependent k b 
goal: AffineIndependent k ⇑b

full_name: AffineBasis.tot
code: theorem tot : affineSpan k (range b) = ⊤ 
goal: affineSpan k (Set.range ⇑b) = ⊤

full_name: AffineBasis.nonempty
code: protected theorem nonempty : Nonempty ι 
goal: Nonempty ι

full_name: AffineBasis.reindex
code: /-- Composition of an affine basis and an equivalence of index types. -/
def reindex (e : ι ≃ ι') : AffineBasis ι' k P 
goal: AffineBasis ι' k P

full_name: AffineBasis.coe_reindex
code: @[simp, norm_cast]
theorem coe_reindex : ⇑(b.reindex e) = b ∘ e.symm 
goal: ⇑(b.reindex e) = ⇑b ∘ ⇑e.symm

full_name: AffineBasis.reindex_apply
code: @[simp]
theorem reindex_apply (i' : ι') : b.reindex e i' = b (e.symm i') 
goal: (b.reindex e) i' = b (e.symm i')

full_name: AffineBasis.reindex_refl
code: @[simp]
theorem reindex_refl : b.reindex (Equiv.refl _) = b 
goal: b.reindex (Equiv.refl ι) = b

full_name: AffineBasis.basisOf
code: /-- 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 corresponding to the singled-out member `i : ι` is indexed by `{j : ι // j ≠ i}`
and its `j`th element is `b j -ᵥ b i`. (See `basisOf_apply`.) -/
noncomputable def basisOf (i : ι) : Basis { j : ι // j ≠ i } k V 
goal: Basis { j // j ≠ i } k V

full_name: AffineBasis.basisOf_apply
code: @[simp]
theorem basisOf_apply (i : ι) (j : { j : ι // j ≠ i }) : b.basisOf i j = b ↑j -ᵥ b i 
goal: (b.basisOf i) j = b ↑j -ᵥ b i

full_name: AffineBasis.basisOf_reindex
code: @[simp]
theorem basisOf_reindex (i : ι') :
    (b.reindex e).basisOf i =
      (b.basisOf <| e.symm i).reindex (e.subtypeEquiv fun _ => e.eq_symm_apply.not) 
goal: (b.reindex e).basisOf i = (b.basisOf (e.symm i)).reindex (e.subtypeEquiv ⋯)

full_name: AffineBasis.coord
code: /-- The `i`th barycentric coordinate of a point. -/
noncomputable def coord (i : ι) : P →ᵃ[k] k 
goal: P →ᵃ[k] k

full_name: AffineBasis.linear_eq_sumCoords
code: @[simp]
theorem linear_eq_sumCoords (i : ι) : (b.coord i).linear = -(b.basisOf i).sumCoords 
goal: (b.coord i).linear = -(b.basisOf i).sumCoords

full_name: AffineBasis.coord_reindex
code: @[simp]
theorem coord_reindex (i : ι') : (b.reindex e).coord i = b.coord (e.symm i) 
goal: (b.reindex e).coord i = b.coord (e.symm i)

full_name: AffineBasis.coord_apply_eq
code: @[simp]
theorem coord_apply_eq (i : ι) : b.coord i (b i) = 1 
goal: (b.coord i) (b i) = 1

full_name: AffineBasis.coord_apply_ne
code: @[simp]
theorem coord_apply_ne (h : i ≠ j) : b.coord i (b j) = 0 
goal: (b.coord i) (b j) = 0

full_name: AffineBasis.coord_apply
code: theorem coord_apply [DecidableEq ι] (i j : ι) : b.coord i (b j) = if i = j then 1 else 0 
goal: (b.coord i) (b j) = if i = j then 1 else 0

full_name: AffineBasis.coord_apply_combination_of_mem
code: @[simp]
theorem coord_apply_combination_of_mem (hi : i ∈ s) {w : ι → k} (hw : s.sum w = 1) :
    b.coord i (s.affineCombination k b w) = w i 
goal: (b.coord i) ((Finset.affineCombination k s ⇑b) w) = w i

full_name: AffineBasis.coord_apply_combination_of_not_mem
code: @[simp]
theorem coord_apply_combination_of_not_mem (hi : i ∉ s) {w : ι → k} (hw : s.sum w = 1) :
    b.coord i (s.affineCombination k b w) = 0 
goal: (b.coord i) ((Finset.affineCombination k s ⇑b) w) = 0

full_name: AffineBasis.sum_coord_apply_eq_one
code: @[simp]
theorem sum_coord_apply_eq_one [Fintype ι] (q : P) : ∑ i, b.coord i q = 1 
goal: ∑ i : ι, (b.coord i) q = 1

full_name: AffineBasis.affineCombination_coord_eq_self
code: @[simp]
theorem affineCombination_coord_eq_self [Fintype ι] (q : P) :
    (Finset.univ.affineCombination k b fun i => b.coord i q) = q 
goal: ((Finset.affineCombination k Finset.univ ⇑b) fun i => (b.coord i) q) = q

full_name: AffineBasis.linear_combination_coord_eq_self
code: /-- A variant of `AffineBasis.affineCombination_coord_eq_self` for the special case when the
affine space is a module so we can talk about linear combinations. -/
@[simp]
theorem linear_combination_coord_eq_self [Fintype ι] (b : AffineBasis ι k V) (v : V) :
    ∑ i, b.coord i v • b i = v 
goal: ∑ i : ι, (b.coord i) v • b i = v

full_name: AffineBasis.ext_elem
code: theorem ext_elem [Finite ι] {q₁ q₂ : P} (h : ∀ i, b.coord i q₁ = b.coord i q₂) : q₁ = q₂ 
goal: q₁ = q₂

full_name: AffineBasis.coe_coord_of_subsingleton_eq_one
code: @[simp]
theorem coe_coord_of_subsingleton_eq_one [Subsingleton ι] (i : ι) : (b.coord i : P → k) = 1 
goal: ⇑(b.coord i) = 1

full_name: AffineBasis.surjective_coord
code: theorem surjective_coord [Nontrivial ι] (i : ι) : Function.Surjective <| b.coord i 
goal: Function.Surjective ⇑(b.coord i)

full_name: AffineBasis.coords
code: /-- Barycentric coordinates as an affine map. -/
noncomputable def coords : P →ᵃ[k] ι → k 
goal: P →ᵃ[k] ι → k

full_name: AffineBasis.coords_apply
code: @[simp]
theorem coords_apply (q : P) (i : ι) : b.coords q i = b.coord i q 
goal: b.coords q i = (b.coord i) q

full_name: AffineBasis.instVAdd
code: instance instVAdd : VAdd V (AffineBasis ι k P) 
goal: VAdd V (AffineBasis ι k P)

full_name: AffineBasis.coe_vadd
code: @[simp, norm_cast] lemma coe_vadd (v : V) (b : AffineBasis ι k P) : ⇑(v +ᵥ b) = v +ᵥ ⇑b 
goal: ⇑(v +ᵥ b) = v +ᵥ ⇑b

full_name: AffineBasis.basisOf_vadd
code: @[simp] lemma basisOf_vadd (v : V) (b : AffineBasis ι k P) : (v +ᵥ b).basisOf = b.basisOf 
goal: (v +ᵥ b).basisOf = b.basisOf

full_name: AffineBasis.instAddAction
code: instance instAddAction : AddAction V (AffineBasis ι k P) 
goal: AddAction V (AffineBasis ι k P)

full_name: AffineBasis.coord_vadd
code: @[simp] lemma coord_vadd (v : V) (b : AffineBasis ι k P) :
    (v +ᵥ b).coord i = (b.coord i).comp (AffineEquiv.constVAdd k P v).symm 
goal: (v +ᵥ b).coord i = (b.coord i).comp ↑(AffineEquiv.constVAdd k P v).symm

full_name: AffineBasis.coord_apply_centroid
code: @[simp]
theorem coord_apply_centroid [CharZero k] (b : AffineBasis ι k P) {s : Finset ι} {i : ι}
    (hi : i ∈ s) : b.coord i (s.centroid k b) = (s.card : k)⁻¹ 
goal: (b.coord i) (Finset.centroid k s ⇑b) = (↑s.card)⁻¹

full_name: AffineBasis.exists_affine_subbasis
code: theorem exists_affine_subbasis {t : Set P} (ht : affineSpan k t = ⊤) :
    ∃ s ⊆ t, ∃ b : AffineBasis s k P, ⇑b = ((↑) : s → P) 
goal: ∃ s ⊆ t, ∃ b, ⇑b = Subtype.val

full_name: AffineBasis.exists_affineBasis
code: theorem exists_affineBasis : ∃ (s : Set P) (b : AffineBasis (↥s) k P), ⇑b = ((↑) : s → P) 
goal: ∃ s b, ⇑b = Subtype.val