l3lab/ntp-mathlib huggingface dataset:
@[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₂₂ := by
  ext (_ | _) (_ | _) <;> 

Proof state:
case a.inr.h.inl
R : Type u_1
m : Type u_2
m₁ : Type u_3
m₂ : Type u_4
n : Type u_5
n₁ : Type u_6
n₂ : Type u_7
inst✝¹² : Fintype m
inst✝¹¹ : Fintype m₁
inst✝¹⁰ : Fintype m₂
inst✝⁹ : Fintype n
inst✝⁸ : Fintype n₁
inst✝⁷ : Fintype n₂
inst✝⁶ : DecidableEq m
inst✝⁵ : DecidableEq m₁
inst✝⁴ : DecidableEq m₂
inst✝³ : DecidableEq n
inst✝² : DecidableEq n₁
inst✝¹ : DecidableEq n₂
inst✝ : Semiring R
B₁₁ : Matrix m₁ n₁ R
B₁₂ : Matrix m₁ n₂ R
B₂₁ : Matrix m₂ n₁ R
B₂₂ : Matrix m₂ n₂ R
val✝¹ : m₂
val✝ : n₁
⊢ fromRows (fromColumns B₁₁ B₁₂) (fromColumns B₂₁ B₂₂) (Sum.inr val✝¹) (Sum.inl val✝) =
    fromBlocks B₁₁ B₁₂ B₂₁ B₂₂ (Sum.inr val✝¹) (Sum.inl val✝)

Next tactic:
simp
@[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₂₂ := by
  ext (_ | _) (_ | _) <;> 

Proof state:
case a.inr.h.inr
R : Type u_1
m : Type u_2
m₁ : Type u_3
m₂ : Type u_4
n : Type u_5
n₁ : Type u_6
n₂ : Type u_7
inst✝¹² : Fintype m
inst✝¹¹ : Fintype m₁
inst✝¹⁰ : Fintype m₂
inst✝⁹ : Fintype n
inst✝⁸ : Fintype n₁
inst✝⁷ : Fintype n₂
inst✝⁶ : DecidableEq m
inst✝⁵ : DecidableEq m₁
inst✝⁴ : DecidableEq m₂
inst✝³ : DecidableEq n
inst✝² : DecidableEq n₁
inst✝¹ : DecidableEq n₂
inst✝ : Semiring R
B₁₁ : Matrix m₁ n₁ R
B₁₂ : Matrix m₁ n₂ R
B₂₁ : Matrix m₂ n₁ R
B₂₂ : Matrix m₂ n₂ R
val✝¹ : m₂
val✝ : n₂
⊢ fromRows (fromColumns B₁₁ B₁₂) (fromColumns B₂₁ B₂₂) (Sum.inr val✝¹) (Sum.inr val✝) =
    fromBlocks B₁₁ B₁₂ B₂₁ B₂₂ (Sum.inr val✝¹) (Sum.inr val✝)

Next tactic:
simp
/-- 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₂) := by
  

Proof state:
R : Type u_1
m : Type u_2
m₁ : Type u_3
m₂ : Type u_4
n : Type u_5
n₁ : Type u_6
n₂ : Type u_7
inst✝¹² : Fintype m
inst✝¹¹ : Fintype m₁
inst✝¹⁰ : Fintype m₂
inst✝⁹ : Fintype n
inst✝⁸ : Fintype n₁
inst✝⁷ : Fintype n₂
inst✝⁶ : DecidableEq m
inst✝⁵ : DecidableEq m₁
inst✝⁴ : DecidableEq m₂
inst✝³ : DecidableEq n
inst✝² : DecidableEq n₁
inst✝¹ : DecidableEq n₂
inst✝ : Semiring R
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₂)

Next tactic:
ext (_ | _) (_ | _)
/-- 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₂) := by
  ext (_ | _) (_ | _) <;> 

