File size: 4,152 Bytes
4a56cd6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | 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
|