NLAlib.SpectralBisection.downLevel_writes
Library · theorem
A complete allocated level returns its records and successor inputs, then frees scratch. The geometry premise describes arbitrary fresh storage, independently of all numeric words. A fragment of NLAlib.SpectralBisection.bisectionRoutine.
NLAlib.SpectralBisection.downLevel_writes {K Op Tst : Type} [Inhabited K] [Ops.Has Ops.ScalarOp Op]
[Ops.Has Ops.IndexOp Op] [Ops.Has Ops.SampleOp Op] [Ops.Has Ops.MatrixOp Op]
[Ops.Has Ops.CmpTst Tst] [Ops.Has Ops.IdxTst Tst] (M : Ops.Machine K) (dec : K → ℝ)
(mm : MatMulMap (K × K)) (qr : QRMap (K × K)) {I : Ops.Interp Op Tst K} {τ : Ops.Tape K}
{μ : Ops.Mem K} {n L fuel d base : ℕ} {par lv su sg ma ua qa ea sz kd kp c : ℕ × ℕ}
(R0 eps0 beta : K) (A : Matrix (Fin n) (Fin n) (K × K)) (hS : Ops.IsScalar M I)
(hL : Ops.IsIndexLit M I) (hC : Ops.IsCmp dec I)
(hMM : Ops.IsMatrixMul (Ops.EntryCodec.pair K) (fun {l m n} ↦ mm) I)
(hQR : Ops.IsMatrixQR (Ops.EntryCodec.pair K) (fun {m n} ↦ qr) I) (hQ : Ops.IsToNat dec I)
(hSample : Ops.IsSample I) (hexact : Ops.IsExactNatLit dec M (max n 4))
(hl : μ.Live [par, lv, su, sg, ma, ua, qa, ea, sz, kd, kp, c])
(hPos : μ.pos = base + d * SpectralBisection.levelSampleSize n)
(hLevel :
SpectralBisection.StoresLevel M
(SpectralBisection.tapeMachine M dec (fun {l m n} ↦ mm) (fun {m n} ↦ qr) n base τ) n fuel R0
beta { k := n, A := A, R := R0, ε := eps0, ℓ := L } d ma sz lv μ)
(hpar : μ.store.readBlock par.1 par.2 3 = some [R0, eps0, beta])
(hc :
μ.store.readBlock c.1 c.2 5 =
some [M.lit 1, M.lit 2, M.div (M.lit 1) (M.lit 2), M.neg (M.lit 1), M.sqrtHalf])
(hZero : ∀ j < n, μ.store.get sz.1 (sz.2 + n * (d + 1) + j) = some (M.lit 0))
(hGeometry :
∀ (s : Ops.Store K),
List.length s = List.length μ.store + 1 →
s.len (List.length μ.store) = 5 →
Ops.Store.Below (List.length μ.store) μ.store s →
SpectralBisection.DownLevelGeometry n d
(fun lo ↦
((fun lo ↦
SpectralBisection.nodeAtSlot
(SpectralBisection.tapeMachine M dec (fun {l m n} ↦ mm) (fun {m n} ↦ qr) n
base τ)
n fuel R0 beta { k := n, A := A, R := R0, ε := eps0, ℓ := L } d lo)
lo).k)
par lv su sg ma ua qa ea sz kd kp c (List.length μ.store, 0) s) :
Ops.Writes Ops.Mode.total I τ (SpectralBisection.downLevel SpectralBisection.node)
(Ops.Env.frame [n, L, fuel, d] [par, lv, su, sg, ma, ua, qa, ea, sz, kd, kp, c])
(SpectralBisection.downLevelOutputFp n d lv su sg ma ua qa ea sz kd kp)
(fun ν ↦
ν.pos = base + (d + 1) * SpectralBisection.levelSampleSize n ∧
SpectralBisection.StoresRecords M
(SpectralBisection.tapeMachine M dec (fun {l m n} ↦ mm) (fun {m n} ↦ qr) n base τ) n
fuel R0 beta { k := n, A := A, R := R0, ε := eps0, ℓ := L } d ma ua qa ea sz kd kp ν ∧
SpectralBisection.StoresLevel M
(SpectralBisection.tapeMachine M dec (fun {l m n} ↦ mm) (fun {m n} ↦ qr) n base τ) n
fuel R0 beta { k := n, A := A, R := R0, ε := eps0, ℓ := L } (d + 1) ma sz lv ν)
μImport NLAlib.Eigensolvers.SpectralBisection.DownLevelSolve.