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.Block

135 declarations. Mathlib docs · Source

Block Matrices

Main definitions

  • Matrix.fromBlocks: build a block matrix out of 4 blocks
  • Matrix.toBlocks₁₁, Matrix.toBlocks₁₂, Matrix.toBlocks₂₁, Matrix.toBlocks₂₂: extract each of the four blocks from Matrix.fromBlocks.
  • Matrix.blockDiagonal: block diagonal of equally sized blocks. On square blocks, this is a ring homomorphisms, Matrix.blockDiagonalRingHom.
  • Matrix.blockDiag: extract the blocks from the diagonal of a block diagonal matrix.
  • Matrix.blockDiagonal': block diagonal of unequally sized blocks. On square blocks, this is a ring homomorphisms, Matrix.blockDiagonal'RingHom.
  • Matrix.blockDiag': extract the blocks from the diagonal of a block diagonal matrix.

theorem Matrix.blockDiagonal'.congr_simp E1 #

∀ {o : Type u_4} {m' : o → Type u_7} {n' : o → Type u_8} {α : Type u_11} {inst : DecidableEq o} [inst_1 : DecidableEq o]
  [inst_2 : Zero α] (M M_1 : (i : o) → Matrix (m' i) (n' i) α),
  M = M_1 →
    ∀ (a a_1 : (i : o) × m' i),
      a = a_1 →
        ∀ (a_2 a_3 : (i : o) × n' i), a_2 = a_3 → Matrix.blockDiagonal' M a a_2 = Matrix.blockDiagonal' M_1 a_1 a_3

theorem Matrix.blockDiagonal.match_1.congr_eq_1 E1 #

∀ {n : Type u_1} {o : Type u_2} (motive : n × o → Sort u_3) (x : n × o) (h_1 : (j : n) → (k' : o) → motive (j, k'))
  (j : n) (k' : o),
  x = (j, k') →
    (match x with
      | (j, k') => h_1 j k') ≍
      h_1 j k'

theorem Matrix.blockDiagonal.congr_simp E1 #

∀ {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type u_11} {inst : DecidableEq o} [inst_1 : DecidableEq o]
  [inst_2 : Zero α] (M M_1 : o → Matrix m n α),
  M = M_1 →
    ∀ (a a_1 : m × o),
      a = a_1 → ∀ (a_2 a_3 : n × o), a_2 = a_3 → Matrix.blockDiagonal M a a_2 = Matrix.blockDiagonal M_1 a_1 a_3

theorem Matrix.dotProduct_block E1 #

∀ {m : Type u_2} {n : Type u_3} {α : Type u_11} [inst : Fintype m] [inst_1 : Fintype n] [inst_2 : Mul α]
  [inst_3 : AddCommMonoid α] (v w : m ⊕ n → α), v ⬝ᵥ w = v ∘ Sum.inl ⬝ᵥ w ∘ Sum.inl + v ∘ Sum.inr ⬝ᵥ w ∘ Sum.inr

def Matrix.fromBlocks E3 #

{l : Type u_1} →
  {m : Type u_2} →
    {n : Type u_3} →
      {o : Type u_4} →
        {α : Type u_11} → Matrix n l α → Matrix n m α → Matrix o l α → Matrix o m α → Matrix (n ⊕ o) (l ⊕ m) α

We can form a single large matrix by flattening smaller 'block' matrices of compatible dimensions.

theorem Matrix.fromBlocks_apply₁₁ E0 #

∀ {l : Type u_1} {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type u_11} (A : Matrix n l α) (B : Matrix n m α)
  (C : Matrix o l α) (D : Matrix o m α) (i : n) (j : l), Matrix.fromBlocks A B C D (Sum.inl i) (Sum.inl j) = A i j

theorem Matrix.fromBlocks_apply₁₂ E0 #

∀ {l : Type u_1} {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type u_11} (A : Matrix n l α) (B : Matrix n m α)
  (C : Matrix o l α) (D : Matrix o m α) (i : n) (j : m), Matrix.fromBlocks A B C D (Sum.inl i) (Sum.inr j) = B i j

theorem Matrix.fromBlocks_apply₂₁ E0 #

∀ {l : Type u_1} {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type u_11} (A : Matrix n l α) (B : Matrix n m α)
  (C : Matrix o l α) (D : Matrix o m α) (i : o) (j : l), Matrix.fromBlocks A B C D (Sum.inr i) (Sum.inl j) = C i j

theorem Matrix.fromBlocks_apply₂₂ E0 #

∀ {l : Type u_1} {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type u_11} (A : Matrix n l α) (B : Matrix n m α)
  (C : Matrix o l α) (D : Matrix o m α) (i : o) (j : m), Matrix.fromBlocks A B C D (Sum.inr i) (Sum.inr j) = D i j

def Matrix.toBlocks₁₁ E3 #

{l : Type u_1} →
  {m : Type u_2} → {n : Type u_3} → {o : Type u_4} → {α : Type u_11} → Matrix (n ⊕ o) (l ⊕ m) α → Matrix n l α

Given a matrix whose row and column indexes are sum types, we can extract the corresponding "top left" submatrix.

def Matrix.toBlocks₁₂ E3 #

{l : Type u_1} →
  {m : Type u_2} → {n : Type u_3} → {o : Type u_4} → {α : Type u_11} → Matrix (n ⊕ o) (l ⊕ m) α → Matrix n m α

Given a matrix whose row and column indexes are sum types, we can extract the corresponding "top right" submatrix.

def Matrix.toBlocks₂₁ E3 #

{l : Type u_1} →
  {m : Type u_2} → {n : Type u_3} → {o : Type u_4} → {α : Type u_11} → Matrix (n ⊕ o) (l ⊕ m) α → Matrix o l α

Given a matrix whose row and column indexes are sum types, we can extract the corresponding "bottom left" submatrix.

def Matrix.toBlocks₂₂ E3 #

{l : Type u_1} →
  {m : Type u_2} → {n : Type u_3} → {o : Type u_4} → {α : Type u_11} → Matrix (n ⊕ o) (l ⊕ m) α → Matrix o m α

Given a matrix whose row and column indexes are sum types, we can extract the corresponding "bottom right" submatrix.

theorem Matrix.fromBlocks_toBlocks E1 #

∀ {l : Type u_1} {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type u_11} (M : Matrix (n ⊕ o) (l ⊕ m) α),
  Matrix.fromBlocks M.toBlocks₁₁ M.toBlocks₁₂ M.toBlocks₂₁ M.toBlocks₂₂ = M

theorem Matrix.toBlocks_fromBlocks₁₁ E0 #

∀ {l : Type u_1} {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type u_11} (A : Matrix n l α) (B : Matrix n m α)
  (C : Matrix o l α) (D : Matrix o m α), (Matrix.fromBlocks A B C D).toBlocks₁₁ = A

theorem Matrix.toBlocks_fromBlocks₁₂ E0 #

∀ {l : Type u_1} {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type u_11} (A : Matrix n l α) (B : Matrix n m α)
  (C : Matrix o l α) (D : Matrix o m α), (Matrix.fromBlocks A B C D).toBlocks₁₂ = B

theorem Matrix.toBlocks_fromBlocks₂₁ E0 #

∀ {l : Type u_1} {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type u_11} (A : Matrix n l α) (B : Matrix n m α)
  (C : Matrix o l α) (D : Matrix o m α), (Matrix.fromBlocks A B C D).toBlocks₂₁ = C

theorem Matrix.toBlocks_fromBlocks₂₂ E0 #

∀ {l : Type u_1} {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type u_11} (A : Matrix n l α) (B : Matrix n m α)
  (C : Matrix o l α) (D : Matrix o m α), (Matrix.fromBlocks A B C D).toBlocks₂₂ = D

theorem Matrix.ext_iff_blocks E1 #

∀ {l : Type u_1} {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type u_11} {A B : Matrix (n ⊕ o) (l ⊕ m) α},
  A = B ↔
    A.toBlocks₁₁ = B.toBlocks₁₁ ∧
      A.toBlocks₁₂ = B.toBlocks₁₂ ∧ A.toBlocks₂₁ = B.toBlocks₂₁ ∧ A.toBlocks₂₂ = B.toBlocks₂₂

Two block matrices are equal if their blocks are equal.

theorem Matrix.fromBlocks_inj E0 #

∀ {l : Type u_1} {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type u_11} {A : Matrix n l α} {B : Matrix n m α}
  {C : Matrix o l α} {D : Matrix o m α} {A' : Matrix n l α} {B' : Matrix n m α} {C' : Matrix o l α} {D' : Matrix o m α},
  Matrix.fromBlocks A B C D = Matrix.fromBlocks A' B' C' D' ↔ A = A' ∧ B = B' ∧ C = C' ∧ D = D'

theorem Matrix.fromBlocks_map E1 #

∀ {l : Type u_1} {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type u_11} {β : Type u_12} (A : Matrix n l α)
  (B : Matrix n m α) (C : Matrix o l α) (D : Matrix o m α) (f : α → β),
  (Matrix.fromBlocks A B C D).map f = Matrix.fromBlocks (A.map f) (B.map f) (C.map f) (D.map f)

theorem Matrix.fromBlocks_transpose E1 #

∀ {l : Type u_1} {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type u_11} (A : Matrix n l α) (B : Matrix n m α)
  (C : Matrix o l α) (D : Matrix o m α),
  (Matrix.fromBlocks A B C D).transpose = Matrix.fromBlocks A.transpose C.transpose B.transpose D.transpose

theorem Matrix.fromBlocks_conjTranspose E1 #

∀ {l : Type u_1} {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type u_11} [inst : Star α] (A : Matrix n l α)
  (B : Matrix n m α) (C : Matrix o l α) (D : Matrix o m α),
  (Matrix.fromBlocks A B C D).conjTranspose =
    Matrix.fromBlocks A.conjTranspose C.conjTranspose B.conjTranspose D.conjTranspose

theorem Matrix.fromBlocks_submatrix_sumMap E0 #

∀ {l : Type u_1} {m : Type u_2} {n : Type u_3} {o : Type u_4} {p : Type u_5} {q : Type u_6} {α : Type u_11}
  {r : Type u_13} {s : Type u_14} (A : Matrix n l α) (B : Matrix n m α) (C : Matrix o l α) (D : Matrix o m α)
  (f₁ : p → n) (f₂ : q → o) (g₁ : r → l) (g₂ : s → m),
  (Matrix.fromBlocks A B C D).submatrix (Sum.map f₁ f₂) (Sum.map g₁ g₂) =
    Matrix.fromBlocks (A.submatrix f₁ g₁) (B.submatrix f₁ g₂) (C.submatrix f₂ g₁) (D.submatrix f₂ g₂)

theorem Matrix.fromBlocks_submatrix_sum_swap_left E0 #

∀ {l : Type u_1} {m : Type u_2} {n : Type u_3} {o : Type u_4} {p : Type u_5} {α : Type u_11} (A : Matrix n l α)
  (B : Matrix n m α) (C : Matrix o l α) (D : Matrix o m α) (f : p → l ⊕ m),
  (Matrix.fromBlocks A B C D).submatrix Sum.swap f = (Matrix.fromBlocks C D A B).submatrix id f

theorem Matrix.fromBlocks_submatrix_sum_swap_right E0 #

∀ {l : Type u_1} {m : Type u_2} {n : Type u_3} {o : Type u_4} {p : Type u_5} {α : Type u_11} (A : Matrix n l α)
  (B : Matrix n m α) (C : Matrix o l α) (D : Matrix o m α) (f : p → n ⊕ o),
  (Matrix.fromBlocks A B C D).submatrix f Sum.swap = (Matrix.fromBlocks B A D C).submatrix f id

theorem Matrix.fromBlocks_submatrix_sum_swap_sum_swap E1 #

∀ {l : Type u_13} {m : Type u_14} {n : Type u_15} {o : Type u_16} {α : Type u_17} (A : Matrix n l α) (B : Matrix n m α)
  (C : Matrix o l α) (D : Matrix o m α),
  (Matrix.fromBlocks A B C D).submatrix Sum.swap Sum.swap = Matrix.fromBlocks D C B A

def Matrix.IsTwoBlockDiagonal E1 #

{l : Type u_1} →
  {m : Type u_2} → {n : Type u_3} → {o : Type u_4} → {α : Type u_11} → [Zero α] → Matrix (n ⊕ o) (l ⊕ m) α → Prop

A 2x2 block matrix is block diagonal if the blocks outside of the diagonal vanish

def Matrix.toBlock E1 #

{m : Type u_2} →
  {n : Type u_3} → {α : Type u_11} → Matrix m n α → (p : m → Prop) → (q : n → Prop) → Matrix { a // p a } { a // q a } α

Let p pick out certain rows and q pick out certain columns of a matrix M. Then toBlock M p q is the corresponding block matrix.

theorem Matrix.toBlock_apply E0 #

∀ {m : Type u_2} {n : Type u_3} {α : Type u_11} (M : Matrix m n α) (p : m → Prop) (q : n → Prop) (i : { a // p a })
  (j : { a // q a }), M.toBlock p q i j = M ↑i ↑j

def Matrix.toSquareBlockProp E1 #

{m : Type u_2} → {α : Type u_11} → Matrix m m α → (p : m → Prop) → Matrix { a // p a } { a // p a } α

Let p pick out certain rows and columns of a square matrix M. Then toSquareBlockProp M p is the corresponding block matrix.

theorem Matrix.toSquareBlockProp_def E0 #

∀ {m : Type u_2} {α : Type u_11} (M : Matrix m m α) (p : m → Prop), M.toSquareBlockProp p = Matrix.of fun i j ↦ M ↑i ↑j

def Matrix.toSquareBlock E1 #

{m : Type u_2} →
  {α : Type u_11} → {β : Type u_12} → Matrix m m α → (b : m → β) → (k : β) → Matrix { a // b a = k } { a // b a = k } α

Let b map rows and columns of a square matrix M to blocks. Then toSquareBlock M b k is the block k matrix.

theorem Matrix.toSquareBlock_def E0 #

∀ {m : Type u_2} {α : Type u_11} {β : Type u_12} (M : Matrix m m α) (b : m → β) (k : β),
  M.toSquareBlock b k = Matrix.of fun i j ↦ M ↑i ↑j

theorem Matrix.fromBlocks_smul E1 #

∀ {l : Type u_1} {m : Type u_2} {n : Type u_3} {o : Type u_4} {R : Type u_10} {α : Type u_11} [inst : SMul R α] (x : R)
  (A : Matrix n l α) (B : Matrix n m α) (C : Matrix o l α) (D : Matrix o m α),
  x • Matrix.fromBlocks A B C D = Matrix.fromBlocks (x • A) (x • B) (x • C) (x • D)

theorem Matrix.fromBlocks_neg E1 #

∀ {l : Type u_1} {m : Type u_2} {n : Type u_3} {o : Type u_4} {R : Type u_10} [inst : Neg R] (A : Matrix n l R)
  (B : Matrix n m R) (C : Matrix o l R) (D : Matrix o m R),
  -Matrix.fromBlocks A B C D = Matrix.fromBlocks (-A) (-B) (-C) (-D)

theorem Matrix.fromBlocks_zero E0 #

∀ {l : Type u_1} {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type u_11} [inst : Zero α],
  Matrix.fromBlocks 0 0 0 0 = 0

theorem Matrix.fromBlocks_add E1 #

∀ {l : Type u_1} {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type u_11} [inst : Add α] (A : Matrix n l α)
  (B : Matrix n m α) (C : Matrix o l α) (D : Matrix o m α) (A' : Matrix n l α) (B' : Matrix n m α) (C' : Matrix o l α)
  (D' : Matrix o m α),
  Matrix.fromBlocks A B C D + Matrix.fromBlocks A' B' C' D' = Matrix.fromBlocks (A + A') (B + B') (C + C') (D + D')

theorem Matrix.fromBlocks_multiply E1 #

∀ {l : Type u_1} {m : Type u_2} {n : Type u_3} {o : Type u_4} {p : Type u_5} {q : Type u_6} {α : Type u_11}
  [inst : Fintype l] [inst_1 : Fintype m] [inst_2 : NonUnitalNonAssocSemiring α] (A : Matrix n l α) (B : Matrix n m α)
  (C : Matrix o l α) (D : Matrix o m α) (A' : Matrix l p α) (B' : Matrix l q α) (C' : Matrix m p α) (D' : Matrix m q α),
  Matrix.fromBlocks A B C D * Matrix.fromBlocks A' B' C' D' =
    Matrix.fromBlocks (A * A' + B * C') (A * B' + B * D') (C * A' + D * C') (C * B' + D * D')

theorem Matrix.fromBlocks_diagonal_pow E1 #

∀ {m : Type u_2} {n : Type u_3} {α : Type u_11} [inst : Semiring α] [inst_1 : Fintype n] [inst_2 : Fintype m]
  [inst_3 : DecidableEq n] [inst_4 : DecidableEq m] (A : Matrix n n α) (D : Matrix m m α) (k : ℕ),
  Matrix.fromBlocks A 0 0 D ^ k = Matrix.fromBlocks (A ^ k) 0 0 (D ^ k)

theorem Matrix.fromBlocks_mulVec E1 #

∀ {l : Type u_1} {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type u_11} [inst : Fintype l] [inst_1 : Fintype m]
  [inst_2 : NonUnitalNonAssocSemiring α] (A : Matrix n l α) (B : Matrix n m α) (C : Matrix o l α) (D : Matrix o m α)
  (x : l ⊕ m → α),
  (Matrix.fromBlocks A B C D).mulVec x =
    Sum.elim (A.mulVec (x ∘ Sum.inl) + B.mulVec (x ∘ Sum.inr)) (C.mulVec (x ∘ Sum.inl) + D.mulVec (x ∘ Sum.inr))

theorem Matrix.vecMul_fromBlocks E1 #

∀ {l : Type u_1} {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type u_11} [inst : Fintype n] [inst_1 : Fintype o]
  [inst_2 : NonUnitalNonAssocSemiring α] (A : Matrix n l α) (B : Matrix n m α) (C : Matrix o l α) (D : Matrix o m α)
  (x : n ⊕ o → α),
  Matrix.vecMul x (Matrix.fromBlocks A B C D) =
    Sum.elim (Matrix.vecMul (x ∘ Sum.inl) A + Matrix.vecMul (x ∘ Sum.inr) C)
      (Matrix.vecMul (x ∘ Sum.inl) B + Matrix.vecMul (x ∘ Sum.inr) D)

theorem Matrix.toBlock_diagonal_self E1 #

∀ {m : Type u_2} {α : Type u_11} [inst : DecidableEq m] [inst_1 : Zero α] (d : m → α) (p : m → Prop),
  (Matrix.diagonal d).toBlock p p = Matrix.diagonal fun i ↦ d ↑i

theorem Matrix.toBlock_diagonal_disjoint E1 #

∀ {m : Type u_2} {α : Type u_11} [inst : DecidableEq m] [inst_1 : Zero α] (d : m → α) {p q : m → Prop},
  Disjoint p q → (Matrix.diagonal d).toBlock p q = 0

theorem Matrix.fromBlocks_diagonal E0 #

∀ {l : Type u_1} {m : Type u_2} {α : Type u_11} [inst : DecidableEq l] [inst_1 : DecidableEq m] [inst_2 : Zero α]
  (d₁ : l → α) (d₂ : m → α),
  Matrix.fromBlocks (Matrix.diagonal d₁) 0 0 (Matrix.diagonal d₂) = Matrix.diagonal (Sum.elim d₁ d₂)

theorem Matrix.toBlocks₁₁_diagonal E0 #

∀ {l : Type u_1} {m : Type u_2} {α : Type u_11} [inst : DecidableEq l] [inst_1 : DecidableEq m] [inst_2 : Zero α]
  (v : l ⊕ m → α), (Matrix.diagonal v).toBlocks₁₁ = Matrix.diagonal fun i ↦ v (Sum.inl i)

theorem Matrix.toBlocks₂₂_diagonal E0 #

∀ {l : Type u_1} {m : Type u_2} {α : Type u_11} [inst : DecidableEq l] [inst_1 : DecidableEq m] [inst_2 : Zero α]
  (v : l ⊕ m → α), (Matrix.diagonal v).toBlocks₂₂ = Matrix.diagonal fun i ↦ v (Sum.inr i)

theorem Matrix.toBlocks₁₂_diagonal E0 #

∀ {l : Type u_1} {m : Type u_2} {α : Type u_11} [inst : DecidableEq l] [inst_1 : DecidableEq m] [inst_2 : Zero α]
  (v : l ⊕ m → α), (Matrix.diagonal v).toBlocks₁₂ = 0

theorem Matrix.toBlocks₂₁_diagonal E0 #

∀ {l : Type u_1} {m : Type u_2} {α : Type u_11} [inst : DecidableEq l] [inst_1 : DecidableEq m] [inst_2 : Zero α]
  (v : l ⊕ m → α), (Matrix.diagonal v).toBlocks₂₁ = 0

theorem Matrix.fromBlocks_one E0 #

∀ {l : Type u_1} {m : Type u_2} {α : Type u_11} [inst : DecidableEq l] [inst_1 : DecidableEq m] [inst_2 : Zero α]
  [inst_3 : One α], Matrix.fromBlocks 1 0 0 1 = 1

theorem Matrix.toBlock_one_self E0 #

∀ {m : Type u_2} {α : Type u_11} [inst : DecidableEq m] [inst_1 : Zero α] [inst_2 : One α] (p : m → Prop),
  Matrix.toBlock 1 p p = 1

theorem Matrix.toBlock_one_disjoint E1 #

∀ {m : Type u_2} {α : Type u_11} [inst : DecidableEq m] [inst_1 : Zero α] [inst_2 : One α] {p q : m → Prop},
  Disjoint p q → Matrix.toBlock 1 p q = 0

def Matrix.blockDiagonal E3 #

{m : Type u_2} →
  {n : Type u_3} →
    {o : Type u_4} → {α : Type u_11} → [DecidableEq o] → [Zero α] → (o → Matrix m n α) → Matrix (m × o) (n × o) α

Matrix.blockDiagonal M turns a homogeneously-indexed collection of matrices M : o → Matrix m n α' into an m × o-by-n × o block matrix which has the entries of M along the diagonal and zero elsewhere.

See also Matrix.blockDiagonal' if the matrices may not have the same size everywhere.

theorem Matrix.blockDiagonal_apply' E1 #

∀ {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type u_11} [inst : DecidableEq o] [inst_1 : Zero α]
  (M : o → Matrix m n α) (i : m) (k : o) (j : n) (k' : o),
  Matrix.blockDiagonal M (i, k) (j, k') = if k = k' then M k i j else 0

theorem Matrix.blockDiagonal_apply E0 #

∀ {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type u_11} [inst : DecidableEq o] [inst_1 : Zero α]
  (M : o → Matrix m n α) (ik : m × o) (jk : n × o),
  Matrix.blockDiagonal M ik jk = if ik.2 = jk.2 then M ik.2 ik.1 jk.1 else 0

theorem Matrix.blockDiagonal_apply_eq E0 #

∀ {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type u_11} [inst : DecidableEq o] [inst_1 : Zero α]
  (M : o → Matrix m n α) (i : m) (j : n) (k : o), Matrix.blockDiagonal M (i, k) (j, k) = M k i j

theorem Matrix.blockDiagonal_apply_ne E1 #

∀ {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type u_11} [inst : DecidableEq o] [inst_1 : Zero α]
  (M : o → Matrix m n α) (i : m) (j : n) {k k' : o}, k ≠ k' → Matrix.blockDiagonal M (i, k) (j, k') = 0

theorem Matrix.blockDiagonal_map E1 #

∀ {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type u_11} {β : Type u_12} [inst : DecidableEq o] [inst_1 : Zero α]
  [inst_2 : Zero β] (M : o → Matrix m n α) (f : α → β),
  f 0 = 0 → (Matrix.blockDiagonal M).map f = Matrix.blockDiagonal fun k ↦ (M k).map f

theorem Matrix.blockDiagonal_transpose E0 #

∀ {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type u_11} [inst : DecidableEq o] [inst_1 : Zero α]
  (M : o → Matrix m n α), (Matrix.blockDiagonal M).transpose = Matrix.blockDiagonal fun k ↦ (M k).transpose

theorem Matrix.blockDiagonal_conjTranspose E0 #

∀ {m : Type u_2} {n : Type u_3} {o : Type u_4} [inst : DecidableEq o] {α : Type u_13} [inst_1 : AddMonoid α]
  [inst_2 : StarAddMonoid α] (M : o → Matrix m n α),
  (Matrix.blockDiagonal M).conjTranspose = Matrix.blockDiagonal fun k ↦ (M k).conjTranspose

theorem Matrix.blockDiagonal_zero E0 #

∀ {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type u_11} [inst : DecidableEq o] [inst_1 : Zero α],
  Matrix.blockDiagonal 0 = 0

theorem Matrix.blockDiagonal_diagonal E0 #

∀ {m : Type u_2} {o : Type u_4} {α : Type u_11} [inst : DecidableEq o] [inst_1 : Zero α] [inst_2 : DecidableEq m]
  (d : o → m → α), (Matrix.blockDiagonal fun k ↦ Matrix.diagonal (d k)) = Matrix.diagonal fun ik ↦ d ik.2 ik.1

theorem Matrix.blockDiagonal_one E0 #

∀ {m : Type u_2} {o : Type u_4} {α : Type u_11} [inst : DecidableEq o] [inst_1 : Zero α] [inst_2 : DecidableEq m]
  [inst_3 : One α], Matrix.blockDiagonal 1 = 1

theorem Matrix.blockDiagonal_add E0 #

∀ {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type u_11} [inst : DecidableEq o] [inst_1 : AddZeroClass α]
  (M N : o → Matrix m n α), Matrix.blockDiagonal (M + N) = Matrix.blockDiagonal M + Matrix.blockDiagonal N

def Matrix.blockDiagonalAddMonoidHom E1 #

(m : Type u_2) →
  (n : Type u_3) →
    (o : Type u_4) →
      (α : Type u_11) → [DecidableEq o] → [inst : AddZeroClass α] → (o → Matrix m n α) →+ Matrix (m × o) (n × o) α

Matrix.blockDiagonal as an AddMonoidHom.

theorem Matrix.blockDiagonalAddMonoidHom_apply E0 #

∀ (m : Type u_2) (n : Type u_3) (o : Type u_4) (α : Type u_11) [inst : DecidableEq o] [inst_1 : AddZeroClass α]
  (M : o → Matrix m n α), (Matrix.blockDiagonalAddMonoidHom m n o α) M = Matrix.blockDiagonal M

theorem Matrix.blockDiagonal_neg E0 #

∀ {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type u_11} [inst : DecidableEq o] [inst_1 : AddGroup α]
  (M : o → Matrix m n α), Matrix.blockDiagonal (-M) = -Matrix.blockDiagonal M

theorem Matrix.blockDiagonal_sub E0 #

∀ {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type u_11} [inst : DecidableEq o] [inst_1 : AddGroup α]
  (M N : o → Matrix m n α), Matrix.blockDiagonal (M - N) = Matrix.blockDiagonal M - Matrix.blockDiagonal N

theorem Matrix.blockDiagonal_mul E0 #

∀ {m : Type u_2} {n : Type u_3} {o : Type u_4} {p : Type u_5} {α : Type u_11} [inst : DecidableEq o]
  [inst_1 : Fintype n] [inst_2 : Fintype o] [inst_3 : NonUnitalNonAssocSemiring α] (M : o → Matrix m n α)
  (N : o → Matrix n p α), (Matrix.blockDiagonal fun k ↦ M k * N k) = Matrix.blockDiagonal M * Matrix.blockDiagonal N

def Matrix.blockDiagonalRingHom E3 #

(m : Type u_2) →
  (o : Type u_4) →
    (α : Type u_11) →
      [inst : DecidableEq o] →
        [inst_1 : DecidableEq m] →
          [inst_2 : Fintype o] →
            [inst_3 : Fintype m] → [inst_4 : NonAssocSemiring α] → (o → Matrix m m α) →+* Matrix (m × o) (m × o) α

Matrix.blockDiagonal as a RingHom.

theorem Matrix.blockDiagonalRingHom_apply E0 #

∀ (m : Type u_2) (o : Type u_4) (α : Type u_11) [inst : DecidableEq o] [inst_1 : DecidableEq m] [inst_2 : Fintype o]
  [inst_3 : Fintype m] [inst_4 : NonAssocSemiring α] (M : o → Matrix m m α),
  (Matrix.blockDiagonalRingHom m o α) M = Matrix.blockDiagonal M

theorem Matrix.blockDiagonal_pow E0 #

∀ {m : Type u_2} {o : Type u_4} {α : Type u_11} [inst : DecidableEq o] [inst_1 : DecidableEq m] [inst_2 : Fintype o]
  [inst_3 : Fintype m] [inst_4 : Semiring α] (M : o → Matrix m m α) (n : ℕ),
  Matrix.blockDiagonal (M ^ n) = Matrix.blockDiagonal M ^ n

theorem Matrix.blockDiagonal_smul E0 #

∀ {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type u_11} [inst : DecidableEq o] {R : Type u_13} [inst_1 : Zero α]
  [inst_2 : SMulZeroClass R α] (x : R) (M : o → Matrix m n α), Matrix.blockDiagonal (x • M) = x • Matrix.blockDiagonal M

def Matrix.blockDiag E3 #

{m : Type u_2} → {n : Type u_3} → {o : Type u_4} → {α : Type u_11} → Matrix (m × o) (n × o) α → o → Matrix m n α

Extract a block from the diagonal of a block diagonal matrix.

This is the block form of Matrix.diag, and the left-inverse of Matrix.blockDiagonal.

theorem Matrix.blockDiag_apply E0 #

∀ {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type u_11} (M : Matrix (m × o) (n × o) α) (k : o) (i : m) (j : n),
  M.blockDiag k i j = M (i, k) (j, k)

theorem Matrix.blockDiag_map E1 #

∀ {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type u_11} {β : Type u_12} (M : Matrix (m × o) (n × o) α)
  (f : α → β), (M.map f).blockDiag = fun k ↦ (M.blockDiag k).map f

theorem Matrix.blockDiag_transpose E0 #

∀ {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type u_11} (M : Matrix (m × o) (n × o) α) (k : o),
  M.transpose.blockDiag k = (M.blockDiag k).transpose

theorem Matrix.blockDiag_conjTranspose E0 #

∀ {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type u_13} [inst : Star α] (M : Matrix (m × o) (n × o) α) (k : o),
  M.conjTranspose.blockDiag k = (M.blockDiag k).conjTranspose

theorem Matrix.blockDiag_zero E0 #

∀ {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type u_11} [inst : Zero α], Matrix.blockDiag 0 = 0

theorem Matrix.blockDiag_diagonal E0 #

∀ {m : Type u_2} {o : Type u_4} {α : Type u_11} [inst : Zero α] [inst_1 : DecidableEq o] [inst_2 : DecidableEq m]
  (d : m × o → α) (k : o), (Matrix.diagonal d).blockDiag k = Matrix.diagonal fun i ↦ d (i, k)

theorem Matrix.blockDiag_blockDiagonal E0 #

∀ {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type u_11} [inst : Zero α] [inst_1 : DecidableEq o]
  (M : o → Matrix m n α), (Matrix.blockDiagonal M).blockDiag = M

theorem Matrix.blockDiagonal_injective E1 #

∀ {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type u_11} [inst : Zero α] [inst_1 : DecidableEq o],
  Function.Injective Matrix.blockDiagonal

theorem Matrix.blockDiagonal_inj E0 #

∀ {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type u_11} [inst : Zero α] [inst_1 : DecidableEq o]
  {M N : o → Matrix m n α}, Matrix.blockDiagonal M = Matrix.blockDiagonal N ↔ M = N

theorem Matrix.blockDiag_one E0 #

∀ {m : Type u_2} {o : Type u_4} {α : Type u_11} [inst : Zero α] [inst_1 : DecidableEq o] [inst_2 : DecidableEq m]
  [inst_3 : One α], Matrix.blockDiag 1 = 1

theorem Matrix.blockDiag_add E0 #

∀ {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type u_11} [inst : Add α] (M N : Matrix (m × o) (n × o) α),
  (M + N).blockDiag = M.blockDiag + N.blockDiag

def Matrix.blockDiagAddMonoidHom E1 #

(m : Type u_2) →
  (n : Type u_3) →
    (o : Type u_4) → (α : Type u_11) → [inst : AddZeroClass α] → Matrix (m × o) (n × o) α →+ o → Matrix m n α

Matrix.blockDiag as an AddMonoidHom.

theorem Matrix.blockDiagAddMonoidHom_apply E0 #

∀ (m : Type u_2) (n : Type u_3) (o : Type u_4) (α : Type u_11) [inst : AddZeroClass α] (M : Matrix (m × o) (n × o) α)
  (k : o), (Matrix.blockDiagAddMonoidHom m n o α) M k = M.blockDiag k

theorem Matrix.blockDiag_neg E0 #

∀ {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type u_11} [inst : AddGroup α] (M : Matrix (m × o) (n × o) α),
  (-M).blockDiag = -M.blockDiag

theorem Matrix.blockDiag_sub E0 #

∀ {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type u_11} [inst : AddGroup α] (M N : Matrix (m × o) (n × o) α),
  (M - N).blockDiag = M.blockDiag - N.blockDiag

theorem Matrix.blockDiag_smul E0 #

∀ {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type u_11} {R : Type u_13} [inst : SMul R α] (x : R)
  (M : Matrix (m × o) (n × o) α), (x • M).blockDiag = x • M.blockDiag

def Matrix.blockDiagonal' E3 #

{o : Type u_4} →
  {m' : o → Type u_7} →
    {n' : o → Type u_8} →
      {α : Type u_11} →
        [DecidableEq o] → [Zero α] → ((i : o) → Matrix (m' i) (n' i) α) → Matrix ((i : o) × m' i) ((i : o) × n' i) α

Matrix.blockDiagonal' M turns M : Π i, Matrix (m i) (n i) α into a Σ i, m i-by-Σ i, n i block matrix which has the entries of M along the diagonal and zero elsewhere.

This is the dependently-typed version of Matrix.blockDiagonal.

theorem Matrix.blockDiagonal'_apply' E1 #

∀ {o : Type u_4} {m' : o → Type u_7} {n' : o → Type u_8} {α : Type u_11} [inst : DecidableEq o] [inst_1 : Zero α]
  (M : (i : o) → Matrix (m' i) (n' i) α) (k : o) (i : m' k) (k' : o) (j : n' k'),
  Matrix.blockDiagonal' M ⟨k, i⟩ ⟨k', j⟩ = if h : k = k' then M k i (cast ⋯ j) else 0

theorem Matrix.blockDiagonal'_eq_blockDiagonal E1 #

∀ {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type u_11} [inst : DecidableEq o] [inst_1 : Zero α]
  (M : o → Matrix m n α) {k k' : o} (i : m) (j : n),
  Matrix.blockDiagonal M (i, k) (j, k') = Matrix.blockDiagonal' M ⟨k, i⟩ ⟨k', j⟩

theorem Matrix.blockDiagonal'_submatrix_eq_blockDiagonal E1 #

∀ {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type u_11} [inst : DecidableEq o] [inst_1 : Zero α]
  (M : o → Matrix m n α),
  (Matrix.blockDiagonal' M).submatrix (Prod.toSigma ∘ Prod.swap) (Prod.toSigma ∘ Prod.swap) = Matrix.blockDiagonal M

theorem Matrix.blockDiagonal'_apply E0 #

∀ {o : Type u_4} {m' : o → Type u_7} {n' : o → Type u_8} {α : Type u_11} [inst : DecidableEq o] [inst_1 : Zero α]
  (M : (i : o) → Matrix (m' i) (n' i) α) (ik : (i : o) × m' i) (jk : (i : o) × n' i),
  Matrix.blockDiagonal' M ik jk = if h : ik.fst = jk.fst then M ik.fst ik.snd (cast ⋯ jk.snd) else 0

theorem Matrix.blockDiagonal'_apply_eq E0 #

∀ {o : Type u_4} {m' : o → Type u_7} {n' : o → Type u_8} {α : Type u_11} [inst : DecidableEq o] [inst_1 : Zero α]
  (M : (i : o) → Matrix (m' i) (n' i) α) (k : o) (i : m' k) (j : n' k), Matrix.blockDiagonal' M ⟨k, i⟩ ⟨k, j⟩ = M k i j

theorem Matrix.blockDiagonal'_apply_ne E1 #

∀ {o : Type u_4} {m' : o → Type u_7} {n' : o → Type u_8} {α : Type u_11} [inst : DecidableEq o] [inst_1 : Zero α]
  (M : (i : o) → Matrix (m' i) (n' i) α) {k k' : o} (i : m' k) (j : n' k'),
  k ≠ k' → Matrix.blockDiagonal' M ⟨k, i⟩ ⟨k', j⟩ = 0

theorem Matrix.blockDiagonal'_map E1 #

∀ {o : Type u_4} {m' : o → Type u_7} {n' : o → Type u_8} {α : Type u_11} {β : Type u_12} [inst : DecidableEq o]
  [inst_1 : Zero α] [inst_2 : Zero β] (M : (i : o) → Matrix (m' i) (n' i) α) (f : α → β),
  f 0 = 0 → (Matrix.blockDiagonal' M).map f = Matrix.blockDiagonal' fun k ↦ (M k).map f

theorem Matrix.blockDiagonal'_transpose E0 #

∀ {o : Type u_4} {m' : o → Type u_7} {n' : o → Type u_8} {α : Type u_11} [inst : DecidableEq o] [inst_1 : Zero α]
  (M : (i : o) → Matrix (m' i) (n' i) α),
  (Matrix.blockDiagonal' M).transpose = Matrix.blockDiagonal' fun k ↦ (M k).transpose

theorem Matrix.blockDiagonal'_conjTranspose E0 #

∀ {o : Type u_4} {m' : o → Type u_7} {n' : o → Type u_8} [inst : DecidableEq o] {α : Type u_13} [inst_1 : AddMonoid α]
  [inst_2 : StarAddMonoid α] (M : (i : o) → Matrix (m' i) (n' i) α),
  (Matrix.blockDiagonal' M).conjTranspose = Matrix.blockDiagonal' fun k ↦ (M k).conjTranspose

theorem Matrix.blockDiagonal'_zero E0 #

∀ {o : Type u_4} {m' : o → Type u_7} {n' : o → Type u_8} {α : Type u_11} [inst : DecidableEq o] [inst_1 : Zero α],
  Matrix.blockDiagonal' 0 = 0

theorem Matrix.blockDiagonal'_diagonal E0 #

∀ {o : Type u_4} {m' : o → Type u_7} {α : Type u_11} [inst : DecidableEq o] [inst_1 : Zero α]
  [inst_2 : (i : o) → DecidableEq (m' i)] (d : (i : o) → m' i → α),
  (Matrix.blockDiagonal' fun k ↦ Matrix.diagonal (d k)) = Matrix.diagonal fun ik ↦ d ik.fst ik.snd

theorem Matrix.blockDiagonal'_one E0 #

∀ {o : Type u_4} {m' : o → Type u_7} {α : Type u_11} [inst : DecidableEq o] [inst_1 : Zero α]
  [inst_2 : (i : o) → DecidableEq (m' i)] [inst_3 : One α], Matrix.blockDiagonal' 1 = 1

theorem Matrix.blockDiagonal'_add E0 #

∀ {o : Type u_4} {m' : o → Type u_7} {n' : o → Type u_8} {α : Type u_11} [inst : DecidableEq o]
  [inst_1 : AddZeroClass α] (M N : (i : o) → Matrix (m' i) (n' i) α),
  Matrix.blockDiagonal' (M + N) = Matrix.blockDiagonal' M + Matrix.blockDiagonal' N

def Matrix.blockDiagonal'AddMonoidHom E1 #

{o : Type u_4} →
  (m' : o → Type u_7) →
    (n' : o → Type u_8) →
      (α : Type u_11) →
        [DecidableEq o] →
          [inst : AddZeroClass α] → ((i : o) → Matrix (m' i) (n' i) α) →+ Matrix ((i : o) × m' i) ((i : o) × n' i) α

Matrix.blockDiagonal' as an AddMonoidHom.

theorem Matrix.blockDiagonal'AddMonoidHom_apply E0 #

∀ {o : Type u_4} (m' : o → Type u_7) (n' : o → Type u_8) (α : Type u_11) [inst : DecidableEq o]
  [inst_1 : AddZeroClass α] (M : (i : o) → Matrix (m' i) (n' i) α),
  (Matrix.blockDiagonal'AddMonoidHom m' n' α) M = Matrix.blockDiagonal' M

theorem Matrix.blockDiagonal'_neg E0 #

∀ {o : Type u_4} {m' : o → Type u_7} {n' : o → Type u_8} {α : Type u_11} [inst : DecidableEq o] [inst_1 : AddGroup α]
  (M : (i : o) → Matrix (m' i) (n' i) α), Matrix.blockDiagonal' (-M) = -Matrix.blockDiagonal' M

theorem Matrix.blockDiagonal'_sub E0 #

∀ {o : Type u_4} {m' : o → Type u_7} {n' : o → Type u_8} {α : Type u_11} [inst : DecidableEq o] [inst_1 : AddGroup α]
  (M N : (i : o) → Matrix (m' i) (n' i) α),
  Matrix.blockDiagonal' (M - N) = Matrix.blockDiagonal' M - Matrix.blockDiagonal' N

theorem Matrix.blockDiagonal'_mul E0 #

∀ {o : Type u_4} {m' : o → Type u_7} {n' : o → Type u_8} {p' : o → Type u_9} {α : Type u_11} [inst : DecidableEq o]
  [inst_1 : NonUnitalNonAssocSemiring α] [inst_2 : (i : o) → Fintype (n' i)] [inst_3 : Fintype o]
  (M : (i : o) → Matrix (m' i) (n' i) α) (N : (i : o) → Matrix (n' i) (p' i) α),
  (Matrix.blockDiagonal' fun k ↦ M k * N k) = Matrix.blockDiagonal' M * Matrix.blockDiagonal' N

def Matrix.blockDiagonal'RingHom E3 #

{o : Type u_4} →
  (m' : o → Type u_7) →
    (α : Type u_11) →
      [inst : DecidableEq o] →
        [inst_1 : (i : o) → DecidableEq (m' i)] →
          [inst_2 : Fintype o] →
            [inst_3 : (i : o) → Fintype (m' i)] →
              [inst_4 : NonAssocSemiring α] →
                ((i : o) → Matrix (m' i) (m' i) α) →+* Matrix ((i : o) × m' i) ((i : o) × m' i) α

Matrix.blockDiagonal' as a RingHom.

theorem Matrix.blockDiagonal'RingHom_apply E0 #

∀ {o : Type u_4} (m' : o → Type u_7) (α : Type u_11) [inst : DecidableEq o] [inst_1 : (i : o) → DecidableEq (m' i)]
  [inst_2 : Fintype o] [inst_3 : (i : o) → Fintype (m' i)] [inst_4 : NonAssocSemiring α]
  (M : (i : o) → Matrix (m' i) (m' i) α), (Matrix.blockDiagonal'RingHom m' α) M = Matrix.blockDiagonal' M

theorem Matrix.blockDiagonal'_pow E0 #

∀ {o : Type u_4} {m' : o → Type u_7} {α : Type u_11} [inst : DecidableEq o] [inst_1 : (i : o) → DecidableEq (m' i)]
  [inst_2 : Fintype o] [inst_3 : (i : o) → Fintype (m' i)] [inst_4 : Semiring α] (M : (i : o) → Matrix (m' i) (m' i) α)
  (n : ℕ), Matrix.blockDiagonal' (M ^ n) = Matrix.blockDiagonal' M ^ n

theorem Matrix.blockDiagonal'_smul E0 #

∀ {o : Type u_4} {m' : o → Type u_7} {n' : o → Type u_8} {α : Type u_11} [inst : DecidableEq o] {R : Type u_13}
  [inst_1 : Zero α] [inst_2 : SMulZeroClass R α] (x : R) (M : (i : o) → Matrix (m' i) (n' i) α),
  Matrix.blockDiagonal' (x • M) = x • Matrix.blockDiagonal' M

def Matrix.blockDiag' E3 #

{o : Type u_4} →
  {m' : o → Type u_7} →
    {n' : o → Type u_8} →
      {α : Type u_11} → Matrix ((i : o) × m' i) ((i : o) × n' i) α → (k : o) → Matrix (m' k) (n' k) α

Extract a block from the diagonal of a block diagonal matrix.

This is the block form of Matrix.diag, and the left-inverse of Matrix.blockDiagonal'.

theorem Matrix.blockDiag'_apply E0 #

∀ {o : Type u_4} {m' : o → Type u_7} {n' : o → Type u_8} {α : Type u_11}
  (M : Matrix ((i : o) × m' i) ((i : o) × n' i) α) (k : o) (i : m' k) (j : n' k), M.blockDiag' k i j = M ⟨k, i⟩ ⟨k, j⟩

theorem Matrix.blockDiag'_map E1 #

∀ {o : Type u_4} {m' : o → Type u_7} {n' : o → Type u_8} {α : Type u_11} {β : Type u_12}
  (M : Matrix ((i : o) × m' i) ((i : o) × n' i) α) (f : α → β), (M.map f).blockDiag' = fun k ↦ (M.blockDiag' k).map f

theorem Matrix.blockDiag'_transpose E0 #

∀ {o : Type u_4} {m' : o → Type u_7} {n' : o → Type u_8} {α : Type u_11}
  (M : Matrix ((i : o) × m' i) ((i : o) × n' i) α) (k : o), M.transpose.blockDiag' k = (M.blockDiag' k).transpose

theorem Matrix.blockDiag'_conjTranspose E0 #

∀ {o : Type u_4} {m' : o → Type u_7} {n' : o → Type u_8} {α : Type u_13} [inst : Star α]
  (M : Matrix ((i : o) × m' i) ((i : o) × n' i) α) (k : o),
  M.conjTranspose.blockDiag' k = (M.blockDiag' k).conjTranspose

theorem Matrix.blockDiag'_zero E0 #

∀ {o : Type u_4} {m' : o → Type u_7} {n' : o → Type u_8} {α : Type u_11} [inst : Zero α], Matrix.blockDiag' 0 = 0

theorem Matrix.blockDiag'_diagonal E0 #

∀ {o : Type u_4} {m' : o → Type u_7} {α : Type u_11} [inst : Zero α] [inst_1 : DecidableEq o]
  [inst_2 : (i : o) → DecidableEq (m' i)] (d : (i : o) × m' i → α) (k : o),
  (Matrix.diagonal d).blockDiag' k = Matrix.diagonal fun i ↦ d ⟨k, i⟩

theorem Matrix.blockDiag'_blockDiagonal' E0 #

∀ {o : Type u_4} {m' : o → Type u_7} {n' : o → Type u_8} {α : Type u_11} [inst : Zero α] [inst_1 : DecidableEq o]
  (M : (i : o) → Matrix (m' i) (n' i) α), (Matrix.blockDiagonal' M).blockDiag' = M

theorem Matrix.blockDiagonal'_injective E1 #

∀ {o : Type u_4} {m' : o → Type u_7} {n' : o → Type u_8} {α : Type u_11} [inst : Zero α] [inst_1 : DecidableEq o],
  Function.Injective Matrix.blockDiagonal'

theorem Matrix.blockDiagonal'_inj E0 #

∀ {o : Type u_4} {m' : o → Type u_7} {n' : o → Type u_8} {α : Type u_11} [inst : Zero α] [inst_1 : DecidableEq o]
  {M N : (i : o) → Matrix (m' i) (n' i) α}, Matrix.blockDiagonal' M = Matrix.blockDiagonal' N ↔ M = N

theorem Matrix.blockDiag'_one E0 #

∀ {o : Type u_4} {m' : o → Type u_7} {α : Type u_11} [inst : Zero α] [inst_1 : DecidableEq o]
  [inst_2 : (i : o) → DecidableEq (m' i)] [inst_3 : One α], Matrix.blockDiag' 1 = 1

theorem Matrix.blockDiag'_add E0 #

∀ {o : Type u_4} {m' : o → Type u_7} {n' : o → Type u_8} {α : Type u_11} [inst : Add α]
  (M N : Matrix ((i : o) × m' i) ((i : o) × n' i) α), (M + N).blockDiag' = M.blockDiag' + N.blockDiag'

def Matrix.blockDiag'AddMonoidHom E1 #

{o : Type u_4} →
  (m' : o → Type u_7) →
    (n' : o → Type u_8) →
      (α : Type u_11) →
        [inst : AddZeroClass α] → Matrix ((i : o) × m' i) ((i : o) × n' i) α →+ (i : o) → Matrix (m' i) (n' i) α

Matrix.blockDiag' as an AddMonoidHom.

theorem Matrix.blockDiag'AddMonoidHom_apply E0 #

∀ {o : Type u_4} (m' : o → Type u_7) (n' : o → Type u_8) (α : Type u_11) [inst : AddZeroClass α]
  (M : Matrix ((i : o) × m' i) ((i : o) × n' i) α) (k : o), (Matrix.blockDiag'AddMonoidHom m' n' α) M k = M.blockDiag' k

theorem Matrix.blockDiag'_neg E0 #

∀ {o : Type u_4} {m' : o → Type u_7} {n' : o → Type u_8} {α : Type u_11} [inst : AddGroup α]
  (M : Matrix ((i : o) × m' i) ((i : o) × n' i) α), (-M).blockDiag' = -M.blockDiag'

theorem Matrix.blockDiag'_sub E0 #

∀ {o : Type u_4} {m' : o → Type u_7} {n' : o → Type u_8} {α : Type u_11} [inst : AddGroup α]
  (M N : Matrix ((i : o) × m' i) ((i : o) × n' i) α), (M - N).blockDiag' = M.blockDiag' - N.blockDiag'

theorem Matrix.blockDiag'_smul E0 #

∀ {o : Type u_4} {m' : o → Type u_7} {n' : o → Type u_8} {α : Type u_11} {R : Type u_13} [inst : SMul R α] (x : R)
  (M : Matrix ((i : o) × m' i) ((i : o) × n' i) α), (x • M).blockDiag' = x • M.blockDiag'

theorem Matrix.toBlock_mul_eq_mul E1 #

∀ {R : Type u_10} [inst : CommRing R] {m : Type u_13} {n : Type u_14} {k : Type u_15} [inst_1 : Fintype n]
  (p : m → Prop) (q : k → Prop) (A : Matrix m n R) (B : Matrix n k R),
  (A * B).toBlock p q = A.toBlock p ⊤ * B.toBlock ⊤ q

theorem Matrix.toBlock_mul_eq_add E1 #

∀ {R : Type u_10} [inst : CommRing R] {m : Type u_13} {n : Type u_14} {k : Type u_15} [inst_1 : Fintype n]
  (p : m → Prop) (q : n → Prop) [inst_2 : DecidablePred q] (r : k → Prop) (A : Matrix m n R) (B : Matrix n k R),
  (A * B).toBlock p r = A.toBlock p q * B.toBlock q r + (A.toBlock p fun i ↦ ¬q i) * B.toBlock (fun i ↦ ¬q i) r

theorem Matrix.map_toSquareBlock E0 #

∀ {m : Type u_2} {α : Type u_14} {β : Type u_15} (f : α → β) {M : Matrix m m α} {ι : Type u_17} {b : m → ι} {i : ι},
  (M.map f).toSquareBlock b i = (M.toSquareBlock b i).map f

theorem Matrix.comp_toSquareBlock E1 #

∀ {m : Type u_2} {n : Type u_3} {R : Type u_13} {α : Type u_14} {b : m → α} (M : Matrix m m (Matrix n n R)) (a : α),
  ((Matrix.comp m m n n R) M).toSquareBlock (fun i ↦ b i.1) a =
    (Matrix.reindex Equiv.prodSubtypeFstEquivSubtypeProd.symm Equiv.prodSubtypeFstEquivSubtypeProd.symm)
      ((Matrix.comp { a_1 // b a_1 = a } { a_1 // b a_1 = a } n n R) (M.toSquareBlock b a))

theorem Matrix.comp_diagonal E1 #

∀ {m : Type u_2} {n : Type u_3} {p : Type u_5} {R : Type u_13} [inst : Zero R] [inst_1 : DecidableEq m]
  (d : m → Matrix n p R),
  (Matrix.comp m m n p R) (Matrix.diagonal d) =
    (Matrix.reindex (Equiv.prodComm n m) (Equiv.prodComm p m)) (Matrix.blockDiagonal d)