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.Data.Matrix.PEquiv

22 declarations. Mathlib docs · Source

theorem PEquiv.toMatrix.congr_simp E1 #

∀ {m : Type u_3} {n : Type u_4} {α : Type u_5} {inst : DecidableEq n} [inst_1 : DecidableEq n] [inst_2 : Zero α]
  [inst_3 : One α] (f f_1 : m ≃. n),
  f = f_1 → ∀ (a a_1 : m), a = a_1 → ∀ (a_2 a_3 : n), a_2 = a_3 → f.toMatrix a a_2 = f_1.toMatrix a_1 a_3

def PEquiv.toMatrix E1 #

{m : Type u_3} → {n : Type u_4} → {α : Type u_5} → [DecidableEq n] → [Zero α] → [One α] → (m ≃. n) → Matrix m n α

toMatrix returns a matrix containing ones and zeros. f.toMatrix i j is 1 if f i = some j and 0 otherwise

theorem PEquiv.toMatrix_apply E0 #

∀ {m : Type u_3} {n : Type u_4} {α : Type u_5} [inst : DecidableEq n] [inst_1 : Zero α] [inst_2 : One α] (f : m ≃. n)
  (i : m) (j : n), f.toMatrix i j = if j ∈ f i then 1 else 0

theorem PEquiv.toMatrix_mul_apply E0 #

∀ {l : Type u_2} {m : Type u_3} {n : Type u_4} {α : Type u_5} [inst : Fintype m] [inst_1 : DecidableEq m]
  [inst_2 : NonAssocSemiring α] (f : l ≃. m) (i : l) (j : n) (M : Matrix m n α),
  (f.toMatrix * M) i j = Option.casesOn (f i) 0 fun fi ↦ M fi j

theorem PEquiv.mul_toMatrix_apply E0 #

∀ {l : Type u_2} {m : Type u_3} {n : Type u_4} {α : Type u_5} [inst : Fintype m] [inst_1 : NonAssocSemiring α]
  [inst_2 : DecidableEq n] (M : Matrix l m α) (f : m ≃. n) (i : l) (j : n),
  (M * f.toMatrix) i j = Option.casesOn (f.symm j) 0 (M i)

theorem PEquiv.toMatrix_symm E1 #

∀ {m : Type u_3} {n : Type u_4} {α : Type u_5} [inst : DecidableEq m] [inst_1 : DecidableEq n] [inst_2 : Zero α]
  [inst_3 : One α] (f : m ≃. n), f.symm.toMatrix = f.toMatrix.transpose

theorem PEquiv.toMatrix_refl E0 #

∀ {n : Type u_4} {α : Type u_5} [inst : DecidableEq n] [inst_1 : Zero α] [inst_2 : One α], (PEquiv.refl n).toMatrix = 1

theorem PEquiv.toMatrix_toPEquiv_apply E0 #

∀ {m : Type u_3} {n : Type u_4} {α : Type u_5} [inst : DecidableEq n] [inst_1 : Zero α] [inst_2 : One α] (f : m ≃ n)
  (i : m), f.toPEquiv.toMatrix i = Pi.single (f i) 1

theorem PEquiv.transpose_toMatrix_toPEquiv_apply E0 #

∀ {m : Type u_3} {n : Type u_4} {α : Type u_5} [inst : DecidableEq m] [inst_1 : DecidableEq n] [inst_2 : Zero α]
  [inst_3 : One α] (f : m ≃ n) (j : n), f.toPEquiv.toMatrix.transpose j = Pi.single (f.symm j) 1

theorem PEquiv.toMatrix_toPEquiv_mul E1 #

∀ {l : Type u_2} {m : Type u_3} {n : Type u_4} {α : Type u_5} [inst : Fintype m] [inst_1 : DecidableEq m]
  [inst_2 : NonAssocSemiring α] (f : l ≃ m) (M : Matrix m n α), f.toPEquiv.toMatrix * M = M.submatrix (⇑f) id

theorem PEquiv.mul_toMatrix_toPEquiv E1 #

∀ {l : Type u_2} {m : Type u_3} {n : Type u_4} {α : Type u_5} [inst : Fintype m] [inst_1 : DecidableEq n]
  [inst_2 : NonAssocSemiring α] (M : Matrix l m α) (f : m ≃ n), M * f.toPEquiv.toMatrix = M.submatrix id ⇑f.symm

theorem PEquiv.toMatrix_toPEquiv_mulVec E1 #

∀ {m : Type u_3} {n : Type u_4} {α : Type u_5} [inst : DecidableEq n] [inst_1 : Fintype n] [inst_2 : NonAssocSemiring α]
  (σ : m ≃ n) (a : n → α), σ.toPEquiv.toMatrix.mulVec a = a ∘ ⇑σ

