l3lab/ntp-mathlib huggingface dataset:
theorem schur_complement_eq₂₂ [Fintype m] [Fintype n] [DecidableEq n] (A : Matrix m m 𝕜)
    (B : Matrix m n 𝕜) {D : Matrix n n 𝕜} (x : m → 𝕜) (y : n → 𝕜) [Invertible D]
    (hD : D.IsHermitian) :
    vecMul (star (x ⊕ᵥ y)) (fromBlocks A B Bᴴ D) ⬝ᵥ (x ⊕ᵥ y) =
      vecMul (star ((D⁻¹ * Bᴴ).mulVec x + y)) D ⬝ᵥ ((D⁻¹ * Bᴴ).mulVec x + y) +
        vecMul (star x) (A - B * D⁻¹ * Bᴴ) ⬝ᵥ x := by
  

Proof state:
l : Type u_1
m : Type u_2
n : Type u_3
α : Type u_4
𝕜 : Type u_5
inst✝⁶ : CommRing 𝕜
inst✝⁵ : PartialOrder 𝕜
inst✝⁴ : StarOrderedRing 𝕜
inst✝³ : Fintype m
inst✝² : Fintype n
inst✝¹ : DecidableEq n
A : Matrix m m 𝕜
B : Matrix m n 𝕜
D : Matrix n n 𝕜
x : m → 𝕜
y : n → 𝕜
inst✝ : Invertible D
hD : IsHermitian D
⊢ vecMul (star (x ⊕ᵥ y)) (fromBlocks A B Bᴴ D) ⬝ᵥ (x ⊕ᵥ y) =
    vecMul (star (mulVec (D⁻¹ * Bᴴ) x + y)) D ⬝ᵥ (mulVec (D⁻¹ * Bᴴ) x + y) + vecMul (star x) (A - B * D⁻¹ * Bᴴ) ⬝ᵥ x

Next tactic:
simp [Function.star_sum_elim, fromBlocks_mulVec, vecMul_fromBlocks, add_vecMul,
    dotProduct_mulVec, vecMul_sub, Matrix.mul_assoc, vecMul_mulVec, hD.eq,
    conjTranspose_nonsing_inv, star_mulVec]
theorem schur_complement_eq₂₂ [Fintype m] [Fintype n] [DecidableEq n] (A : Matrix m m 𝕜)
    (B : Matrix m n 𝕜) {D : Matrix n n 𝕜} (x : m → 𝕜) (y : n → 𝕜) [Invertible D]
    (hD : D.IsHermitian) :
    vecMul (star (x ⊕ᵥ y)) (fromBlocks A B Bᴴ D) ⬝ᵥ (x ⊕ᵥ y) =
      vecMul (star ((D⁻¹ * Bᴴ).mulVec x + y)) D ⬝ᵥ ((D⁻¹ * Bᴴ).mulVec x + y) +
        vecMul (star x) (A - B * D⁻¹ * Bᴴ) ⬝ᵥ x := by
  simp [Function.star_sum_elim, fromBlocks_mulVec, vecMul_fromBlocks, add_vecMul,
    dotProduct_mulVec, vecMul_sub, Matrix.mul_assoc, vecMul_mulVec, hD.eq,
    conjTranspose_nonsing_inv, star_mulVec]
  

Proof state:
l : Type u_1
m : Type u_2
n : Type u_3
α : Type u_4
𝕜 : Type u_5
inst✝⁶ : CommRing 𝕜
inst✝⁵ : PartialOrder 𝕜
inst✝⁴ : StarOrderedRing 𝕜
inst✝³ : Fintype m
inst✝² : Fintype n
inst✝¹ : DecidableEq n
A : Matrix m m 𝕜
B : Matrix m n 𝕜
D : Matrix n n 𝕜
x : m → 𝕜
y : n → 𝕜
inst✝ : Invertible D
hD : IsHermitian D
⊢ vecMul (star x) A ⬝ᵥ x + vecMul (star y) Bᴴ ⬝ᵥ x + (vecMul (star x) B ⬝ᵥ y + vecMul (star y) D ⬝ᵥ y) =
    vecMul (star x) (B * (D⁻¹ * Bᴴ)) ⬝ᵥ x + vecMul (star y) Bᴴ ⬝ᵥ x +
        (vecMul (star x) B ⬝ᵥ y + vecMul (star y) D ⬝ᵥ y) +
      (vecMul (star x) A ⬝ᵥ x - vecMul (star x) (B * (D⁻¹ * Bᴴ)) ⬝ᵥ x)

Next tactic:
abel
theorem IsHermitian.fromBlocks₁₁ [Fintype m] [DecidableEq m] {A : Matrix m m 𝕜} (B : Matrix m n 𝕜)
    (D : Matrix n n 𝕜) (hA : A.IsHermitian) :
    (Matrix.fromBlocks A B Bᴴ D).IsHermitian ↔ (D - Bᴴ * A⁻¹ * B).IsHermitian := by
  

Proof state:
l : Type u_1
m : Type u_2
n : Type u_3
α : Type u_4
𝕜 : Type u_5
inst✝⁴ : CommRing 𝕜
inst✝³ : PartialOrder 𝕜
inst✝² : StarOrderedRing 𝕜
inst✝¹ : Fintype m
inst✝ : DecidableEq m
A : Matrix m m 𝕜
B : Matrix m n 𝕜
D : Matrix n n 𝕜
hA : IsHermitian A
⊢ IsHermitian (Matrix.fromBlocks A B Bᴴ D) ↔ IsHermitian (D - Bᴴ * A⁻¹ * B)

