File: Mathlib/Data/Matrix/ColumnRowPartitioned.lean

full_name: Matrix.fromRows
code: /-- Concatenate together two matrices A₁[m₁ × N] and A₂[m₂ × N] with the same columns (N) to get a
bigger matrix indexed by [(m₁ ⊕ m₂) × N] -/
def fromRows (A₁ : Matrix m₁ n R) (A₂ : Matrix m₂ n R) : Matrix (m₁ ⊕ m₂) n R 
goal: Matrix (m₁ ⊕ m₂) n R

full_name: Matrix.fromColumns
code: /-- Concatenate together two matrices B₁[m × n₁] and B₂[m × n₂] with the same rows (M) to get a
bigger matrix indexed by [m × (n₁ ⊕ n₂)] -/
def fromColumns (B₁ : Matrix m n₁ R) (B₂ : Matrix m n₂ R) : Matrix m (n₁ ⊕ n₂) R 
goal: Matrix m (n₁ ⊕ n₂) R

full_name: Matrix.toColumns₁
code: /-- Given a column partitioned matrix extract the first column -/
def toColumns₁ (A : Matrix m (n₁ ⊕ n₂) R) : Matrix m n₁ R 
goal: Matrix m n₁ R

full_name: Matrix.toColumns₂
code: /-- Given a column partitioned matrix extract the second column -/
def toColumns₂ (A : Matrix m (n₁ ⊕ n₂) R) : Matrix m n₂ R 
goal: Matrix m n₂ R

full_name: Matrix.toRows₁
code: /-- Given a row partitioned matrix extract the first row -/
def toRows₁ (A : Matrix (m₁ ⊕ m₂) n R) : Matrix m₁ n R 
goal: Matrix m₁ n R

full_name: Matrix.toRows₂
code: /-- Given a row partitioned matrix extract the second row -/
def toRows₂ (A : Matrix (m₁ ⊕ m₂) n R) : Matrix m₂ n R 
goal: Matrix m₂ n R

full_name: Matrix.fromRows_apply_inl
code: @[simp]
lemma fromRows_apply_inl (A₁ : Matrix m₁ n R) (A₂ : Matrix m₂ n R) (i : m₁) (j : n) :
    (fromRows A₁ A₂) (Sum.inl i) j = A₁ i j 
goal: A₁.fromRows A₂ (Sum.inl i) j = A₁ i j

full_name: Matrix.fromRows_apply_inr
code: @[simp]
lemma fromRows_apply_inr (A₁ : Matrix m₁ n R) (A₂ : Matrix m₂ n R) (i : m₂) (j : n) :
    (fromRows A₁ A₂) (Sum.inr i) j = A₂ i j 
goal: A₁.fromRows A₂ (Sum.inr i) j = A₂ i j

full_name: Matrix.fromColumns_apply_inl
code: @[simp]
lemma fromColumns_apply_inl (A₁ : Matrix m n₁ R) (A₂ : Matrix m n₂ R) (i : m) (j : n₁) :
    (fromColumns A₁ A₂) i (Sum.inl j) = A₁ i j 
goal: A₁.fromColumns A₂ i (Sum.inl j) = A₁ i j

full_name: Matrix.fromColumns_apply_inr
code: @[simp]
lemma fromColumns_apply_inr (A₁ : Matrix m n₁ R) (A₂ : Matrix m n₂ R) (i : m) (j : n₂) :
    (fromColumns A₁ A₂) i (Sum.inr j) = A₂ i j 
goal: A₁.fromColumns A₂ i (Sum.inr j) = A₂ i j

full_name: Matrix.toRows₁_apply
code: @[simp]
lemma toRows₁_apply (A : Matrix (m₁ ⊕ m₂) n R) (i : m₁) (j : n) :
    (toRows₁ A) i j = A (Sum.inl i) j 
goal: A.toRows₁ i j = A (Sum.inl i) j

full_name: Matrix.toRows₂_apply
code: @[simp]
lemma toRows₂_apply (A : Matrix (m₁ ⊕ m₂) n R) (i : m₂) (j : n) :
    (toRows₂ A) i j = A (Sum.inr i) j 
goal: A.toRows₂ i j = A (Sum.inr i) j

full_name: Matrix.toRows₁_fromRows
code: @[simp]
lemma toRows₁_fromRows  (A₁ : Matrix m₁ n R) (A₂ : Matrix m₂ n R) :
    toRows₁ (fromRows A₁ A₂) = A₁ 