Proof state:
case a.inl.h.inl
R : Type u_1
m : Type u_2
m₁ : Type u_3
m₂ : Type u_4
n : Type u_5
n₁ : Type u_6
n₂ : Type u_7
inst✝¹² : Fintype m
inst✝¹¹ : Fintype m₁
inst✝¹⁰ : Fintype m₂
inst✝⁹ : Fintype n
inst✝⁸ : Fintype n₁
inst✝⁷ : Fintype n₂
inst✝⁶ : DecidableEq m
inst✝⁵ : DecidableEq m₁
inst✝⁴ : DecidableEq m₂
inst✝³ : DecidableEq n
inst✝² : DecidableEq n₁
inst✝¹ : DecidableEq n₂
inst✝ : Semiring R
A₁ : Matrix m₁ n R
A₂ : Matrix m₂ n R
B₁ : Matrix n n₁ R
B₂ : Matrix n n₂ R
val✝¹ : m₁
val✝ : n₁
⊢ (fromRows A₁ A₂ * fromColumns B₁ B₂) (Sum.inl val✝¹) (Sum.inl val✝) =
    fromBlocks (A₁ * B₁) (A₁ * B₂) (A₂ * B₁) (A₂ * B₂) (Sum.inl val✝¹) (Sum.inl val✝)

Next tactic:
simp
/-- 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₂) := by
  ext (_ | _) (_ | _) <;> 

Proof state:
case a.inl.h.inr
R : Type u_1
m : Type u_2
m₁ : Type u_3
m₂ : Type u_4
n : Type u_5
n₁ : Type u_6
n₂ : Type u_7
inst✝¹² : Fintype m
inst✝¹¹ : Fintype m₁
inst✝¹⁰ : Fintype m₂
inst✝⁹ : Fintype n
inst✝⁸ : Fintype n₁
inst✝⁷ : Fintype n₂
inst✝⁶ : DecidableEq m
inst✝⁵ : DecidableEq m₁
inst✝⁴ : DecidableEq m₂
inst✝³ : DecidableEq n
inst✝² : DecidableEq n₁
inst✝¹ : DecidableEq n₂
inst✝ : Semiring R
A₁ : Matrix m₁ n R
A₂ : Matrix m₂ n R
B₁ : Matrix n n₁ R
B₂ : Matrix n n₂ R
val✝¹ : m₁
val✝ : n₂
⊢ (fromRows A₁ A₂ * fromColumns B₁ B₂) (Sum.inl val✝¹) (Sum.inr val✝) =
    fromBlocks (A₁ * B₁) (A₁ * B₂) (A₂ * B₁) (A₂ * B₂) (Sum.inl val✝¹) (Sum.inr val✝)

Next tactic:
simp
/-- 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₂) := by
  ext (_ | _) (_ | _) <;> 

Proof state:
case a.inr.h.inl
R : Type u_1
m : Type u_2
m₁ : Type u_3
m₂ : Type u_4
n : Type u_5
n₁ : Type u_6
n₂ : Type u_7
inst✝¹² : Fintype m
inst✝¹¹ : Fintype m₁
inst✝¹⁰ : Fintype m₂
inst✝⁹ : Fintype n
inst✝⁸ : Fintype n₁
inst✝⁷ : Fintype n₂
inst✝⁶ : DecidableEq m
inst✝⁵ : DecidableEq m₁
inst✝⁴ : DecidableEq m₂
inst✝³ : DecidableEq n
inst✝² : DecidableEq n₁
inst✝¹ : DecidableEq n₂
inst✝ : Semiring R
A₁ : Matrix m₁ n R
A₂ : Matrix m₂ n R
B₁ : Matrix n n₁ R
B₂ : Matrix n n₂ R
val✝¹ : m₂
val✝ : n₁
⊢ (fromRows A₁ A₂ * fromColumns B₁ B₂) (Sum.inr val✝¹) (Sum.inl val✝) =
    fromBlocks (A₁ * B₁) (A₁ * B₂) (A₂ * B₁) (A₂ * B₂) (Sum.inr val✝¹) (Sum.inl val✝)

Next tactic:
simp
/-- 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₂) := by
  ext (_ | _) (_ | _) <;> 