Next tactic:
have hBAB : (Bᴴ * A⁻¹ * B).IsHermitian := by
    apply isHermitian_conjTranspose_mul_mul
    apply hA.inv
theorem IsHermitian.fromBlocks₁₁ [Fintype m] [DecidableEq m] {A : Matrix m m 𝕜} (B : Matrix m n 𝕜)
    (D : Matrix n n 𝕜) (hA : A.IsHermitian) :
    (Matrix.fromBlocks A B Bᴴ D).IsHermitian ↔ (D - Bᴴ * A⁻¹ * B).IsHermitian := by
  have hBAB : (Bᴴ * A⁻¹ * B).IsHermitian := by
    

Proof state:
l : Type u_1
m : Type u_2
n : Type u_3
α : Type u_4
𝕜 : Type u_5
inst✝⁴ : CommRing 𝕜
inst✝³ : PartialOrder 𝕜
inst✝² : StarOrderedRing 𝕜
inst✝¹ : Fintype m
inst✝ : DecidableEq m
A : Matrix m m 𝕜
B : Matrix m n 𝕜
D : Matrix n n 𝕜
hA : IsHermitian A
⊢ IsHermitian (Bᴴ * A⁻¹ * B)

Next tactic:
apply isHermitian_conjTranspose_mul_mul
theorem IsHermitian.fromBlocks₁₁ [Fintype m] [DecidableEq m] {A : Matrix m m 𝕜} (B : Matrix m n 𝕜)
    (D : Matrix n n 𝕜) (hA : A.IsHermitian) :
    (Matrix.fromBlocks A B Bᴴ D).IsHermitian ↔ (D - Bᴴ * A⁻¹ * B).IsHermitian := by
  have hBAB : (Bᴴ * A⁻¹ * B).IsHermitian := by
    apply isHermitian_conjTranspose_mul_mul
    

Proof state:
case hA
l : Type u_1
m : Type u_2
n : Type u_3
α : Type u_4
𝕜 : Type u_5
inst✝⁴ : CommRing 𝕜
inst✝³ : PartialOrder 𝕜
inst✝² : StarOrderedRing 𝕜
inst✝¹ : Fintype m
inst✝ : DecidableEq m
A : Matrix m m 𝕜
B : Matrix m n 𝕜
D : Matrix n n 𝕜
hA : IsHermitian A
⊢ IsHermitian A⁻¹

Next tactic:
apply hA.inv
theorem IsHermitian.fromBlocks₁₁ [Fintype m] [DecidableEq m] {A : Matrix m m 𝕜} (B : Matrix m n 𝕜)
    (D : Matrix n n 𝕜) (hA : A.IsHermitian) :
    (Matrix.fromBlocks A B Bᴴ D).IsHermitian ↔ (D - Bᴴ * A⁻¹ * B).IsHermitian := by
  have hBAB : (Bᴴ * A⁻¹ * B).IsHermitian := by
    apply isHermitian_conjTranspose_mul_mul
    apply hA.inv
  

Proof state:
l : Type u_1
m : Type u_2
n : Type u_3
α : Type u_4
𝕜 : Type u_5
inst✝⁴ : CommRing 𝕜
inst✝³ : PartialOrder 𝕜
inst✝² : StarOrderedRing 𝕜
inst✝¹ : Fintype m
inst✝ : DecidableEq m
A : Matrix m m 𝕜
B : Matrix m n 𝕜
D : Matrix n n 𝕜
hA : IsHermitian A
hBAB : IsHermitian (Bᴴ * A⁻¹ * B)
⊢ IsHermitian (Matrix.fromBlocks A B Bᴴ D) ↔ IsHermitian (D - Bᴴ * A⁻¹ * B)

Next tactic:
rw [isHermitian_fromBlocks_iff]
theorem IsHermitian.fromBlocks₁₁ [Fintype m] [DecidableEq m] {A : Matrix m m 𝕜} (B : Matrix m n 𝕜)
    (D : Matrix n n 𝕜) (hA : A.IsHermitian) :
    (Matrix.fromBlocks A B Bᴴ D).IsHermitian ↔ (D - Bᴴ * A⁻¹ * B).IsHermitian := by
  have hBAB : (Bᴴ * A⁻¹ * B).IsHermitian := by
    apply isHermitian_conjTranspose_mul_mul
    apply hA.inv
  rw [isHermitian_fromBlocks_iff]
  

Proof state:
l : Type u_1
m : Type u_2
n : Type u_3
α : Type u_4
𝕜 : Type u_5
inst✝⁴ : CommRing 𝕜
inst✝³ : PartialOrder 𝕜
inst✝² : StarOrderedRing 𝕜
inst✝¹ : Fintype m
inst✝ : DecidableEq m
A : Matrix m m 𝕜
B : Matrix m n 𝕜
D : Matrix n n 𝕜
hA : IsHermitian A
hBAB : IsHermitian (Bᴴ * A⁻¹ * B)
⊢ IsHermitian A ∧ Bᴴ = Bᴴ ∧ Bᴴᴴ = B ∧ IsHermitian D ↔ IsHermitian (D - Bᴴ * A⁻¹ * B)

