Download data/lean/ComparatorChallenges/TriangularGaussian.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 9.66 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/ComparatorChallenges/TriangularGaussian.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/ComparatorChallenges/TriangularGaussian.lean
-
curl -L -o TriangularGaussian.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/ComparatorChallenges/TriangularGaussian.lean
9.66 kB
| import Mathlib | |
| namespace OAI | |
| /-! | |
| # Sharp Gaussian minorants with atomic interpolation | |
| The sharp Gaussian minorants of the atomic certificate for triangular-lattice | |
| universal optimality, including the construction for parameters at least one. | |
| -/ | |
| noncomputable section | |
| open scoped BigOperators FourierTransform SchwartzMap | |
| open Complex Polynomial | |
| namespace AtomicTriangular | |
| abbrev Plane := EuclideanSpace β (Fin 2) | |
| def b : β := Real.sqrt 3 / 2 | |
| def triangularPoint (jk : β€ Γ β€) : Plane := | |
| (Real.sqrt b)β»ΒΉ β’ | |
| (EuclideanSpace.single 0 ((jk.1 : β) + (jk.2 : β) / 2) + | |
| EuclideanSpace.single 1 ((jk.2 : β) * b)) | |
| def A : Set Plane := Set.range triangularPoint | |
| def dualA : Set Plane := {w | β a β A, β n : β€, inner β a w = (n : β)} | |
| def gaussian (Ξ± : β) (x : Plane) : β := Real.exp (-Real.pi * Ξ± * βxβ ^ 2) | |
| def Radial (f : Plane β β) : Prop := β x y, βxβ = βyβ β f x = f y | |
| def realFourier (f : Plane β β) (w : Plane) : β := π (fun x => (f x : β)) w | |
| end AtomicTriangular | |
| namespace AtomicTriangular.Construction | |
| def b : β := Real.sqrt 3 / 2 | |
| def h : β := 17 / 50 | |
| def H : β := 27 / 50 | |
| def eta : β := 1 / 5 | |
| def kappa : β := Real.pi / 36 | |
| def residues : Finset β€ := {0,1,3,4,7,9,12,13,16,19,21,25,27,28,31} | |
| def residue (a : Fin 15) : β€ := ![0,1,3,4,7,9,12,13,16,19,21,25,27,28,31] a | |
| def Node : Type := {n : β€ // 0 < n β§ n % 36 β residues} | |
| def FiniteNodes : Finset β€ := {1,3,4,7,9,12,13,16,19,21} | |
| def sineFactor (a : Fin 15) (s : β) : β := | |
| 2 * Complex.sin ((kappa : β) * (s - (residue a : β))) | |
| def P (s : β) : β := β a : Fin 15, (sineFactor a s)^2 | |
| def dBasis (n : Node) : β β β := dslope P (n.val : β) | |
| def cBasis (n : Node) : β β β := dslope (dBasis n) (n.val : β) | |
| def finiteC (a : Fin 15) (s : β) : β := | |
| 4 * (kappa : β)^2 * β r β Finset.univ.erase a, (sineFactor r s)^2 | |
| def finiteD (a : Fin 15) (s : β) : β := | |
| 2 * (kappa : β) * sineFactor a s * | |
| Complex.cos ((kappa : β) * (s - (residue a : β))) * | |
| β r β Finset.univ.erase a, (sineFactor r s)^2 | |
| def phase (s : β) : β := Complex.exp ((Real.pi : β) * Complex.I * s / 18) | |
| def atomFactor (a : Fin 15) : Polynomial β := | |
| -C (phase (residue a)) + C 2 * X - C (phase (-residue a)) * X^2 | |
| def atomPolynomial : Polynomial β := β a : Fin 15, atomFactor a | |
| def cAtomPolynomial (a : Fin 15) : Polynomial β := | |
| C (4 * (kappa : β)^2) * β r β Finset.univ.erase a, atomFactor r | |
| def dAtomPolynomial (a : Fin 15) : Polynomial β := | |
| C (Complex.I * (kappa : β)) * | |
| (C (phase (residue a)) - C (phase (-residue a)) * X^2) * | |
| β r β Finset.univ.erase a, atomFactor r | |
| def fourierCoeff (j : Fin 31) : β := atomPolynomial.coeff j.val | |
| def frequency (j : Fin 31) : β := ((j.val : β)-15)/18 | |
| def waveDerivative (k : β) (s : β) : β := | |
| β j : Fin 31, fourierCoeff j * (I*Real.pi*frequency j)^k * | |
| exp (I*Real.pi*frequency j*s) | |
| def Q (n : β€) : β := (waveDerivative 2 n).re / 2 | |
| def D (n : β€) : β := (waveDerivative 3 n).re / (6 * Q n) | |
| end AtomicTriangular.Construction | |
| namespace AtomicTriangular.FiniteCertificate | |
| open Construction | |
| def cShiftPolynomial (a : Fin 15) : Polynomial β := X * cAtomPolynomial a | |
| def cCoefficient (a : Fin 15) (j : Fin 31) : β := (cShiftPolynomial a).coeff j.val | |
| def dCoefficient (a : Fin 15) (j : Fin 31) : β := (dAtomPolynomial a).coeff j.val | |
| end AtomicTriangular.FiniteCertificate | |
| namespace AtomicTriangular.Construction | |
| abbrev Plane := EuclideanSpace β (Fin 2) | |
| def radial (x : Plane) : β := b*βxβ^2 | |
| def waveDen (k t : β) : β := k^2+t^2 | |
| def Xwave (k t : β) : β := (4/3)/waveDen k t | |
| def lambda (k t : β) : β := ((k:β)+I*t)/(b*waveDen k t : β) | |
| def zeta (k v t : β) : β := -(t:β)*(Xwave k t:β)+I*(k*Xwave k t-v:β) | |
| def transformedWave (k v t : β) (s : β) : β := lambda k t*exp (I*Real.pi*zeta k v t*s) | |
| def finiteColumn (col : Fin 23) (j : Fin 31) : β := | |
| if hc : col.val<22 then | |
| if col.val%2=0 then FiniteCertificate.cCoefficient β¨col.val/2,by omegaβ© j | |
| else FiniteCertificate.dCoefficient β¨col.val/2,by omegaβ© j | |
| else fourierCoeff j | |
| def finiteNode (n : Fin 10) : β€ := residue β¨n.val+1,by omegaβ© | |
| def jetMultiplier (k v : β) (n : β€) (d : Fin 2) (t : β) : β := | |
| (Q n:β)β»ΒΉ*transformedWave k v t n * | |
| (if d.val=0 then -1 else (D n:β)-I*Real.pi*zeta k v t) | |
| def jet (k v : β) (n : β€) (d : Fin 2) (S : Fin 31 β β) : β := | |
| (β j : Fin 31, jetMultiplier k v n d (frequency j)*S j).re | |
| def fullJetMatrix : Matrix (Fin 20) (Fin 23) β := fun i col => | |
| jet (if col.val=22 then h else H) H | |
| (finiteNode β¨i.val/2,by omegaβ©) β¨i.val%2,by omegaβ© (finiteColumn col) | |
| def R : Matrix (Fin 20) (Fin 20) β := fun i j => fullJetMatrix i β¨j.val+2,by omegaβ© | |
| def R0 : Matrix (Fin 20) (Fin 3) β := fun i j => | |
| fullJetMatrix i (if j.val<2 then β¨j.val,by omegaβ© else 22) | |
| abbrev TailNode := {n : Node // n.val β FiniteNodes} | |
| structure InputCoefficients where | |
| C : β | |
| finiteC : Fin 11 β β | |
| finiteD : Fin 11 β β | |
| tailC : TailNode β β | |
| tailD : TailNode β β | |
| summable : Summable (fun n => |tailC n|+|tailD n|) | |
| def tailInput (a : InputCoefficients) (s : β) : β := | |
| (a.C:β)*P s + β' n : TailNode, ((a.tailC n:β)*cBasis n.val s+(a.tailD n:β)*dBasis n.val s) | |
| def finiteInput (a : InputCoefficients) (s : β) : β := | |
| β j : Fin 11, ((a.finiteC j:β)*finiteC β¨j.val,by omegaβ© s + | |
| (a.finiteD j:β)*finiteD β¨j.val,by omegaβ© s) | |
| def inputComplex (a : InputCoefficients) (x : Plane) : β := | |
| exp (-(Real.pi:β)*h*(radial x:β))*tailInput a (radial x) + | |
| exp (-(Real.pi:β)*H*(radial x:β))*finiteInput a (radial x) | |
| def targetCoefficient (n : Fin 10) : β := Q 1 / Q (finiteNode n) * Real.exp (Real.pi*eta*(finiteNode n)) | |
| def Yf : Matrix (Fin 20) (Fin 8) β := fun i j => | |
| if i.val<8 then | |
| targetCoefficient β¨i.val/2,by omegaβ© * | |
| (if i.val%2=0 then (if j.val=i.val then 1 else 0) | |
| else (if j.val=i.val then -1 else if j.val=i.val-1 then Real.pi*eta-D (finiteNode β¨i.val/2,by omegaβ©) else 0)) | |
| else 0 | |
| def gamma (side : Fin 2) : Matrix (Fin 3) (Fin 8) β := fun i j => | |
| if j.val=1 then (if i.val=0 then 11/25 else if i.val=1 then 0 else if side.val=0 then -(3/500) else 3/500) else 0 | |
| def Uplus : Matrix (Fin 20) (Fin 8) β := | |
| (1-R)β»ΒΉ*(Yf+R0*(gamma 1+gamma 0)) | |
| def Uminus : Matrix (Fin 20) (Fin 8) β := | |
| (1+R)β»ΒΉ*(Yf+R0*(gamma 1-gamma 0)) | |
| def finiteSolution (side : Fin 2) : Matrix (Fin 20) (Fin 8) β := | |
| if side.val=0 then (1/2:β) β’ (Uplus+Uminus) else (1/2:β) β’ (Uplus-Uminus) | |
| def Acoefficient (side : Fin 2) : Matrix (Fin 23) (Fin 8) β := fun i j => | |
| if hi : i.val<2 then gamma side β¨i.val,by omegaβ© j | |
| else if h22 : i.val=22 then gamma side 2 j | |
| else finiteSolution side β¨i.val-2,by omegaβ© j | |
| def gaussianZ (Ξ± : β) : β := 1/(Real.pi*(Ξ±/b-h)) | |
| def actualParameter (z : β) : Fin 8 β β := | |
| ![z,1,z*Real.exp (-2/z),Real.exp (-2/z),z*Real.exp (-3/z),Real.exp (-3/z), | |
| z*Real.exp (-6/z),Real.exp (-6/z)] | |
| def normalizingDen (z : β) := Q 1*z*Real.exp (1/z) | |
| end AtomicTriangular.Construction | |
| end | |
| noncomputable section | |
| open scoped BigOperators FourierTransform | |
| namespace AtomicTriangular.Construction | |
| def correctedFinite (side : Fin 2) (z : β) (Ξ΄ : Fin 20 β β) (j : Fin 22) : β := | |
| (β r : Fin 8, Acoefficient side β¨j.val, by omegaβ© r * actualParameter z r) + | |
| if hj : j.val < 2 then 0 else Ξ΄ β¨j.val - 2, by omegaβ© | |
| end AtomicTriangular.Construction | |
| namespace AtomicTriangular | |
| open Construction | |
| local instance finite_pair_neZero : NeZero (2 : β) := inferInstance | |
| local instance three_atLeastTwo : Nat.AtLeastTwo 3 := inferInstance | |
| local instance ten_atLeastTwo : Nat.AtLeastTwo 10 := inferInstance | |
| local instance five_hundred_atLeastTwo : Nat.AtLeastTwo 500 := inferInstance | |
| local instance plane_borelSpace : BorelSpace Plane := inferInstance | |
| local instance plane_finite : Module.Finite β Plane := inferInstance | |
| def AtomicConstruction (Ξ± : β) (f : Plane β β) : Prop := | |
| IsUnit (1 - R) β§ IsUnit (1 + R) β§ | |
| (1 - R) * Uplus = Yf + R0 * (gamma 1 + gamma 0) β§ | |
| (1 + R) * Uminus = Yf + R0 * (gamma 1 - gamma 0) β§ | |
| β (Ξ΄ : Fin 2 β Fin 20 β β) (a : Fin 2 β InputCoefficients), | |
| (β side, (β j : Fin 20, |Ξ΄ side j|) < (1 / 10^5 : β)) β§ | |
| (β side, (a side).C = if side.val = 0 then -(3/500) else 3/500) β§ | |
| (β side (j : Fin 11), | |
| (a side).finiteC j = | |
| correctedFinite side (gaussianZ Ξ±) (Ξ΄ side) β¨2*j.val, by omegaβ© β§ | |
| (a side).finiteD j = | |
| correctedFinite side (gaussianZ Ξ±) (Ξ΄ side) β¨2*j.val+1, by omegaβ©) β§ | |
| (β side, Summable (fun n => |(a side).tailC n| + |(a side).tailD n|) β§ | |
| (β' n, (|(a side).tailC n| + |(a side).tailD n|)) < (3 / 10^9 : β)) β§ | |
| (β x, (f x : β) = | |
| (inputComplex (a 0) x + π (inputComplex (a 1)) x) / | |
| (normalizingDen (gaussianZ Ξ±) : β)) | |
| end AtomicTriangular | |
| end | |
| noncomputable section | |
| open scoped BigOperators FourierTransform | |
| namespace AtomicTriangular | |
| open Construction | |
| theorem sharp_gaussian_minorants_with_construction (Ξ± : β) (hΞ± : 0 < Ξ±) : | |
| β f : SchwartzMap Plane β, | |
| Radial f β§ (β x, f x β€ gaussian Ξ± x) β§ | |
| (β w, (realFourier f w).im = 0 β§ 0 β€ (realFourier f w).re) β§ | |
| (β a β A, a β 0 β f a = gaussian Ξ± a) β§ | |
| (β w β dualA, w β 0 β realFourier f w = 0) β§ | |
| (1 β€ Ξ± β AtomicConstruction Ξ± f) := by | |
| sorry | |
| end AtomicTriangular | |
| end | |
| end OAI | |