File size: 10,478 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 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 | import OAI.Probability.FreeIsing.Conditioning.FiniteFieldEntropyExpectation
import OAI.Probability.FreeIsing.Posterior.LipschitzObservationDerivative
namespace OAI
noncomputable section
open MeasureTheory ProbabilityTheory Set
open scoped BigOperators NNReal
namespace Problem367.FinitePosterior
variable {S V : Type*} [Fintype S] [Nonempty S] [Fintype V] [DecidableEq V]
[MeasurableSpace S] [MeasurableSingletonClass S] [StandardBorelSpace S]
theorem hasDerivAt_finiteStandardEntropyEnergy
(ΞΌ : Measure S) [IsProbabilityMeasure ΞΌ] (energy : S β β)
(hprior : β s, ΞΌ.real {s} = Real.exp (energy s) / β a, Real.exp (energy a))
(spin : S β V β β) (observable : S β β)
(hspin : β s, observable s = -1 β¨ observable s = 1)
(hneg : β s, observable s = -1) (hpos : β s, observable s = 1)
(hcoords : β s v, spin s v = -1 β¨ spin s v = 1)
{t : β} (ht : 0 < t) :
HasDerivAt
(fun r => β« x, fieldEntropy energy spin observable (finiteStandardObservation spin r x)
βΞΌ.prod (Measure.pi (fun _ : V => gaussianReal 0 1)))
(β« x, (1 + fieldMean energy spin observable (finiteStandardObservation spin t x) ^ 2) *
β v, normalizedFieldCovariance energy spin observable
(finiteStandardObservation spin t x) v ^ 2
βΞΌ.prod (Measure.pi (fun _ : V => gaussianReal 0 1))) t := by
have hd := hasDerivAt_integral_gaussianObservationCurve_of_integrable
(ΞΌ.prod (Measure.pi (fun _ : V => gaussianReal 0 1)))
(fieldEntropy energy spin observable) (fieldEntropyGradient energy spin observable)
(fun x => hasFDerivAt_fieldEntropy energy spin observable x hspin hneg hpos)
(fun v => continuous_fieldEntropyGradient energy spin observable v hspin hneg hpos)
2 (by norm_num)
(fun x v => abs_fieldEntropyGradient_le energy spin observable x v hspin hneg hpos
(fun s => (abs_spin_eq_one (fun s => spin s v) (fun s => hcoords s v) s).le))
(fun x : S Γ (V β β) => spin x.1) Prod.snd
((measurable_of_finite spin).comp measurable_fst) measurable_snd
(fun x v => (abs_spin_eq_one (fun s => spin s v) (fun s => hcoords s v) x.1).le)
(fun v => integrable_finiteStandardNoise ΞΌ v) ht
(integrable_finiteStandardEntropy ΞΌ energy spin observable hspin hneg hpos hcoords t)
apply hd.congr_deriv
exact integral_finiteStandardEntropyVelocity ΞΌ energy hprior spin observable hspin hneg hpos hcoords ht
theorem integral_finiteStandardEntropyEnergy
(ΞΌ : Measure S) [IsProbabilityMeasure ΞΌ] (energy : S β β)
(hprior : β s, ΞΌ.real {s} = Real.exp (energy s) / β a, Real.exp (energy a))
(spin : S β V β β) (observable : S β β)
(hspin : β s, observable s = -1 β¨ observable s = 1)
(hneg : β s, observable s = -1) (hpos : β s, observable s = 1)
(hcoords : β s v, spin s v = -1 β¨ spin s v = 1)
{T : β} (hT : 0 β€ T) :
let C : β β β := fun t => β« x,
(1 + fieldMean energy spin observable (finiteStandardObservation spin t x) ^ 2) *
β v, normalizedFieldCovariance energy spin observable
(finiteStandardObservation spin t x) v ^ 2
βΞΌ.prod (Measure.pi (fun _ : V => gaussianReal 0 1))
IntervalIntegrable C volume 0 T β§
(β« t in 0..T, C t) =
(β« x, fieldEntropy energy spin observable (finiteStandardObservation spin T x)
βΞΌ.prod (Measure.pi (fun _ : V => gaussianReal 0 1))) -
fieldEntropy energy spin observable 0 β§
0 β€ (β« t in 0..T, C t) := by
let Ο := ΞΌ.prod (Measure.pi (fun _ : V => gaussianReal 0 1))
let E : β β β := fun t => β« x,
fieldEntropy energy spin observable (finiteStandardObservation spin t x) βΟ
let C : β β β := fun t => β« x,
(1 + fieldMean energy spin observable (finiteStandardObservation spin t x) ^ 2) *
β v, normalizedFieldCovariance energy spin observable (finiteStandardObservation spin t x) v ^ 2 βΟ
have hG : Integrable (Prod.snd : S Γ (V β β) β (V β β)) Ο :=
Integrable.of_eval (fun v => integrable_finiteStandardNoise ΞΌ v)
have hE : Continuous E := by
simpa only [E, finiteStandardObservation, gaussianObservationCurve] using
continuous_integral_sqrt_observation_lipschitz
(integrable_finiteStandardSignal ΞΌ spin hcoords) hG
(lipschitzWith_fieldEntropy energy spin observable hspin hneg hpos
(fun s v => (abs_spin_eq_one (fun s => spin s v) (fun s => hcoords s v) s).le))
have hd (t : β) (ht : 0 < t) : HasDerivAt E (C t) t :=
hasDerivAt_finiteStandardEntropyEnergy ΞΌ energy hprior spin observable hspin hneg hpos hcoords ht
have hCpos (t : β) : 0 β€ C t := integral_nonneg fun x =>
mul_nonneg (by positivity) (Finset.sum_nonneg (fun v _ => sq_nonneg _))
have hCI : IntervalIntegrable C volume 0 T := by
apply intervalIntegral.intervalIntegrable_deriv_of_nonneg hE.continuousOn
Β· intro t ht
exact hd t (by simpa only [min_eq_left hT, max_eq_right hT] using ht.1)
Β· exact fun t _ => hCpos t
have hFTC : (β« t in 0..T, C t) = E T - E 0 :=
intervalIntegral.integral_eq_sub_of_hasDerivAt_of_le hT hE.continuousOn
(fun t ht => hd t ht.1) hCI
have hzero : E 0 = fieldEntropy energy spin observable 0 := by
simp [E, finiteStandardObservation, gaussianObservationCurve, Ο]
exact β¨hCI, by simpa only [hzero] using hFTC,
intervalIntegral.integral_nonneg_of_forall hT hCposβ©
omit [DecidableEq V] [StandardBorelSpace S] in
theorem continuous_finiteStandardNormalizedEnergy
(ΞΌ : Measure S) [IsFiniteMeasure ΞΌ] (energy : S β β)
(spin : S β V β β) (observable : S β β)
(hspin : β s, observable s = -1 β¨ observable s = 1)
(hneg : β s, observable s = -1) (hpos : β s, observable s = 1)
(hcoords : β s v, spin s v = -1 β¨ spin s v = 1) :
Continuous (fun t : β => β« x, β v, normalizedFieldCovariance energy spin observable
(finiteStandardObservation spin t x) v ^ 2
βΞΌ.prod (Measure.pi (fun _ : V => gaussianReal 0 1))) := by
simpa only [finiteStandardObservation, gaussianObservationCurve, Function.comp_def] using
continuous_integral_sqrt_observation
(((measurable_of_finite spin).comp measurable_fst).aestronglyMeasurable)
(measurable_snd.aestronglyMeasurable)
(continuous_normalizedRowEnergy energy spin observable hspin hneg hpos)
(fun x => abs_normalizedRowEnergy_le_card energy spin observable x hspin hneg hpos
(fun s v => (abs_spin_eq_one (fun s => spin s v) (fun s => hcoords s v) s).le))
theorem integral_finiteStandardNormalizedEnergy_le
(ΞΌ : Measure S) [IsProbabilityMeasure ΞΌ] (energy : S β β)
(hprior : β s, ΞΌ.real {s} = Real.exp (energy s) / β a, Real.exp (energy a))
(spin : S β V β β) (observable : S β β)
(hspin : β s, observable s = -1 β¨ observable s = 1)
(hneg : β s, observable s = -1) (hpos : β s, observable s = 1)
(hcoords : β s v, spin s v = -1 β¨ spin s v = 1)
{T : β} (hT : 0 β€ T) :
let Q : β β β := fun t => β« x, β v, normalizedFieldCovariance energy spin observable
(finiteStandardObservation spin t x) v ^ 2
βΞΌ.prod (Measure.pi (fun _ : V => gaussianReal 0 1))
IntervalIntegrable Q volume 0 T β§
(β« t in 0..T, Q t) β€
(β« x, fieldEntropy energy spin observable (finiteStandardObservation spin T x)
βΞΌ.prod (Measure.pi (fun _ : V => gaussianReal 0 1))) -
fieldEntropy energy spin observable 0 β§
0 β€ (β« t in 0..T, Q t) := by
let Ο := ΞΌ.prod (Measure.pi (fun _ : V => gaussianReal 0 1))
let Q : β β β := fun t => β« x, β v, normalizedFieldCovariance energy spin observable
(finiteStandardObservation spin t x) v ^ 2 βΟ
let C : β β β := fun t => β« x,
(1 + fieldMean energy spin observable (finiteStandardObservation spin t x) ^ 2) *
β v, normalizedFieldCovariance energy spin observable (finiteStandardObservation spin t x) v ^ 2 βΟ
have hsignal : β s v, |spin s v| β€ 1 :=
fun s v => (abs_spin_eq_one (fun s => spin s v) (fun s => hcoords s v) s).le
have hQI : IntervalIntegrable Q volume 0 T :=
(continuous_finiteStandardNormalizedEnergy ΞΌ energy spin observable hspin hneg hpos hcoords).intervalIntegrable 0 T
have hFTC := integral_finiteStandardEntropyEnergy ΞΌ energy hprior spin observable
hspin hneg hpos hcoords hT
have hmono (t : β) : Q t β€ C t := by
let Y := finiteStandardObservation spin t
let q := fun x => β v, normalizedFieldCovariance energy spin observable (Y x) v ^ 2
let a := fun x => 1 + fieldMean energy spin observable (Y x) ^ 2
have hY : Measurable Y := measurable_finiteStandardObservation spin t
have hq : Integrable q Ο := by
apply Integrable.of_bound
(((continuous_normalizedRowEnergy energy spin observable hspin hneg hpos).measurable.comp hY).aestronglyMeasurable)
(Fintype.card V : β)
exact Filter.Eventually.of_forall fun x => by
simpa only [Real.norm_eq_abs, Function.comp_def] using
abs_normalizedRowEnergy_le_card energy spin observable (Y x) hspin hneg hpos hsignal
have ha : AEStronglyMeasurable a Ο :=
((continuous_const.add ((continuous_fieldMean energy spin observable).pow 2)).measurable.comp hY).aestronglyMeasurable
have hbound : β x, βa xβ β€ 2 := by
intro x
have hm := abs_fieldMean_le energy spin observable (Y x) 1
(fun s => (abs_spin_eq_one observable hspin s).le)
have hm2 := (sq_le_one_iff_abs_le_one _).mpr hm
simp only [a, Real.norm_eq_abs, abs_of_nonneg (by positivity : 0 β€ 1 + fieldMean energy spin observable (Y x) ^ 2)]
linarith
have hCInt : Integrable (fun x => a x * q x) Ο := by
simpa only [mul_comm] using hq.mul_bdd ha (Filter.Eventually.of_forall hbound)
apply integral_mono hq hCInt
intro x
have hqpos : 0 β€ q x := Finset.sum_nonneg fun v _ => sq_nonneg _
have hp := mul_nonneg (sq_nonneg (fieldMean energy spin observable (Y x))) hqpos
dsimp [a]
nlinarith
have hQC : (β« t in 0..T, Q t) β€ β« t in 0..T, C t :=
intervalIntegral.integral_mono hT hQI hFTC.1 hmono
refine β¨hQI, hQC.trans_eq hFTC.2.1, ?_β©
exact intervalIntegral.integral_nonneg_of_forall hT fun t =>
integral_nonneg fun x => Finset.sum_nonneg fun v _ => sq_nonneg _
end Problem367.FinitePosterior
end
end OAI
|