Next tactic:
constructor
theorem IsHermitian.fromBlocks₁₁ [Fintype m] [DecidableEq m] {A : Matrix m m 𝕜} (B : Matrix m n 𝕜)
    (D : Matrix n n 𝕜) (hA : A.IsHermitian) :
    (Matrix.fromBlocks A B Bᴴ D).IsHermitian ↔ (D - Bᴴ * A⁻¹ * B).IsHermitian := by
  have hBAB : (Bᴴ * A⁻¹ * B).IsHermitian := by
    apply isHermitian_conjTranspose_mul_mul
    apply hA.inv
  rw [isHermitian_fromBlocks_iff]
  constructor
  · 

Proof state:
case mp
l : Type u_1
m : Type u_2
n : Type u_3
α : Type u_4
𝕜 : Type u_5
inst✝⁴ : CommRing 𝕜
inst✝³ : PartialOrder 𝕜
inst✝² : StarOrderedRing 𝕜
inst✝¹ : Fintype m
inst✝ : DecidableEq m
A : Matrix m m 𝕜
B : Matrix m n 𝕜
D : Matrix n n 𝕜
hA : IsHermitian A
hBAB : IsHermitian (Bᴴ * A⁻¹ * B)
⊢ IsHermitian A ∧ Bᴴ = Bᴴ ∧ Bᴴᴴ = B ∧ IsHermitian D → IsHermitian (D - Bᴴ * A⁻¹ * B)

Next tactic:
intro h
theorem IsHermitian.fromBlocks₁₁ [Fintype m] [DecidableEq m] {A : Matrix m m 𝕜} (B : Matrix m n 𝕜)
    (D : Matrix n n 𝕜) (hA : A.IsHermitian) :
    (Matrix.fromBlocks A B Bᴴ D).IsHermitian ↔ (D - Bᴴ * A⁻¹ * B).IsHermitian := by
  have hBAB : (Bᴴ * A⁻¹ * B).IsHermitian := by
    apply isHermitian_conjTranspose_mul_mul
    apply hA.inv
  rw [isHermitian_fromBlocks_iff]
  constructor
  · intro h
    

Proof state:
case mp
l : Type u_1
m : Type u_2
n : Type u_3
α : Type u_4
𝕜 : Type u_5
inst✝⁴ : CommRing 𝕜
inst✝³ : PartialOrder 𝕜
inst✝² : StarOrderedRing 𝕜
inst✝¹ : Fintype m
inst✝ : DecidableEq m
A : Matrix m m 𝕜
B : Matrix m n 𝕜
D : Matrix n n 𝕜
hA : IsHermitian A
hBAB : IsHermitian (Bᴴ * A⁻¹ * B)
h : IsHermitian A ∧ Bᴴ = Bᴴ ∧ Bᴴᴴ = B ∧ IsHermitian D
⊢ IsHermitian (D - Bᴴ * A⁻¹ * B)

Next tactic:
apply IsHermitian.sub h.2.2.2 hBAB
theorem IsHermitian.fromBlocks₁₁ [Fintype m] [DecidableEq m] {A : Matrix m m 𝕜} (B : Matrix m n 𝕜)
    (D : Matrix n n 𝕜) (hA : A.IsHermitian) :
    (Matrix.fromBlocks A B Bᴴ D).IsHermitian ↔ (D - Bᴴ * A⁻¹ * B).IsHermitian := by
  have hBAB : (Bᴴ * A⁻¹ * B).IsHermitian := by
    apply isHermitian_conjTranspose_mul_mul
    apply hA.inv
  rw [isHermitian_fromBlocks_iff]
  constructor
  · intro h
    apply IsHermitian.sub h.2.2.2 hBAB
  · 

Proof state:
case mpr
l : Type u_1
m : Type u_2
n : Type u_3
α : Type u_4
𝕜 : Type u_5
inst✝⁴ : CommRing 𝕜
inst✝³ : PartialOrder 𝕜
inst✝² : StarOrderedRing 𝕜
inst✝¹ : Fintype m
inst✝ : DecidableEq m
A : Matrix m m 𝕜
B : Matrix m n 𝕜
D : Matrix n n 𝕜
hA : IsHermitian A
hBAB : IsHermitian (Bᴴ * A⁻¹ * B)
⊢ IsHermitian (D - Bᴴ * A⁻¹ * B) → IsHermitian A ∧ Bᴴ = Bᴴ ∧ Bᴴᴴ = B ∧ IsHermitian D

Next tactic:
intro h
theorem IsHermitian.fromBlocks₁₁ [Fintype m] [DecidableEq m] {A : Matrix m m 𝕜} (B : Matrix m n 𝕜)
    (D : Matrix n n 𝕜) (hA : A.IsHermitian) :
    (Matrix.fromBlocks A B Bᴴ D).IsHermitian ↔ (D - Bᴴ * A⁻¹ * B).IsHermitian := by
  have hBAB : (Bᴴ * A⁻¹ * B).IsHermitian := by
    apply isHermitian_conjTranspose_mul_mul
    apply hA.inv
  rw [isHermitian_fromBlocks_iff]
  constructor
  · intro h
    apply IsHermitian.sub h.2.2.2 hBAB
  · intro h
    

