Download data/lean/OAI/Probability/GaussianReplacement/FiberModel.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 4.15 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/GaussianReplacement/FiberModel.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/GaussianReplacement/FiberModel.lean
-
curl -L -o FiberModel.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/GaussianReplacement/FiberModel.lean
4.15 kB
| import OAI.Probability.GaussianReplacement.FiberBlock | |
| namespace OAI | |
| open MeasureTheory ProbabilityTheory Set Filter | |
| open scoped ENNReal NNReal RealInnerProductSpace Topology | |
| noncomputable section | |
| namespace CurrentProjection | |
| open InnerProductSpace | |
| open InformationTheory | |
| def fiberObservationLaw (d k : β) : Measure ((Rows k dΓ(Fin kββ))ΓSphere d) := | |
| ((gaussianRows k d).prod (uniformSphere d)).map | |
| (fun z => ((z.1,label z.1 (z.2:Vector d)),z.2)) | |
| lemma measurable_fiberObservationMap {d k : β} : | |
| Measurable (fun z : Rows k dΓSphere d => ((z.1,label z.1 (z.2:Vector d)),z.2)) := | |
| (measurable_fst.prodMk measurable_own_label).prodMk measurable_snd | |
| instance uniformSphere_finite (d : β) : IsFiniteMeasure (uniformSphere d) := by | |
| constructor | |
| unfold uniformSphere | |
| rw [Measure.smul_apply, smul_eq_mul] | |
| exact lt_of_le_of_lt (ENNReal.inv_mul_le_one _) ENNReal.one_lt_top | |
| instance fiberObservationLaw_finite (d k : β) : IsFiniteMeasure (fiberObservationLaw d k) := by | |
| unfold fiberObservationLaw | |
| infer_instance | |
| lemma sphere_standardBorel (d : β) : StandardBorelSpace (Sphere d) := | |
| Metric.isClosed_sphere.measurableSet.standardBorel | |
| def sphericalFiberKernel (d k : β) [sphereNonempty : Nonempty (Sphere d)] : | |
| Kernel (Rows k dΓ(Fin kββ)) (Sphere d) := | |
| @Measure.condKernel (Rows k dΓ(Fin kββ)) (Sphere d) _ _ | |
| (sphere_standardBorel d) sphereNonempty | |
| (fiberObservationLaw d k) (fiberObservationLaw_finite d k) | |
| instance sphericalFiberKernel_markov (d k : β) [Nonempty (Sphere d)] : | |
| IsMarkovKernel (sphericalFiberKernel d k) := by | |
| unfold sphericalFiberKernel | |
| infer_instance | |
| def fiberTwoPointLeft (d k : β) [Nonempty (Sphere d)] : Measure (Rows k dΓ(Sphere dΓSphere d)) := | |
| ((((gaussianRows k d).prod (uniformSphere d)).withDensity | |
| (fun z => exactDensity (uniformSphere d) z.1 (label z.1 (z.2:Vector d)))) ββ | |
| ((sphericalFiberKernel d k).comap (fun z => (z.1,label z.1 (z.2:Vector d))) | |
| (measurable_fst.prodMk measurable_own_label))).map | |
| (fun z => (z.1.1,(z.1.2,z.2))) | |
| def perpendicularRow {d : β} (v g : Vector d) : Vector d := | |
| letI : NormedAddCommGroup (Vector d) := PiLp.normedAddCommGroup 2 (fun _ : Fin d => β) | |
| letI : InnerProductSpace β (Vector d) := PiLp.innerProductSpace (fun _ : Fin d => β) | |
| g - (βͺv,gβ« / βvβ^2) β’ v | |
| lemma measurable_perpendicularRow {d : β} : | |
| Measurable (fun z : Vector dΓVector d => perpendicularRow z.1 z.2) := by | |
| unfold perpendicularRow | |
| fun_prop | |
| def perpendicularRowsKernel (d k : β) : Kernel (Sphere dΓSphere d) (Rows k d) := | |
| dependentMapKernel (Kernel.const (Sphere dΓSphere d) (gaussianRows k d)) | |
| (fun z => fun i => perpendicularRow ((z.1.1:Vector d)-(z.1.2:Vector d)) (z.2 i)) | |
| def fiberTwoPointConstant (k : β) : ββ₯0β := | |
| letI : OfNat β 2 := @instOfNatAtLeastTwo β 2 Real.instNatCast inferInstance | |
| letI : Mul β := Real.instMul | |
| letI : Inv β := Real.instInv | |
| letI : Pow β β := @NPow.toPow β Real.instMonoid.toNPow | |
| ENNReal.ofReal ((Real.sqrt (2*Real.pi))β»ΒΉ ^ k) | |
| def fiberDistanceWeight {d : β} (k : β) (z : Sphere dΓSphere d) : ββ₯0β := | |
| (ENNReal.ofReal β(z.1:Vector d)-(z.2:Vector d)β)β»ΒΉ ^ k | |
| def fiberTwoPointRight (d k : β) : Measure (Rows k dΓ(Sphere dΓSphere d)) := | |
| letI : IsScalarTower ββ₯0β ββ₯0β ββ₯0β := Semigroup.isScalarTower | |
| fiberTwoPointConstant k β’ | |
| Measure.map (Prod.swap : (Sphere dΓSphere d)ΓRows k d β Rows k dΓ(Sphere dΓSphere d)) | |
| (Measure.compProd | |
| (Measure.withDensity (Measure.prod (uniformSphere d) (uniformSphere d)) | |
| (fiberDistanceWeight k)) | |
| (perpendicularRowsKernel d k)) | |
| def FiberTwoPointMain : Prop := | |
| β (d k : β) (_hk : 1 β€ k) (hkd : k < d-1), | |
| letI : IsProbabilityMeasure (uniformSphere d) := | |
| uniformSphere_probability_of_pos (by omega) | |
| letI : Nonempty (Sphere d) := nonempty_of_isProbabilityMeasure (uniformSphere d) | |
| IsFiniteMeasure (fiberTwoPointLeft d k) β§ IsFiniteMeasure (fiberTwoPointRight d k) β§ | |
| fiberTwoPointLeft d k = fiberTwoPointRight d k | |
| end CurrentProjection | |
| end | |
| end OAI | |