Documentation

Complexitylib.Circuits.ExactFourier.Internal.SparseSpectral

Exact Fourier circuits: sparse spectral #

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

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

theorem Complexity.ExactFourier.SparseReflection.spectral_price {α : Type} [Fintype α] [DecidableEq α] (p : MatrixPrice) (A : Matrix α α ℝ) (hA : A.IsSymm) (d : α → ℂ) (L : List (PairTerm α)) (hL : RealMatrix.complex A = Matrix.diagonal d + (List.map PairTerm.direction L).sum) :
∃ (R : Matrix α α ℂ) (T : Matrix α α ℂ), R * R = 1 ∧ R.IsSymm ∧ RealMatrix.complex A * (1 + R) = 0 ∧ 1 - R = RealMatrix.complex A * T ∧ p.value R ≤ 3 / 2 * ↑L.length + 2 * ↑(Fintype.card α)

Algebraic certificate for the real orthogonal reflection in the kernel, together with its uniform sparse price. Both annihilator equations are retained.

noncomputable def Complexity.ExactFourier.SparseReflection.pairs {α : Type} [Fintype α] [LinearOrder α] (A : Matrix α α ℂ) :
Finset (α × α)

Strictly upper-triangular positions carrying nonzero entries.

Equations
Instances For
    @[simp]
    theorem Complexity.ExactFourier.SparseReflection.mem_pairs {α : Type} [Fintype α] [LinearOrder α] (A : Matrix α α ℂ) (ij : α × α) :
    ij ∈ pairs A ↔ ij.1 < ij.2 ∧ A ij.1 ij.2 ≠ 0
    def Complexity.ExactFourier.SparseReflection.term {α : Type} [Fintype α] [LinearOrder α] (A : Matrix α α ℂ) (hA : A.IsSymm) (ij : ↥(pairs A)) :

    The pair term associated with one nonzero off-diagonal entry of a symmetric matrix.

    Equations
    Instances For
      noncomputable def Complexity.ExactFourier.SparseReflection.terms {α : Type} [Fintype α] [LinearOrder α] (A : Matrix α α ℂ) (hA : A.IsSymm) :

      List the pair terms corresponding to all nonzero upper-triangular entries.

      Equations
      Instances For
        theorem Complexity.ExactFourier.SparseReflection.terms_sum {α : Type} [Fintype α] [LinearOrder α] (A : Matrix α α ℂ) (hA : A.IsSymm) :
        (List.map PairTerm.direction (terms A hA)).sum = ∑ ij ∈ pairs A, (Matrix.single ij.1 ij.2 (A ij.1 ij.2) + Matrix.single ij.2 ij.1 (A ij.2 ij.1))
        theorem Complexity.ExactFourier.SparseReflection.exists_reflection {α : Type} [Fintype α] [LinearOrder α] (p : MatrixPrice) (A : Matrix α α ℂ) (hA : A.IsSymm) (hreal : ∀ (i j : α), star (A i j) = A i j) :
        ∃ (R : Matrix α α ℂ) (T : Matrix α α ℂ), R * R = 1 ∧ R.IsSymm ∧ A * (1 + R) = 0 ∧ 1 - R = A * T ∧ p.value R ≤ 3 / 2 * ↑(pairs A).card + 2 * ↑(Fintype.card α)

        Uniform sparse reflection certificate, with supported unordered pairs counted exactly. The annihilator identities characterize the reflection when A is real symmetric.

        theorem Complexity.ExactFourier.SparseReflection.exists_reflection_nnz {α : Type} [Fintype α] [LinearOrder α] (p : MatrixPrice) (A : Matrix α α ℂ) (hA : A.IsSymm) (hreal : ∀ (i j : α), star (A i j) = A i j) :
        ∃ (R : Matrix α α ℂ) (T : Matrix α α ℂ), R * R = 1 ∧ R.IsSymm ∧ A * (1 + R) = 0 ∧ 1 - R = A * T ∧ p.value R ≤ 3 / 4 * ↑(nnz A) + 2 * ↑(Fintype.card α)
        theorem Complexity.ExactFourier.SymLap.relations {α : Type} [Fintype α] [DecidableEq α] (G J R T M A : Matrix α α ℂ) (hJ : IsUnit J) (hG : IsUnit G) (hA : A = J * G * (1 - M)) (hs : A.IsSymm) (hk : A * (1 + M) = 0) (hp : A * (1 + R) = 0) (hm : 1 - R = A * T) :
        M * (1 + R) = 1 + R ∧ M.transpose * (1 - R) = -(1 - R)
        theorem Complexity.ExactFourier.SymLap.exists_tensor_reflection {α : Type} [Fintype α] [DecidableEq α] (p : MatrixPrice) (G J : Matrix α α ℂ) (hG : G * G = 1) (hJ : MonomialMatrix J) (s : ℂ) (hs : s * s = 1) (ht : J.transpose = s • J) (hc : J * G = G.transpose * J) (hrG : ∀ (i j : α), star (G i j) = G i j) (hrJ : ∀ (i j : α), star (J i j) = J i j) :
        ∃ (R : Matrix (α × α) (α × α) ℂ), R * R = 1 ∧ R.IsSymm ∧ tensor G * (1 + R) = 1 + R ∧ (tensor G).transpose * (1 - R) = -(1 - R) ∧ p.value R ≤ 3 / 4 * (2 * ↑(nnz G) * ↑(Fintype.card α)) + 2 * ↑(Fintype.card α) ^ 2
        theorem Complexity.ExactFourier.SignedBits.D_parity (m : ℕ) (i j : Bits m) :
        parity m i = parity m j → D m i j = 0
        theorem Complexity.ExactFourier.SignedBits.Gamma_parity (m : ℕ) (i j : Bits (m + 1)) :
        parity (m + 1) i = parity (m + 1) j → Gamma m i j = 0

        Reorder bit strings so that the two halves separate even and odd parity.

        Equations
        Instances For

          Exchange the two equal-sized coordinate blocks.

          Equations
          Instances For

            Apply a two-coordinate Hadamard transform to each pair of corresponding coordinates.

            Equations
            Instances For
              noncomputable def Complexity.ExactFourier.GraphReflection.graph {α : Type} [Fintype α] [DecidableEq α] (B : Matrix α α ℂ) :
              Matrix (α ⊕ α) (α ⊕ α) ℂ

              The block involution with off-diagonal blocks B and B⁻¹.

              Equations
              Instances For
                theorem Complexity.ExactFourier.GraphReflection.gram_unit {α : Type} [Fintype α] [DecidableEq α] (B : Matrix α α ℂ) (hB : ∀ (i j : α), star (B i j) = B i j) :
                @[reducible, inline]

                One parity half of the tensor-square bit-string coordinate space.

                Equations
                Instances For

                  Regroup tensor-square coordinates by the parity of the first factor.

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

                    The signed tensor involution written in coordinates grouped by parity.

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

                      The upper-right block of the parity decomposition of the signed tensor involution.

                      Equations
                      Instances For