Proof state:
case mpr
l : Type u_1
m : Type u_2
n : Type u_3
α : Type u_4
𝕜 : Type u_5
inst✝⁴ : CommRing 𝕜
inst✝³ : PartialOrder 𝕜
inst✝² : StarOrderedRing 𝕜
inst✝¹ : Fintype m
inst✝ : DecidableEq m
A : Matrix m m 𝕜
B : Matrix m n 𝕜
D : Matrix n n 𝕜
hA : IsHermitian A
hBAB : IsHermitian (Bᴴ * A⁻¹ * B)
h : IsHermitian (D - Bᴴ * A⁻¹ * B)
⊢ IsHermitian A ∧ Bᴴ = Bᴴ ∧ Bᴴᴴ = B ∧ IsHermitian D

Next tactic:
refine' ⟨hA, rfl, conjTranspose_conjTranspose B, _⟩
theorem IsHermitian.fromBlocks₁₁ [Fintype m] [DecidableEq m] {A : Matrix m m 𝕜} (B : Matrix m n 𝕜)
    (D : Matrix n n 𝕜) (hA : A.IsHermitian) :
    (Matrix.fromBlocks A B Bᴴ D).IsHermitian ↔ (D - Bᴴ * A⁻¹ * B).IsHermitian := by
  have hBAB : (Bᴴ * A⁻¹ * B).IsHermitian := by
    apply isHermitian_conjTranspose_mul_mul
    apply hA.inv
  rw [isHermitian_fromBlocks_iff]
  constructor
  · intro h
    apply IsHermitian.sub h.2.2.2 hBAB
  · intro h
    refine' ⟨hA, rfl, conjTranspose_conjTranspose B, _⟩
    

Proof state:
case mpr
l : Type u_1
m : Type u_2
n : Type u_3
α : Type u_4
𝕜 : Type u_5
inst✝⁴ : CommRing 𝕜
inst✝³ : PartialOrder 𝕜
inst✝² : StarOrderedRing 𝕜
inst✝¹ : Fintype m
inst✝ : DecidableEq m
A : Matrix m m 𝕜
B : Matrix m n 𝕜
D : Matrix n n 𝕜
hA : IsHermitian A
hBAB : IsHermitian (Bᴴ * A⁻¹ * B)
h : IsHermitian (D - Bᴴ * A⁻¹ * B)
⊢ IsHermitian D

Next tactic:
rw [← sub_add_cancel D]
theorem IsHermitian.fromBlocks₁₁ [Fintype m] [DecidableEq m] {A : Matrix m m 𝕜} (B : Matrix m n 𝕜)
    (D : Matrix n n 𝕜) (hA : A.IsHermitian) :
    (Matrix.fromBlocks A B Bᴴ D).IsHermitian ↔ (D - Bᴴ * A⁻¹ * B).IsHermitian := by
  have hBAB : (Bᴴ * A⁻¹ * B).IsHermitian := by
    apply isHermitian_conjTranspose_mul_mul
    apply hA.inv
  rw [isHermitian_fromBlocks_iff]
  constructor
  · intro h
    apply IsHermitian.sub h.2.2.2 hBAB
  · intro h
    refine' ⟨hA, rfl, conjTranspose_conjTranspose B, _⟩
    rw [← sub_add_cancel D]
    

Proof state:
case mpr
l : Type u_1
m : Type u_2
n : Type u_3
α : Type u_4
𝕜 : Type u_5
inst✝⁴ : CommRing 𝕜
inst✝³ : PartialOrder 𝕜
inst✝² : StarOrderedRing 𝕜
inst✝¹ : Fintype m
inst✝ : DecidableEq m
A : Matrix m m 𝕜
B : Matrix m n 𝕜
D : Matrix n n 𝕜
hA : IsHermitian A
hBAB : IsHermitian (Bᴴ * A⁻¹ * B)
h : IsHermitian (D - Bᴴ * A⁻¹ * B)
⊢ IsHermitian (D - ?mpr + ?mpr)
case mpr
l : Type u_1
m : Type u_2
n : Type u_3
α : Type u_4
𝕜 : Type u_5
inst✝⁴ : CommRing 𝕜
inst✝³ : PartialOrder 𝕜
inst✝² : StarOrderedRing 𝕜
inst✝¹ : Fintype m
inst✝ : DecidableEq m
A : Matrix m m 𝕜
B : Matrix m n 𝕜
D : Matrix n n 𝕜
hA : IsHermitian A
hBAB : IsHermitian (Bᴴ * A⁻¹ * B)
h : IsHermitian (D - Bᴴ * A⁻¹ * B)
⊢ Matrix n n 𝕜

Next tactic:
apply IsHermitian.add h hBAB
theorem IsHermitian.fromBlocks₂₂ [Fintype n] [DecidableEq n] (A : Matrix m m 𝕜) (B : Matrix m n 𝕜)
    {D : Matrix n n 𝕜} (hD : D.IsHermitian) :
    (Matrix.fromBlocks A B Bᴴ D).IsHermitian ↔ (A - B * D⁻¹ * Bᴴ).IsHermitian := by
  

Proof state:
l : Type u_1
m : Type u_2
n : Type u_3
α : Type u_4
𝕜 : Type u_5
inst✝⁴ : CommRing 𝕜
inst✝³ : PartialOrder 𝕜
inst✝² : StarOrderedRing 𝕜
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix m m 𝕜
B : Matrix m n 𝕜
D : Matrix n n 𝕜
hD : IsHermitian D
⊢ IsHermitian (Matrix.fromBlocks A B Bᴴ D) ↔ IsHermitian (A - B * D⁻¹ * Bᴴ)