Proof state:
case a.inr.h.inr
R : Type u_1
m : Type u_2
m₁ : Type u_3
m₂ : Type u_4
n : Type u_5
n₁ : Type u_6
n₂ : Type u_7
inst✝¹² : Fintype m
inst✝¹¹ : Fintype m₁
inst✝¹⁰ : Fintype m₂
inst✝⁹ : Fintype n
inst✝⁸ : Fintype n₁
inst✝⁷ : Fintype n₂
inst✝⁶ : DecidableEq m
inst✝⁵ : DecidableEq m₁
inst✝⁴ : DecidableEq m₂
inst✝³ : DecidableEq n
inst✝² : DecidableEq n₁
inst✝¹ : DecidableEq n₂
inst✝ : Semiring R
A₁ : Matrix m₁ n R
A₂ : Matrix m₂ n R
B₁ : Matrix n n₁ R
B₂ : Matrix n n₂ R
val✝¹ : m₂
val✝ : n₂
⊢ (fromRows A₁ A₂ * fromColumns B₁ B₂) (Sum.inr val✝¹) (Sum.inr val✝) =
    fromBlocks (A₁ * B₁) (A₁ * B₂) (A₂ * B₁) (A₂ * B₂) (Sum.inr val✝¹) (Sum.inr val✝)

Next tactic:
simp
/-- 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₂) := by
  

Proof state:
R : Type u_1
m : Type u_2
m₁ : Type u_3
m₂ : Type u_4
n : Type u_5
n₁ : Type u_6
n₂ : Type u_7
inst✝¹² : Fintype m
inst✝¹¹ : Fintype m₁
inst✝¹⁰ : Fintype m₂
inst✝⁹ : Fintype n
inst✝⁸ : Fintype n₁
inst✝⁷ : Fintype n₂
inst✝⁶ : DecidableEq m
inst✝⁵ : DecidableEq m₁
inst✝⁴ : DecidableEq m₂
inst✝³ : DecidableEq n
inst✝² : DecidableEq n₁
inst✝¹ : DecidableEq n₂
inst✝ : Semiring R
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₂

Next tactic:
ext
/-- 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₂) := by
  ext
  

Proof state:
case a.h
R : Type u_1
m : Type u_2
m₁ : Type u_3
m₂ : Type u_4
n : Type u_5
n₁ : Type u_6
n₂ : Type u_7
inst✝¹² : Fintype m
inst✝¹¹ : Fintype m₁
inst✝¹⁰ : Fintype m₂
inst✝⁹ : Fintype n
inst✝⁸ : Fintype n₁
inst✝⁷ : Fintype n₂
inst✝⁶ : DecidableEq m
inst✝⁵ : DecidableEq m₁
inst✝⁴ : DecidableEq m₂
inst✝³ : DecidableEq n
inst✝² : DecidableEq n₁
inst✝¹ : DecidableEq n₂
inst✝ : Semiring R
A₁ : Matrix m n₁ R
A₂ : Matrix m n₂ R
B₁ : Matrix n₁ n R
B₂ : Matrix n₂ n R
i✝ : m
x✝ : n
⊢ (fromColumns A₁ A₂ * fromRows B₁ B₂) i✝ x✝ = (A₁ * B₁ + A₂ * B₂) i✝ x✝

Next tactic:
simp [mul_apply]
/-- 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₂₂) := by
  

Proof state:
R : Type u_1
m : Type u_2
m₁ : Type u_3
m₂ : Type u_4
n : Type u_5
n₁ : Type u_6
n₂ : Type u_7
inst✝¹² : Fintype m
inst✝¹¹ : Fintype m₁
inst✝¹⁰ : Fintype m₂
inst✝⁹ : Fintype n
inst✝⁸ : Fintype n₁
inst✝⁷ : Fintype n₂
inst✝⁶ : DecidableEq m
inst✝⁵ : DecidableEq m₁
inst✝⁴ : DecidableEq m₂
inst✝³ : DecidableEq n
inst✝² : DecidableEq n₁
inst✝¹ : DecidableEq n₂
inst✝ : Semiring R
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₂₂)

Next tactic:
ext _ (_ | _)
/-- 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₂₂) := by
  ext _ (_ | _) <;> 

