The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V07. Linear algebra

Mathlib.LinearAlgebra.StdBasis

20 declarations. Mathlib docs · Source

The standard basis

This file defines the standard basis Pi.basis (s : ∀ j, Basis (ι j) R (M j)), which is the Σ j, ι j-indexed basis of Π j, M j. The basis vectors are given by Pi.basis s ⟨j, i⟩ j' = Pi.single j' (s j) i = if j = j' then s i else 0.

The standard basis on R^η, i.e. η → R is called Pi.basisFun.

To give a concrete example, Pi.single (i : Fin 3) (1 : R) gives the ith unit basis vector in R³, and Pi.basisFun R (Fin 3) proves this is a basis over Fin 3 → R.

Main definitions

  • Pi.basis s: given a basis s i for each M i, the standard basis on Π i, M i
  • Pi.basisFun R η: the standard basis on R^η, i.e. η → R, given by Pi.basisFun R η i j = Pi.single i 1 j = if i = j then 1 else 0.
  • Matrix.stdBasis R n m: the standard basis on Matrix n m R, given by Matrix.stdBasis R n m (i, j) i' j' = if (i, j) = (i', j') then 1 else 0.

theorem Pi.basisFun.congr_simp E1 #

∀ (R : Type u_2) (η : Type u_4) [inst : Semiring R] [inst_1 : Finite η], Pi.basisFun R η = Pi.basisFun R η

theorem Pi.linearIndependent_single E1 #

∀ {R : Type u_2} {η : Type u_4} {ιs : η → Type u_5} {Ms : η → Type u_6} [inst : Semiring R]
  [inst_1 : (i : η) → AddCommMonoid (Ms i)] [inst_2 : (i : η) → Module R (Ms i)] [inst_3 : DecidableEq η]
  (v : (j : η) → ιs j → Ms j),
  (∀ (i : η), LinearIndependent R (v i)) → LinearIndependent R fun ji ↦ Pi.single ji.fst (v ji.fst ji.snd)

theorem Pi.linearIndependent_single_one E1 #

∀ (ι : Type u_7) (R : Type u_8) [inst : Semiring R] [inst_1 : DecidableEq ι], LinearIndependent R fun i ↦ Pi.single i 1

theorem Pi.linearIndependent_single_of_ne_zero E1 #

∀ {ι : Type u_1} {R : Type u_2} {M : Type u_3} [inst : Ring R] [IsDomain R] [inst_2 : AddCommGroup M]
  [inst_3 : Module R M] [Module.IsTorsionFree R M] [inst_5 : DecidableEq ι] {v : ι → M},
  (∀ (i : ι), v i ≠ 0) → LinearIndependent R fun i ↦ Pi.single i (v i)

def Pi.basis E1 #

{R : Type u_2} →
  {η : Type u_4} →
    {ιs : η → Type u_5} →
      {Ms : η → Type u_6} →
        [inst : Semiring R] →
          [inst_1 : (i : η) → AddCommMonoid (Ms i)] →
            [inst_2 : (i : η) → Module R (Ms i)] →
              [Fintype η] → ((j : η) → Module.Basis (ιs j) R (Ms j)) → Module.Basis ((j : η) × ιs j) R ((j : η) → Ms j)

Pi.basis (s : ∀ j, Basis (ιs j) R (Ms j)) is the Σ j, ιs j-indexed basis on Π j, Ms j given by s j on each component.

For the standard basis over R on the finite-dimensional space η → R see Pi.basisFun.

theorem Pi.basis_repr_single E0 #

∀ {R : Type u_2} {η : Type u_4} {ιs : η → Type u_5} {Ms : η → Type u_6} [inst : Semiring R]
  [inst_1 : (i : η) → AddCommMonoid (Ms i)] [inst_2 : (i : η) → Module R (Ms i)] [inst_3 : Fintype η]
  [inst_4 : DecidableEq η] (s : (j : η) → Module.Basis (ιs j) R (Ms j)) (j : η) (i : ιs j),
  (Pi.basis s).repr (Pi.single j ((s j) i)) = fun₀ | ⟨j, i⟩ => 1

theorem Pi.basis_apply E0 #

∀ {R : Type u_2} {η : Type u_4} {ιs : η → Type u_5} {Ms : η → Type u_6} [inst : Semiring R]
  [inst_1 : (i : η) → AddCommMonoid (Ms i)] [inst_2 : (i : η) → Module R (Ms i)] [inst_3 : Fintype η]
  [inst_4 : DecidableEq η] (s : (j : η) → Module.Basis (ιs j) R (Ms j)) (ji : (j : η) × ιs j),
  (Pi.basis s) ji = Pi.single ji.fst ((s ji.fst) ji.snd)