Next tactic:
rw [← isHermitian_submatrix_equiv (Equiv.sumComm n m), Equiv.sumComm_apply,
    fromBlocks_submatrix_sum_swap_sum_swap]
theorem IsHermitian.fromBlocks₂₂ [Fintype n] [DecidableEq n] (A : Matrix m m 𝕜) (B : Matrix m n 𝕜)
    {D : Matrix n n 𝕜} (hD : D.IsHermitian) :
    (Matrix.fromBlocks A B Bᴴ D).IsHermitian ↔ (A - B * D⁻¹ * Bᴴ).IsHermitian := by
  rw [← isHermitian_submatrix_equiv (Equiv.sumComm n m), Equiv.sumComm_apply,
    fromBlocks_submatrix_sum_swap_sum_swap]
  

Proof state:
l : Type u_1
m : Type u_2
n : Type u_3
α : Type u_4
𝕜 : Type u_5
inst✝⁴ : CommRing 𝕜
inst✝³ : PartialOrder 𝕜
inst✝² : StarOrderedRing 𝕜
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix m m 𝕜
B : Matrix m n 𝕜
D : Matrix n n 𝕜
hD : IsHermitian D
⊢ IsHermitian (Matrix.fromBlocks D Bᴴ B A) ↔ IsHermitian (A - B * D⁻¹ * Bᴴ)

Next tactic:
convert IsHermitian.fromBlocks₁₁ _ _ hD
theorem IsHermitian.fromBlocks₂₂ [Fintype n] [DecidableEq n] (A : Matrix m m 𝕜) (B : Matrix m n 𝕜)
    {D : Matrix n n 𝕜} (hD : D.IsHermitian) :
    (Matrix.fromBlocks A B Bᴴ D).IsHermitian ↔ (A - B * D⁻¹ * Bᴴ).IsHermitian := by
  rw [← isHermitian_submatrix_equiv (Equiv.sumComm n m), Equiv.sumComm_apply,
    fromBlocks_submatrix_sum_swap_sum_swap]
  convert IsHermitian.fromBlocks₁₁ _ _ hD <;> 

Proof state:
case h.e'_1.h.e'_4.h.e'_8
l : Type u_1
m : Type u_2
n : Type u_3
α : Type u_4
𝕜 : Type u_5
inst✝⁴ : CommRing 𝕜
inst✝³ : PartialOrder 𝕜
inst✝² : StarOrderedRing 𝕜
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix m m 𝕜
B : Matrix m n 𝕜
D : Matrix n n 𝕜
hD : IsHermitian D
⊢ B = Bᴴᴴ

Next tactic:
simp
theorem IsHermitian.fromBlocks₂₂ [Fintype n] [DecidableEq n] (A : Matrix m m 𝕜) (B : Matrix m n 𝕜)
    {D : Matrix n n 𝕜} (hD : D.IsHermitian) :
    (Matrix.fromBlocks A B Bᴴ D).IsHermitian ↔ (A - B * D⁻¹ * Bᴴ).IsHermitian := by
  rw [← isHermitian_submatrix_equiv (Equiv.sumComm n m), Equiv.sumComm_apply,
    fromBlocks_submatrix_sum_swap_sum_swap]
  convert IsHermitian.fromBlocks₁₁ _ _ hD <;> 

Proof state:
case h.e'_2.h.e'_4.h.e'_6.h.e'_5.h.e'_5
l : Type u_1
m : Type u_2
n : Type u_3
α : Type u_4
𝕜 : Type u_5
inst✝⁴ : CommRing 𝕜
inst✝³ : PartialOrder 𝕜
inst✝² : StarOrderedRing 𝕜
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix m m 𝕜
B : Matrix m n 𝕜
D : Matrix n n 𝕜
hD : IsHermitian D
⊢ B = Bᴴᴴ

Next tactic:
simp
theorem PosSemidef.fromBlocks₁₁ [Fintype m] [DecidableEq m] [Fintype n] {A : Matrix m m 𝕜}
    (B : Matrix m n 𝕜) (D : Matrix n n 𝕜) (hA : A.PosDef) [Invertible A] :
    (fromBlocks A B Bᴴ D).PosSemidef ↔ (D - Bᴴ * A⁻¹ * B).PosSemidef := by
  

Proof state:
l : Type u_1
m : Type u_2
n : Type u_3
α : Type u_4
𝕜 : Type u_5
inst✝⁶ : CommRing 𝕜
inst✝⁵ : PartialOrder 𝕜
inst✝⁴ : StarOrderedRing 𝕜
inst✝³ : Fintype m
inst✝² : DecidableEq m
inst✝¹ : Fintype n
A : Matrix m m 𝕜
B : Matrix m n 𝕜
D : Matrix n n 𝕜
hA : PosDef A
inst✝ : Invertible A
⊢ PosSemidef (fromBlocks A B Bᴴ D) ↔ PosSemidef (D - Bᴴ * A⁻¹ * B)

Next tactic:
rw [PosSemidef, IsHermitian.fromBlocks₁₁ _ _ hA.1]
theorem PosSemidef.fromBlocks₁₁ [Fintype m] [DecidableEq m] [Fintype n] {A : Matrix m m 𝕜}
    (B : Matrix m n 𝕜) (D : Matrix n n 𝕜) (hA : A.PosDef) [Invertible A] :
    (fromBlocks A B Bᴴ D).PosSemidef ↔ (D - Bᴴ * A⁻¹ * B).PosSemidef := by
  rw [PosSemidef, IsHermitian.fromBlocks₁₁ _ _ hA.1]
  

