Rational hitting lists: binary factorial #
Adapted from OpenAI's formalization at revision adc7f1241b42e322a6451854ab7e4b4c146bf78a.
Source: https://github.com/openai/math/blob/adc7f1241b42e322a6451854ab7e4b4c146bf78a/lean/OAI/Computability/RationalHitting/BinaryFactorial.lean
Imports, namespaces, module visibility, documentation, and formatting are adapted for complexitylib. The source theorem statements and mathematical arguments are retained.
One Euclidean algorithm step on binary stack words.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Repeat Euclidean reduction until the second operand is zero.
Equations
Instances For
The scratch-register emptiness invariant for the Euclidean algorithm.
Equations
Instances For
No value-sized fuel: the compiler executes an ordinary while loop, and Euclid's product-halving supplies a bound linear in the input bit lengths.
Destructive exact binary quotient, retaining its positive denominator.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Extra work registers for retaining numerator and denominator through Euclid.
Instances For
The clean-register invariant for reducing a rational fraction.
Equations
- Complexity.RationalHitting.StackLanguage.FractionScratch s = ∀ (k : Fin 10), k ≠ 0 → k ≠ 5 → s (Complexity.RationalHitting.StackLanguage.fractionArith k) = []