Documentation

Complexitylib.Circuits.ExactFourier.Defs

Exact Fourier circuits: core #

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

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

One charged scalar gate, referencing only available values.

  • add {w : ℕ} (i j : Fin w) : Gate w

    One charged addition.

  • sub {w : ℕ} (i j : Fin w) : Gate w

    One charged subtraction.

  • scale {w : ℕ} (c : ℂ) (i : Fin w) : Gate w

    One charged multiplication by an arbitrary complex scalar.

Instances For

    A topologically ordered scalar DAG; available values are never consumed.

    • nil {n : ℕ} : Program n 0

      Initial inputs and a free zero wire.

    • step {n k : ℕ} (p : Program n k) (g : Gate (n + 1 + k)) : Program n (k + 1)

      Append one operation whose operands are already available.

    Instances For
      def Complexity.ExactFourier.Program.eval {n k : ℕ} :
      Program n k → (Fin n → ℂ) → Fin (n + 1 + k) → ℂ

      All available values, with inputs first, then zero, then computed gate values.

      Equations
      Instances For

        Outputs name available values, so permutations and arbitrary fanout are uncharged.

        • size : ℕ

          The number of charged scalar operations.

        • program : Program n self.size

          The topologically ordered operations.

        • outputs : Fin n → Fin (n + 1 + self.size)

          A freely chosen available wire for each output coordinate.

        Instances For
          def Complexity.ExactFourier.Circuit.eval {n : ℕ} (C : Circuit n) (x : Fin n → ℂ) :
          Fin n → ℂ

          Read all designated outputs after evaluating the program.

          Equations
          Instances For
            noncomputable def Complexity.ExactFourier.zeta (n : ℕ) :

            The standard complex root used by the exact discrete Fourier transform.

            Equations
            Instances For
              noncomputable def Complexity.ExactFourier.fourierMatrix (n : ℕ) :
              Matrix (Fin n) (Fin n) ℂ

              The unnormalized DFT matrix, with positive exponential sign.

              Equations
              Instances For

                Exact matrix multiplication on every complex input vector.

                Equations
                Instances For

                  Arbitrarily large sizes admit circuits below any fixed multiple of n * log₂ n.

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For