goal: (A₁.fromRows A₂).toRows₁ = A₁

full_name: Matrix.toRows₂_fromRows
code: @[simp]
lemma toRows₂_fromRows  (A₁ : Matrix m₁ n R) (A₂ : Matrix m₂ n R) :
    toRows₂ (fromRows A₁ A₂) = A₂ 
goal: (A₁.fromRows A₂).toRows₂ = A₂

full_name: Matrix.toColumns₁_apply
code: @[simp]
lemma toColumns₁_apply (A : Matrix m (n₁ ⊕ n₂) R) (i : m) (j : n₁) :
    (toColumns₁ A) i j = A i (Sum.inl j) 
goal: A.toColumns₁ i j = A i (Sum.inl j)

full_name: Matrix.toColumns₂_apply
code: @[simp]
lemma toColumns₂_apply (A : Matrix m (n₁ ⊕ n₂) R) (i : m) (j : n₂) :
    (toColumns₂ A) i j = A i (Sum.inr j) 
goal: A.toColumns₂ i j = A i (Sum.inr j)

full_name: Matrix.toColumns₁_fromColumns
code: @[simp]
lemma toColumns₁_fromColumns (A₁ : Matrix m n₁ R) (A₂ : Matrix m n₂ R) :
    toColumns₁ (fromColumns A₁ A₂) = A₁ 
goal: (A₁.fromColumns A₂).toColumns₁ = A₁

full_name: Matrix.toColumns₂_fromColumns
code: @[simp]
lemma toColumns₂_fromColumns (A₁ : Matrix m n₁ R) (A₂ : Matrix m n₂ R) :
    toColumns₂ (fromColumns A₁ A₂) = A₂ 
goal: (A₁.fromColumns A₂).toColumns₂ = A₂

full_name: Matrix.fromColumns_toColumns
code: @[simp]
lemma fromColumns_toColumns (A : Matrix m (n₁ ⊕ n₂) R) :
    fromColumns A.toColumns₁ A.toColumns₂ = A 
goal: A.toColumns₁.fromColumns A.toColumns₂ = A

full_name: Matrix.fromRows_toRows
code: @[simp]
lemma fromRows_toRows (A : Matrix (m₁ ⊕ m₂) n R) : fromRows A.toRows₁ A.toRows₂ = A 
goal: A.toRows₁.fromRows A.toRows₂ = A

full_name: Matrix.fromRows_inj
code: lemma fromRows_inj : Function.Injective2 (@fromRows R m₁ m₂ n) 
goal: Function.Injective2 Matrix.fromRows

full_name: Matrix.fromColumns_inj
code: lemma fromColumns_inj : Function.Injective2 (@fromColumns R m n₁ n₂) 
goal: Function.Injective2 Matrix.fromColumns

full_name: Matrix.fromColumns_ext_iff
code: lemma fromColumns_ext_iff (A₁ : Matrix m n₁ R) (A₂ : Matrix m n₂ R) (B₁ : Matrix m n₁ R)
    (B₂ : Matrix m n₂ R) :
    fromColumns A₁ A₂ = fromColumns B₁ B₂ ↔ A₁ = B₁ ∧ A₂ = B₂ 
goal: A₁.fromColumns A₂ = B₁.fromColumns B₂ ↔ A₁ = B₁ ∧ A₂ = B₂

full_name: Matrix.fromRows_ext_iff
code: lemma fromRows_ext_iff (A₁ : Matrix m₁ n R) (A₂ : Matrix m₂ n R) (B₁ : Matrix m₁ n R)
    (B₂ : Matrix m₂ n R) :
    fromRows A₁ A₂ = fromRows B₁ B₂ ↔ A₁ = B₁ ∧ A₂ = B₂ 
goal: A₁.fromRows A₂ = B₁.fromRows B₂ ↔ A₁ = B₁ ∧ A₂ = B₂

full_name: Matrix.transpose_fromColumns
code: /-- A column partioned matrix when transposed gives a row partioned matrix with columns of the
initial matrix tranposed to become rows. -/
lemma transpose_fromColumns (A₁ : Matrix m n₁ R) (A₂ : Matrix m n₂ R) :
    transpose (fromColumns A₁ A₂) = fromRows (transpose A₁) (transpose A₂) 
goal: (A₁.fromColumns A₂).transpose = A₁.transpose.fromRows A₂.transpose

