Download data/lean/OAI/Computability/FourierTransform/Goal.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 3.51 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Computability/FourierTransform/Goal.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Computability/FourierTransform/Goal.lean
-
curl -L -o Goal.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Computability/FourierTransform/Goal.lean
3.51 kB
| import OAI.Computability.FourierTransform.RAM | |
| import OAI.Computability.FourierCircuit.Core | |
| namespace OAI | |
| /-! Main proof targets. -/ | |
| namespace PowerSaving | |
| noncomputable section | |
| open RAM RAM.Ty Filter Asymptotics | |
| /-- Positive-sign, canonical roots. Need only at positive order. -/ | |
| abbrev root := ExactFourier.zeta | |
| abbrev Vec (n : β) := Fin n β β | |
| abbrev dftMatrix := ExactFourier.fourierMatrix | |
| def dft (n : β) (x : Vec n) : Vec n := | |
| fun j => β k, (root n) ^ (j.val*k.val) * x k | |
| def conv (n : β) (x y : Vec n) : Vec (2*n-1) := | |
| fun k => β r : Fin n, β s : Fin n, if r.val+s.val=k.val then x r*y s else 0 | |
| /-- Exact exponent from the TeX (natural logarithms). -/ | |
| def paperM : β := 1000000 | |
| def paperW : β := ((2 : β) : β) ^ (71:β) | |
| def paperDelta : β := 6871402692000000 | |
| def paperMultiplier := paperM - paperDelta / paperW | |
| def theta : β := Real.log paperMultiplier / Real.log paperM | |
| def decimalExponent : β := 1 - 1/(10^(13:β)) | |
| def paperTime (n : β) : β := | |
| (n:β) * (Real.log (n:β)) ^ theta * (Real.log (Real.log (n:β))) ^ (4-theta) | |
| def decimalTime (n : β) : β := (n:β) * (Real.log (n:β)) ^ decimalExponent | |
| def nlogn (n : β) : β := (n:β) * Real.log (n:β) | |
| abbrev dftInKind := p w (p sc (a (c Paint.left))) | |
| abbrev dftOutKind := a (c Paint.left) | |
| abbrev convInKind := p w (p sc (p (a (c Paint.left)) (a (c Paint.right)))) | |
| abbrev convOutKind := a (c Paint.both) | |
| /-- Include an integer and address bound polynomial in n. Constants inside this bound are | |
| immaterial (a constant number of logarithmic sized words is allowed). W n is the work | |
| allowance, including the order program, one root primitive and the transform program. | |
| The order program takes only the length, so its result specifies the root explicitly. -/ | |
| def DFTProgram (order : Prog false w w) (solve : Prog false dftInKind dftOutKind) | |
| (W : β β β) : Prop := | |
| β cBound : β, β n : β, 0<n β | |
| let cap := (n+2)^cBound | |
| let d := run order n | |
| W n + 10*(n+2) β€ cap β§ d.peak β€ cap β§ d.valid β§ | |
| 0 < d.val β§ d.val < 1024*n^3 β§ d.val β€ cap β§ | |
| β x : Vec n, | |
| let result := run solve (n, root d.val, (β¨n,xβ© : Tape β)) | |
| result.valid β§ result.peak β€ cap β§ d.work+1+result.work β€ W n β§ | |
| result.val = (β¨n, dft n xβ© : Tape β) | |
| /-- Convolution in the same model extended by pointwise field multiplication for two | |
| inputs. We even require the bound on the supplied root from the proof of the corollary. -/ | |
| def ConvProgram (order : Prog false w w) (solve : Prog true convInKind convOutKind) | |
| (W : β β β) : Prop := | |
| β cBound : β, β n : β, 0<n β | |
| let cap := (n+2)^cBound | |
| let d := run order n | |
| W n + 10*(n+2) β€ cap β§ d.peak β€ cap β§ d.valid β§ | |
| 0 < d.val β§ d.val < 1024*(2*n-1)^3 β§ d.val β€ cap β§ | |
| β x y : Vec n, | |
| let result := run solve (n, root d.val, (β¨n,xβ© : Tape β),(β¨n,yβ© : Tape β)) | |
| result.valid β§ result.peak β€ cap β§ d.work+1+result.work β€ W n β§ | |
| result.val = (β¨2*n-1, conv n x yβ© : Tape β) | |
| /-- Thm 1 (intro main) and decimal corollary estimates. -/ | |
| def TimeBounds (W : β β β) : Prop := | |
| let W' := fun n : β => (W n : β) | |
| W' =O[atTop] paperTime β§ W' =O[atTop] decimalTime β§ W' =o[atTop] nlogn | |
| def DFTGoal : Prop := β order solve W, DFTProgram order solve W β§ TimeBounds W | |
| def ConvGoal : Prop := β order solve W, ConvProgram order solve W β§ TimeBounds W | |
| end | |
| end PowerSaving | |
| end OAI | |