File: Mathlib/LinearAlgebra/Matrix/Basis.lean

full_name: Basis.toMatrix
code: /-- From a basis `e : ι → M` and a family of vectors `v : ι' → M`, make the matrix whose columns
are the vectors `v i` written in the basis `e`. -/
def Basis.toMatrix (e : Basis ι R M) (v : ι' → M) : Matrix ι ι' R 
goal: Matrix ι ι' R

full_name: Basis.toMatrix_apply
code: theorem toMatrix_apply : e.toMatrix v i j = e.repr (v j) i 
goal: e.toMatrix v i j = (e.repr (v j)) i

full_name: Basis.toMatrix_transpose_apply
code: theorem toMatrix_transpose_apply : (e.toMatrix v)ᵀ j = e.repr (v j) 
goal: (e.toMatrix v)ᵀ j = ⇑(e.repr (v j))

full_name: Basis.toMatrix_eq_toMatrix_constr
code: theorem toMatrix_eq_toMatrix_constr [Fintype ι] [DecidableEq ι] (v : ι → M) :
    e.toMatrix v = LinearMap.toMatrix e e (e.constr ℕ v) 
goal: e.toMatrix v = (LinearMap.toMatrix e e) ((e.constr ℕ) v)

full_name: Basis.coePiBasisFun.toMatrix_eq_transpose
code: theorem coePiBasisFun.toMatrix_eq_transpose [Finite ι] :
    ((Pi.basisFun R ι).toMatrix : Matrix ι ι R → Matrix ι ι R) = Matrix.transpose 
goal: (Pi.basisFun R ι).toMatrix = Matrix.transpose

full_name: Basis.toMatrix_self
code: @[simp]
theorem toMatrix_self [DecidableEq ι] : e.toMatrix e = 1 
goal: e.toMatrix ⇑e = 1

full_name: Basis.toMatrix_update
code: theorem toMatrix_update [DecidableEq ι'] (x : M) :
    e.toMatrix (Function.update v j x) = Matrix.updateColumn (e.toMatrix v) j (e.repr x) 
goal: e.toMatrix (Function.update v j x) = (e.toMatrix v).updateColumn j ⇑(e.repr x)

full_name: Basis.toMatrix_unitsSMul
code: /-- The basis constructed by `unitsSMul` has vectors given by a diagonal matrix. -/
@[simp]
theorem toMatrix_unitsSMul [DecidableEq ι] (e : Basis ι R₂ M₂) (w : ι → R₂ˣ) :
    e.toMatrix (e.unitsSMul w) = diagonal ((↑) ∘ w) 
goal: e.toMatrix ⇑(e.unitsSMul w) = Matrix.diagonal (Units.val ∘ w)

full_name: Basis.toMatrix_isUnitSMul
code: /-- The basis constructed by `isUnitSMul` has vectors given by a diagonal matrix. -/
@[simp]
theorem toMatrix_isUnitSMul [DecidableEq ι] (e : Basis ι R₂ M₂) {w : ι → R₂}
    (hw : ∀ i, IsUnit (w i)) : e.toMatrix (e.isUnitSMul hw) = diagonal w 
goal: e.toMatrix ⇑(e.isUnitSMul hw) = Matrix.diagonal w

full_name: Basis.toMatrix_smul_left
code: theorem toMatrix_smul_left {G} [Group G] [DistribMulAction G M] [SMulCommClass G R M] (g : G) :
    (g • e).toMatrix v = e.toMatrix (g⁻¹ • v) 
goal: (g • e).toMatrix v = e.toMatrix (g⁻¹ • v)

full_name: Basis.sum_toMatrix_smul_self
code: @[simp]
theorem sum_toMatrix_smul_self [Fintype ι] : ∑ i : ι, e.toMatrix v i j • e i = v j 
goal: ∑ i : ι, e.toMatrix v i j • e i = v j

full_name: Basis.toMatrix_smul
code: theorem toMatrix_smul {R₁ S : Type*} [CommRing R₁] [Ring S] [Algebra R₁ S] [Fintype ι]
    [DecidableEq ι] (x : S) (b : Basis ι R₁ S) (w : ι → S) :
    (b.toMatrix (x • w)) = (Algebra.leftMulMatrix b x) * (b.toMatrix w) 
goal: b.toMatrix (x • w) = (Algebra.leftMulMatrix b) x * b.toMatrix w

full_name: Basis.toMatrix_map_vecMul
code: theorem toMatrix_map_vecMul {S : Type*} [Ring S] [Algebra R S] [Fintype ι] (b : Basis ι R S)
    (v : ι' → S) : b ᵥ* ((b.toMatrix v).map <| algebraMap R S) = v 
goal: ⇑b ᵥ* (b.toMatrix v).map ⇑(algebraMap R S) = v

full_name: Basis.toLin_toMatrix
code: @[simp]
theorem toLin_toMatrix [Finite ι] [Fintype ι'] [DecidableEq ι'] (v : Basis ι' R M) :
    Matrix.toLin v e (e.toMatrix v) = LinearMap.id 
goal: (Matrix.toLin v e) (e.toMatrix ⇑v) = LinearMap.id

full_name: Basis.toMatrixEquiv
code: /-- From a basis `e : ι → M`, build a linear equivalence between families of vectors `v : ι → M`,
and matrices, making the matrix whose columns are the vectors `v i` written in the basis `e`. -/
def toMatrixEquiv [Fintype ι] (e : Basis ι R M) : (ι → M) ≃ₗ[R] Matrix ι ι R 
goal: (ι → M) ≃ₗ[R] Matrix ι ι R

full_name: Basis.restrictScalars_toMatrix
code: theorem restrictScalars_toMatrix [Fintype ι] [DecidableEq ι] {S : Type*} [CommRing S] [Nontrivial S]
    [Algebra R₂ S] [Module S M₂] [IsScalarTower R₂ S M₂] [NoZeroSMulDivisors R₂ S]
    (b : Basis ι S M₂) (v : ι → span R₂ (Set.range b)) :
    (algebraMap R₂ S).mapMatrix ((b.restrictScalars R₂).toMatrix v) =
      b.toMatrix (fun i ↦ (v i : M₂)) 
goal: (algebraMap R₂ S).mapMatrix ((Basis.restrictScalars R₂ b).toMatrix v) = b.toMatrix fun i => ↑(v i)

full_name: LinearMap.toMatrix_id_eq_basis_toMatrix
code: /-- A generalization of `LinearMap.toMatrix_id`. -/
@[simp]
theorem LinearMap.toMatrix_id_eq_basis_toMatrix [Fintype ι] [DecidableEq ι] [Finite ι'] :
    LinearMap.toMatrix b b' id = b'.toMatrix b 
goal: (LinearMap.toMatrix b b') LinearMap.id = b'.toMatrix ⇑b

full_name: basis_toMatrix_mul_linearMap_toMatrix
code: @[simp]
theorem basis_toMatrix_mul_linearMap_toMatrix [Finite κ] [Fintype κ'] [DecidableEq ι'] :
    c.toMatrix c' * LinearMap.toMatrix b' c' f = LinearMap.toMatrix b' c f 
goal: c.toMatrix ⇑c' * (LinearMap.toMatrix b' c') f = (LinearMap.toMatrix b' c) f

full_name: basis_toMatrix_mul
code: theorem basis_toMatrix_mul [Fintype κ] [Finite ι] [DecidableEq κ]
    (b₁ : Basis ι R M) (b₂ : Basis ι' R M) (b₃ : Basis κ R N) (A : Matrix ι' κ R) :
    b₁.toMatrix b₂ * A = LinearMap.toMatrix b₃ b₁ (toLin b₃ b₂ A) 
goal: b₁.toMatrix ⇑b₂ * A = (LinearMap.toMatrix b₃ b₁) ((Matrix.toLin b₃ b₂) A)

full_name: linearMap_toMatrix_mul_basis_toMatrix
code: @[simp]
theorem linearMap_toMatrix_mul_basis_toMatrix [Finite κ'] [DecidableEq ι] [DecidableEq ι'] :
    LinearMap.toMatrix b' c' f * b'.toMatrix b = LinearMap.toMatrix b c' f 
goal: (LinearMap.toMatrix b' c') f * b'.toMatrix ⇑b = (LinearMap.toMatrix b c') f

full_name: basis_toMatrix_mul_linearMap_toMatrix_mul_basis_toMatrix
code: theorem basis_toMatrix_mul_linearMap_toMatrix_mul_basis_toMatrix
    [Fintype κ'] [DecidableEq ι] [DecidableEq ι'] :
    c.toMatrix c' * LinearMap.toMatrix b' c' f * b'.toMatrix b = LinearMap.toMatrix b c f 
goal: c.toMatrix ⇑c' * (LinearMap.toMatrix b' c') f * b'.toMatrix ⇑b = (LinearMap.toMatrix b c) f

full_name: mul_basis_toMatrix
code: theorem mul_basis_toMatrix [DecidableEq ι] [DecidableEq ι'] (b₁ : Basis ι R M) (b₂ : Basis ι' R M)
    (b₃ : Basis κ R N) (A : Matrix κ ι R) :
    A * b₁.toMatrix b₂ = LinearMap.toMatrix b₂ b₃ (toLin b₁ b₃ A) 
goal: A * b₁.toMatrix ⇑b₂ = (LinearMap.toMatrix b₂ b₃) ((Matrix.toLin b₁ b₃) A)

full_name: basis_toMatrix_basisFun_mul
code: theorem basis_toMatrix_basisFun_mul (b : Basis ι R (ι → R)) (A : Matrix ι ι R) :
    b.toMatrix (Pi.basisFun R ι) * A = of fun i j => b.repr (Aᵀ j) i 
goal: b.toMatrix ⇑(Pi.basisFun R ι) * A = Matrix.of fun i j => (b.repr (Aᵀ j)) i

full_name: Basis.toMatrix_reindex'
code: /-- See also `Basis.toMatrix_reindex` which gives the `simp` normal form of this result. -/
theorem Basis.toMatrix_reindex' [DecidableEq ι] [DecidableEq ι'] (b : Basis ι R M) (v : ι' → M)
    (e : ι ≃ ι') : (b.reindex e).toMatrix v =
    Matrix.reindexAlgEquiv R R e (b.toMatrix (v ∘ e)) 
goal: (b.reindex e).toMatrix v = (Matrix.reindexAlgEquiv R R e) (b.toMatrix (v ∘ ⇑e))

full_name: Basis.toMatrix_mul_toMatrix
code: /-- A generalization of `Basis.toMatrix_self`, in the opposite direction. -/
@[simp]
theorem Basis.toMatrix_mul_toMatrix {ι'' : Type*} [Fintype ι'] (b'' : ι'' → M) :
    b.toMatrix b' * b'.toMatrix b'' = b.toMatrix b'' 
goal: b.toMatrix ⇑b' * b'.toMatrix b'' = b.toMatrix b''

full_name: Basis.toMatrix_mul_toMatrix_flip
code: /-- `b.toMatrix b'` and `b'.toMatrix b` are inverses. -/
theorem Basis.toMatrix_mul_toMatrix_flip [DecidableEq ι] [Fintype ι'] :
    b.toMatrix b' * b'.toMatrix b = 1 
goal: b.toMatrix ⇑b' * b'.toMatrix ⇑b = 1

full_name: Basis.invertibleToMatrix
code: /-- A matrix whose columns form a basis `b'`, expressed w.r.t. a basis `b`, is invertible. -/
def Basis.invertibleToMatrix [DecidableEq ι] [Fintype ι] (b b' : Basis ι R₂ M₂) :
    Invertible (b.toMatrix b') 
goal: Invertible (b.toMatrix ⇑b')

full_name: Basis.toMatrix_reindex
code: @[simp]
theorem Basis.toMatrix_reindex (b : Basis ι R M) (v : ι' → M) (e : ι ≃ ι') :
    (b.reindex e).toMatrix v = (b.toMatrix v).submatrix e.symm _root_.id 
goal: (b.reindex e).toMatrix v = (b.toMatrix v).submatrix (⇑e.symm) id

full_name: Basis.toMatrix_map
code: @[simp]
theorem Basis.toMatrix_map (b : Basis ι R M) (f : M ≃ₗ[R] N) (v : ι → N) :
    (b.map f).toMatrix v = b.toMatrix (f.symm ∘ v) 
goal: (b.map f).toMatrix v = b.toMatrix (⇑f.symm ∘ v)