Exact Fourier circuits: matrix relabel #
Adapted from OpenAI's formalization at revision adc7f1241b42e322a6451854ab7e4b4c146bf78a.
Source: https://github.com/openai/math/blob/adc7f1241b42e322a6451854ab7e4b4c146bf78a/lean/OAI/Computability/FourierCircuit/MatrixRelabel.lean
Imports, namespaces, module visibility, documentation, and formatting are adapted for complexitylib. The source theorem statements and mathematical arguments are retained.
The block butterfly matrix combining even and odd Fourier transforms.
Equations
- Complexity.ExactFourier.RadixTwo.butterfly n ω = Matrix.fromBlocks 1 (Matrix.diagonal fun (i : Fin n) => ω ^ ↑i) 1 (-Matrix.diagonal fun (i : Fin n) => ω ^ ↑i)
Instances For
The Newton basis polynomial with roots at the first k powers of ω.
Equations
- Complexity.ExactFourier.NewtonFourier.newton ω k = ∏ j ∈ Finset.range k, (Polynomial.X - Polynomial.C (ω ^ j))
Instances For
The product of 1 - ω^j for exponents from one through i.
Equations
- Complexity.ExactFourier.NewtonFourier.H ω i = ∏ j ∈ Finset.range i, (1 - ω ^ (j + 1))
Instances For
The product of the negatives of the first k powers of ω.
Equations
- Complexity.ExactFourier.NewtonFourier.scale ω k = ∏ j ∈ Finset.range k, -ω ^ j
Instances For
Evaluate the Newton basis at successive powers of ω.
Equations
- Complexity.ExactFourier.NewtonFourier.N n ω i k = Polynomial.eval (ω ^ ↑i) (Complexity.ExactFourier.NewtonFourier.newton ω ↑k)
Instances For
The coefficient matrix expressing the Newton basis in the monomial basis.
Equations
Instances For
Reassociate three coordinate blocks and exchange the last two.
Equations
- Complexity.ExactFourier.Layered.swapLast = (Equiv.sumAssoc α γ β).trans ((Equiv.refl α).sumCongr (Equiv.sumComm γ β))