File size: 4,007 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 | import Mathlib.MeasureTheory.Integral.Bochner.Basic
import OAI.NumberTheory.Jacobsthal.Partitions.CompactTestGeometry
namespace OAI
namespace Erdos970
open scoped _root_.Erdos970
section
namespace NumberTheoryLean.CompactTestMeasurable
open _root_.Set _root_.Finset _root_.MeasureTheory ProbabilityTheory
open scoped ENNReal
open FinitePathGeometry FinitePathMeasures PrimeHistories PrimeKilledChain
open CompactTestGeometry RegeneratingInverseBands ActualCouplingUpdates ArrivalKernelGeometry
variable {w ell S : β} {start : Node}
theorem primeTest_measurable (F : Side β βΓβ β β) :
Measurable (primeTest (w:=w) (ell:=ell) (S:=S) (start:=start) F) := measurable_of_countable _
theorem continuousTest_measurable (v : β) (F : Side β βΓβ β β) (hF : β i,Measurable (F i)) :
Measurable (continuousTest v F) := by
have hcoord : Measurable (fun z : CostState => (gapValue v z,stateRatio z.1)) :=
(gapValue_measurable v).prodMk (stateRatio_measurable.comp measurable_fst)
have hside : MeasurableSet {z : CostState | stateSide z.1 = .even} :=
measurable_fst (side_set_measurable .even)
have heq : (fun z : CostState => F (stateSide z.1) (gapValue v z,stateRatio z.1)) =
(fun z => if stateSide z.1 = .even then F .even (gapValue v z,stateRatio z.1)
else F .odd (gapValue v z,stateRatio z.1)) := by
funext z
rcases z with β¨s,tβ©
cases s <;> rfl
have hb : Measurable (fun z : CostState => F (stateSide z.1) (gapValue v z,stateRatio z.1)) := by
rw [heq]
exact Measurable.ite hside ((hF .even).comp hcoord) ((hF .odd).comp hcoord)
exact hb.sumElim measurable_const
theorem primeTest_bound {F : Side β βΓβ β β} {A : β} (hA : 0 β€ A)
(hF : β i x,|F i x| β€ A) (z : ChainState w ell S start) : |primeTest F z| β€ A := by
cases z with
| none => simpa only [primeTest,abs_zero] using hA
| some h => exact hF _ _
theorem continuousTest_bound {F : Side β βΓβ β β} {A : β} (hA : 0 β€ A)
(hF : β i x,|F i x| β€ A) (v : β) (z : CemeteryKernel.Space CostState) :
|continuousTest v F z| β€ A := by
cases z with
| inr u => simpa only [continuousTest,abs_zero] using hA
| inl y => exact hF _ _
theorem test_difference_bound {F : Side β βΓβ β β} {A : β} (hA : 0 β€ A)
(hF : β i x,|F i x| β€ A) (v : β) (p : ChainState w ell S start) (z : CemeteryKernel.Space CostState) :
|primeTest F p-continuousTest v F z| β€ 2*A := by
exact (abs_sub _ _).trans (by linarith [primeTest_bound hA hF p,continuousTest_bound hA hF v z])
section Generic
variable {Ξ± : Type*} [MeasurableSpace Ξ±] {ΞΌ : Measure Ξ±}
theorem bounded_integrable [IsFiniteMeasure ΞΌ] {f : Ξ± β β} (hf : Measurable f)
{A : β} (hb : β x,|f x| β€ A) : Integrable f ΞΌ := by
refine (integrable_const A).mono' hf.aestronglyMeasurable ?_
exact Filter.Eventually.of_forall (fun x => by simpa only [Real.norm_eq_abs] using hb x)
theorem integral_difference_enorm {f g : Ξ± β β} (hf : Integrable f ΞΌ) (hg : Integrable g ΞΌ) :
ENNReal.ofReal |(β« x,f x βΞΌ)-(β« x,g x βΞΌ)| β€ β«β» x,ENNReal.ofReal |f x-g x| βΞΌ := by
rw [β integral_sub hf hg]
simpa only [Real.enorm_eq_ofReal_abs] using enorm_integral_le_lintegral_enorm (fun x => f x-g x)
theorem finite_integral_difference (ΞΌ : β β Measure Ξ±) (f g : Ξ± β β) (N : β)
(hf : β n β range N,Integrable f (ΞΌ n)) (hg : β n β range N,Integrable g (ΞΌ n)) :
ENNReal.ofReal |(β n β range N,β« x,f x βΞΌ n)-(β n β range N,β« x,g x βΞΌ n)| β€
β n β range N,β«β» x,ENNReal.ofReal |f x-g x| βΞΌ n := by
rw [β Finset.sum_sub_distrib]
refine (ENNReal.ofReal_le_ofReal (Finset.abs_sum_le_sum_abs _ _)).trans ?_
rw [ENNReal.ofReal_sum_of_nonneg (fun _ _ => abs_nonneg _)]
exact Finset.sum_le_sum (fun n hn => integral_difference_enorm (hf n hn) (hg n hn))
end Generic
end NumberTheoryLean.CompactTestMeasurable
end
end Erdos970
end OAI
|