theorem PEquiv.vecMul_toMatrix_toPEquiv E1 #

∀ {m : Type u_3} {n : Type u_4} {α : Type u_5} [inst : DecidableEq n] [inst_1 : Fintype m] [inst_2 : NonAssocSemiring α]
  (σ : m ≃ n) (a : m → α), Matrix.vecMul a σ.toPEquiv.toMatrix = a ∘ ⇑σ.symm

theorem PEquiv.toMatrix_trans E1 #

∀ {l : Type u_2} {m : Type u_3} {n : Type u_4} {α : Type u_5} [inst : Fintype m] [inst_1 : DecidableEq m]
  [inst_2 : DecidableEq n] [inst_3 : NonAssocSemiring α] (f : l ≃. m) (g : m ≃. n),
  (f.trans g).toMatrix = f.toMatrix * g.toMatrix

theorem PEquiv.toMatrix_bot E0 #

∀ {m : Type u_3} {n : Type u_4} {α : Type u_5} [inst : DecidableEq n] [inst_1 : Zero α] [inst_2 : One α], ⊥.toMatrix = 0

theorem PEquiv.toMatrix_injective E1 #

∀ {m : Type u_3} {n : Type u_4} {α : Type u_5} [inst : DecidableEq n] [inst_1 : MulZeroOneClass α] [Nontrivial α],
  Function.Injective PEquiv.toMatrix

theorem PEquiv.toMatrix_swap E1 #

∀ {n : Type u_4} {α : Type u_5} [inst : DecidableEq n] [inst_1 : AddGroupWithOne α] (i j : n),
  (Equiv.toPEquiv (Equiv.swap i j)).toMatrix =
    1 - (PEquiv.single i i).toMatrix - (PEquiv.single j j).toMatrix + (PEquiv.single i j).toMatrix +
      (PEquiv.single j i).toMatrix

theorem PEquiv.single_mul_single E0 #

∀ {k : Type u_1} {m : Type u_3} {n : Type u_4} {α : Type u_5} [inst : Fintype n] [inst_1 : DecidableEq k]
  [inst_2 : DecidableEq m] [inst_3 : DecidableEq n] [inst_4 : NonAssocSemiring α] (a : m) (b : n) (c : k),
  (PEquiv.single a b).toMatrix * (PEquiv.single b c).toMatrix = (PEquiv.single a c).toMatrix

theorem PEquiv.single_mul_single_of_ne E1 #

∀ {k : Type u_1} {m : Type u_3} {n : Type u_4} {α : Type u_5} [inst : Fintype n] [inst_1 : DecidableEq n]
  [inst_2 : DecidableEq k] [inst_3 : DecidableEq m] [inst_4 : NonAssocSemiring α] {b₁ b₂ : n},
  b₁ ≠ b₂ → ∀ (a : m) (c : k), (PEquiv.single a b₁).toMatrix * (PEquiv.single b₂ c).toMatrix = 0

theorem PEquiv.single_mul_single_right E0 #

∀ {k : Type u_1} {l : Type u_2} {m : Type u_3} {n : Type u_4} {α : Type u_5} [inst : Fintype n] [inst_1 : Fintype k]
  [inst_2 : DecidableEq n] [inst_3 : DecidableEq k] [inst_4 : DecidableEq m] [inst_5 : Semiring α] (a : m) (b : n)
  (c : k) (M : Matrix k l α),
  (PEquiv.single a b).toMatrix * ((PEquiv.single b c).toMatrix * M) = (PEquiv.single a c).toMatrix * M

Restatement of single_mul_single, which will simplify expressions in simp normal form, when associativity may otherwise need to be carefully applied.

theorem PEquiv.toMatrix_toPEquiv_eq E0 #

∀ {m : Type u_3} {n : Type u_4} {α : Type u_5} [inst : DecidableEq n] [inst_1 : Zero α] [inst_2 : One α] (σ : m ≃ n),
  σ.toPEquiv.toMatrix = Matrix.submatrix 1 (⇑σ) id

We can also define permutation matrices by permuting the rows of the identity matrix.

theorem PEquiv.map_toMatrix E0 #

∀ {m : Type u_3} {n : Type u_4} {α : Type u_5} {β : Type u_6} [inst : DecidableEq n] [inst_1 : NonAssocSemiring α]
  [inst_2 : NonAssocSemiring β] (f : α →+* β) (σ : m ≃. n), σ.toMatrix.map ⇑f = σ.toMatrix