Rational hitting lists: rational binary #
Adapted from OpenAI's formalization at revision adc7f1241b42e322a6451854ab7e4b4c146bf78a.
Source: https://github.com/openai/math/blob/adc7f1241b42e322a6451854ab7e4b4c146bf78a/lean/OAI/Computability/RationalHitting/RationalBinary.lean
Imports, namespaces, module visibility, documentation, and formatting are adapted for complexitylib. The source theorem statements and mathematical arguments are retained.
Euclid followed by two binary divisions, destructively producing the coprime numerator and positive denominator magnitudes.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Consume a word, emitting its unary length, independently of its bits.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Canonical output's self-delimiting natural-number encoding, applied to an already canonical little-endian binary word.
Equations
Instances For
Write a self-delimiting binary word with its unary length prefix.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Registers 12 and 13 hold signed-magnitude signs; 15 stores the canonical result's sign and remains disjoint from the twelve arithmetic registers.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Embed fraction-reduction registers into the rational-encoding program.
Equations
Instances For
Full signed canonical rational output. No gcd, comparison or sign oracle occurs in this fixed finite binary-stack program.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Exact final canonical binary fraction, with a cubic bit-time stack implementation. This supplies the output-format obligation of the uniform list generator.