OAI/Computability/FourierCircuit/Shears.lean
36 declarations, 0 contain sorry, 0 declared as axioms
- def
OAI.ExactFourier.Program.dirtyEvalline 10Source documentation
Each internal gate starts at an arbitrary dirty value, and its computed linear combination is added to that value. The literal zero remains literal zero.
def Program.dirtyEval {n : ℕ} : {k : ℕ} → Program n k → (Fin n → ℂ) → (Fin k → ℂ) → (Fin (n + 1 + k) → ℂ) | 0, .nil, x, _ => Fin.snoc x 0 | k + 1, .step p g, x, z => let v := p.dirtyEval x (Fin.init z) …Mentions: OAI.ExactFourier.Program
- theorem
OAI.ExactFourier.Gate.eval_addline 17 - theorem
OAI.ExactFourier.snoc_addline 21 - theorem
OAI.ExactFourier.Program.dirtyEval_addline 27 - theorem
OAI.ExactFourier.Program.dirtyEval_cleanline 41 - theorem
OAI.ExactFourier.Program.dirtyEval_splitline 51Source documentation
Exact identity behind the two replays (
fft:dirty-forward,fft:dirty-output).theorem Program.dirtyEval_split {n k : ℕ} (p : Program n k) (x : Fin n → ℂ) (z : Fin k → ℂ) : p.dirtyEval x z = p.eval x + p.dirtyEval 0 z := by …Mentions: OAI.ExactFourier.Program
- structure
OAI.ExactFourier.LinearDAGline 57 - def
OAI.ExactFourier.LinearDAG.evalline 62 - abbrev
OAI.ExactFourier.Shearline 69 - def
OAI.ExactFourier.Shear.actline 71 - def
OAI.ExactFourier.runShearsline 75 - theorem
OAI.ExactFourier.runShears_nilline 78 - theorem
OAI.ExactFourier.runShears_consline 79 - theorem
OAI.ExactFourier.runShears_appendline 81 - theorem
OAI.ExactFourier.Shear.act_selfline 84 - theorem
OAI.ExactFourier.Shear.act_otherline 87 - theorem
OAI.ExactFourier.Shear.act_sourceline 90 - theorem
OAI.ExactFourier.Shear.inv_act_actline 93 - def
OAI.ExactFourier.reverseShearsline 102 - theorem
OAI.ExactFourier.reverseShears_lengthline 105 - theorem
OAI.ExactFourier.runShears_reverseline 108 - def
OAI.ExactFourier.readCoordline 119Source documentation
noneis the literal input zero, not a physical workspace coordinate.def readCoord {ι : Type*} (r : Option ι) (v : ι → ℂ) : ℂ := r.elim 0 v - theorem
OAI.ExactFourier.readCoord_congr_exceptline 121 - theorem
OAI.ExactFourier.add_referenceline 129Source documentation
Adding one permitted reference uses at most one elementary coordinate shear.
theorem add_reference {ι : Type*} (d : ι) (r : Option ι) (c : ℂ) (h : ∀ i, r = some i → d ≠ i) : ∃ W : List (Shear ι), W.length ≤ 1 ∧ ∀ v : ι → ℂ, runShears W v d = v d + c * readCoord r v ∧ ∀ i, i ≠ d → runShears W v i = v i := by …Mentions: OAI.ExactFourier.Shear, OAI.ExactFourier.runShears, OAI.ExactFourier.readCoord
- theorem
OAI.ExactFourier.add_gateline 149Source documentation
A gate's two (or one) distinct-from-destination reads, with repeated operands allowed.
theorem add_gate {ι : Type*} {w : ℕ} (d : ι) (refs : Fin w → Option ι) (h : ∀ a j, refs a = some j → d ≠ j) (g : Gate w) : ∃ W : List (Shear ι), W.length ≤ 2 ∧ ∀ v : ι → ℂ, runShears W v d = v d + g.eval (fun a => readCoord (refs a) v) ∧ ∀ i, i ≠ d → runShears W v i = v i := by …Mentions: OAI.ExactFourier.Gate, OAI.ExactFourier.Shear, OAI.ExactFourier.runShears, OAI.ExactFourier.readCoord
- def
OAI.ExactFourier.availableline 190 - def
OAI.ExactFourier.Program.dirtyScratchline 193 - theorem
OAI.ExactFourier.Program.dirtyEval_inputline 197 - theorem
OAI.ExactFourier.Program.dirtyEval_availableline 207 - theorem
OAI.ExactFourier.Program.dirtyScratch_step_castline 215 - theorem
OAI.ExactFourier.Program.dirtyScratch_step_lastline 223 - def
OAI.ExactFourier.replayInputsline 231 - def
OAI.ExactFourier.referenceMapline 234 - theorem
OAI.ExactFourier.read_referenceMapline 239 - theorem
OAI.ExactFourier.referenceMap_avoidsline 250 - theorem
OAI.ExactFourier.Program.dirtySweep_existsline 263Source documentation
The full forward-sweep construction, with one coordinate per gate and NO zero register. Its exact semantic statement is uniform in arbitrary dirty initial values.
theorem Program.dirtySweep_exists {ι : Type*} {n k : ℕ} (p : Program n k) (enabled : Bool) (xs : Fin n → ι) (zs : Fin k → ι) (hz : Function.Injective zs) (hxz : ∀ i j, xs i ≠ zs j) : ∃ W : List (Shear ι), W.length ≤ 2 * k ∧ ∀ v : ι → ℂ, (∀ j, runShears W v (zs j) = p.dirtyScratch (replayInputs enabled xs v) (v ∘ zs) j) ∧ (∀ r, (∀ j, r ≠ zs j) → runShears W v r = v r) := by …Mentions: OAI.ExactFourier.Program, OAI.ExactFourier.Shear, OAI.ExactFourier.runShears, OAI.ExactFourier.replayInputs