File: Mathlib/LinearAlgebra/AffineSpace/Matrix.lean

full_name: AffineBasis.toMatrix
code: /-- Given an affine basis `p`, and a family of points `q : ι' → P`, this is the matrix whose
rows are the barycentric coordinates of `q` with respect to `p`.

It is an affine equivalent of `Basis.toMatrix`. -/
noncomputable def toMatrix {ι' : Type*} (q : ι' → P) : Matrix ι' ι k 
goal: Matrix ι' ι k

full_name: AffineBasis.toMatrix_apply
code: @[simp]
theorem toMatrix_apply {ι' : Type*} (q : ι' → P) (i : ι') (j : ι) :
    b.toMatrix q i j = b.coord j (q i) 
goal: b.toMatrix q i j = (b.coord j) (q i)

full_name: AffineBasis.toMatrix_self
code: @[simp]
theorem toMatrix_self [DecidableEq ι] : b.toMatrix b = (1 : Matrix ι ι k) 
goal: b.toMatrix ⇑b = 1

full_name: AffineBasis.toMatrix_row_sum_one
code: theorem toMatrix_row_sum_one [Fintype ι] (q : ι' → P) (i : ι') : ∑ j, b.toMatrix q i j = 1 
goal: ∑ j : ι, b.toMatrix q i j = 1

full_name: AffineBasis.affineIndependent_of_toMatrix_right_inv
code: /-- Given a family of points `p : ι' → P` and an affine basis `b`, if the matrix whose rows are the
coordinates of `p` with respect `b` has a right inverse, then `p` is affine independent. -/
theorem affineIndependent_of_toMatrix_right_inv [Fintype ι] [Finite ι'] [DecidableEq ι']
    (p : ι' → P) {A : Matrix ι ι' k} (hA : b.toMatrix p * A = 1) : AffineIndependent k p 
goal: AffineIndependent k p

full_name: AffineBasis.affineSpan_eq_top_of_toMatrix_left_inv
code: /-- Given a family of points `p : ι' → P` and an affine basis `b`, if the matrix whose rows are the
coordinates of `p` with respect `b` has a left inverse, then `p` spans the entire space. -/
theorem affineSpan_eq_top_of_toMatrix_left_inv [Finite ι] [Fintype ι'] [DecidableEq ι]
    [Nontrivial k] (p : ι' → P) {A : Matrix ι ι' k} (hA : A * b.toMatrix p = 1) :
    affineSpan k (range p) = ⊤ 
goal: affineSpan k (Set.range p) = ⊤

full_name: AffineBasis.toMatrix_vecMul_coords
code: /-- A change of basis formula for barycentric coordinates.

See also `AffineBasis.toMatrix_inv_vecMul_toMatrix`. -/
@[simp]
theorem toMatrix_vecMul_coords (x : P) : b₂.coords x ᵥ* b.toMatrix b₂ = b.coords x 
goal: b₂.coords x ᵥ* b.toMatrix ⇑b₂ = b.coords x

full_name: AffineBasis.toMatrix_mul_toMatrix
code: theorem toMatrix_mul_toMatrix : b.toMatrix b₂ * b₂.toMatrix b = 1 
goal: b.toMatrix ⇑b₂ * b₂.toMatrix ⇑b = 1

full_name: AffineBasis.isUnit_toMatrix
code: theorem isUnit_toMatrix : IsUnit (b.toMatrix b₂) 
goal: IsUnit (b.toMatrix ⇑b₂)

full_name: AffineBasis.isUnit_toMatrix_iff
code: theorem isUnit_toMatrix_iff [Nontrivial k] (p : ι → P) :
    IsUnit (b.toMatrix p) ↔ AffineIndependent k p ∧ affineSpan k (range p) = ⊤ 
goal: IsUnit (b.toMatrix p) ↔ AffineIndependent k p ∧ affineSpan k (Set.range p) = ⊤

full_name: AffineBasis.toMatrix_inv_vecMul_toMatrix
code: /-- A change of basis formula for barycentric coordinates.

See also `AffineBasis.toMatrix_vecMul_coords`. -/
@[simp]
theorem toMatrix_inv_vecMul_toMatrix (x : P) :
    b.coords x ᵥ* (b.toMatrix b₂)⁻¹ = b₂.coords x 
goal: b.coords x ᵥ* (b.toMatrix ⇑b₂)⁻¹ = b₂.coords x

full_name: AffineBasis.det_smul_coords_eq_cramer_coords
code: /-- If we fix a background affine basis `b`, then for any other basis `b₂`, we can characterise
the barycentric coordinates provided by `b₂` in terms of determinants relative to `b`. -/
theorem det_smul_coords_eq_cramer_coords (x : P) :
    (b.toMatrix b₂).det • b₂.coords x = (b.toMatrix b₂)ᵀ.cramer (b.coords x) 
goal: (b.toMatrix ⇑b₂).det • b₂.coords x = (b.toMatrix ⇑b₂)ᵀ.cramer (b.coords x)