math / data /lean /OAI /Probability /Perceptron /Control /FreshControl.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
5.2 kB
import Mathlib
import OAI.Probability.Perceptron.Variational.QuantileReference
import OAI.Probability.Perceptron.Variational.QuantileLimit
namespace OAI
noncomputable section
open MeasureTheory ProbabilityTheory Filter Set
open scoped Topology ENNReal NNReal BigOperators BoundedContinuousFunction
namespace SphericalPerceptronFreeEnergy
instance compactPositivePairLaw_fst_isProbability
(Ξ½ : ProbabilityMeasure (CompactArray CompactJointOverlap)) :
IsProbabilityMeasure ((compactPositivePairLaw Ξ½).map Prod.fst) :=
inferInstance
lemma compactPositivePairLaw_spin_quantile
(Ξ½ : ProbabilityMeasure (CompactArray CompactJointOverlap))
(hn : βˆ€α΅ Q βˆ‚(Ξ½ : Measure (CompactArray CompactJointOverlap)), 0≀(Q 0 1).1.val) :
(Ξ½ : Measure (CompactArray CompactJointOverlap)).map (fun Q => (Q 0 1).1)=
(quantileSpinLaw (boundedQuantile ((compactPositivePairLaw Ξ½).map Prod.fst))
(boundedQuantile_measurable _) : Measure CompactOverlap) := by
have : IsProbabilityMeasure ((compactPositivePairLaw Ξ½).map Prod.fst) :=
inferInstance
change _=timeLaw.map (timeSpin ∘ boundedQuantile ((compactPositivePairLaw ν).map Prod.fst))
rw [←Measure.map_map timeSpin_continuous.measurable (boundedQuantile_measurable _),
timeLaw_eq_volume,boundedQuantile_law]
unfold compactPositivePairLaw
rw [Measure.map_map (f := fun Q : CompactArray CompactJointOverlap => compactPositivePair (Q 0 1))
measurable_fst (by exact compactPositivePair_measurable.comp (by fun_prop))]
rw [Measure.map_map timeSpin_continuous.measurable
(show Measurable (Prod.fst ∘ fun Q : CompactArray CompactJointOverlap => compactPositivePair (Q 0 1)) from
measurable_fst.comp (compactPositivePair_measurable.comp (by fun_prop)))]
apply Measure.map_congr
filter_upwards [hn] with Q hQ
apply Subtype.ext
change (Q 0 1).1.val=max 0 (Q 0 1).1.val
exact (max_eq_right hQ).symm
theorem compactGG_freshLog_control (Ξ½ : ProbabilityMeasure (CompactArray CompactJointOverlap))
(hGG : βˆ€ (r : β„•) (i : Fin r) (G : CompactBlock CompactJointOverlap r →ᡇ ℝ)
(a : CompactJointOverlap →ᡇ ℝ), compactGGDefect Ξ½ r i G a=0)
(hgeo : βˆ€α΅ Q βˆ‚(Ξ½ : Measure (CompactArray CompactJointOverlap)), CompactSpinGeometry Q)
(hn : βˆ€α΅ Q βˆ‚(Ξ½ : Measure (CompactArray CompactJointOverlap)), 0≀(Q 0 1).1.val)
(g : Jet3) (Ξ· : ProbabilityMeasure (FreshPartitionRange g.f))
(hm : βˆ€ r, (∫ x, x.val^r βˆ‚(Ξ· : Measure (FreshPartitionRange g.f)))=
∫ Q, freshReplicaArrayKernel (expBCF 1 g.f) r Q βˆ‚(Ξ½ : Measure _))
(P : Measure BrownianPath) [IsProbabilityMeasure P] (hB : IsBrownianReal brownianEval P) :
(∫ x, Real.log x.val βˆ‚(Ξ· : Measure (FreshPartitionRange g.f)))=
controlValue P g.f (quantileTrial (boundedQuantile ((compactPositivePairLaw Ξ½).map Prod.fst))) := by
obtain ⟨ρ,ξ,hG,hge,hp,hξ,hl⟩ := quantile_reference_exists
(boundedQuantile ((compactPositivePairLaw Ξ½).map Prod.fst)) (boundedQuantile_monotone _) g P hB
rw [freshLog_eq_of_pair_law ν ρ hGG hG hgeo hge
((compactPositivePairLaw_spin_quantile Ξ½ hn).trans hp.symm) g.f Ξ· ΞΎ hm hΞΎ]
exact hl
theorem source_contact_freshLog_control (k : β„•) (g : Jet3) (p d : β„• β†’ β„•) (z : Fin k β†’ ℝ)
(hz : StrictMono z) (hz0 : βˆ€ i, 0<z i) (hz1 : βˆ€ i, z i<1)
(t : β„• β†’ ℝβ‰₯0) (h : β„• β†’ Fin (k+1) β†’ ℝ)
(hh0 : βˆ€ n l, 0≀h n l) (hh : βˆ€ n, Monotone (h n))
(u : (n : β„•) β†’ Fin (n+1) β†’ ℝ)
(hu : βˆ€ n, u n ∈ Icc (fun _ => 1) (fun _ => 2))
(hmin : βˆ€ n, IsMinOn (fun v => quadraticBoxPenalty (sourcePenaltyWeight (n+1)) v-
sourceExpectedPressure n k g.f (fun j => p j.val) (fun j => d j.val) (h n) z (t n) v)
(Icc (fun _ : Fin (n+1) => 1) (fun _ => 2)) (u n))
{H T : ℝ} (hH : 0≀H) (hhH : βˆ€ n, h n 0≀H) (ht : βˆ€ n, (t n:ℝ)≀T)
(hcover : βˆ€ a b : β„•, 1≀a+b β†’ βˆƒ j, p j=a ∧ d j=b)
{Ξ½ : ProbabilityMeasure (CompactArray CompactJointOverlap)} {s : β„• β†’ β„•} (hs : StrictMono s)
(hlim : Tendsto (fun n => sourceGibbsArrayLaw (s n) k g.f
(fun a => p a.val) (fun a => d a.val) (h (s n)) (u (s n)) z (t (s n))) atTop (𝓝 Ξ½))
(P : Measure BrownianPath) [IsProbabilityMeasure P] (hB : IsBrownianReal brownianEval P) :
Tendsto (fun n => sourceFreshLog (s n) k g.f (fun a => p a.val) (fun a => d a.val)
(h (s n)) (u (s n)) z (t (s n))) atTop
(𝓝 (controlValue P g.f (quantileTrial (boundedQuantile ((compactPositivePairLaw Ξ½).map Prod.fst))))) := by
obtain ⟨η,hη,hm,hl⟩ := sourceFreshLog_tendsto k g.f (fun _ a => p a.val) (fun _ a => d a.val)
h hh0 hh u z t s hlim
have hGG := source_contact_limit_joint_gg k g.f p d z hz hz0 hz1 t h hh0 hh u hu hmin
hH hhH ht hs hlim hcover
have hgeo := source_contact_limit_spin_geometry k g.f p d z hz hz0 hz1 t h hh0 hh u hu hmin
hH hhH ht hcover hs hlim
have hn := compact_spin_nonnegative Ξ½ (compactRealLaw_gg Ξ½ hGG)
(sourceGibbsArray_limit_gram k g.f (fun _ a => p a.val) (fun _ a => d a.val) h u z t s hlim).1
rwa [compactGG_freshLog_control Ξ½ hGG hgeo hn g Ξ· hm P hB] at hl
end SphericalPerceptronFreeEnergy
end
end OAI