cfahlgren1/math / lean /OAI /Analysis /MatrixSigning /Matrices /EliminationSoundness.lean
cfahlgren1's picture
download
raw
2.8 kB
import Mathlib
import OAI.Analysis.MatrixSigning.Matrices.FinPivot
import OAI.Analysis.MatrixSigning.Matrices.PSDSeparation
namespace OAI
section
namespace KS.W17
open Matrix
theorem quadratic_zero_cons {n : ℕ}
(M : Matrix (Fin (n + 1)) (Fin (n + 1)) ℚ) (y : Fin n → ℚ) :
Fin.cons 0 y ⬝ᵥ (M *ᵥ Fin.cons 0 y) = y ⬝ᵥ (trailingMatrix M *ᵥ y) := by
simp [dotProduct, Matrix.mulVec, Fin.sum_univ_succ, trailingMatrix]
theorem rationalNegativeWitness_sound (n : ℕ)
(M : Matrix (Fin n) (Fin n) ℚ) (hM : M.IsSymm) (q : Fin n → ℚ)
(hout : rationalNegativeWitness n M = some q) : q ⬝ᵥ (M *ᵥ q) < 0 := by
induction n with
| zero => simp [rationalNegativeWitness] at hout
| succ n ih =>
by_cases hnegative : M 0 0 < 0
· have hq : Pi.single 0 1 = q := by
simpa [rationalNegativeWitness, hnegative] using hout
subst q
exact negativeDiagonal_witness M 0 hnegative
· by_cases hzero : M 0 0 = 0
· cases hfind : firstNonzeroOffDiagonal M with
| some j =>
have hq : zeroPivotWitness M 0 j.succ = q := by
simpa [rationalNegativeWitness, hnegative, hzero, hfind] using hout
subst q
exact zeroPivotWitness_negative M 0 j.succ hzero
(firstNonzeroOffDiagonal_some M j hfind) (hM.apply 0 j.succ)
| none =>
cases hrec : rationalNegativeWitness n (trailingMatrix M) with
| none =>
simp [rationalNegativeWitness, hzero, hfind, hrec] at hout
| some y =>
have hq : Fin.cons 0 y = q := by
simpa [rationalNegativeWitness, hnegative, hzero, hfind, hrec] using hout
subst q
rw [quadratic_zero_cons]
exact ih (trailingMatrix M) (trailingMatrix_isSymm M hM) y hrec
· cases hrec : rationalNegativeWitness n (schurTail M) with
| none =>
simp [rationalNegativeWitness, hnegative, hzero, hrec] at hout
| some y =>
have hq : schurWitnessLift M y = q := by
simpa [rationalNegativeWitness, hnegative, hzero, hrec] using hout
subst q
rw [KS.W07.fin_schurWitnessLift_quadratic M hM hzero y]
exact ih (schurTail M) (schurTail_isSymm M hM) y hrec
theorem computedPSDSeparator_separates (n : ℕ)
(M : Matrix (Fin n) (Fin n) ℚ) (hM : M.IsSymm) (q : Fin n → ℚ)
(hout : rationalNegativeWitness n M = some q) :
0 < psdCutEvalReal q (fun i j => (M i j : ℝ)) ∧
∀ B : Matrix (Fin n) (Fin n) ℝ, B.PosSemidef → psdCutEvalReal q B ≤ 0 :=
psdWitness_separates q M (rationalNegativeWitness_sound n M hM q hout)
end KS.W17
end
end OAI

Xet Storage Details

Size:
2.8 kB
·
Xet hash:
9cf4fadad83dca1d1a46ce791ced92e7f394dbd745145ec531c223d4af2b944f

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