Proof state:
l : Type u_1
m : Type u_2
n : Type u_3
α : Type u_4
𝕜 : Type u_5
inst✝⁶ : CommRing 𝕜
inst✝⁵ : PartialOrder 𝕜
inst✝⁴ : StarOrderedRing 𝕜
inst✝³ : Fintype m
inst✝² : DecidableEq m
inst✝¹ : Fintype n
A : Matrix m m 𝕜
B : Matrix m n 𝕜
D : Matrix n n 𝕜
hA : PosDef A
inst✝ : Invertible A
⊢ (IsHermitian (D - Bᴴ * A⁻¹ * B) ∧ ∀ (x : m ⊕ n → 𝕜), 0 ≤ star x ⬝ᵥ mulVec (fromBlocks A B Bᴴ D) x) ↔
    PosSemidef (D - Bᴴ * A⁻¹ * B)

Next tactic:
constructor
theorem PosSemidef.fromBlocks₁₁ [Fintype m] [DecidableEq m] [Fintype n] {A : Matrix m m 𝕜}
    (B : Matrix m n 𝕜) (D : Matrix n n 𝕜) (hA : A.PosDef) [Invertible A] :
    (fromBlocks A B Bᴴ D).PosSemidef ↔ (D - Bᴴ * A⁻¹ * B).PosSemidef := by
  rw [PosSemidef, IsHermitian.fromBlocks₁₁ _ _ hA.1]
  constructor
  · 

Proof state:
case mp
l : Type u_1
m : Type u_2
n : Type u_3
α : Type u_4
𝕜 : Type u_5
inst✝⁶ : CommRing 𝕜
inst✝⁵ : PartialOrder 𝕜
inst✝⁴ : StarOrderedRing 𝕜
inst✝³ : Fintype m
inst✝² : DecidableEq m
inst✝¹ : Fintype n
A : Matrix m m 𝕜
B : Matrix m n 𝕜
D : Matrix n n 𝕜
hA : PosDef A
inst✝ : Invertible A
⊢ (IsHermitian (D - Bᴴ * A⁻¹ * B) ∧ ∀ (x : m ⊕ n → 𝕜), 0 ≤ star x ⬝ᵥ mulVec (fromBlocks A B Bᴴ D) x) →
    PosSemidef (D - Bᴴ * A⁻¹ * B)

Next tactic:
refine' fun h => ⟨h.1, fun x => _⟩
theorem PosSemidef.fromBlocks₁₁ [Fintype m] [DecidableEq m] [Fintype n] {A : Matrix m m 𝕜}
    (B : Matrix m n 𝕜) (D : Matrix n n 𝕜) (hA : A.PosDef) [Invertible A] :
    (fromBlocks A B Bᴴ D).PosSemidef ↔ (D - Bᴴ * A⁻¹ * B).PosSemidef := by
  rw [PosSemidef, IsHermitian.fromBlocks₁₁ _ _ hA.1]
  constructor
  · refine' fun h => ⟨h.1, fun x => _⟩
    

Proof state:
case mp
l : Type u_1
m : Type u_2
n : Type u_3
α : Type u_4
𝕜 : Type u_5
inst✝⁶ : CommRing 𝕜
inst✝⁵ : PartialOrder 𝕜
inst✝⁴ : StarOrderedRing 𝕜
inst✝³ : Fintype m
inst✝² : DecidableEq m
inst✝¹ : Fintype n
A : Matrix m m 𝕜
B : Matrix m n 𝕜
D : Matrix n n 𝕜
hA : PosDef A
inst✝ : Invertible A
h : IsHermitian (D - Bᴴ * A⁻¹ * B) ∧ ∀ (x : m ⊕ n → 𝕜), 0 ≤ star x ⬝ᵥ mulVec (fromBlocks A B Bᴴ D) x
x : n → 𝕜
⊢ 0 ≤ star x ⬝ᵥ mulVec (D - Bᴴ * A⁻¹ * B) x

Next tactic:
have := h.2 (-(A⁻¹ * B).mulVec x ⊕ᵥ x)
theorem PosSemidef.fromBlocks₁₁ [Fintype m] [DecidableEq m] [Fintype n] {A : Matrix m m 𝕜}
    (B : Matrix m n 𝕜) (D : Matrix n n 𝕜) (hA : A.PosDef) [Invertible A] :
    (fromBlocks A B Bᴴ D).PosSemidef ↔ (D - Bᴴ * A⁻¹ * B).PosSemidef := by
  rw [PosSemidef, IsHermitian.fromBlocks₁₁ _ _ hA.1]
  constructor
  · refine' fun h => ⟨h.1, fun x => _⟩
    have := h.2 (-(A⁻¹ * B).mulVec x ⊕ᵥ x)
    