full_name: Matrix.transpose_fromRows
code: /-- A row partioned matrix when transposed gives a column partioned matrix with rows of the initial
matrix tranposed to become columns. -/
lemma transpose_fromRows (A₁ : Matrix m₁ n R) (A₂ : Matrix m₂ n R) :
    transpose (fromRows A₁ A₂) = fromColumns (transpose A₁) (transpose A₂) 
goal: (A₁.fromRows A₂).transpose = A₁.transpose.fromColumns A₂.transpose

full_name: Matrix.fromRows_neg
code: /-- Negating a matrix partitioned by rows is equivalent to negating each of the rows. -/
@[simp]
lemma fromRows_neg (A₁ : Matrix m₁ n R) (A₂ : Matrix m₂ n R) :
    -fromRows A₁ A₂ = fromRows (-A₁) (-A₂) 
goal: -A₁.fromRows A₂ = (-A₁).fromRows (-A₂)

full_name: Matrix.fromColumns_neg
code: /-- Negating a matrix partitioned by columns is equivalent to negating each of the columns. -/
@[simp]
lemma fromColumns_neg (A₁ : Matrix n m₁ R) (A₂ : Matrix n m₂ R) :
    -fromColumns A₁ A₂ = fromColumns (-A₁) (-A₂) 
goal: -A₁.fromColumns A₂ = (-A₁).fromColumns (-A₂)

full_name: Matrix.fromRows_mulVec
code: @[simp]
lemma fromRows_mulVec (A₁ : Matrix m₁ n R) (A₂ : Matrix m₂ n R) (v : n → R) :
    fromRows A₁ A₂ *ᵥ v = Sum.elim (A₁ *ᵥ v) (A₂ *ᵥ v) 
goal: (A₁.fromRows A₂).mulVec v = Sum.elim (A₁.mulVec v) (A₂.mulVec v)

full_name: Matrix.vecMul_fromColumns
code: @[simp]
lemma vecMul_fromColumns (B₁ : Matrix m n₁ R) (B₂ : Matrix m n₂ R) (v : m → R) :
    v ᵥ* fromColumns B₁ B₂ = Sum.elim (v ᵥ* B₁) (v ᵥ* B₂) 
goal: Matrix.vecMul v (B₁.fromColumns B₂) = Sum.elim (Matrix.vecMul v B₁) (Matrix.vecMul v B₂)

full_name: Matrix.sum_elim_vecMul_fromRows
code: @[simp]
lemma sum_elim_vecMul_fromRows (B₁ : Matrix m₁ n R) (B₂ : Matrix m₂ n R)
    (v₁ : m₁ → R) (v₂ : m₂ → R) :
    Sum.elim v₁ v₂ ᵥ* fromRows B₁ B₂ = v₁ ᵥ* B₁ + v₂ ᵥ* B₂ 
goal: Matrix.vecMul (Sum.elim v₁ v₂) (B₁.fromRows B₂) = Matrix.vecMul v₁ B₁ + Matrix.vecMul v₂ B₂

full_name: Matrix.fromColumns_mulVec_sum_elim
code: @[simp]
lemma fromColumns_mulVec_sum_elim (A₁ : Matrix m n₁ R) (A₂ : Matrix m n₂ R)
    (v₁ : n₁ → R) (v₂ : n₂ → R) :
    fromColumns A₁ A₂ *ᵥ Sum.elim v₁ v₂ = A₁ *ᵥ v₁ + A₂ *ᵥ v₂ 
goal: (A₁.fromColumns A₂).mulVec (Sum.elim v₁ v₂) = A₁.mulVec v₁ + A₂.mulVec v₂

full_name: Matrix.fromRows_mul
code: @[simp]
lemma fromRows_mul (A₁ : Matrix m₁ n R) (A₂ : Matrix m₂ n R) (B : Matrix n m R) :
    fromRows A₁ A₂ * B = fromRows (A₁ * B) (A₂ * B) 
goal: A₁.fromRows A₂ * B = (A₁ * B).fromRows (A₂ * B)

full_name: Matrix.mul_fromColumns
code: @[simp]
lemma mul_fromColumns (A : Matrix m n R) (B₁ : Matrix n n₁ R) (B₂ : Matrix n n₂ R) :
    A * fromColumns B₁ B₂ = fromColumns (A * B₁) (A * B₂) 
goal: A * B₁.fromColumns B₂ = (A * B₁).fromColumns (A * B₂)

