Download data/lean/OAI/Probability/ProjectionMoments/Model.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 29.6 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/ProjectionMoments/Model.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/ProjectionMoments/Model.lean
-
curl -L -o Model.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/ProjectionMoments/Model.lean
29.6 kB
| import Mathlib | |
| namespace OAI | |
| noncomputable section | |
| section InlineMainProof | |
| open MeasureTheory ProbabilityTheory Set Filter | |
| open scoped ENNReal NNReal RealInnerProductSpace | |
| universe u | |
| namespace NoiselessRegression | |
| abbrev Vector (d : β) := EuclideanSpace β (Fin d) | |
| abbrev UnitSphere (d : β) := Metric.sphere (0 : Vector d) 1 | |
| abbrev State (M : β) := Fin (2 ^ M) | |
| abbrev Samples (d T : β) := Fin T β Vector d | |
| def uniformSphere (d : β) : Measure (UnitSphere d) := | |
| let Ο := (volume : Measure (Vector d)).toSphere | |
| (Ο Set.univ)β»ΒΉ β’ Ο | |
| def sampleLaw (d T : β) : Measure (Samples d T) := | |
| Measure.pi fun _ => stdGaussian (Vector d) | |
| def observationReference (d : β) : Measure (Vector d Γ β) := | |
| (stdGaussian (Vector d)).prod volume | |
| structure Learner (d M T : β) (Ξ© : Type u) where | |
| initialChoice : Ξ© β Bool Γ State M | |
| transition : β β Ξ© β State M β (Vector d Γ β) β Bool Γ State M | |
| output : β β Ξ© β State M β UnitSphere d | |
| namespace Learner | |
| abbrev RunStatus (M : β) := Sum (State M) (β Γ State M) | |
| def start {d M T : β} {Ξ© : Type u} (L : Learner d M T Ξ©) (Ο : Ξ©) : | |
| RunStatus M := | |
| let a := L.initialChoice Ο | |
| if a.1 then .inr (0, a.2) else .inl a.2 | |
| def run {d M T : β} {Ξ© : Type u} (L : Learner d M T Ξ©) | |
| (s : UnitSphere d) (Ο : Ξ©) (x : Samples d T) : β β RunStatus M | |
| | 0 => L.start Ο | |
| | n + 1 => | |
| match L.run s Ο x n with | |
| | .inr done => .inr done | |
| | .inl state => | |
| if hn : n < T then | |
| let row := x β¨n, hnβ© | |
| let a := L.transition (n + 1) Ο state (row, βͺrow, s.valβ«) | |
| if a.1 then .inr (n + 1, a.2) else .inl a.2 | |
| else .inl state | |
| def terminal {d M T : β} {Ξ© : Type u} (L : Learner d M T Ξ©) | |
| (s : UnitSphere d) (Ο : Ξ©) (x : Samples d T) : β Γ State M := | |
| match L.run s Ο x T with | |
| | .inl state => (T, state) | |
| | .inr done => done | |
| def estimate {d M T : β} {Ξ© : Type u} (L : Learner d M T Ξ©) | |
| (s : UnitSphere d) (Ο : Ξ©) (x : Samples d T) : UnitSphere d := | |
| let a := L.terminal s Ο x | |
| L.output a.1 Ο a.2 | |
| structure Admissible {d M T : β} {Ξ© : Type u} [MeasurableSpace Ξ©] | |
| (L : Learner d M T Ξ©) (Ο : Measure Ξ©) : Prop where | |
| initialChoice : AEMeasurable L.initialChoice Ο | |
| transition : β t a, AEMeasurable (fun z : Ξ© Γ (Vector d Γ β) => | |
| L.transition t z.1 a z.2) (Ο.prod (observationReference d)) | |
| output : β t a, AEMeasurable (fun Ο => L.output t Ο a) Ο | |
| fixed_experiment : β s, AEMeasurable (fun z : Ξ© Γ Samples d T => | |
| L.estimate s z.1 z.2) (Ο.prod (sampleLaw d T)) | |
| uniform_experiment : AEMeasurable | |
| (fun z : UnitSphere d Γ (Ξ© Γ Samples d T) => L.estimate z.1 z.2.1 z.2.2) | |
| ((uniformSphere d).prod (Ο.prod (sampleLaw d T))) | |
| def angularError {d : β} (s Ε : UnitSphere d) : β := | |
| Real.arccos βͺΕ.val, s.valβ« | |
| def uniformSuccess {d M T : β} {Ξ© : Type u} [MeasurableSpace Ξ©] | |
| (L : Learner d M T Ξ©) (Ο : Measure Ξ©) (Ξ΅ : β) : ββ₯0β := | |
| ((uniformSphere d).prod (Ο.prod (sampleLaw d T))) | |
| {z | angularError z.1 (L.estimate z.1 z.2.1 z.2.2) β€ Ξ΅} | |
| end Learner | |
| open scoped Topology | |
| open InnerProductSpace | |
| section SphereBounds | |
| open scoped Pointwise | |
| variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace β E] | |
| [FiniteDimensional β E] [MeasurableSpace E] [BorelSpace E] | |
| def sphereLaw : Measure (Metric.sphere (0 : E) 1) := | |
| let Ο := (volume : Measure E).toSphere | |
| (Ο Set.univ)β»ΒΉ β’ Ο | |
| end SphereBounds | |
| open scoped Pointwise | |
| variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace β E] | |
| [FiniteDimensional β E] [MeasurableSpace E] [BorelSpace E] | |
| def ambientSphereLaw : Measure E := (sphereLaw (E := E)).map Subtype.val | |
| end NoiselessRegression | |
| end InlineMainProof | |
| open scoped ENNReal NNReal RealInnerProductSpace Topology MatrixOrder Matrix.Norms.L2Operator | |
| open MeasureTheory ProbabilityTheory Set Filter InnerProductSpace Matrix | |
| open MeasureTheory ProbabilityTheory Set Filter InnerProductSpace | |
| open scoped ENNReal NNReal RealInnerProductSpace Topology | |
| namespace ProjectionMoments | |
| section GaussianGraph | |
| variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace β E] | |
| [FiniteDimensional β E] [MeasurableSpace E] [BorelSpace E] | |
| def vectorSmoothing (Ξ½ : Measure E) (m : β) (Ο : (Fin m β β) β ββ₯0β) | |
| (z : (Fin m β E) Γ (Fin m β β)) : ββ₯0β := | |
| β«β» t, Ο (fun j => z.2 j - βͺt, z.1 jβ«) βΞ½ | |
| end GaussianGraph | |
| section | |
| abbrev Label (m : β) := EuclideanSpace β (Fin m) | |
| def ballKernel (m : β) (Ξ· : β) (y : Fin m β β) : ββ₯0β := | |
| (Metric.closedBall (0 : Label m) Ξ·).indicator | |
| (fun _ => (volume (Metric.closedBall (0 : Label m) Ξ·))β»ΒΉ) (WithLp.toLp 2 y) | |
| section BallDensity | |
| variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace β E] | |
| [FiniteDimensional β E] [MeasurableSpace E] [BorelSpace E] | |
| def rowMap {m : β} (A : Fin m β E) : E βL[β] Label m := | |
| (PiLp.continuousLinearEquiv 2 β (fun _ : Fin m => β)).symm.toContinuousLinearMap.comp | |
| (ContinuousLinearMap.pi (fun j => innerSL β (A j))) | |
| def ballAverage (Ξ½ : Measure E) (m : β) (Ξ· : β) | |
| (z : (Fin m β E) Γ Label m) : ββ₯0β := | |
| vectorSmoothing Ξ½ m (ballKernel m Ξ·) (z.1, WithLp.ofLp z.2) | |
| def lowerDensity (Ξ½ : Measure E) (m : β) (z : (Fin m β E) Γ Label m) : ββ₯0β := | |
| liminf (fun n : β => ballAverage Ξ½ m ((n : β) + 1)β»ΒΉ z) atTop | |
| end BallDensity | |
| variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace β E] | |
| [FiniteDimensional β E] [MeasurableSpace E] [BorelSpace E] | |
| def AllBallMass (Ξ½ : Measure E) (K a : β) : Prop := | |
| β b : E, β t : β, 0 < t β Ξ½ (Metric.closedBall b t) β€ ENNReal.ofReal (K * t ^ a) | |
| end | |
| section Rotations | |
| variable (E : Type*) [NormedAddCommGroup E] [InnerProductSpace β E] | |
| [FiniteDimensional β E] | |
| abbrev Rotation := unitary (E βL[β] E) | |
| instance rotationMeasurableSpace : MeasurableSpace (Rotation E) := borel (Rotation E) | |
| instance rotationBorelSpace : BorelSpace (Rotation E) := β¨rflβ© | |
| instance rotationCompact : CompactSpace (Rotation E) := by | |
| apply isCompact_iff_compactSpace.mp | |
| apply Metric.isCompact_of_isClosed_isBounded isClosed_unitary | |
| apply (Metric.isBounded_closedBall (x := (0 : E βL[β] E)) (r := 1)).subset (s := (unitary (E βL[β] E) : Set (E βL[β] E))) | |
| intro U hU | |
| rw [Metric.mem_closedBall, dist_zero_right] | |
| by_cases h : Subsingleton E | |
| Β· have := h | |
| simp | |
| Β· have : Nontrivial E := not_subsingleton_iff_nontrivial.mp h | |
| exact (CStarRing.norm_of_mem_unitary hU).le | |
| def rotationLaw : Measure (Rotation E) := | |
| ((Measure.haar : Measure (Rotation E)) Set.univ)β»ΒΉ β’ Measure.haar | |
| variable {E} | |
| variable [MeasurableSpace E] [BorelSpace E] | |
| def rotateRows {ΞΉ : Type*} (O : Rotation E) (v : ΞΉ β E) : ΞΉ β E := | |
| fun i => (O : E βL[β] E) (v i) | |
| end Rotations | |
| section Triangular | |
| variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace β E] | |
| [FiniteDimensional β E] | |
| [MeasurableSpace E] [BorelSpace E] | |
| def coordinateMap {m : β} (A : Fin m β E) : E ββ[β] (Fin m β β) := | |
| (WithLp.linearEquiv 2 β (Fin m β β)) ββ (rowMap A).toLinearMap | |
| end Triangular | |
| section CoordinateDensity | |
| variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace β E] | |
| [FiniteDimensional β E] | |
| [MeasurableSpace E] [BorelSpace E] | |
| def coordinateDensity (Ξ½ : Measure E) (m : β) (z : (Fin m β E) Γ (Fin m β β)) : ββ₯0β := | |
| lowerDensity Ξ½ m (z.1, WithLp.toLp 2 z.2) | |
| end CoordinateDensity | |
| section | |
| variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace β E] | |
| [FiniteDimensional β E] [MeasurableSpace E] [BorelSpace E] | |
| def frameLaw {m : β} (u : Fin m β E) : Measure (Fin m β E) := | |
| (rotationLaw E).map (fun O => rotateRows O u) | |
| end | |
| section | |
| variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace β E] | |
| [FiniteDimensional β E] [MeasurableSpace E] [BorelSpace E] | |
| def rieszKernel (Ξ± : β) (z s : E) : ββ₯0β := (ENNReal.ofReal βs-zβ)^(-Ξ±) | |
| def rieszPotential (Ξ± : β) (h : E β ββ₯0β) : ββ₯0β := | |
| β¨ z : E, β«β» s, h s*rieszKernel Ξ± z s βNoiselessRegression.ambientSphereLaw | |
| end | |
| section | |
| variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace β E] | |
| [FiniteDimensional β E] [MeasurableSpace E] [BorelSpace E] | |
| def mixRows {k : β} (M : Matrix (Fin k) (Fin k) β) (X : Fin k β E) : Fin k β E := | |
| fun i => β j, M i j β’ X j | |
| def polarRadial {k : β} (X : Fin k β E) : Matrix (Fin k) (Fin k) β := | |
| CFC.sqrt (Matrix.gram β X) | |
| def rawPolarRows {k : β} (X : Fin k β E) : Fin k β E := | |
| mixRows (polarRadial X)β»ΒΉ X | |
| def polarRows {k : β} (u X : Fin k β E) : Fin k β E := by | |
| classical | |
| exact if LinearIndependent β X then rawPolarRows X else u | |
| end | |
| section | |
| variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace β E] | |
| [FiniteDimensional β E] [MeasurableSpace E] [BorelSpace E] | |
| def unitBallVolume (k : β) : ββ₯0β := (volume : Measure (Label k)) (Metric.closedBall 0 1) | |
| def unitBallLaw (k : β) : Measure (Label k) := | |
| (unitBallVolume k)β»ΒΉ β’ volume.restrict (Metric.closedBall 0 1) | |
| def normalizedDensity (Ξ½ : Measure E) (k : β) (u : Fin k β E) | |
| (z : (Fin k β E) Γ Label k) : ββ₯0β := | |
| unitBallVolume k * lowerDensity Ξ½ k (polarRows u z.1,z.2) | |
| def sphereWeightedRestriction (h : E β ββ₯0β) (H : Set E) : Measure E := | |
| (NoiselessRegression.ambientSphereLaw.withDensity h).restrict H | |
| end | |
| section | |
| universe u | |
| variable {E : Type u} [NormedAddCommGroup E] [InnerProductSpace β E] | |
| [FiniteDimensional β E] [MeasurableSpace E] [BorelSpace E] | |
| def capMeasure (c : E) (r : β) : Measure E := | |
| (NoiselessRegression.ambientSphereLaw (Metric.closedBall c r))β»ΒΉ β’ | |
| NoiselessRegression.ambientSphereLaw.restrict (Metric.closedBall c r) | |
| structure CapDictionary (c : E) (r Ξ± : β) where | |
| I : Type u | |
| countable : Countable I | |
| center : I β E | |
| radius : I β β | |
| center_norm : β i, βcenter iβ = 1 | |
| radius_pos : β i, 0 < radius i | |
| radius_le : β i, radius i β€ r | |
| parent : I | |
| parent_center : center parent = c | |
| parent_radius : radius parent = r | |
| proper : β R : β, {i | (r/radius i)^Ξ± β€ R}.Finite | |
| cover : β (s : E), βsβ = 1 β β t : β, 0 < t β t β€ 1/4 β | |
| β i, 4*r*t β€ radius i β§ radius i < 8*r*t β§ dist s (center i) β€ radius i/2 | |
| end | |
| section | |
| variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace β E] | |
| [FiniteDimensional β E] [MeasurableSpace E] [BorelSpace E] | |
| def radialLabel {k : β} (X : Fin k β E) (y : Label k) : Label k := | |
| WithLp.toLp 2 (polarRadial X *α΅₯ y.ofLp) | |
| def capKernelValue {k : β} (K : (Fin k β E) Γ Label k β ββ₯0β) (s : E) : ββ₯0β := | |
| β«β» X, K (X,rowMap X s) βMeasure.pi (fun _ => stdGaussian E) | |
| def capReferenceLabel {k : β} (c : E) (r : β) (X : Fin k β E) (z : Label k) : Label k := | |
| rowMap X c + r β’ radialLabel X z | |
| def capReference {k : β} (K : (Fin k β E) Γ Label k β ββ₯0β) (c : E) (r : β) : ββ₯0β := | |
| β«β» X, β«β» z, K (X,capReferenceLabel c r X z) βunitBallLaw k βMeasure.pi (fun _ => stdGaussian E) | |
| end | |
| variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace β E] | |
| [FiniteDimensional β E] [MeasurableSpace E] [BorelSpace E] | |
| def fractionalBlock {J : Type*} [Fintype J] {k : β} | |
| (Q : J β (Fin k β E) Γ Label k β ββ₯0β) (f : J β E β ββ₯0β) (s : E) : ββ₯0β := | |
| β«β» X, β j, Q j (X,rowMap X s)*f j s βMeasure.pi (fun _ => stdGaussian E) | |
| end ProjectionMoments | |
| open MeasureTheory ProbabilityTheory Set Filter unitInterval | |
| open MeasureTheory ProbabilityTheory Set Filter | |
| open scoped ENNReal NNReal RealInnerProductSpace | |
| namespace NoiselessRegression | |
| namespace Learner | |
| section | |
| universe u | |
| variable {d M T : β} {Ξ© : Type u} | |
| abbrev TaggedState (M T : β) := Sum (State M) (Fin (T+1) Γ State M) | |
| instance taggedMeasurableSpace : MeasurableSpace (TaggedState M T) := β€ | |
| def taggedStart (a : Bool Γ State M) : TaggedState M T := | |
| if a.1 then .inr (β¨0,by omegaβ©,a.2) else .inl a.2 | |
| end | |
| universe u | |
| variable {d M T : β} {Ξ© : Type u} [MeasurableSpace Ξ©] | |
| structure MeasurableRules (L : Learner d M T Ξ©) : Prop where | |
| initial : Measurable L.initialChoice | |
| transition : β t j, Measurable (fun z : Ξ© Γ (Vector d Γ β) => L.transition t z.1 j z.2) | |
| output : β t j, Measurable (fun Ο => L.output t Ο j) | |
| end Learner | |
| structure FiniteKernelLearner (d M T : β) where | |
| initial : Measure (Bool Γ State M) | |
| initial_probability : IsProbabilityMeasure initial | |
| transition : β β State M β (Vector d Γ β) β Measure (Bool Γ State M) | |
| transition_probability : β t j obs, IsProbabilityMeasure (transition t j obs) | |
| output : β β State M β Measure (UnitSphere d) | |
| output_probability : β t j, IsProbabilityMeasure (output t j) | |
| namespace FiniteKernelLearner | |
| variable {d M T : β} | |
| structure CompletedRules (K : FiniteKernelLearner d M T) : Prop where | |
| transition : β t j a, AEMeasurable (fun obs => K.transition t j obs {a}) (observationReference d) | |
| end FiniteKernelLearner | |
| section | |
| variable {J O : Type*} [Fintype J] [MeasurableSpace J] [MeasurableSingletonClass J] | |
| [MeasurableSpace O] | |
| def kernelRun (P : β β J β O β Measure J) : (n : β) β J β (Fin n β O) β Measure J | |
| | 0, j, _ => Measure.dirac j | |
| | n+1, j, obs => (kernelRun P n j (Fin.init obs)).bind (fun a => P (n+1) a (obs (Fin.last n))) | |
| end | |
| namespace FiniteKernelLearner | |
| section | |
| open Learner | |
| variable {d M T : β} | |
| abbrev Tape (M T : β) := (Bool Γ State M) Γ ((Fin T β I) Γ I) | |
| def destination (t : β) (h : t β€ T) (a : Bool Γ State M) : TaggedState M T := | |
| if a.1 then .inr (β¨t,by omegaβ©,a.2) else .inl a.2 | |
| def taggedKernel (K : FiniteKernelLearner d M T) (t : β) : | |
| TaggedState M T β (Vector d Γ β) β Measure (TaggedState M T) | |
| | .inr a, _ => Measure.dirac (.inr a) | |
| | .inl j, obs => if ht : t β€ T then (K.transition t j obs).map (destination t ht) | |
| else Measure.dirac (.inl j) | |
| def terminalOutput (K : FiniteKernelLearner d M T) : TaggedState M T β Measure (UnitSphere d) | |
| | .inl j => K.output T j | |
| | .inr (t,j) => K.output t j | |
| end | |
| open Learner | |
| variable {d M T : β} | |
| abbrev Result (d M : β) := (β Γ State M) Γ UnitSphere d | |
| def terminalTag : TaggedState M T β β Γ State M | |
| | .inl j => (T,j) | |
| | .inr (t,j) => (t,j) | |
| def terminalJointOutput (K : FiniteKernelLearner d M T) (j : TaggedState M T) : Measure (Result d M) := | |
| (K.terminalOutput j).map (fun y => (terminalTag j,y)) | |
| def jointExperimentLaw (K : FiniteKernelLearner d M T) (obs : Fin T β (Vector d Γ β)) : Measure (Result d M) := | |
| K.initial.bind (fun a => (kernelRun K.taggedKernel T (taggedStart a) obs).bind K.terminalJointOutput) | |
| def uniformSuccess (K : FiniteKernelLearner d M T) (Ξ΅ : β) : ββ₯0β := | |
| β«β» z : UnitSphere d Γ Samples d T, | |
| K.jointExperimentLaw (fun i => (z.2 i,βͺz.1.val,z.2 iβ«)) | |
| {r | angularError z.1 r.2 β€ Ξ΅} β((uniformSphere d).prod (sampleLaw d T)) | |
| def uniformFixedSuccess (K : FiniteKernelLearner d M T) (Ξ΅ : β) (t : β) : ββ₯0β := | |
| β«β» z : UnitSphere d Γ Samples d T, | |
| K.jointExperimentLaw (fun i => (z.2 i,βͺz.1.val,z.2 iβ«)) | |
| {r | r.1.1 = t β§ angularError z.1 r.2 β€ Ξ΅} β((uniformSphere d).prod (sampleLaw d T)) | |
| end FiniteKernelLearner | |
| section | |
| universe u | |
| variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace β E] | |
| [FiniteDimensional β E] [MeasurableSpace E] [BorelSpace E] [Nontrivial E] | |
| namespace Learner | |
| variable {d M T : β} {Ξ© : Type u} | |
| def uniformFixedSuccess [MeasurableSpace Ξ©] (L : Learner d M T Ξ©) (Ο : Measure Ξ©) | |
| (Ξ΅ : β) (t : β) : ββ₯0β := | |
| ((uniformSphere d).prod (Ο.prod (sampleLaw d T))) | |
| {z | (L.terminal z.1 z.2.1 z.2.2).1 = t β§ angularError z.1 (L.estimate z.1 z.2.1 z.2.2) β€ Ξ΅} | |
| end Learner | |
| end | |
| namespace FiniteKernelLearner | |
| section | |
| universe u | |
| variable {d M T : β} | |
| def seededSuccess {Ξ : Type u} [MeasurableSpace Ξ] | |
| (K : Ξ β FiniteKernelLearner d M T) (Ο : Measure Ξ) (Ξ΅ : β) : ββ₯0β := | |
| β«β» ΞΎ, (K ΞΎ).uniformSuccess Ξ΅ βΟ | |
| def seededFixedSuccess {Ξ : Type u} [MeasurableSpace Ξ] | |
| (K : Ξ β FiniteKernelLearner d M T) (Ο : Measure Ξ) (Ξ΅ : β) (t : β) : ββ₯0β := | |
| β«β» ΞΎ, (K ΞΎ).uniformFixedSuccess Ξ΅ t βΟ | |
| def FixedQuadraticMemory : Prop := | |
| β Aβ : β, 0 < Aβ β β c : β, 0 < c β§ β dβ : β, | |
| β d : β, dβ β€ d β β M T : β, (M : β) β€ Aβ * (d : β)^2 β | |
| β Ξ΅ : β, 0 < Ξ΅ β Ξ΅ β€ 1/10 β | |
| β (Ξ : Type u) [MeasurableSpace Ξ] (Ο : Measure Ξ), IsProbabilityMeasure Ο β | |
| β K : Ξ β FiniteKernelLearner d M T, (βα΅ ΞΎ βΟ, (K ΞΎ).CompletedRules) β | |
| (2/3 : ββ₯0β) β€ seededSuccess K Ο Ξ΅ β | |
| c*(d:β)*Real.log (1/Ξ΅) β€ (T:β) | |
| end | |
| universe u | |
| variable {d M T : β} {Ξ : Type u} [MeasurableSpace Ξ] | |
| def conditionalSuccess (K : FiniteKernelLearner d M T) (Ξ΅ : β) | |
| (s : UnitSphere d) (x : Samples d T) : ββ₯0β := | |
| K.jointExperimentLaw (fun i => (x i,βͺs.val,x iβ«)) {r | Learner.angularError s r.2 β€ Ξ΅} | |
| def seededPointwiseSuccess (K : Ξ β FiniteKernelLearner d M T) (Ο : Measure Ξ) | |
| (Ξ΅ : β) (s : UnitSphere d) : ββ₯0β := | |
| β«β» z : Ξ Γ Samples d T, (K z.1).conditionalSuccess Ξ΅ s z.2 βΟ.prod (sampleLaw d T) | |
| def JointSuccessMeasurable (K : Ξ β FiniteKernelLearner d M T) (Ο : Measure Ξ) (Ξ΅ : β) : Prop := | |
| AEMeasurable (fun z : UnitSphere d Γ (Ξ Γ Samples d T) => | |
| (K z.2.1).conditionalSuccess Ξ΅ z.1 z.2.2) | |
| ((uniformSphere d).prod (Ο.prod (sampleLaw d T))) | |
| def SubquadraticMemoryWithPointwise : Prop := | |
| β c : β, 0 < c β§ β M : β β β, | |
| Asymptotics.IsLittleO atTop (fun d => (M d : β)) (fun d => (d:β)^2) β | |
| β dβ : β, β d : β, dβ β€ d β β T : β, β Ξ΅ : β, | |
| 0 < Ξ΅ β Ξ΅ β€ 1/10 β | |
| β (Ξ : Type u) [MeasurableSpace Ξ] (Ο : Measure Ξ), IsProbabilityMeasure Ο β | |
| β K : Ξ β FiniteKernelLearner d (M d) T, (βα΅ ΞΎ βΟ, (K ΞΎ).CompletedRules) β | |
| ((2/3 : ββ₯0β) β€ seededSuccess K Ο Ξ΅ β¨ | |
| (JointSuccessMeasurable K Ο Ξ΅ β§ β s, (2/3 : ββ₯0β) β€ seededPointwiseSuccess K Ο Ξ΅ s)) β | |
| c*(d:β)*Real.log (1/Ξ΅) β€ (T:β) | |
| end FiniteKernelLearner | |
| end NoiselessRegression | |
| open MeasureTheory ProbabilityTheory Set Filter InnerProductSpace | |
| open NoiselessRegression NoiselessRegression.FiniteKernelLearner | |
| open scoped ENNReal NNReal RealInnerProductSpace Topology | |
| universe u | |
| namespace ProjectionMoments | |
| def IntegratedFrameMoment : Prop := | |
| β C : β, 1 β€ C β§ β (d k q : β) (Ξ² K R : β) | |
| (Ξ½ : Measure (EuclideanSpace β (Fin d))) [IsFiniteMeasure Ξ½] | |
| (z : EuclideanSpace β (Fin d)) (u : Fin k β EuclideanSpace β (Fin d)), | |
| 1 β€ k β 2 β€ q β k+q β€ d β 0 < Ξ² β Ξ² β€ d β | |
| 1 β€ Ξ²-k-((q:β)-2) β 0 β€ K β 0 < R β | |
| Ξ½.support β Metric.closedBall z R β AllBallMass Ξ½ K Ξ² β | |
| Orthonormal β u β | |
| (βα΅ A βframeLaw u, Ξ½.map (coordinateMap A) βͺ (volume : Measure (Fin k β β))) β | |
| Measurable (coordinateDensity Ξ½ k) β§ | |
| (βα΅ A βframeLaw u, | |
| (volume : Measure (Fin k β β)).withDensity (fun y => coordinateDensity Ξ½ k (A,y)) = | |
| Ξ½.map (coordinateMap A)) β§ | |
| (β (A : Fin k β EuclideanSpace β (Fin d)), Orthonormal β A β | |
| β y : Fin k β β, | |
| R < βWithLp.toLp 2 (y-coordinateMap A z)β β coordinateDensity Ξ½ k (A,y) = 0) β§ | |
| (β«β» A, β«β» y : Fin k β β, coordinateDensity Ξ½ k (A,y)^q βvolume βframeLaw u) ^ (1/(q:β)) β€ | |
| ENNReal.ofReal (C^d * (C*Real.sqrt d)^((k:β)*(1-1/(q:β))) * | |
| K * R^(Ξ²-(k:β)*(1-1/(q:β)))) | |
| def NormalizedUnitBallMoment : Prop := | |
| β D : β, 0 < D β | |
| β C_D : β, 0 < C_D β§ β d : β, 32 β€ d β | |
| let k := d/16 | |
| let lam : β := ((d:β)-1)/2 | |
| β (Ξ½ : Measure (EuclideanSpace β (Fin d))) [IsFiniteMeasure Ξ½] | |
| (u : Fin k β EuclideanSpace β (Fin d)), | |
| Ξ½ Set.univ β€ 1 β Ξ½.support β Metric.closedBall 0 1 β | |
| AllBallMass Ξ½ (D^d) lam β Orthonormal β u β | |
| (βα΅ X βMeasure.pi (fun _ : Fin k => stdGaussian (EuclideanSpace β (Fin d))), | |
| Ξ½.map (rowMap (polarRows u X)) βͺ (volume : Measure (Label k))) β | |
| Measurable (normalizedDensity Ξ½ k u) β§ | |
| (βα΅ X βMeasure.pi (fun _ : Fin k => stdGaussian (EuclideanSpace β (Fin d))), | |
| ((unitBallVolume k)β»ΒΉ β’ (volume : Measure (Label k))).withDensity | |
| (fun y => normalizedDensity Ξ½ k u (X,y)) = Ξ½.map (rowMap (polarRows u X))) β§ | |
| (β X y, 1 < βyβ β normalizedDensity Ξ½ k u (X,y) = 0) β§ | |
| (β«β» X, β«β» y, normalizedDensity Ξ½ k u (X,y)^k βunitBallLaw k | |
| βMeasure.pi (fun _ => stdGaussian (EuclideanSpace β (Fin d)))) β€ | |
| ENNReal.ofReal (Real.exp (C_D*d*k)) | |
| def AllRadiiSphereMoment : Prop := | |
| β C : β, 1 β€ C β§ β d : β, 16 β€ d β | |
| let k := d/4 | |
| let Ξ² : β := (d:β)-1-k | |
| β f : EuclideanSpace β (Fin d) β ββ₯0β, | |
| Measurable f β (β s, f s β€ 1) β | |
| β K : β, 0 β€ K β | |
| AllBallMass (NoiselessRegression.ambientSphereLaw.withDensity f) K Ξ² β | |
| β z : EuclideanSpace β (Fin d), β R : β, 0 < R β | |
| β u : Fin k β EuclideanSpace β (Fin d), Orthonormal β u β | |
| let ΞΌ := sphereWeightedRestriction f (Metric.closedBall z R) | |
| Measurable (coordinateDensity ΞΌ k) β§ | |
| (β A : Fin k β EuclideanSpace β (Fin d), Orthonormal β A β | |
| (volume : Measure (Fin k β β)).withDensity (fun y => coordinateDensity ΞΌ k (A,y)) = | |
| ΞΌ.map (coordinateMap A)) β§ | |
| (β A : Fin k β EuclideanSpace β (Fin d), Orthonormal β A β | |
| β y : Fin k β β, R < βWithLp.toLp 2 (y-coordinateMap A z)β β | |
| coordinateDensity ΞΌ k (A,y) = 0) β§ | |
| (β«β» A, β«β» y : Fin k β β, coordinateDensity ΞΌ k (A,y)^k βvolume βframeLaw u) ^ (1/(k:β)) β€ | |
| ENNReal.ofReal (C^d*(C*Real.sqrt d)^((k:β)*(1-1/(k:β)))* | |
| K*R^(Ξ²-(k:β)*(1-1/(k:β)))) | |
| def PositiveCapDomination : Prop := | |
| β C : β, 0 < C β§ β d : β, 32 β€ d β | |
| let k := d/16 | |
| let Ξ± : β := ((d:β)-1)/2 | |
| β (c : EuclideanSpace β (Fin d)), βcβ = 1 β | |
| β r : β, 0 < r β r β€ 2 β β N : β, | |
| β K : Fin N β (Fin k β EuclideanSpace β (Fin d)) Γ Label k β ββ₯0β, | |
| (β j, Measurable (K j)) β (β z, β j, K j z β€ 1) β | |
| (β j, capReference (K j) c r) β€ 1 β§ | |
| β j, β D : CapDictionary c r Ξ±, β a : D.I β β, | |
| (β i, 0 β€ a i) β§ Summable (fun i => a i*(r/D.radius i)^Ξ±) β§ | |
| (β' i, a i*(r/D.radius i)^Ξ±) β€ Real.exp (C*d)*(capReference (K j) c r).toReal^(1-1/(k:β)) β§ | |
| (capMeasure c r).withDensity (capKernelValue (K j)) β€ | |
| Measure.sum (fun i => ENNReal.ofReal (a i) β’ capMeasure (D.center i) (D.radius i)) β§ | |
| (Measure.sum (fun i => ENNReal.ofReal (a i) β’ capMeasure (D.center i) (D.radius i))) Set.univ < β | |
| def DeterministicOffsetDensity : Prop := | |
| β C : β, 1 β€ C β§ β d : β, 16 β€ d β | |
| let k := d/8 | |
| let Ξ± : β := (d:β)/2 | |
| β h : EuclideanSpace β (Fin d) β ββ₯0β, Measurable h β (β s, h s β€ 1) β | |
| β z : EuclideanSpace β (Fin d), β Ο : β, 0 < Ο β | |
| β H : Set (EuclideanSpace β (Fin d)), MeasurableSet H β H β Metric.closedBall z Ο β | |
| rieszPotential Ξ± h < β β§ | |
| Measurable (lowerDensity (sphereWeightedRestriction h H) k) β§ | |
| (β A : Fin k β EuclideanSpace β (Fin d), LinearIndependent β A β | |
| volume.withDensity (fun y => lowerDensity (sphereWeightedRestriction h H) k (A,y)) = | |
| (sphereWeightedRestriction h H).map (rowMap A)) β§ | |
| (β b : Label k, (β«β» A, (lowerDensity (sphereWeightedRestriction h H) k (A,rowMap A z+b))^k | |
| βMeasure.pi (fun _ => stdGaussian (EuclideanSpace β (Fin d))))^(1/(k:β)) β€ | |
| ENNReal.ofReal (C^d) * rieszPotential Ξ± h * ENNReal.ofReal (Ο^(Ξ±-k))) β§ | |
| (β A y, βrowMap Aβ*Ο < βy-rowMap A zβ β | |
| lowerDensity (sphereWeightedRestriction h H) k (A,y) = 0) | |
| def AllRadiiBlockBound : Prop := | |
| β C : β, 1 β€ C β§ β d : β, 16 β€ d β | |
| let k := d/4 | |
| let Ξ² : β := (d:β)-1-k | |
| β N : β, β f : Fin N β EuclideanSpace β (Fin d) β ββ₯0β, | |
| (β j, Measurable (f j)) β (β j s, f j s β€ 1) β | |
| β K : β, 0 β€ K β | |
| (β j, AllBallMass (NoiselessRegression.ambientSphereLaw.withDensity (f j)) K Ξ²) β | |
| β Q : Fin N β (Fin k β EuclideanSpace β (Fin d)) Γ Label k β ββ₯0β, | |
| (β j, Measurable (Q j)) β (β z, β j, Q j z β€ 1) β | |
| AllBallMass (NoiselessRegression.ambientSphereLaw.withDensity (fractionalBlock Q f)) | |
| (C^d*(N:β)^(1/(k:β))*K) Ξ² | |
| def HaarStreamingCost : Prop := | |
| β C : β, 1 β€ C β§ β d M T : β, 16 β€ d β β Ξ΅ : β, | |
| 0 < Ξ΅ β Ξ΅ β€ 1/10 β | |
| β (Ξ : Type u) [MeasurableSpace Ξ] (Ο : Measure Ξ), IsProbabilityMeasure Ο β | |
| β K : Ξ β FiniteKernelLearner d M T, (βα΅ ΞΎ βΟ, (K ΞΎ).CompletedRules) β | |
| let k := d/4 | |
| let Nstar : β := ((k:β)+2)*2^M | |
| seededSuccess K Ο Ξ΅ β€ ENNReal.ofReal | |
| (C^d*Ξ΅^k*(C^d*Nstar^(1/(k:β)))^((T+k-1)/k)) | |
| def RieszStreamingCost : Prop := | |
| β Cβ : β, 1 β€ Cβ β§ β d M T : β, 16 β€ d β β Ξ΅ : β, | |
| 0 < Ξ΅ β Ξ΅ β€ 1/10 β | |
| β (Ξ : Type u) [MeasurableSpace Ξ] (Ο : Measure Ξ), IsProbabilityMeasure Ο β | |
| β K : Ξ β FiniteKernelLearner d M T, (βα΅ ΞΎ βΟ, (K ΞΎ).CompletedRules) β | |
| let q := d/8 | |
| let W : β := ((T:β)+2)*2^M | |
| seededSuccess K Ο Ξ΅ β€ ENNReal.ofReal | |
| (Cβ^d*Ξ΅^((d:β)/2-1)*(1+Cβ^d*(1+Real.log (1/Ξ΅))*W^(1/(q:β)))^((T+q-1)/q)) | |
| def CapFixedStoppingCost : Prop := | |
| β C : β, 0 < C β§ β d M T : β, 32 β€ d β β Ξ΅ : β, | |
| 0 < Ξ΅ β Ξ΅ β€ 1/10 β | |
| β (Ξ : Type u) [MeasurableSpace Ξ] (Ο : Measure Ξ), IsProbabilityMeasure Ο β | |
| β K : Ξ β FiniteKernelLearner d M T, (βα΅ ΞΎ βΟ, (K ΞΎ).CompletedRules) β | |
| β t : β, t β€ T β | |
| let k := d/16 | |
| let Ξ± : β := ((d:β)-1)/2 | |
| seededFixedSuccess K Ο Ξ΅ t β€ ENNReal.ofReal | |
| (Real.exp (C*d)*(Ξ΅/2)^Ξ±*(Real.exp (C*d)*(2:β)^((M:β)/k))^((t+k-1)/k)) | |
| def CapTotalStoppingCost : Prop := | |
| β C : β, 0 < C β§ β d M T : β, 32 β€ d β β Ξ΅ : β, | |
| 0 < Ξ΅ β Ξ΅ β€ 1/10 β | |
| β (Ξ : Type u) [MeasurableSpace Ξ] (Ο : Measure Ξ), IsProbabilityMeasure Ο β | |
| β K : Ξ β FiniteKernelLearner d M T, (βα΅ ΞΎ βΟ, (K ΞΎ).CompletedRules) β | |
| let k := d/16 | |
| let Ξ± : β := ((d:β)-1)/2 | |
| seededSuccess K Ο Ξ΅ β€ ENNReal.ofReal | |
| (((T:β)+1)*Real.exp (C*d)*(Ξ΅/2)^Ξ±* | |
| (Real.exp (C*d)*(2:β)^((M:β)/k))^((T+k-1)/k)) | |
| def CapFixedStoppingAsymptotic : Prop := | |
| β C : β, 0 < C β§ β M : β β β, | |
| Asymptotics.IsLittleO atTop (fun d => (M d:β)) (fun d => (d:β)^2) β | |
| β dβ : β, β d : β, dβ β€ d β β T : β, β Ξ΅ : β, | |
| 0 < Ξ΅ β Ξ΅ β€ 1/10 β | |
| β (Ξ : Type u) [MeasurableSpace Ξ] (Ο : Measure Ξ), IsProbabilityMeasure Ο β | |
| β K : Ξ β FiniteKernelLearner d (M d) T, (βα΅ ΞΎ βΟ, (K ΞΎ).CompletedRules) β | |
| β t : β, t β€ T β | |
| let k := d/16 | |
| let Ξ± : β := ((d:β)-1)/2 | |
| seededFixedSuccess K Ο Ξ΅ t β€ ENNReal.ofReal | |
| (Real.exp (C*d*(1+((t+k-1)/k:β)))*(Ξ΅/2)^Ξ±) | |
| def CapTotalStoppingAsymptotic : Prop := | |
| β Cβ Cβ : β, 0 < Cβ β§ 0 < Cβ β§ β M : β β β, | |
| Asymptotics.IsLittleO atTop (fun d => (M d:β)) (fun d => (d:β)^2) β | |
| β dβ : β, β d : β, dβ β€ d β β T : β, β Ξ΅ : β, | |
| 0 < Ξ΅ β Ξ΅ β€ 1/10 β | |
| β (Ξ : Type u) [MeasurableSpace Ξ] (Ο : Measure Ξ), IsProbabilityMeasure Ο β | |
| β K : Ξ β FiniteKernelLearner d (M d) T, (βα΅ ΞΎ βΟ, (K ΞΎ).CompletedRules) β | |
| seededSuccess K Ο Ξ΅ β€ ENNReal.ofReal | |
| (((T:β)+1)*Real.exp (Cβ*d+Cβ*T-(d:β)*Real.log (1/Ξ΅)/3)) | |
| def KernelModelBridge : Prop := | |
| β d M T : β, 3 β€ d β β K : FiniteKernelLearner d M T, K.CompletedRules β | |
| β (Ο : Measure (Tape M T)) (L : Learner d M T (Tape M T)), | |
| IsProbabilityMeasure Ο β§ L.MeasurableRules β§ L.Admissible Ο β§ | |
| (β Ξ΅, L.uniformSuccess Ο Ξ΅ = K.uniformSuccess Ξ΅) β§ | |
| (β Ξ΅ t, L.uniformFixedSuccess Ο Ξ΅ t = K.uniformFixedSuccess Ξ΅ t) | |
| def MainStatement : Prop := | |
| IntegratedFrameMoment β§ NormalizedUnitBallMoment β§ AllRadiiSphereMoment β§ | |
| PositiveCapDomination β§ DeterministicOffsetDensity β§ AllRadiiBlockBound β§ | |
| HaarStreamingCost.{u} β§ RieszStreamingCost.{u} β§ CapFixedStoppingCost.{u} β§ | |
| CapTotalStoppingCost.{u} β§ CapFixedStoppingAsymptotic.{u} β§ | |
| CapTotalStoppingAsymptotic.{u} β§ KernelModelBridge β§ | |
| NoiselessRegression.FiniteKernelLearner.SubquadraticMemoryWithPointwise.{u} β§ | |
| NoiselessRegression.FiniteKernelLearner.FixedQuadraticMemory.{u} | |
| end ProjectionMoments | |
| end | |
| end OAI | |