Exact Fourier circuits: shears #
Adapted from OpenAI's formalization at revision adc7f1241b42e322a6451854ab7e4b4c146bf78a.
Source: https://github.com/openai/math/blob/adc7f1241b42e322a6451854ab7e4b4c146bf78a/lean/OAI/Computability/FourierCircuit/Shears.lean
Imports, namespaces, module visibility, documentation, and formatting are adapted for complexitylib. The source theorem statements and mathematical arguments are retained.
Each internal gate starts at an arbitrary dirty value, and its computed linear combination is added to that value. The literal zero remains literal zero.
Equations
Instances For
An elementary operation adding a scalar multiple of one coordinate to another.
Equations
Instances For
Execute elementary shears from left to right on the input vector.
Equations
- Complexity.ExactFourier.runShears W v = List.foldl (fun (v : ι → ℂ) (t : Complexity.ExactFourier.Shear ι) => t.act v) v W
Instances For
Reverse the execution order and invert every shear to undo a computation.
Instances For
none is the literal input zero, not a physical workspace coordinate.
Equations
- Complexity.ExactFourier.readCoord r v = r.elim 0 v
Instances For
Combine the input vector, free zero, and scratch coordinates into one wire vector.
Equations
- Complexity.ExactFourier.available x z i = Fin.addCases (Fin.snoc x 0) z i
Instances For
The scratch-coordinate outputs of a program started with arbitrary scratch values.
Equations
- p.dirtyScratch x z i = p.dirtyEval x z (Fin.natAdd (n + 1) i)
Instances For
The full forward-sweep construction, with one coordinate per gate and NO zero register. Its exact semantic statement is uniform in arbitrary dirty initial values.