Rational hitting lists: binary binomial #
Adapted from OpenAI's formalization at revision adc7f1241b42e322a6451854ab7e4b4c146bf78a.
Source: https://github.com/openai/math/blob/adc7f1241b42e322a6451854ab7e4b4c146bf78a/lean/OAI/Computability/RationalHitting/BinaryBinomial.lean
Imports, namespaces, module visibility, documentation, and formatting are adapted for complexitylib. The source theorem statements and mathematical arguments are retained.
Clean multiplication interface used by the finite rising-product loop.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Embed the multiplication registers in the factorial register bank.
Instances For
One rising-product step: multiply accumulator by the copied current index, advance the binary index, and drop one symbol of the unary loop counter.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Repeat factorial multiplication over the unary counter.
Equations
Instances For
Rising products, with a unary iteration budget obtained from the input. No scalar factorial operation occurs in this fixed finite program.
Ordinary factorial on unary n, including zero, with polynomial bit cost. The two binary registers initially contain 1; no computed value is an input.
Factorial with clean local registers: only the unary counter and output register are changed. This is the binary subroutine for the Taylor binomials.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Cancel one unary digit, recording when the minuend is exhausted.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Subtract unary counters while retaining an underflow flag.
Equations
Instances For
Variable-length subtraction of unary loop counters. The leftover flag is nonempty exactly when the second counter exceeded the first.
Embed the arithmetic register bank in the binomial-coefficient program.
Instances For
Compute one factorial and copy its binary result to the chosen register.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Stack-step bound for a factorial block, including copies and cleanup.
Equations
Instances For
Initial register store containing the two unary binomial arguments.
Equations
- Complexity.RationalHitting.StackLanguage.Binomial.input n k = Function.update (Function.update (fun (x : Fin 18) => []) 14 (List.replicate n true)) 15 (List.replicate k true)
Instances For
The input store extended with both truncated differences of its arguments.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Compute the unary difference and underflow flag for binomial evaluation.
Equations
- One or more equations did not get rendered due to their size.