full_name: Matrix.fromRows_zero
code: @[simp]
lemma fromRows_zero : fromRows (0 : Matrix m₁ n R) (0 : Matrix m₂ n R) = 0 
goal: Matrix.fromRows 0 0 = 0

full_name: Matrix.fromColumns_zero
code: @[simp]
lemma fromColumns_zero : fromColumns (0 : Matrix m n₁ R) (0 : Matrix m n₂ R) = 0 
goal: Matrix.fromColumns 0 0 = 0

full_name: Matrix.fromColumns_fromRows_eq_fromBlocks
code: @[simp]
lemma fromColumns_fromRows_eq_fromBlocks (B₁₁ : Matrix m₁ n₁ R) (B₁₂ : Matrix m₁ n₂ R)
    (B₂₁ : Matrix m₂ n₁ R) (B₂₂ : Matrix m₂ n₂ R) :
    fromColumns (fromRows B₁₁ B₂₁) (fromRows B₁₂ B₂₂) = fromBlocks B₁₁ B₁₂ B₂₁ B₂₂ 
goal: (B₁₁.fromRows B₂₁).fromColumns (B₁₂.fromRows B₂₂) = Matrix.fromBlocks B₁₁ B₁₂ B₂₁ B₂₂

full_name: Matrix.fromRows_fromColumn_eq_fromBlocks
code: @[simp]
lemma fromRows_fromColumn_eq_fromBlocks (B₁₁ : Matrix m₁ n₁ R) (B₁₂ : Matrix m₁ n₂ R)
    (B₂₁ : Matrix m₂ n₁ R) (B₂₂ : Matrix m₂ n₂ R) :
    fromRows (fromColumns B₁₁ B₁₂) (fromColumns B₂₁ B₂₂) = fromBlocks B₁₁ B₁₂ B₂₁ B₂₂ 
goal: (B₁₁.fromColumns B₁₂).fromRows (B₂₁.fromColumns B₂₂) = Matrix.fromBlocks B₁₁ B₁₂ B₂₁ B₂₂

full_name: Matrix.fromRows_mul_fromColumns
code: /-- A row partitioned matrix multiplied by a column partioned matrix gives a 2 by 2 block matrix -/
lemma fromRows_mul_fromColumns (A₁ : Matrix m₁ n R) (A₂ : Matrix m₂ n R)
    (B₁ : Matrix n n₁ R) (B₂ : Matrix n n₂ R) :
    (fromRows A₁ A₂) * (fromColumns B₁ B₂) =
      fromBlocks (A₁ * B₁) (A₁ * B₂) (A₂ * B₁) (A₂ * B₂) 
goal: A₁.fromRows A₂ * B₁.fromColumns B₂ = Matrix.fromBlocks (A₁ * B₁) (A₁ * B₂) (A₂ * B₁) (A₂ * B₂)

full_name: Matrix.fromColumns_mul_fromRows
code: /-- A column partitioned matrix mulitplied by a row partitioned matrix gives the sum of the "outer"
products of the block matrices -/
lemma fromColumns_mul_fromRows (A₁ : Matrix m n₁ R) (A₂ : Matrix m n₂ R)
    (B₁ : Matrix n₁ n R) (B₂ : Matrix n₂ n R) :
    fromColumns A₁ A₂ * fromRows B₁ B₂ = (A₁ * B₁ + A₂ * B₂) 
goal: A₁.fromColumns A₂ * B₁.fromRows B₂ = A₁ * B₁ + A₂ * B₂

full_name: Matrix.fromColumns_mul_fromBlocks
code: /-- A column partitioned matrix multipiled by a block matrix results in a column partioned matrix -/
lemma fromColumns_mul_fromBlocks (A₁ : Matrix m m₁ R) (A₂ : Matrix m m₂ R)
    (B₁₁ : Matrix m₁ n₁ R) (B₁₂ : Matrix m₁ n₂ R) (B₂₁ : Matrix m₂ n₁ R) (B₂₂ : Matrix m₂ n₂ R) :
    (fromColumns A₁ A₂) * fromBlocks B₁₁ B₁₂ B₂₁ B₂₂ =
      fromColumns (A₁ * B₁₁ + A₂ * B₂₁) (A₁ * B₁₂ + A₂ * B₂₂) 
goal: A₁.fromColumns A₂ * Matrix.fromBlocks B₁₁ B₁₂ B₂₁ B₂₂ = (A₁ * B₁₁ + A₂ * B₂₁).fromColumns (A₁ * B₁₂ + A₂ * B₂₂)

