introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
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