Proof state:
case mp
l : Type u_1
m : Type u_2
n : Type u_3
α : Type u_4
𝕜 : Type u_5
inst✝⁶ : CommRing 𝕜
inst✝⁵ : PartialOrder 𝕜
inst✝⁴ : StarOrderedRing 𝕜
inst✝³ : Fintype m
inst✝² : DecidableEq m
inst✝¹ : Fintype n
A : Matrix m m 𝕜
B : Matrix m n 𝕜
D : Matrix n n 𝕜
hA : PosDef A
inst✝ : Invertible A
h : IsHermitian (D - Bᴴ * A⁻¹ * B) ∧ ∀ (x : m ⊕ n → 𝕜), 0 ≤ star x ⬝ᵥ mulVec (fromBlocks A B Bᴴ D) x
x : n → 𝕜
this : 0 ≤ star (-mulVec (A⁻¹ * B) x ⊕ᵥ x) ⬝ᵥ mulVec (fromBlocks A B Bᴴ D) (-mulVec (A⁻¹ * B) x ⊕ᵥ x)
⊢ 0 ≤ star x ⬝ᵥ mulVec (D - Bᴴ * A⁻¹ * B) x

Next tactic:
rw [dotProduct_mulVec, schur_complement_eq₁₁ B D _ _ hA.1, neg_add_self, dotProduct_zero,
      zero_add] at this
theorem PosSemidef.fromBlocks₁₁ [Fintype m] [DecidableEq m] [Fintype n] {A : Matrix m m 𝕜}
    (B : Matrix m n 𝕜) (D : Matrix n n 𝕜) (hA : A.PosDef) [Invertible A] :
    (fromBlocks A B Bᴴ D).PosSemidef ↔ (D - Bᴴ * A⁻¹ * B).PosSemidef := by
  rw [PosSemidef, IsHermitian.fromBlocks₁₁ _ _ hA.1]
  constructor
  · refine' fun h => ⟨h.1, fun x => _⟩
    have := h.2 (-(A⁻¹ * B).mulVec x ⊕ᵥ x)
    rw [dotProduct_mulVec, schur_complement_eq₁₁ B D _ _ hA.1, neg_add_self, dotProduct_zero,
      zero_add] at this
    

Proof state:
case mp
l : Type u_1
m : Type u_2
n : Type u_3
α : Type u_4
𝕜 : Type u_5
inst✝⁶ : CommRing 𝕜
inst✝⁵ : PartialOrder 𝕜
inst✝⁴ : StarOrderedRing 𝕜
inst✝³ : Fintype m
inst✝² : DecidableEq m
inst✝¹ : Fintype n
A : Matrix m m 𝕜
B : Matrix m n 𝕜
D : Matrix n n 𝕜
hA : PosDef A
inst✝ : Invertible A
h : IsHermitian (D - Bᴴ * A⁻¹ * B) ∧ ∀ (x : m ⊕ n → 𝕜), 0 ≤ star x ⬝ᵥ mulVec (fromBlocks A B Bᴴ D) x
x : n → 𝕜
this : 0 ≤ vecMul (star x) (D - Bᴴ * A⁻¹ * B) ⬝ᵥ x
⊢ 0 ≤ star x ⬝ᵥ mulVec (D - Bᴴ * A⁻¹ * B) x

Next tactic:
rw [dotProduct_mulVec]
theorem PosSemidef.fromBlocks₁₁ [Fintype m] [DecidableEq m] [Fintype n] {A : Matrix m m 𝕜}
    (B : Matrix m n 𝕜) (D : Matrix n n 𝕜) (hA : A.PosDef) [Invertible A] :
    (fromBlocks A B Bᴴ D).PosSemidef ↔ (D - Bᴴ * A⁻¹ * B).PosSemidef := by
  rw [PosSemidef, IsHermitian.fromBlocks₁₁ _ _ hA.1]
  constructor
  · refine' fun h => ⟨h.1, fun x => _⟩
    have := h.2 (-(A⁻¹ * B).mulVec x ⊕ᵥ x)
    rw [dotProduct_mulVec, schur_complement_eq₁₁ B D _ _ hA.1, neg_add_self, dotProduct_zero,
      zero_add] at this
    rw [dotProduct_mulVec]; 

Proof state:
case mp
l : Type u_1
m : Type u_2
n : Type u_3
α : Type u_4
𝕜 : Type u_5
inst✝⁶ : CommRing 𝕜
inst✝⁵ : PartialOrder 𝕜
inst✝⁴ : StarOrderedRing 𝕜
inst✝³ : Fintype m
inst✝² : DecidableEq m
inst✝¹ : Fintype n
A : Matrix m m 𝕜
B : Matrix m n 𝕜
D : Matrix n n 𝕜
hA : PosDef A
inst✝ : Invertible A
h : IsHermitian (D - Bᴴ * A⁻¹ * B) ∧ ∀ (x : m ⊕ n → 𝕜), 0 ≤ star x ⬝ᵥ mulVec (fromBlocks A B Bᴴ D) x
x : n → 𝕜
this : 0 ≤ vecMul (star x) (D - Bᴴ * A⁻¹ * B) ⬝ᵥ x
⊢ 0 ≤ vecMul (star x) (D - Bᴴ * A⁻¹ * B) ⬝ᵥ x

Next tactic:
exact this
theorem PosSemidef.fromBlocks₁₁ [Fintype m] [DecidableEq m] [Fintype n] {A : Matrix m m 𝕜}
    (B : Matrix m n 𝕜) (D : Matrix n n 𝕜) (hA : A.PosDef) [Invertible A] :
    (fromBlocks A B Bᴴ D).PosSemidef ↔ (D - Bᴴ * A⁻¹ * B).PosSemidef := by
  rw [PosSemidef, IsHermitian.fromBlocks₁₁ _ _ hA.1]
  constructor
  · refine' fun h => ⟨h.1, fun x => _⟩
    have := h.2 (-(A⁻¹ * B).mulVec x ⊕ᵥ x)
    rw [dotProduct_mulVec, schur_complement_eq₁₁ B D _ _ hA.1, neg_add_self, dotProduct_zero,
      zero_add] at this
    rw [dotProduct_mulVec]; exact this
  · 