full_name: Matrix.fromBlocks_mul_fromRows
code: /-- A block matrix mulitplied by a row partitioned matrix gives a row partitioned matrix -/
lemma fromBlocks_mul_fromRows (A₁ : Matrix n₁ n R) (A₂ : Matrix n₂ n R)
    (B₁₁ : Matrix m₁ n₁ R) (B₁₂ : Matrix m₁ n₂ R) (B₂₁ : Matrix m₂ n₁ R) (B₂₂ : Matrix m₂ n₂ R) :
    fromBlocks B₁₁ B₁₂ B₂₁ B₂₂ * (fromRows A₁ A₂) =
      fromRows (B₁₁ * A₁ + B₁₂ * A₂) (B₂₁ * A₁ + B₂₂ * A₂) 
goal: Matrix.fromBlocks B₁₁ B₁₂ B₂₁ B₂₂ * A₁.fromRows A₂ = (B₁₁ * A₁ + B₁₂ * A₂).fromRows (B₂₁ * A₁ + B₂₂ * A₂)

full_name: Matrix.fromColumns_mul_fromRows_eq_one_comm
code: /-- Multiplication of a matrix by its inverse is commutative.
This is the column and row partitioned matrix form of `Matrix.mul_eq_one_comm`.

The condition `e : n ≃ n₁ ⊕ n₂` states that `fromColumns A₁ A₂` and `fromRows B₁ B₂` are "square".
-/
lemma fromColumns_mul_fromRows_eq_one_comm (e : n ≃ n₁ ⊕ n₂)
    (A₁ : Matrix n n₁ R) (A₂ : Matrix n n₂ R) (B₁ : Matrix n₁ n R) (B₂ : Matrix n₂ n R) :
    fromColumns A₁ A₂ * fromRows B₁ B₂ = 1 ↔ fromRows B₁ B₂ * fromColumns A₁ A₂ = 1 
goal: A₁.fromColumns A₂ * B₁.fromRows B₂ = 1 ↔ B₁.fromRows B₂ * A₁.fromColumns A₂ = 1

full_name: Matrix.equiv_compl_fromColumns_mul_fromRows_eq_one_comm
code: /-- The lemma `fromColumns_mul_fromRows_eq_one_comm` specialized to the case where the index sets n₁
and n₂, are the result of subtyping by a predicate and its complement. -/
lemma equiv_compl_fromColumns_mul_fromRows_eq_one_comm (p : n → Prop)[DecidablePred p]
    (A₁ : Matrix n {i // p i} R) (A₂ : Matrix n {i // ¬p i} R)
    (B₁ : Matrix {i // p i} n R) (B₂ : Matrix {i // ¬p i} n R) :
    fromColumns A₁ A₂ * fromRows B₁ B₂ = 1 ↔ fromRows B₁ B₂ * fromColumns A₁ A₂ = 1 
goal: A₁.fromColumns A₂ * B₁.fromRows B₂ = 1 ↔ B₁.fromRows B₂ * A₁.fromColumns A₂ = 1

full_name: Matrix.conjTranspose_fromColumns_eq_fromRows_conjTranspose
code: /-- A column partioned matrix in a Star ring when conjugate transposed gives a row partitioned
matrix with the columns of the initial matrix conjugate transposed to become rows. -/
lemma conjTranspose_fromColumns_eq_fromRows_conjTranspose (A₁ : Matrix m n₁ R)
    (A₂ : Matrix m n₂ R) :
    conjTranspose (fromColumns A₁ A₂) = fromRows (conjTranspose A₁) (conjTranspose A₂) 
goal: (A₁.fromColumns A₂).conjTranspose = A₁.conjTranspose.fromRows A₂.conjTranspose

full_name: Matrix.conjTranspose_fromRows_eq_fromColumns_conjTranspose
code: /-- A row partioned matrix in a Star ring when conjugate transposed gives a column partitioned
matrix with the rows of the initial matrix conjugate transposed to become columns. -/
lemma conjTranspose_fromRows_eq_fromColumns_conjTranspose (A₁ : Matrix m₁ n R)
    (A₂ : Matrix m₂ n R) : conjTranspose (fromRows A₁ A₂) =
      fromColumns (conjTranspose A₁) (conjTranspose A₂) 
goal: (A₁.fromRows A₂).conjTranspose = A₁.conjTranspose.fromColumns A₂.conjTranspose