Proof state:
case a.h.inl
R : Type u_1
m : Type u_2
m₁ : Type u_3
m₂ : Type u_4
n : Type u_5
n₁ : Type u_6
n₂ : Type u_7
inst✝¹² : Fintype m
inst✝¹¹ : Fintype m₁
inst✝¹⁰ : Fintype m₂
inst✝⁹ : Fintype n
inst✝⁸ : Fintype n₁
inst✝⁷ : Fintype n₂
inst✝⁶ : DecidableEq m
inst✝⁵ : DecidableEq m₁
inst✝⁴ : DecidableEq m₂
inst✝³ : DecidableEq n
inst✝² : DecidableEq n₁
inst✝¹ : DecidableEq n₂
inst✝ : Semiring R
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
i✝ : m
val✝ : n₁
⊢ (fromColumns A₁ A₂ * fromBlocks B₁₁ B₁₂ B₂₁ B₂₂) i✝ (Sum.inl val✝) =
    fromColumns (A₁ * B₁₁ + A₂ * B₂₁) (A₁ * B₁₂ + A₂ * B₂₂) i✝ (Sum.inl val✝)

Next tactic:
simp [mul_apply]
/-- 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₂₂) := by
  ext _ (_ | _) <;> 

Proof state:
case a.h.inr
R : Type u_1
m : Type u_2
m₁ : Type u_3
m₂ : Type u_4
n : Type u_5
n₁ : Type u_6
n₂ : Type u_7
inst✝¹² : Fintype m
inst✝¹¹ : Fintype m₁
inst✝¹⁰ : Fintype m₂
inst✝⁹ : Fintype n
inst✝⁸ : Fintype n₁
inst✝⁷ : Fintype n₂
inst✝⁶ : DecidableEq m
inst✝⁵ : DecidableEq m₁
inst✝⁴ : DecidableEq m₂
inst✝³ : DecidableEq n
inst✝² : DecidableEq n₁
inst✝¹ : DecidableEq n₂
inst✝ : Semiring R
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
i✝ : m
val✝ : n₂
⊢ (fromColumns A₁ A₂ * fromBlocks B₁₁ B₁₂ B₂₁ B₂₂) i✝ (Sum.inr val✝) =
    fromColumns (A₁ * B₁₁ + A₂ * B₂₁) (A₁ * B₁₂ + A₂ * B₂₂) i✝ (Sum.inr val✝)

Next tactic:
simp [mul_apply]
/-- 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₂) := by
  

Proof state:
R : Type u_1
m : Type u_2
m₁ : Type u_3
m₂ : Type u_4
n : Type u_5
n₁ : Type u_6
n₂ : Type u_7
inst✝¹² : Fintype m
inst✝¹¹ : Fintype m₁
inst✝¹⁰ : Fintype m₂
inst✝⁹ : Fintype n
inst✝⁸ : Fintype n₁
inst✝⁷ : Fintype n₂
inst✝⁶ : DecidableEq m
inst✝⁵ : DecidableEq m₁
inst✝⁴ : DecidableEq m₂
inst✝³ : DecidableEq n
inst✝² : DecidableEq n₁
inst✝¹ : DecidableEq n₂
inst✝ : Semiring R
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₂)

Next tactic:
ext (_ | _) _
/-- 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₂) := by
  ext (_ | _) _ <;> 

Proof state:
case a.inl.h
R : Type u_1
m : Type u_2
m₁ : Type u_3
m₂ : Type u_4
n : Type u_5
n₁ : Type u_6
n₂ : Type u_7
inst✝¹² : Fintype m
inst✝¹¹ : Fintype m₁
inst✝¹⁰ : Fintype m₂
inst✝⁹ : Fintype n
inst✝⁸ : Fintype n₁
inst✝⁷ : Fintype n₂
inst✝⁶ : DecidableEq m
inst✝⁵ : DecidableEq m₁
inst✝⁴ : DecidableEq m₂
inst✝³ : DecidableEq n
inst✝² : DecidableEq n₁
inst✝¹ : DecidableEq n₂
inst✝ : Semiring R
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
val✝ : m₁
x✝ : n
⊢ (fromBlocks B₁₁ B₁₂ B₂₁ B₂₂ * fromRows A₁ A₂) (Sum.inl val✝) x✝ =
    fromRows (B₁₁ * A₁ + B₁₂ * A₂) (B₂₁ * A₁ + B₂₂ * A₂) (Sum.inl val✝) x✝

