Exact Fourier circuits: linear dag #
Adapted from OpenAI's formalization at revision adc7f1241b42e322a6451854ab7e4b4c146bf78a.
Source: https://github.com/openai/math/blob/adc7f1241b42e322a6451854ab7e4b4c146bf78a/lean/OAI/Computability/FourierCircuit/LinearDAG.lean
Imports, namespaces, module visibility, documentation, and formatting are adapted for complexitylib. The source theorem statements and mathematical arguments are retained.
Relabel every input wire of a scalar gate.
Equations
- Complexity.ExactFourier.Gate.map f (Complexity.ExactFourier.Gate.add i j) = Complexity.ExactFourier.Gate.add (f i) (f j)
- Complexity.ExactFourier.Gate.map f (Complexity.ExactFourier.Gate.sub i j) = Complexity.ExactFourier.Gate.sub (f i) (f j)
- Complexity.ExactFourier.Gate.map f (Complexity.ExactFourier.Gate.scale c i) = Complexity.ExactFourier.Gate.scale c (f i)
Instances For
Append a scalar program using the supplied references for its inputs and zero wire.
Equations
- p.append f Complexity.ExactFourier.Program.nil = p
- p.append f (q.step g) = (p.append f q).step (Complexity.ExactFourier.Gate.map (Complexity.ExactFourier.appendIndex f) g)
Instances For
Literal semantics of DAG composition, including preservation of every existing value.
Exact composition: all previous values can be reused without being consumed.
Equations
Instances For
Emit independent scalar operations, one cost unit per coordinate, with original operands still available after the whole layer.
Equations
- p.emit x_2 = p
- p.emit g = (p.emit (g ∘ Fin.castSucc)).step (Complexity.ExactFourier.Gate.map Complexity.ExactFourier.keepIndex (g (Fin.last a)))
Instances For
Read-only input relabeling and arbitrary fanout are genuinely free.
Equations
- Complexity.ExactFourier.LinearDAG.wires f = { size := 0, program := Complexity.ExactFourier.Program.nil, outputs := f }
Instances For
A rectangular vector layer still charges every scalar gate separately.
Equations
- Complexity.ExactFourier.LinearDAG.layer g = { size := 0 + a, program := Complexity.ExactFourier.Program.nil.emit g, outputs := Complexity.ExactFourier.gateIndex }
Instances For
Append a scaled original input into each existing output accumulator. The two scalar operations per row are charged even for a zero scalar.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Direct multiplication: this construction will be used only for the fixed spatial matrices in the coefficient-boundary comparison, not as a purported FFT saving.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Quantitative version of the two-way pre-corner argument, with no hidden inverse
oracle: D is an actual charged DAG computing the inverse map.
Uniform finite upper bound needed in the compactness branch. It does not assert that any price exists; it is a consequence of the standing price laws.