Proof state:
case mpr
l : Type u_1
m : Type u_2
n : Type u_3
α : Type u_4
𝕜 : Type u_5
inst✝⁶ : CommRing 𝕜
inst✝⁵ : PartialOrder 𝕜
inst✝⁴ : StarOrderedRing 𝕜
inst✝³ : Fintype m
inst✝² : DecidableEq m
inst✝¹ : Fintype n
A : Matrix m m 𝕜
B : Matrix m n 𝕜
D : Matrix n n 𝕜
hA : PosDef A
inst✝ : Invertible A
⊢ PosSemidef (D - Bᴴ * A⁻¹ * B) →
    IsHermitian (D - Bᴴ * A⁻¹ * B) ∧ ∀ (x : m ⊕ n → 𝕜), 0 ≤ star x ⬝ᵥ mulVec (fromBlocks A B Bᴴ D) x

Next tactic:
refine' fun h => ⟨h.1, fun x => _⟩
theorem PosSemidef.fromBlocks₁₁ [Fintype m] [DecidableEq m] [Fintype n] {A : Matrix m m 𝕜}
    (B : Matrix m n 𝕜) (D : Matrix n n 𝕜) (hA : A.PosDef) [Invertible A] :
    (fromBlocks A B Bᴴ D).PosSemidef ↔ (D - Bᴴ * A⁻¹ * B).PosSemidef := by
  rw [PosSemidef, IsHermitian.fromBlocks₁₁ _ _ hA.1]
  constructor
  · refine' fun h => ⟨h.1, fun x => _⟩
    have := h.2 (-(A⁻¹ * B).mulVec x ⊕ᵥ x)
    rw [dotProduct_mulVec, schur_complement_eq₁₁ B D _ _ hA.1, neg_add_self, dotProduct_zero,
      zero_add] at this
    rw [dotProduct_mulVec]; exact this
  · refine' fun h => ⟨h.1, fun x => _⟩
    

Proof state:
case mpr
l : Type u_1
m : Type u_2
n : Type u_3
α : Type u_4
𝕜 : Type u_5
inst✝⁶ : CommRing 𝕜
inst✝⁵ : PartialOrder 𝕜
inst✝⁴ : StarOrderedRing 𝕜
inst✝³ : Fintype m
inst✝² : DecidableEq m
inst✝¹ : Fintype n
A : Matrix m m 𝕜
B : Matrix m n 𝕜
D : Matrix n n 𝕜
hA : PosDef A
inst✝ : Invertible A
h : PosSemidef (D - Bᴴ * A⁻¹ * B)
x : m ⊕ n → 𝕜
⊢ 0 ≤ star x ⬝ᵥ mulVec (fromBlocks A B Bᴴ D) x

Next tactic:
rw [dotProduct_mulVec, ← Sum.elim_comp_inl_inr x, schur_complement_eq₁₁ B D _ _ hA.1]
theorem PosSemidef.fromBlocks₁₁ [Fintype m] [DecidableEq m] [Fintype n] {A : Matrix m m 𝕜}
    (B : Matrix m n 𝕜) (D : Matrix n n 𝕜) (hA : A.PosDef) [Invertible A] :
    (fromBlocks A B Bᴴ D).PosSemidef ↔ (D - Bᴴ * A⁻¹ * B).PosSemidef := by
  rw [PosSemidef, IsHermitian.fromBlocks₁₁ _ _ hA.1]
  constructor
  · refine' fun h => ⟨h.1, fun x => _⟩
    have := h.2 (-(A⁻¹ * B).mulVec x ⊕ᵥ x)
    rw [dotProduct_mulVec, schur_complement_eq₁₁ B D _ _ hA.1, neg_add_self, dotProduct_zero,
      zero_add] at this
    rw [dotProduct_mulVec]; exact this
  · refine' fun h => ⟨h.1, fun x => _⟩
    rw [dotProduct_mulVec, ← Sum.elim_comp_inl_inr x, schur_complement_eq₁₁ B D _ _ hA.1]
    

Proof state:
case mpr
l : Type u_1
m : Type u_2
n : Type u_3
α : Type u_4
𝕜 : Type u_5
inst✝⁶ : CommRing 𝕜
inst✝⁵ : PartialOrder 𝕜
inst✝⁴ : StarOrderedRing 𝕜
inst✝³ : Fintype m
inst✝² : DecidableEq m
inst✝¹ : Fintype n
A : Matrix m m 𝕜
B : Matrix m n 𝕜
D : Matrix n n 𝕜
hA : PosDef A
inst✝ : Invertible A
h : PosSemidef (D - Bᴴ * A⁻¹ * B)
x : m ⊕ n → 𝕜
⊢ 0 ≤
    vecMul (star (x ∘ Sum.inl + mulVec (A⁻¹ * B) (x ∘ Sum.inr))) A ⬝ᵥ (x ∘ Sum.inl + mulVec (A⁻¹ * B) (x ∘ Sum.inr)) +
      vecMul (star (x ∘ Sum.inr)) (D - Bᴴ * A⁻¹ * B) ⬝ᵥ x ∘ Sum.inr

Next tactic:
apply le_add_of_nonneg_of_le