have h := (observedLocalCount_information_measurable (N:=N) ell k (Nat.zero_le _) y R).mono
(observationInformation_le ell 0) (le_refl _)
apply (integrable_const (N:ℝ)).mono' h.aestronglyMeasurable
exact ae_of_all _ (fun z =>by
simpa only [Real.norm_eq_abs,abs_of_nonneg (observedLocalCount_nonneg ell k y R z)] using
observedLocalCount_le ell k y R z)
theoremposterior_observed_test_sandwich {NK : ℕ} (μ : Measure (ConfigurationN))
[IsFiniteMeasure μ] (ell : FinK→ℝ) (hell : ∀ k, 0≤ ell k)
{j : ℕ} (k : FinK) (hk : j ≤ k.val) {g : Space→ℝ} {L : ℝ≥0}
(hg : LipschitzWithL g) (y : Space) (R : ℝ)
(hs : Function.support g ⊆ closedBall y R) :
∀ᵐ z ∂physicalObservationLaw μ K,
|posteriorTestValue μ ell j g z-(∑ i, g (physicalObservedConfiguration ell k z i))| ≤
observedLocalCount ell k y (R+Real.sqrt 3*ell k) z*((L:ℝ)*(Real.sqrt 3*ell k)) :=by
proof · 15
lines
havehc : HasCompactSupport g :=HasCompactSupport.of_support_subset_isCompact (isCompact_closedBall y R) hs
have hf := integrable_configuration_test (physicalObservationLaw μ K)
measurable_fst hg.continuous hc
have hh := integrable_configuration_test (physicalObservationLaw μ K)
(physicalObservedConfiguration_measurable ell k) hg.continuous hc
have hd := (observedLocalCount_integrable μ ell k y (R+Real.sqrt 3*ell k)).mul_const
((L:ℝ)*(Real.sqrt 3*ell k))
have hhm := (observedStatistic_information_measurable (N:=N) ell k hk hg.continuous.measurable).stronglyMeasurable
have hdm := ((observedLocalCount_information_measurable (N:=N) ell k hk y (R+Real.sqrt 3*ell k)).mul_const
((L:ℝ)*(Real.sqrt 3*ell k))).stronglyMeasurable
apply condExp_observable_sandwich (observationInformation_le ell j)
(physicalObservationLaw μ K) hf hh hd hhm hdm
filter_upwards [physicalObservationLaw_ae_displacement μ ell hell] with z hz
exact matchedLocal_test_error z.1 (physicalObservedConfiguration ell k z)
(mul_nonneg (Real.sqrt_nonneg _) (hell k)) (hz k) hg y hs
filter_upwards [physicalObservationLaw_ae_displacement μ ell hell,
posterior_observed_test_sandwich μ ell hell k hk hg y R hs] with z hz hp
have hr := matchedLocal_test_error z.1 (physicalObservedConfiguration ell k z)
(mul_nonneg (Real.sqrt_nonneg _) (hell k)) (hz k) hg y hs
havehe : (∑ i, g (z.1 i))-posteriorTestValue μ ell j g z =
((∑ i, g (z.1 i))-(∑ i, g (physicalObservedConfiguration ell k z i)))+
((∑ i, g (physicalObservedConfiguration ell k z i))-posteriorTestValue μ ell j g z) :=by ring
rw [he]
refine (abs_add_le _ _).trans ?_
rw [abs_sub_comm (∑ i, g (physicalObservedConfiguration ell k z i))]
change _+_ ≤2*observedLocalCount ell k y (R+Real.sqrt 3*ell k) z*((L:ℝ)*(Real.sqrt 3*ell k))
dsimp only [observedLocalCount] at hp ⊢
linarith