Correctness and state cost of the binary liveness scanner #
Descending column order lets a countdown retain the selected target vertex. The codeword transition relation is exactly the relation being encoded. The arbitrary-word-encoding lower bound then applies with no state loss.
theorem
Complexity.FiniteAutomaton.BinaryLiveness.evalFrom_carry_rows_stop
(n : ℕ)
(i : Fin (n + 1))
(rows : List (ℕ → Bool))
:
(machine n).evalFrom {State.carry i} (List.flatMap (rowWord n) rows ++ [Letter.stop]) = {State.seek i}
theorem
Complexity.FiniteAutomaton.BinaryLiveness.evalFrom_encode
{n : ℕ}
(w : List (BRel (Fin (n + 1))))
(S : Set (Fin (n + 1)))
:
(machine n).evalFrom (State.seek '' S) (List.flatMap code w) = State.seek '' (livenessNFA (n + 1)).evalFrom S w