Next tactic:
simp [mul_apply]
/-- 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₂) := by
  ext (_ | _) _ <;> 

Proof state:
case a.inr.h
R : Type u_1
m : Type u_2
m₁ : Type u_3
m₂ : Type u_4
n : Type u_5
n₁ : Type u_6
n₂ : Type u_7
inst✝¹² : Fintype m
inst✝¹¹ : Fintype m₁
inst✝¹⁰ : Fintype m₂
inst✝⁹ : Fintype n
inst✝⁸ : Fintype n₁
inst✝⁷ : Fintype n₂
inst✝⁶ : DecidableEq m
inst✝⁵ : DecidableEq m₁
inst✝⁴ : DecidableEq m₂
inst✝³ : DecidableEq n
inst✝² : DecidableEq n₁
inst✝¹ : DecidableEq n₂
inst✝ : Semiring R
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
val✝ : m₂
x✝ : n
⊢ (fromBlocks B₁₁ B₁₂ B₂₁ B₂₂ * fromRows A₁ A₂) (Sum.inr val✝) x✝ =
    fromRows (B₁₁ * A₁ + B₁₂ * A₂) (B₂₁ * A₁ + B₂₂ * A₂) (Sum.inr val✝) x✝

Next tactic:
simp [mul_apply]
/-- 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 := by
  

Proof state:
R : Type u_1
m : Type u_2
m₁ : Type u_3
m₂ : Type u_4
n : Type u_5
n₁ : Type u_6
n₂ : Type u_7
inst✝¹² : Fintype m
inst✝¹¹ : Fintype m₁
inst✝¹⁰ : Fintype m₂
inst✝⁹ : Fintype n
inst✝⁸ : Fintype n₁
inst✝⁷ : Fintype n₂
inst✝⁶ : DecidableEq m
inst✝⁵ : DecidableEq m₁
inst✝⁴ : DecidableEq m₂
inst✝³ : DecidableEq n
inst✝² : DecidableEq n₁
inst✝¹ : DecidableEq n₂
inst✝ : CommRing R
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

Next tactic:
calc fromColumns A₁ A₂ * fromRows B₁ B₂ = 1
  _ ↔ submatrix (fromColumns A₁ A₂) id e * submatrix (fromRows B₁ B₂) e id = 1 := by
    simp
  _ ↔ submatrix (fromRows B₁ B₂) e id * submatrix (fromColumns A₁ A₂) id e = 1 :=
    mul_eq_one_comm
  _ ↔ reindex e.symm e.symm (fromRows B₁ B₂ * fromColumns A₁ A₂) = reindex e.symm e.symm 1 := by
    simp only [reindex_apply, Equiv.symm_symm, submatrix_one_equiv,
        submatrix_mul (he₂ := Function.bijective_id)]
  _ ↔ fromRows B₁ B₂ * fromColumns A₁ A₂ = 1 :=
    (reindex _ _).injective.eq_iff
/-- 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 := by
  calc fromColumns A₁ A₂ * fromRows B₁ B₂ = 1
  _ ↔ submatrix (fromColumns A₁ A₂) id e * submatrix (fromRows B₁ B₂) e id = 1 := by
    

Proof state:
R : Type u_1
m : Type u_2
m₁ : Type u_3
m₂ : Type u_4
n : Type u_5
n₁ : Type u_6
n₂ : Type u_7
inst✝¹² : Fintype m
inst✝¹¹ : Fintype m₁
inst✝¹⁰ : Fintype m₂
inst✝⁹ : Fintype n
inst✝⁸ : Fintype n₁
inst✝⁷ : Fintype n₂
inst✝⁶ : DecidableEq m
inst✝⁵ : DecidableEq m₁
inst✝⁴ : DecidableEq m₂
inst✝³ : DecidableEq n
inst✝² : DecidableEq n₁
inst✝¹ : DecidableEq n₂
inst✝ : CommRing R
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 ↔ submatrix (fromColumns A₁ A₂) id ⇑e * submatrix (fromRows B₁ B₂) (⇑e) id = 1

