The encoded step simulates the abstract one #
⚠️ Unreviewed by Bolton
Complexity.savStep is Savitch's recursion written on a bitstring, so that it
lands in FP; Complexity.Sav.step is the same recursion on an inductive state,
where it can be reasoned about. This file writes the encoding down and proves the
square commutes.
Main definitions #
Complexity.encFrm,Complexity.encSst— the encoding of a frame and a stateComplexity.savSem— the abstract step the encoded one simulates
Main results #
Complexity.savStep_encSst— one encoded step is one abstract stepComplexity.savStep_iterate_encSst— hence so is any number of them
Flags as booleans #
The base reachability test, as a boolean.
Equations
- Complexity.baseReachB tm R u v = (Complexity.baseReach tm R u v).headD false
Instances For
The base acceptance test, as a boolean.
Equations
- Complexity.baseAccB tm R rl u = (Complexity.baseAcc tm R rl u).headD false
Instances For
The encoding #
A state on the tape.
Equations
- Complexity.encSst R s = Complexity.mkSt [s.done] [s.ans] R (Complexity.encOpt s.ret) (Complexity.encStack (List.map Complexity.encFrm s.stk))
Instances For
The abstract step the encoded one runs.
Equations
- Complexity.savSem tm R = Complexity.Sav.step (Complexity.baseReachB tm R) (fun (u : List Bool) => Complexity.baseAccB tm R (Complexity.savRuler k R) u) (Complexity.savZero k R)
Instances For
The square commutes #
Iterating #
The root frame the recursion starts from.
Equations
- One or more equations did not get rendered due to their size.
Instances For
noncomputable def
Complexity.savInitSst
{k : ℕ}
(tm : NTM k)
(qp lp : Polynomial ℕ)
(x : List Bool)
:
The state Complexity.savInit builds, decoded.
Equations
- Complexity.savInitSst tm qp lp x = { done := false, ans := false, ret := none, stk := [Complexity.savRoot tm qp lp x] }
Instances For
theorem
Complexity.savInitSst_stkOk
{k : ℕ}
(tm : NTM k)
(qp lp : Polynomial ℕ)
(x : List Bool)
:
Sav.StkOk (savInitSst tm qp lp x)