cfahlgren1's picture
download
raw
2.5 kB
import Mathlib
import OAI.Analysis.MatrixSigning.Matrices.RationalElimination
import OAI.Analysis.MatrixSigning.Matrices.Pivot
namespace OAI
section
open Matrix
namespace KS.W07
def pivotIndexEquiv (n : ℕ) : Unit ⊕ Fin n ≃ Fin (n + 1) where
toFun := Sum.elim (fun _ => 0) Fin.succ
invFun := Fin.cases (Sum.inl ()) Sum.inr
left_inv := by
intro i
cases i with
| inl i => cases i; rfl
| inr i => rfl
right_inv := by
intro i
refine Fin.cases ?_ (fun j => ?_) i <;> rfl
theorem quadratic_submatrix_equiv {n m K : Type*} [Fintype n] [Fintype m]
[CommSemiring K] (M : Matrix n n K) (x : n → K) (e : m ≃ n) :
(x ∘ e) ⬝ᵥ (M.submatrix e e *ᵥ (x ∘ e)) = x ⬝ᵥ (M *ᵥ x) := by
rw [Matrix.submatrix_mulVec_equiv]
have hc : (x ∘ e) ∘ e.symm = x := by funext i; simp
rw [hc]
exact comp_equiv_dotProduct_comp_equiv x (M *ᵥ x) e
theorem fin_pivotBlock {n : ℕ} (M : Matrix (Fin (n + 1)) (Fin (n + 1)) ℚ)
(hM : M.IsSymm) :
M.submatrix (pivotIndexEquiv n) (pivotIndexEquiv n) =
pivotBlock (M 0 0) (fun i => M 0 i.succ) (KS.W17.trailingMatrix M) := by
ext i j
cases i with
| inl i => cases i; cases j <;> rfl
| inr i =>
cases j with
| inl j => cases j; exact hM.apply 0 i.succ
| inr j => rfl
theorem fin_pivotSchur {n : ℕ} (M : Matrix (Fin (n + 1)) (Fin (n + 1)) ℚ)
(hM : M.IsSymm) :
pivotSchur (M 0 0) (fun i => M 0 i.succ) (KS.W17.trailingMatrix M) =
KS.W17.schurTail M := by
ext i j
simp only [pivotSchur, KS.W17.schurTail, KS.W17.trailingMatrix, hM.apply 0 i.succ]
theorem fin_pivotWitnessLift {n : ℕ}
(M : Matrix (Fin (n + 1)) (Fin (n + 1)) ℚ) (y : Fin n → ℚ) :
KS.W17.schurWitnessLift M y ∘ pivotIndexEquiv n =
pivotWitnessLift (M 0 0) (fun i => M 0 i.succ) y := by
funext i
cases i with
| inl i =>
cases i
simp [pivotIndexEquiv, KS.W17.schurWitnessLift,
pivotWitnessLift, div_eq_mul_inv, mul_comm]
| inr i => rfl
theorem fin_schurWitnessLift_quadratic {n : ℕ}
(M : Matrix (Fin (n + 1)) (Fin (n + 1)) ℚ) (hM : M.IsSymm)
(ha : M 0 0 ≠ 0) (y : Fin n → ℚ) :
KS.W17.schurWitnessLift M y ⬝ᵥ (M *ᵥ KS.W17.schurWitnessLift M y) =
y ⬝ᵥ (KS.W17.schurTail M *ᵥ y) := by
rw [← quadratic_submatrix_equiv M (KS.W17.schurWitnessLift M y) (pivotIndexEquiv n),
fin_pivotBlock M hM, fin_pivotWitnessLift M y,
pivotWitnessLift_quadratic ha, fin_pivotSchur M hM]
end KS.W07
end
end OAI

Xet Storage Details

Size:
2.5 kB
·
Xet hash:
10b8f6e6f2ae8389d8130f8b71823d471732a23234f128bd74a082c56755827a

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.