Documentation

Complexitylib.Circuits.ExactFourier.Internal.MatrixRelabel

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.

theorem Complexity.ExactFourier.reindex_mulVec {α β γ δ : Type} [Fintype α] [Fintype γ] (e : β ≃ δ) (f : α ≃ γ) (M : Matrix β α ℂ) (x : γ → ℂ) :
((Matrix.reindex e f) M).mulVec x = M.mulVec (x ∘ ⇑f) ∘ ⇑e.symm

The Fourier matrix associated with the specified size and complex root.

Equations
Instances For

    The block butterfly matrix combining even and odd Fourier transforms.

    Equations
    Instances For

      Interleave two coordinate blocks into the even and odd positions.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        theorem Complexity.ExactFourier.RadixTwo.dft_step (n : ℕ) (ω : ℂ) (hω : ω ^ n = -1) :
        dft (n + n) ω = (Matrix.reindex finSumFinEquiv (paritySumEquiv n)) (butterfly n ω * Matrix.fromBlocks (dft n (ω ^ 2)) 0 0 (dft n (ω ^ 2)))
        theorem Complexity.ExactFourier.RadixTwo.dft_layers (k : ℕ) (ω : ℂ) (hω : IsPrimitiveRoot ω (2 ^ k)) :
        Layered (dft (2 ^ k) ω) (2 * k)

        The Newton basis polynomial with roots at the first k powers of ω.

        Equations
        Instances For

          The product of 1 - ω^j for exponents from one through i.

          Equations
          Instances For

            The product of the negatives of the first k powers of ω.

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

              Evaluate the Newton basis at successive powers of ω.

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

                The coefficient matrix expressing the Newton basis in the monomial basis.

                Equations
                Instances For
                  theorem Complexity.ExactFourier.NewtonFourier.H_succ (ω : ℂ) (i : ℕ) :
                  H ω (i + 1) = H ω i * (1 - ω ^ (i + 1))
                  theorem Complexity.ExactFourier.NewtonFourier.eval_factor (ω : ℂ) (i k : ℕ) (hki : k ≤ i) :
                  Polynomial.eval (ω ^ i) (newton ω k) * H ω (i - k) = scale ω k * H ω i
                  theorem Complexity.ExactFourier.NewtonFourier.H_ne_zero {ω : ℂ} {n : ℕ} (hω : IsPrimitiveRoot ω n) {i : ℕ} (hi : i < n) :
                  H ω i ≠ 0
                  theorem Complexity.ExactFourier.Layered.inverse {α : Type} [Fintype α] [DecidableEq α] {M : Matrix α α ℂ} {d : ℕ} (h : Layered M d) :
                  theorem Complexity.ExactFourier.Layered.conjugate {α : Type} [Fintype α] [DecidableEq α] {M N : Matrix α α ℂ} {d e : ℕ} (hM : Layered M d) (hN : Layered N e) :
                  Layered (M * N * M⁻¹) (2 * d + e)
                  theorem Complexity.ExactFourier.Layered.rect_add {α β : Type} [Fintype α] [Fintype β] [DecidableEq α] [DecidableEq β] {G H : Matrix α β ℂ} {d e : ℕ} (hG : Layered (rectangularShear G) d) (hH : Layered (rectangularShear H) e) :
                  Layered (rectangularShear (G + H)) (d + e)
                  theorem Complexity.ExactFourier.Layered.rect_mul_left {α β : Type} [Fintype α] [Fintype β] [DecidableEq α] [DecidableEq β] {M : Matrix α α ℂ} {G : Matrix α β ℂ} {d e : ℕ} (hM : Layered M d) (hG : Layered (rectangularShear G) e) :
                  Layered (rectangularShear (M * G)) (2 * d + e)
                  theorem Complexity.ExactFourier.Layered.rect_mul_right {α β : Type} [Fintype α] [Fintype β] [DecidableEq α] [DecidableEq β] {M : Matrix β β ℂ} {G : Matrix α β ℂ} {d e : ℕ} (hM : Layered M d) (hG : Layered (rectangularShear G) e) :
                  Layered (rectangularShear (G * M)) (2 * d + e)
                  def Complexity.ExactFourier.Layered.swapLast {α β γ : Type} :
                  (α ⊕ γ) ⊕ β ≃ α ⊕ β ⊕ γ

                  Reassociate three coordinate blocks and exchange the last two.

                  Equations
                  Instances For
                    theorem Complexity.ExactFourier.Layered.rect_product_stable {α β γ : Type} [Fintype α] [Fintype β] [Fintype γ] [DecidableEq α] [DecidableEq β] [DecidableEq γ] {G : Matrix α β ℂ} {H : Matrix β γ ℂ} {d e : ℕ} (hG : Layered (rectangularShear G) d) (hH : Layered (rectangularShear H) e) :
                    Layered (Matrix.fromBlocks (rectangularShear (G * H)) 0 0 1) (2 * (d + e))
                    theorem Complexity.ExactFourier.Layered.rect_submatrix_stable {α β γ : Type} [Fintype α] [Fintype β] [Fintype γ] [DecidableEq α] [DecidableEq β] [DecidableEq γ] {M : Matrix γ γ ℂ} {d : ℕ} (hM : Layered M d) (e : α ↪ γ) (f : β ↪ γ) :
                    Layered (Matrix.fromBlocks (rectangularShear (M.submatrix ⇑e ⇑f)) 0 0 1) (4 * d + 4)