lemmaobservableRows_law {d ℓ k m : ℕ} {u : Tuple d m}
(hu : LinearIndependentℝ (differences u)) (hkm : k+m ≤ ℓ) :
(auxLaw d ℓ k).map (observableRows u) = constrainedRows k u :=by
proof · 10
lines
apply Measure.ext_of_lintegral
intro H hH
rw [lintegral_map hH (by fun_prop), auxLaw, lintegral_prod _ (by fun_prop)]
change (∫⁻ B, ∫⁻ e, H (rowMix (randomComplement (pairingColumns (differences u) B) e) B) ∂gaussianRows ℓ k ∂gaussianRows d ℓ) = _
have he := observable_gaussian_lintegral hu hkm (H:=fun z =>H z.2) (by fun_prop)
dsimp only [Prod.snd] at he
rw [he]
simp only [lintegral_const, measure_univ, mul_one]
rw [constrainedRows, lintegral_map hH (by fun_prop)]
rfl
defobservableLikelihood {d ℓ k m : ℕ} (f : Vec d →ℝ≥0∞)
(z : Observation d ℓ k m) : ℝ≥0∞:=
body · 5
lines
letC:= randomComplement (differences z.2) z.1.2
equalConstant k m * (wishartMoment ℓ m k)⁻¹ *
(ENNReal.ofReal (affineVolume z.2))⁻¹^k *
(projectedDensity .spherical f (rowMix C z.1.1)
(fun i => ⟪C i,z.20⟫))⁻¹^m
@[fun_prop]lemmameasurable_observableLikelihood {d ℓ k m : ℕ} {f : Vec d →ℝ≥0∞}
(hf : Measurable f) : Measurable (@observableLikelihood d ℓ k m f) :=by
lemmaobservableLikelihood_observe {d ℓ k m : ℕ} (f : Vec d →ℝ≥0∞)
(z : EqualSpace d k m ×AuxSpace d ℓ k) :
observableLikelihood f (observe z) = equalConstant k m * (wishartMoment ℓ m k)⁻¹ *
(ENNReal.ofReal (gramVolume (pairingColumns (differences z.1.2.2) z.2.1)))⁻¹^k *
(projectedDensity .spherical f (observableRows z.1.2.2 z.2)
(labels (observableRows z.1.2.2 z.2) (z.1.2.20)))⁻¹^m :=by
lemmaobservableLikelihood_fixed_lintegral {d ℓ k m : ℕ}
(hk : 1≤ k) (hkm : k+m ≤ ℓ) {u : Tuple d m}
(hu : LinearIndependentℝ (differences u))
{f : Vec d →ℝ≥0∞} (hf : Measurable f) (A : Rows d k) (y : Labels k) :
(∫⁻ b, observableLikelihood f (observe ((A,y,u),b)) ∂auxLaw d ℓ k) =
∫⁻ A, replicaDensity .spherical f (A,labels A (u 0),u) ∂constrainedRows k u :=by
proof · 30
lines
simp_rw [observableLikelihood_observe]
rw [auxLaw,lintegral_prod _ (by fun_prop)]
have h := observable_gaussian_lintegral hu hkm
(H:=funz : Rows ℓ m ×Rows d k => equalConstant k m * (wishartMoment ℓ m k)⁻¹ *
(ENNReal.ofReal (gramVolume z.1))⁻¹^k *
(projectedDensity .spherical f z.2 (labels z.2 (u 0)))⁻¹^m) (by unfold labels; fun_prop)
change _ = _ at h
rw [show (∫⁻ B, ∫⁻ e, equalConstant k m * (wishartMoment ℓ m k)⁻¹ *
(ENNReal.ofReal (gramVolume (pairingColumns (differences u) B)))⁻¹^k *
(projectedDensity .spherical f (observableRows u (B,e))
(labels (observableRows u (B,e)) (u 0)))⁻¹^m ∂gaussianRows ℓ k ∂gaussianRows d ℓ) = _ from h]
simp_rw [lintegral_const_mul _ (showMeasurable (funA : Rows d k =>
(projectedDensity .spherical f (fun i => (Submodule.span ℝ (range (differences u)))ᗮ.starProjection (A i))
(labels (fun i => (Submodule.span ℝ (range (differences u)))ᗮ.starProjection (A i)) (u 0)))⁻¹^m) by unfold labels; fun_prop)]
rw [lintegral_mul_const _ (by fun_prop),lintegral_const_mul _ (by fun_prop),pairingColumns_inverse_moment hu (byomega : m ≤ ℓ)]
rw [constrainedRows,lintegral_map (by unfold replicaDensity labels; fun_prop) (by fun_prop)]
unfold replicaDensity
dsimp only
rw [lintegral_const_mul _ (by unfold labels; fun_prop)]
have hz := wishartMoment_pos (ℓ := ℓ) (m := m) (k := k) (by omega)
have ht := wishartMoment_ne_top hk hkm
havehc : equalConstant k m * (wishartMoment ℓ m k)⁻¹ *
((ENNReal.ofReal (gramVolume (differences u)))⁻¹^k * wishartMoment ℓ m k) =
equalConstant k m * (ENNReal.ofReal (gramVolume (differences u)))⁻¹^k :=bycalc
_ = (equalConstant k m * (ENNReal.ofReal (gramVolume (differences u)))⁻¹^k) *
((wishartMoment ℓ m k)⁻¹ * wishartMoment ℓ m k) :=by ring
_ = _ :=by rw [ENNReal.inv_mul_cancel hz.ne' ht,mul_one]
rw [hc]
rfl
lemmaobservableDensity_expected {d ℓ k m : ℕ} {u : Tuple d m}
(hu : LinearIndependentℝ (differences u)) (hkm : k+m ≤ ℓ)
{f : Vec d →ℝ≥0∞} (hf : Measurable f) :
(∫⁻ b, projectedDensity .spherical f (observableRows u b) (labels (observableRows u b) (u 0))
∂auxLaw d ℓ k) = ∫⁻ A, projectedDensity .spherical f (residualRows u A)
(labels (residualRows u A) (u 0)) ∂gaussianRows d k :=by
proof · 3
lines
rw [← lintegral_map (f :=funA : Rows d k => projectedDensity .spherical f A (labels A (u 0)))
(by unfold labels; fun_prop) (by fun_prop),observableRows_law hu hkm,
constrainedRows_eq_residualRows hu,lintegral_map (by unfold labels; fun_prop) (by fun_prop)]