Next tactic:
simp
/-- 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 := by
  calc fromColumns A₁ A₂ * fromRows B₁ B₂ = 1
  _ ↔ submatrix (fromColumns A₁ A₂) id e * submatrix (fromRows B₁ B₂) e id = 1 := by
    simp
  _ ↔ submatrix (fromRows B₁ B₂) e id * submatrix (fromColumns A₁ A₂) id e = 1 :=
    mul_eq_one_comm
  _ ↔ reindex e.symm e.symm (fromRows B₁ B₂ * fromColumns A₁ A₂) = reindex e.symm e.symm 1 := by
    

Proof state:
R : Type u_1
m : Type u_2
m₁ : Type u_3
m₂ : Type u_4
n : Type u_5
n₁ : Type u_6
n₂ : Type u_7
inst✝¹² : Fintype m
inst✝¹¹ : Fintype m₁
inst✝¹⁰ : Fintype m₂
inst✝⁹ : Fintype n
inst✝⁸ : Fintype n₁
inst✝⁷ : Fintype n₂
inst✝⁶ : DecidableEq m
inst✝⁵ : DecidableEq m₁
inst✝⁴ : DecidableEq m₂
inst✝³ : DecidableEq n
inst✝² : DecidableEq n₁
inst✝¹ : DecidableEq n₂
inst✝ : CommRing R
e : n ≃ n₁ ⊕ n₂
A₁ : Matrix n n₁ R
A₂ : Matrix n n₂ R
B₁ : Matrix n₁ n R
B₂ : Matrix n₂ n R
⊢ submatrix (fromRows B₁ B₂) (⇑e) id * submatrix (fromColumns A₁ A₂) id ⇑e = 1 ↔
    (reindex e.symm e.symm) (fromRows B₁ B₂ * fromColumns A₁ A₂) = (reindex e.symm e.symm) 1

Next tactic:
simp only [reindex_apply, Equiv.symm_symm, submatrix_one_equiv,
        submatrix_mul (he₂ := Function.bijective_id)]
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₂) := by
  

Proof state:
R : Type u_1
m : Type u_2
m₁ : Type u_3
m₂ : Type u_4
n : Type u_5
n₁ : Type u_6
n₂ : Type u_7
inst✝¹² : Fintype m
inst✝¹¹ : Fintype m₁
inst✝¹⁰ : Fintype m₂
inst✝⁹ : Fintype n
inst✝⁸ : Fintype n₁
inst✝⁷ : Fintype n₂
inst✝⁶ : DecidableEq m
inst✝⁵ : DecidableEq m₁
inst✝⁴ : DecidableEq m₂
inst✝³ : DecidableEq n
inst✝² : DecidableEq n₁
inst✝¹ : DecidableEq n₂
inst✝ : Star R
A₁ : Matrix m n₁ R
A₂ : Matrix m n₂ R
⊢ (fromColumns A₁ A₂)ᴴ = fromRows A₁ᴴ A₂ᴴ

Next tactic:
ext (_ | _) _
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₂) := by
  ext (_ | _) _ <;> 

Proof state:
case a.inl.h
R : Type u_1
m : Type u_2
m₁ : Type u_3
m₂ : Type u_4
n : Type u_5
n₁ : Type u_6
n₂ : Type u_7
inst✝¹² : Fintype m
inst✝¹¹ : Fintype m₁
inst✝¹⁰ : Fintype m₂
inst✝⁹ : Fintype n
inst✝⁸ : Fintype n₁
inst✝⁷ : Fintype n₂
inst✝⁶ : DecidableEq m
inst✝⁵ : DecidableEq m₁
inst✝⁴ : DecidableEq m₂
inst✝³ : DecidableEq n
inst✝² : DecidableEq n₁
inst✝¹ : DecidableEq n₂
inst✝ : Star R
A₁ : Matrix m n₁ R
A₂ : Matrix m n₂ R
val✝ : n₁
x✝ : m
⊢ (fromColumns A₁ A₂)ᴴ (Sum.inl val✝) x✝ = fromRows A₁ᴴ A₂ᴴ (Sum.inl val✝) x✝

Next tactic:
simp
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₂) := by
  ext (_ | _) _ <;> 

