math / data /lean /OAI /Probability /InvariantIsing /Arrays /NSpinCascade.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
7.56 kB
import OAI.Probability.InvariantIsing.Fields.CascadeMarking
import OAI.Probability.InvariantIsing.Haar.Rotation
import OAI.Probability.IsingPerceptron.EnrichedFieldCap
namespace OAI
/-!
Gaussian cascade marking for the actual finite Ising partition function at
a fixed orthogonal rotation. The Haar variable is fixed in this result.
-/
noncomputable section
open MeasureTheory ProbabilityTheory
open scoped BigOperators NNReal
namespace InvariantIsing
def rotatedFieldTerminal {N : β„•} (eig : Fin N β†’ ℝ) (U : Rotation N)
(c z : Fin N β†’ ℝ) : ℝ :=
logPartition (fun Οƒ => rotatedEnergy eig U Οƒ + fieldEnergy (c + z) Οƒ)
lemma measurable_rotatedFieldTerminal {N : β„•} (eig : Fin N β†’ ℝ) (U : Rotation N)
(c : Fin N β†’ ℝ) : Measurable (rotatedFieldTerminal eig U c) := by
unfold rotatedFieldTerminal logPartition fieldEnergy
fun_prop
lemma abs_rotatedFieldTerminal_sub_le {N : β„•} (eig : Fin N β†’ ℝ) (U : Rotation N)
(c z w : Fin N β†’ ℝ) :
|rotatedFieldTerminal eig U c z - rotatedFieldTerminal eig U c w| ≀
(N : ℝ) * β€–z - wβ€– := by
have he (Οƒ : Spin N) :
|(rotatedEnergy eig U Οƒ + fieldEnergy (c + z) Οƒ) -
(rotatedEnergy eig U Οƒ + fieldEnergy (c + w) Οƒ)| ≀ (N : ℝ) * β€–z - wβ€– := by
rw [add_sub_add_left_eq_sub]
calc
_ ≀ βˆ‘ i, |(c + z) i - (c + w) i| := abs_fieldEnergy_sub_le _ _ Οƒ
_ = βˆ‘ i, |z i - w i| := by simp only [Pi.add_apply, add_sub_add_left_eq_sub]
_ ≀ βˆ‘ _ : Fin N, β€–z - wβ€– := Finset.sum_le_sum fun i _ => by
simpa only [Pi.sub_apply, Real.norm_eq_abs] using norm_le_pi_norm (z - w) i
_ = (N : ℝ) * β€–z - wβ€– := by simp
exact abs_logPartition_sub_le _ _ _ he
lemma rotatedFieldTerminal_linearGrowth {N : β„•} (eig : Fin N β†’ ℝ) (U : Rotation N)
(c : Fin N β†’ ℝ) : IsingPerceptron.HasLinearGrowth (rotatedFieldTerminal eig U c) := by
refine ⟨|rotatedFieldTerminal eig U c 0|, N, abs_nonneg _, Nat.cast_nonneg _, fun z => ?_⟩
have hl := abs_rotatedFieldTerminal_sub_le eig U c z 0
rw [sub_zero] at hl
have ht := abs_add_le (rotatedFieldTerminal eig U c z - rotatedFieldTerminal eig U c 0)
(rotatedFieldTerminal eig U c 0)
rw [sub_add_cancel] at ht
linarith
def vectorGaussianLaw (N : β„•) (v : ℝβ‰₯0) : ProbabilityMeasure (Fin N β†’ ℝ) :=
⟨Measure.pi (fun _ : Fin N => gaussianReal 0 v), inferInstance⟩
lemma vectorGaussianLaw_moments {N : β„•} (hN : 0 < N) (v : ℝβ‰₯0) :
IsingPerceptron.ExponentialNormMoments (vectorGaussianLaw N v : Measure (Fin N β†’ ℝ)) := by
let : Nonempty (Fin N) := ⟨⟨0, hN⟩⟩
have hm := IsingPerceptron.finite_gaussian_exponentialNormMoments
(P := Measure.pi (fun _ : Fin N => gaussianReal 0 v))
(X := fun z : Fin N β†’ ℝ => z) measurable_id (fun _ => 0) (fun _ => v)
(fun i => (measurePreserving_eval (fun _ : Fin N => gaussianReal 0 v) i).map_eq)
change IsingPerceptron.ExponentialNormMoments
((Measure.pi (fun _ : Fin N => gaussianReal 0 v)).map id) at hm
rw [Measure.map_id] at hm
exact hm
def rotatedCascadeLaw (N n : β„•) (b : β„• β†’ ℝ) (v : β„• β†’ ℝβ‰₯0) :
Measure (IsingPerceptron.NoiseTree (Fin N β†’ ℝ) n) :=
IsingPerceptron.noiseCascadeLaw (Fin N β†’ ℝ) n b (fun i => vectorGaussianLaw N (v i))
def rotatedCascadeLog {N : β„•} (n : β„•) (eig : Fin N β†’ ℝ) (U : Rotation N)
(c z : Fin N β†’ ℝ) (T : IsingPerceptron.NoiseTree (Fin N β†’ ℝ) n) : ℝ :=
Real.log (∫ leaf, Real.exp (IsingPerceptron.noiseLeafTerminal n
(fun _ => rotatedFieldTerminal eig U c) (fun _ p => p.1 + p.2) z leaf)
βˆ‚IsingPerceptron.noiseLeafKernel (Fin N β†’ ℝ) n T)
def rotatedCascadeValue {N : β„•} (n : β„•) (b : β„• β†’ ℝ) (v : β„• β†’ ℝβ‰₯0)
(eig : Fin N β†’ ℝ) (U : Rotation N) (c z : Fin N β†’ ℝ) : ℝ :=
IsingPerceptron.cascadeRecursion n b (fun i => vectorGaussianLaw N (v i))
(fun _ p => p.1 + p.2) (rotatedFieldTerminal eig U c) z
/-- The published Gaussian marking recursion specialized to the actual
finite rotated Ising terminal, with the Haar rotation held fixed. -/
theorem rotatedCascadeLog_recursion {N : β„•} (hN : 0 < N) (n : β„•) (b : β„• β†’ ℝ)
(v : β„• β†’ ℝβ‰₯0) (hb : IsingPerceptron.CascadeExponents n b)
(eig : Fin N β†’ ℝ) (U : Rotation N) (c z : Fin N β†’ ℝ) :
Integrable (rotatedCascadeLog n eig U c z) (rotatedCascadeLaw N n b v) ∧
(∫ T, rotatedCascadeLog n eig U c z T βˆ‚rotatedCascadeLaw N n b v) =
rotatedCascadeValue n b v eig U c z := by
have h := IsingPerceptron.linearGrowth_noiseCascade_recursion n b hb
(fun i => vectorGaussianLaw N (v i)) (fun i _ => vectorGaussianLaw_moments hN (v i))
(measurable_rotatedFieldTerminal eig U c) (rotatedFieldTerminal_linearGrowth eig U c) z
have he := IsingPerceptron.noise_leaf_log_eq_ratio n b hb
(fun i => vectorGaussianLaw N (v i))
(fun _ => measurable_fst.add measurable_snd) (measurable_rotatedFieldTerminal eig U c) z
refine ⟨h.2.1.congr (Filter.EventuallyEq.symm he), ?_⟩
exact (integral_congr_ae he).trans h.2.2.1
lemma integrable_rotatedCascadeValue {N : β„•} (hN : 0 < N) (n : β„•) (b : β„• β†’ ℝ)
(v : β„• β†’ ℝβ‰₯0) (hb : IsingPerceptron.CascadeExponents n b)
(eig : Fin N β†’ ℝ) (U : Rotation N) (c : Fin N β†’ ℝ) (root : ℝβ‰₯0) :
Integrable (rotatedCascadeValue n b v eig U c)
(vectorGaussianLaw N root : Measure (Fin N β†’ ℝ)) := by
have hm := IsingPerceptron.measurable_cascadeRecursion n b
(fun i => vectorGaussianLaw N (v i))
(fun _ => measurable_fst.add measurable_snd) (measurable_rotatedFieldTerminal eig U c)
change Measurable (rotatedCascadeValue n b v eig U c) at hm
have hg := IsingPerceptron.cascadeRecursion_linearGrowth n b
(fun i => vectorGaussianLaw N (v i)) (fun i _ => vectorGaussianLaw_moments hN (v i))
(measurable_rotatedFieldTerminal eig U c) (rotatedFieldTerminal_linearGrowth eig U c)
(fun i hi => (hb.1 i hi).1)
obtain ⟨C, L, _, hL, hbound⟩ := hg
have hi := (integrable_const C).add ((vectorGaussianLaw_moments hN root 1).const_mul L)
apply hi.mono' hm.aestronglyMeasurable
exact ae_of_all _ fun z => by
change |rotatedCascadeValue n b v eig U c z| ≀ C + L * Real.exp (1 * β€–zβ€–)
rw [one_mul]
exact (hbound z).trans (add_le_add le_rfl
(mul_le_mul_of_nonneg_left
((le_add_of_nonneg_right zero_le_one).trans (Real.add_one_le_exp β€–zβ€–)) hL))
def rotatedEnrichedPressure {N : β„•} (n : β„•) (b : β„• β†’ ℝ) (v : β„• β†’ ℝβ‰₯0)
(root : ℝβ‰₯0) (eig : Fin N β†’ ℝ) (U : Rotation N) (c : Fin N β†’ ℝ) : ℝ :=
(N : ℝ)⁻¹ * ∫ z, rotatedCascadeValue n b v eig U c z
βˆ‚(vectorGaussianLaw N root : Measure (Fin N β†’ ℝ))
/-- The fixed-rotation enriched pressure is the actual iterated Gaussian
root and cascade expectation of the finite Ising log partition. -/
theorem rotatedEnrichedPressure_eq_cascade_expectation {N : β„•} (hN : 0 < N)
(n : β„•) (b : β„• β†’ ℝ) (v : β„• β†’ ℝβ‰₯0) (root : ℝβ‰₯0)
(hb : IsingPerceptron.CascadeExponents n b)
(eig : Fin N β†’ ℝ) (U : Rotation N) (c : Fin N β†’ ℝ) :
rotatedEnrichedPressure n b v root eig U c =
(N : ℝ)⁻¹ * ∫ z, (∫ T, rotatedCascadeLog n eig U c z T
βˆ‚rotatedCascadeLaw N n b v) βˆ‚(vectorGaussianLaw N root : Measure (Fin N β†’ ℝ)) := by
unfold rotatedEnrichedPressure
congr 1
apply integral_congr_ae
exact ae_of_all _ fun z => (rotatedCascadeLog_recursion hN n b v hb eig U c z).2.symm
end InvariantIsing
end
end OAI