Rational hitting lists: stack words #
Adapted from OpenAI's formalization at revision adc7f1241b42e322a6451854ab7e4b4c146bf78a.
Source: https://github.com/openai/math/blob/adc7f1241b42e322a6451854ab7e4b4c146bf78a/lean/OAI/Computability/RationalHitting/StackWords.lean
Imports, namespaces, module visibility, documentation, and formatting are adapted for complexitylib. The source theorem statements and mathematical arguments are retained.
Empty a stack by repeatedly dropping its head.
Equations
Instances For
Move a stack onto another stack in reverse order.
Equations
Instances For
Copy a nonempty head to another register without consuming it.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Two simultaneous reversed copies of a word, consuming the operand.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Copy an arbitrary binary word, restoring the operand and clearing temporary storage; all registers have fixed indices.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Little-endian binary words; zero has the empty word.
Equations
Instances For
Increment a little-endian binary word, allowing a new high bit.
Equations
Instances For
Separate the initial carry chain from the incremented remainder.
Equations
- Complexity.RationalHitting.StackLanguage.carrySplit [] = (0, [true])
- Complexity.RationalHitting.StackLanguage.carrySplit (false :: l) = (0, true :: l)
- Complexity.RationalHitting.StackLanguage.carrySplit (true :: l) = ((Complexity.RationalHitting.StackLanguage.carrySplit l).1 + 1, (Complexity.RationalHitting.StackLanguage.carrySplit l).2)
Instances For
One carry-propagation step of binary increment.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Propagate the increment carry until the flag is cleared.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Increment a binary stack word and restore its orientation.
Equations
- One or more equations did not get rendered due to their size.