Rational hitting lists: finite compiler #
Adapted from OpenAI's formalization at revision adc7f1241b42e322a6451854ab7e4b4c146bf78a.
Source: https://github.com/openai/math/blob/adc7f1241b42e322a6451854ab7e4b4c146bf78a/lean/OAI/Computability/RationalHitting/FiniteCompiler.lean
Imports, namespaces, module visibility, documentation, and formatting are adapted for complexitylib. The source theorem statements and mathematical arguments are retained.
Program-dependent coefficient bounding stack-access simulation overhead.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The multi-track tape alphabet used to simulate the Boolean stacks.
Equations
- Complexity.RationalHitting.StackLanguage.Compiler.TapeAlphabet K = Turing.TM2to1.Γ' K fun (x : K) => Bool
Instances For
The tape-machine control labels produced by stack compilation.
Equations
Instances For
The finite tape-machine support generated by the stack program.
Equations
Instances For
Program-dependent coefficient bounding compilation to ordinary tape steps.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A single finite-state TM0, independent of the input word, with quadratic cost in stack execution time plus input length. The output is the encoded family of stacks.
Number of deferred writes along the longest branch.
Equations
- One or more equations did not get rendered due to their size.
- Complexity.RationalHitting.TMTime.Alphabet.writesWeight (Turing.TM1.Stmt.move a q) = Complexity.RationalHitting.TMTime.Alphabet.writesWeight q
- Complexity.RationalHitting.TMTime.Alphabet.writesWeight (Turing.TM1.Stmt.load a q) = Complexity.RationalHitting.TMTime.Alphabet.writesWeight q
- Complexity.RationalHitting.TMTime.Alphabet.writesWeight (Turing.TM1.Stmt.write a q) = Complexity.RationalHitting.TMTime.Alphabet.writesWeight q + 1
- Complexity.RationalHitting.TMTime.Alphabet.writesWeight (Turing.TM1.Stmt.goto a) = 0
- Complexity.RationalHitting.TMTime.Alphabet.writesWeight Turing.TM1.Stmt.halt = 0
Instances For
Alphabet coding adds at most one macrostep per deferred write.
Linear macrostep time overhead for the finite-alphabet compiler. Physical moves and reads are subsequently counted by the quantitative TM1->TM0 compiler.
Polynomial-time compilation to a binary finite-state TM0, preserving an explicit fixed block encoding.
Every fixed finite-control TM1 has an ordinary finite-state TM0 compiling all runs at a fixed linear cost and preserving the literal tape.