theorem Pi.basis_repr E0 #

∀ {R : Type u_2} {η : Type u_4} {ιs : η → Type u_5} {Ms : η → Type u_6} [inst : Semiring R]
  [inst_1 : (i : η) → AddCommMonoid (Ms i)] [inst_2 : (i : η) → Module R (Ms i)] [inst_3 : Fintype η]
  (s : (j : η) → Module.Basis (ιs j) R (Ms j)) (x : (j : η) → Ms j) (ji : (j : η) × ιs j),
  ((Pi.basis s).repr x) ji = ((s ji.fst).repr (x ji.fst)) ji.snd

def Pi.basisFun E1 #

(R : Type u_2) → (η : Type u_4) → [inst : Semiring R] → [Finite η] → Module.Basis η R (η → R)

The basis on η → R where the ith basis vector is Function.update 0 i 1.

theorem Pi.basisFun_apply E0 #

∀ (R : Type u_2) (η : Type u_4) [inst : Semiring R] [inst_1 : Finite η] [inst_2 : DecidableEq η] (i : η),
  (Pi.basisFun R η) i = Pi.single i 1

theorem Pi.basisFun_repr E0 #

∀ (R : Type u_2) (η : Type u_4) [inst : Semiring R] [inst_1 : Finite η] (x : η → R) (i : η),
  ((Pi.basisFun R η).repr x) i = x i

theorem Pi.basisFun_equivFun E0 #

∀ (R : Type u_2) (η : Type u_4) [inst : Semiring R] [inst_1 : Finite η],
  (Pi.basisFun R η).equivFun = LinearEquiv.refl R (η → R)

def Pi.spanSubset E1 #

(R : Type u_2) → {η : Type u_4} → [inst : Semiring R] → [Finite η] → Set η → Submodule R (η → R)

The R-submodule of η → R consisting of functions supported in the subset s.

theorem Pi.mem_spanSubset_iff E0 #

∀ {R : Type u_2} {η : Type u_4} [inst : Semiring R] [inst_1 : Finite η] {s : Set η} {v : η → R},
  v ∈ Pi.spanSubset R s ↔ ∀ i ∉ s, v i = 0

def Module.piEquiv E1 #

(ι : Type u_1) →
  (R : Type u_2) →
    (M : Type u_3) →
      [Finite ι] →
        [inst : CommSemiring R] → [inst_1 : AddCommMonoid M] → [inst_2 : Module R M] → (ι → M) ≃ₗ[R] (ι → R) →ₗ[R] M

The natural linear equivalence: Mⁱ ≃ Hom(Rⁱ, M) for an R-module M.

theorem Module.piEquiv_apply_apply E0 #

∀ (ι : Type u_4) (R : Type u_5) (M : Type u_6) [inst : Fintype ι] [inst_1 : CommSemiring R] [inst_2 : AddCommMonoid M]
  [inst_3 : Module R M] (v : ι → M) (w : ι → R), ((Module.piEquiv ι R M) v) w = ∑ i, w i • v i

theorem Module.range_piEquiv E0 #

∀ (ι : Type u_1) (R : Type u_2) (M : Type u_3) [inst : Finite ι] [inst_1 : CommSemiring R] [inst_2 : AddCommMonoid M]
  [inst_3 : Module R M] (v : ι → M), ((Module.piEquiv ι R M) v).range = Submodule.span R (Set.range v)

theorem Module.surjective_piEquiv_apply_iff E0 #

∀ (ι : Type u_1) (R : Type u_2) (M : Type u_3) [inst : Finite ι] [inst_1 : CommSemiring R] [inst_2 : AddCommMonoid M]
  [inst_3 : Module R M] (v : ι → M),
  Function.Surjective ⇑((Module.piEquiv ι R M) v) ↔ Submodule.span R (Set.range v) = ⊤

instance Module.Free.pi E0 #

∀ {ι : Type u_1} (R : Type u_2) [inst : Semiring R] (M : ι → Type u_4) [Finite ι]
  [inst_2 : (i : ι) → AddCommMonoid (M i)] [inst_3 : (i : ι) → Module R (M i)] [∀ (i : ι), Module.Free R (M i)],
  Module.Free R ((i : ι) → M i)

The product of finitely many free modules is free.

instance Module.Free.function E0 #

∀ (ι : Type u_1) (R : Type u_2) (M : Type u_3) [inst : Semiring R] [inst_1 : AddCommMonoid M] [inst_2 : Module R M]
  [Finite ι] [Module.Free R M], Module.Free R (ι → M)

The product of finitely many free modules is free (non-dependent version to help with typeclass search).