OAI/Computability/FourierCircuit/LinearDAG.lean
34 declarations, 0 contain sorry, 0 declared as axioms
- def
OAI.ExactFourier.Gate.mapline 8 - theorem
OAI.ExactFourier.Gate.eval_mapline 13 - def
OAI.ExactFourier.appendIndexline 16 - def
OAI.ExactFourier.keepIndexline 21 - theorem
OAI.ExactFourier.appendIndex_lastline 24 - theorem
OAI.ExactFourier.appendIndex_castSuccline 34 - theorem
OAI.ExactFourier.keepIndex_succline 40 - theorem
OAI.ExactFourier.keepIndex_zeroline 43 - theorem
OAI.ExactFourier.appendIndex_zeroline 46 - def
OAI.ExactFourier.Program.appendline 51 - theorem
OAI.ExactFourier.Program.eval_appendline 57Source documentation
Literal semantics of DAG composition, including preservation of every existing value.
theorem Program.eval_append {n m k l : ℕ} (p : Program n k) (q : Program m l) (f : Fin (m + 1) → Fin (n + 1 + k)) (x : Fin n → ℂ) (y : Fin m → ℂ) (hf : ∀ (i : Fin (m + 1)), p.eval x (f i) = (Fin.snoc y 0 : Fin (m + 1) → ℂ) i) : (∀ j, (p.append f q).eval x (keepIndex j) = p.eval x j) ∧ (∀ i, (p.append f q).eval x (appendIndex f i) = q.eval y i) := by …Mentions: OAI.ExactFourier.Program, OAI.ExactFourier.Program.eval, OAI.ExactFourier.keepIndex, OAI.ExactFourier.appendIndex
- def
OAI.ExactFourier.LinearDAG.compline 86Source documentation
Exact composition: all previous values can be reused without being consumed.
noncomputable def LinearDAG.comp {n a b : ℕ} (D : LinearDAG a b) (C : LinearDAG n a) : LinearDAG n b where …Mentions: OAI.ExactFourier.LinearDAG
- theorem
OAI.ExactFourier.Program.eval_zeroline 92 - theorem
OAI.ExactFourier.Program.eval_inputline 101 - theorem
OAI.ExactFourier.LinearDAG.eval_compline 110 - def
OAI.ExactFourier.gateIndexline 129Source documentation
Index of a newly emitted vector gate.
def gateIndex {n k a : ℕ} (i : Fin a) : Fin (n + 1 + (k + a)) := … - theorem
OAI.ExactFourier.gateIndex_lastline 132 - theorem
OAI.ExactFourier.gateIndex_castSuccline 137 - def
OAI.ExactFourier.Program.emitline 142Source documentation
Emit independent scalar operations, one cost unit per coordinate, with original operands still available after the whole layer.
def Program.emit {n k : ℕ} (p : Program n k) : {a : ℕ} → (Fin a → Gate (n + 1 + k)) → Program n (k + a) | 0, _ => p | a + 1, g => .step (p.emit (g ∘ Fin.castSucc)) ((g (Fin.last a)).map keepIndex)Mentions: OAI.ExactFourier.Program, OAI.ExactFourier.Gate, OAI.ExactFourier.keepIndex
- theorem
OAI.ExactFourier.Program.eval_emitline 147 - def
OAI.ExactFourier.LinearDAG.wiresline 176Source documentation
Read-only input relabeling and arbitrary fanout are genuinely free.
def LinearDAG.wires {n a : ℕ} (f : Fin a → Fin (n + 1)) : LinearDAG n a where …Mentions: OAI.ExactFourier.LinearDAG
- theorem
OAI.ExactFourier.LinearDAG.eval_wiresline 181 - def
OAI.ExactFourier.LinearDAG.layerline 185Source documentation
A rectangular vector layer still charges every scalar gate separately.
def LinearDAG.layer {n a : ℕ} (g : Fin a → Gate (n + 1)) : LinearDAG n a where …Mentions: OAI.ExactFourier.Gate, OAI.ExactFourier.LinearDAG
- theorem
OAI.ExactFourier.LinearDAG.size_layerline 190 - theorem
OAI.ExactFourier.LinearDAG.eval_layerline 193 - def
OAI.ExactFourier.LinearDAG.addColumnline 200Source documentation
Append a scaled original input into each existing output accumulator. The two scalar operations per row are charged even for a zero scalar.
def LinearDAG.addColumn {n a : ℕ} (C : LinearDAG n a) (j : Fin n) (c : Fin a → ℂ) : LinearDAG n a where …Mentions: OAI.ExactFourier.LinearDAG
- theorem
OAI.ExactFourier.LinearDAG.eval_addColumnline 208 - def
OAI.ExactFourier.LinearDAG.matrixline 225Source documentation
Direct multiplication: this construction will be used only for the fixed spatial matrices in the coefficient-boundary comparison, not as a purported FFT saving.
def LinearDAG.matrix (n a : ℕ) (G : Matrix (Fin a) (Fin n) ℂ) : LinearDAG n a := …
Mentions: OAI.ExactFourier.LinearDAG
- theorem
OAI.ExactFourier.foldColumns_sizeline 233 - theorem
OAI.ExactFourier.foldColumns_evalline 244 - theorem
OAI.ExactFourier.LinearDAG.size_matrixline 254 - theorem
OAI.ExactFourier.LinearDAG.eval_matrixline 258 - theorem
OAI.ExactFourier.MatrixPrice.twoWay_DAG_boundline 270Source documentation
Quantitative version of the two-way pre-corner argument, with no hidden inverse oracle:
Dis an actual charged DAG computing the inverse map.theorem MatrixPrice.twoWay_DAG_bound (p : MatrixPrice) {n : ℕ} (G : Matrix (Fin n) (Fin n) ℂ) (hG : IsUnit G) (C D : LinearDAG n n) (hC : ∀ x, C.eval x = G.mulVec x) (hD : ∀ x, D.eval x = G⁻¹.mulVec x) : p.value G ≤ 8 * C.size + 4 * D.size + 3 * n := by …Mentions: OAI.ExactFourier.MatrixPrice, OAI.ExactFourier.LinearDAG
- theorem
OAI.ExactFourier.MatrixPrice.quadratic_boundline 281Source documentation
Uniform finite upper bound needed in the compactness branch. It does not assert that any price exists; it is a consequence of the standing price laws.
theorem MatrixPrice.quadratic_bound (p : MatrixPrice) {n : ℕ} (G : Matrix (Fin n) (Fin n) ℂ) (hG : IsUnit G) : p.value G ≤ 24 * (n : ℝ) ^ 2 + 3 * n := by …Mentions: OAI.ExactFourier.MatrixPrice