Exact Fourier circuits: circuit cost #
Adapted from OpenAI's formalization at revision adc7f1241b42e322a6451854ab7e4b4c146bf78a.
Source: https://github.com/openai/math/blob/adc7f1241b42e322a6451854ab7e4b4c146bf78a/lean/OAI/Computability/FourierCircuit/CircuitCost.lean
Imports, namespaces, module visibility, documentation, and formatting are adapted for complexitylib. The source theorem statements and mathematical arguments are retained.
@[simp]
theorem
Complexity.ExactFourier.CircuitCost.cost_monomial
{α : Type}
[Fintype α]
[DecidableEq α]
(M : Matrix α α ℂ)
(hM : MonomialMatrix M)
:
def
Complexity.ExactFourier.TypedDAG.stackDepFin
{α : Type}
[Fintype α]
(n : ℕ)
(D : Fin n → Type)
[inst : (i : Fin n) → Fintype (D i)]
:
Stack a finite list of circuits with potentially different output types.
Equations
- One or more equations did not get rendered due to their size.
- Complexity.ExactFourier.TypedDAG.stackDepFin 0 x_4 x_6 = Complexity.ExactFourier.TypedDAG.wires fun (x : (i : Fin 0) × x_4 i) => none
Instances For
noncomputable def
Complexity.ExactFourier.TypedDAG.stackDep
{α : Type}
[Fintype α]
{σ : Type}
[Fintype σ]
(D : σ → Type)
[(i : σ) → Fintype (D i)]
(C : (i : σ) → TypedDAG α (D i))
:
TypedDAG α ((i : σ) × D i)
Stack a dependently indexed family of circuits sharing the same input.
Equations
- One or more equations did not get rendered due to their size.
Instances For
theorem
Complexity.ExactFourier.CircuitCost.cost_blocks
{σ : Type}
[Fintype σ]
[DecidableEq σ]
{D : σ → Type}
[(i : σ) → Fintype (D i)]
(M : (i : σ) → Matrix (D i) (D i) ℂ)
:
theorem
Complexity.ExactFourier.Layered.blocks
{σ : Type}
[Fintype σ]
[DecidableEq σ]
(D : σ → Type)
[(i : σ) → Fintype (D i)]
[(i : σ) → DecidableEq (D i)]
(M : (i : σ) → Matrix (D i) (D i) ℂ)
(d : ℕ)
(hM : ∀ (i : σ), Layered (M i) d)
:
Layered (Matrix.blockDiagonal' M) d
theorem
Complexity.ExactFourier.Layered.blockDiagonal
{α σ : Type}
[Fintype α]
[Fintype σ]
[DecidableEq α]
[DecidableEq σ]
(M : σ → Matrix α α ℂ)
(d : ℕ)
(hM : ∀ (i : σ), Layered (M i) d)
:
Layered (Matrix.blockDiagonal M) d
theorem
Complexity.ExactFourier.Layered.two_reindex
{α β : Type}
[Fintype α]
[Fintype β]
[DecidableEq α]
[DecidableEq β]
{M : Matrix α α ℂ}
{d : ℕ}
(h : Layered M d)
(e f : α ≃ β)
:
Layered ((Matrix.reindex e f) M) (d + 1)
A parallel layer generated by monomial matrices and invertible two-coordinate gates.
- mono {α : Type} [Fintype α] [DecidableEq α] (M : Matrix α α ℂ) (h : MonomialMatrix M) : Round M
- pair (M : Matrix (Fin 2) (Fin 2) ℂ) (h : IsUnit M) : Round M
- reindex {α β : Type} [Fintype α] [Fintype β] [DecidableEq α] [DecidableEq β] (e : α ≃ β) {M : Matrix α α ℂ} (h : Round M) : Round ((Matrix.reindex e e) M)
- sum {α β : Type} [Fintype α] [Fintype β] [DecidableEq α] [DecidableEq β] {M : Matrix α α ℂ} {N : Matrix β β ℂ} (hM : Round M) (hN : Round N) : Round (Matrix.fromBlocks M 0 0 N)
Instances For
def
Complexity.ExactFourier.Round.joint
{α β : Type}
(M : List (Matrix α α ℂ))
(N : List (Matrix β β ℂ))
:
Pair corresponding rounds of two lists by taking their block direct sums.
Equations
- Complexity.ExactFourier.Round.joint M N = List.zipWith (fun (X : Matrix α α ℂ) (Y : Matrix β β ℂ) => Matrix.fromBlocks X 0 0 Y) M N
Instances For
theorem
Complexity.ExactFourier.Round.joint_all
{α β : Type}
(M : List (Matrix α α ℂ))
(N : List (Matrix β β ℂ))
(P : Matrix α α ℂ → Prop)
(Q : Matrix β β ℂ → Prop)
(R : Matrix (α ⊕ β) (α ⊕ β) ℂ → Prop)
(hM : ∀ X ∈ M, P X)
(hN : ∀ X ∈ N, Q X)
(hR : ∀ (X : Matrix α α ℂ) (Y : Matrix β β ℂ), P X → Q Y → R (Matrix.fromBlocks X 0 0 Y))
(X : Matrix (α ⊕ β) (α ⊕ β) ℂ)
: