Download data/lean/OAI/Computability/FourierCircuit/Core.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 1.75 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Computability/FourierCircuit/Core.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Computability/FourierCircuit/Core.lean
-
curl -L -o Core.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Computability/FourierCircuit/Core.lean
1.75 kB
| import Mathlib | |
| namespace OAI | |
| section | |
| namespace ExactFourier | |
| /-- One charged scalar gate, referencing only available values. -/ | |
| inductive Gate (w : β) where | |
| | add (i j : Fin w) | |
| | sub (i j : Fin w) | |
| | scale (c : β) (i : Fin w) | |
| def Gate.eval {w : β} (v : Fin w β β) : Gate w β β | |
| | .add i j => v i + v j | |
| | .sub i j => v i - v j | |
| | .scale c i => c * v i | |
| /-- A topologically ordered scalar DAG; available values are never consumed. -/ | |
| inductive Program (n : β) : β β Type where | |
| | nil : Program n 0 | |
| | step {k : β} (p : Program n k) (g : Gate (n + 1 + k)) : Program n (k + 1) | |
| def Program.eval {n : β} : {k : β} β Program n k β (Fin n β β) β | |
| (Fin (n + 1 + k) β β) | |
| | 0, .nil, x => Fin.snoc x 0 | |
| | _ + 1, .step p g, x => | |
| let v := p.eval x | |
| Fin.snoc v (g.eval v) | |
| /-- Outputs name available values, so permutations and arbitrary fanout are uncharged. -/ | |
| structure Circuit (n : β) where | |
| size : β | |
| program : Program n size | |
| outputs : Fin n β Fin (n + 1 + size) | |
| def Circuit.eval {n : β} (C : Circuit n) (x : Fin n β β) : Fin n β β := | |
| fun i => C.program.eval x (C.outputs i) | |
| noncomputable def zeta (n : β) : β := Complex.exp (2 * Real.pi * Complex.I / (n : β)) | |
| noncomputable def fourierMatrix (n : β) : Matrix (Fin n) (Fin n) β := | |
| fun j k => zeta n ^ (j.val * k.val) | |
| def Circuit.Computes {n : β} (C : Circuit n) (A : Matrix (Fin n) (Fin n) β) : Prop := | |
| β x, C.eval x = A.mulVec x | |
| def MainStatement : Prop := | |
| β c : β, 0 < c β β Nβ : β, 2 β€ Nβ β β n : β, Nβ β€ n β§ | |
| β C : Circuit n, C.Computes (fourierMatrix n) β§ | |
| (C.size : β) < c * (n : β) * Real.logb 2 (n : β) | |
| end ExactFourier | |
| end | |
| end OAI | |