Documentation

Complexitylib.Circuits.ExactFourier.Internal.FFTCircuit

Exact Fourier circuits: fftcircuit #

Adapted from OpenAI's formalization at revision adc7f1241b42e322a6451854ab7e4b4c146bf78a. Source: https://github.com/openai/math/blob/adc7f1241b42e322a6451854ab7e4b4c146bf78a/lean/OAI/Computability/FourierCircuit/FFTCircuit.lean

Imports, namespaces, module visibility, documentation, and formatting are adapted for complexitylib. The source theorem statements and mathematical arguments are retained.

theorem Complexity.ExactFourier.RadixTwo.exists_fft_dag (k : ℕ) (ω : ℂ) (hω : IsPrimitiveRoot ω (2 ^ k)) :
∃ (C : LinearDAG (2 ^ k) (2 ^ k)), C.size ≤ 3 * k * 2 ^ k ∧ ∀ (x : Fin (2 ^ k) → ℂ), C.eval x = eval (2 ^ k) ω x

Select an input index when present and otherwise select the free zero wire.

Equations
Instances For

    Extend or truncate an input vector to the requested length using zeros.

    Equations
    Instances For

      A fixed diagonal layer charges exactly one multiplication per coordinate.

      Equations
      Instances For
        theorem Complexity.ExactFourier.ScalarConvolution.diagonalDAG_eval {m : ℕ} (c x : Fin m → ℂ) :
        (diagonalDAG c).eval x = fun (i : Fin m) => c i * x i
        theorem Complexity.ExactFourier.ScalarConvolution.convolution_dag_at_power (k t : ℕ) (ht : 0 < t) (htm : 2 * t ≤ 2 ^ k) (f : Polynomial ℂ) (hf : f.natDegree < t) :
        ∃ (C : LinearDAG t t), C.size ≤ (6 * k + 1) * 2 ^ k ∧ ∀ (x : Fin t → ℂ) (i : Fin t), C.eval x i = (f * (Polynomial.ofFn t) x).coeff ↑i

        Polynomial convolution on any containing radix-two length.

        theorem Complexity.ExactFourier.ScalarConvolution.exists_truncation_dag (t : ℕ) (ht : 0 < t) (f : PowerSeries ℂ) :
        ∃ (C : LinearDAG t t), C.size ≤ 52 * t * (Nat.log 2 t + 1) ∧ ∀ (x : Fin t → ℂ), C.eval x = (CoefficientTime.truncMatrix t f).mulVec x

        Uniform linear-DAG construction, with logarithmic cost independent of coefficients.

        The literal O(t log(2t)) estimate, with one absolute constant, uniform in f and t.

        theorem Complexity.ExactFourier.Cascade.q_constant {α β : Type} [Fintype α] [Fintype β] [DecidableEq α] [DecidableEq β] (M : Matrix α α ℂ) (C : Matrix α β ℂ) (B : Matrix β α ℂ) (D : Matrix β β ℂ) (hM : IsUnit M) (k : ℕ) :
        theorem Complexity.ExactFourier.Cascade.uniform_bound {α β : Type} [Fintype α] [Fintype β] [DecidableEq α] [DecidableEq β] (p : MatrixPrice) (M : Matrix α α ℂ) (C : Matrix α β ℂ) (B : Matrix β α ℂ) (D : Matrix β β ℂ) (hM : IsUnit M) (hK : IsUnit (Matrix.fromBlocks M C B D)) :
        ∃ (CK : ℝ), 0 ≤ CK ∧ ∀ (k t : ℕ), 0 < t → p.value ((CoefficientTime.blockTruncHom t) (TensorAxis.power (CellSeries.transfer M C B D) k)) ≤ ↑t * ↑(Fintype.card (TensorAxis.Fibers α k)) * p.value (Matrix.fromBlocks M C B D) + CK * (↑(Fintype.card α) ^ k * ↑t * Real.log (2 * ↑t) + (↑k + 1) ^ 3 * ↑(Fintype.card α) ^ k)