Proof state:
case a.inr.h
R : Type u_1
m : Type u_2
m₁ : Type u_3
m₂ : Type u_4
n : Type u_5
n₁ : Type u_6
n₂ : Type u_7
inst✝¹² : Fintype m
inst✝¹¹ : Fintype m₁
inst✝¹⁰ : Fintype m₂
inst✝⁹ : Fintype n
inst✝⁸ : Fintype n₁
inst✝⁷ : Fintype n₂
inst✝⁶ : DecidableEq m
inst✝⁵ : DecidableEq m₁
inst✝⁴ : DecidableEq m₂
inst✝³ : DecidableEq n
inst✝² : DecidableEq n₁
inst✝¹ : DecidableEq n₂
inst✝ : Star R
A₁ : Matrix m n₁ R
A₂ : Matrix m n₂ R
val✝ : n₂
x✝ : m
⊢ (fromColumns A₁ A₂)ᴴ (Sum.inr val✝) x✝ = fromRows A₁ᴴ A₂ᴴ (Sum.inr val✝) x✝

Next tactic:
simp
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₂) := by
  

Proof state:
R : Type u_1
m : Type u_2
m₁ : Type u_3
m₂ : Type u_4
n : Type u_5
n₁ : Type u_6
n₂ : Type u_7
inst✝¹² : Fintype m
inst✝¹¹ : Fintype m₁
inst✝¹⁰ : Fintype m₂
inst✝⁹ : Fintype n
inst✝⁸ : Fintype n₁
inst✝⁷ : Fintype n₂
inst✝⁶ : DecidableEq m
inst✝⁵ : DecidableEq m₁
inst✝⁴ : DecidableEq m₂
inst✝³ : DecidableEq n
inst✝² : DecidableEq n₁
inst✝¹ : DecidableEq n₂
inst✝ : Star R
A₁ : Matrix m₁ n R
A₂ : Matrix m₂ n R
⊢ (fromRows A₁ A₂)ᴴ = fromColumns A₁ᴴ A₂ᴴ

Next tactic:
ext _ (_ | _)
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₂) := by
  ext _ (_ | _) <;> 

Proof state:
case a.h.inl
R : Type u_1
m : Type u_2
m₁ : Type u_3
m₂ : Type u_4
n : Type u_5
n₁ : Type u_6
n₂ : Type u_7
inst✝¹² : Fintype m
inst✝¹¹ : Fintype m₁
inst✝¹⁰ : Fintype m₂
inst✝⁹ : Fintype n
inst✝⁸ : Fintype n₁
inst✝⁷ : Fintype n₂
inst✝⁶ : DecidableEq m
inst✝⁵ : DecidableEq m₁
inst✝⁴ : DecidableEq m₂
inst✝³ : DecidableEq n
inst✝² : DecidableEq n₁
inst✝¹ : DecidableEq n₂
inst✝ : Star R
A₁ : Matrix m₁ n R
A₂ : Matrix m₂ n R
i✝ : n
val✝ : m₁
⊢ (fromRows A₁ A₂)ᴴ i✝ (Sum.inl val✝) = fromColumns A₁ᴴ A₂ᴴ i✝ (Sum.inl val✝)

Next tactic:
simp
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₂) := by
  ext _ (_ | _) <;> 

Proof state:
case a.h.inr
R : Type u_1
m : Type u_2
m₁ : Type u_3
m₂ : Type u_4
n : Type u_5
n₁ : Type u_6
n₂ : Type u_7
inst✝¹² : Fintype m
inst✝¹¹ : Fintype m₁
inst✝¹⁰ : Fintype m₂
inst✝⁹ : Fintype n
inst✝⁸ : Fintype n₁
inst✝⁷ : Fintype n₂
inst✝⁶ : DecidableEq m
inst✝⁵ : DecidableEq m₁
inst✝⁴ : DecidableEq m₂
inst✝³ : DecidableEq n
inst✝² : DecidableEq n₁
inst✝¹ : DecidableEq n₂
inst✝ : Star R
A₁ : Matrix m₁ n R
A₂ : Matrix m₂ n R
i✝ : n
val✝ : m₂
⊢ (fromRows A₁ A₂)ᴴ i✝ (Sum.inr val✝) = fromColumns A₁ᴴ A₂ᴴ i✝ (Sum.inr val✝)

Next tactic:
simp