math / data /lean /OAI /Probability /IsingPerceptron /EnrichedGGFinite.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
19.5 kB
import Mathlib
import OAI.Probability.IsingPerceptron.JointGGClosure
namespace OAI
/-! Enriched G G Finite. -/
noncomputable section
open MeasureTheory ProbabilityTheory Filter Set
open scoped BigOperators Topology ENNReal NNReal
open MeasureTheory ProbabilityTheory Filter Set
open scoped BigOperators Topology ENNReal NNReal
namespace IsingPerceptron
def enrichedMonomialResidual {N : β„•} {A : Type*} [MeasurableSpace A]
(P : Measure A) (r : ℝβ‰₯0) (n : β„•) (b h : β„• β†’ ℝ)
(u : Fin N β†’ ℝ) (Ξ½ : Measure (Spin N)) (Ο† : A β†’ Spin N β†’ ℝ)
(p d : β„•) {m : β„•} (D : (Fin (m+1) β†’ Spin N Γ— LabeledLeaf n) β†’ ℝ) : ℝ :=
let ΞΊ := fun x y : Spin N Γ— LabeledLeaf n => spinOverlap x.1 y.1 ^ p * treeOverlap n x.2 y.2 ^ d
(m+1 : β„•)*enrichedReplicaAverage P r n b h u Ξ½ Ο†
(fun Ο„ : Fin (m+1+1) β†’ Spin N Γ— LabeledLeaf n => D (Fin.tail Ο„)*ΞΊ ((Fin.tail Ο„) 0) (Ο„ 0)) -
enrichedReplicaAverage P r n b h u Ξ½ Ο† D * enrichedReplicaAverage P r n b h u Ξ½ Ο†
(fun Ο„ : Fin 2 β†’ Spin N Γ— LabeledLeaf n => ΞΊ (Ο„ 1) (Ο„ 0)) -
enrichedReplicaAverage P r n b h u Ξ½ Ο†
(fun Οƒ => D Οƒ*(βˆ‘ l : Fin m, ΞΊ (Οƒ 0) (Οƒ l.succ)))
lemma enrichedMonomialResidual_bound {N : β„•} (hN : 0 < N) (n : β„•) (b : β„• β†’ ℝ)
(hb : CascadeExponents n b) {h : β„• β†’ ℝ} (hh : Monotone h) (h0 : 0 ≀ h 0)
{H : ℝ} (hH : h n ≀ H) (u : Fin N β†’ ℝ) (hu : βˆ€ j, u j ∈ Icc (1:ℝ) 2) (j : Fin N)
(Ξ½ : Measure (Spin N)) [IsProbabilityMeasure Ξ½]
{A : Type*} [MeasurableSpace A] (P : Measure A) [IsProbabilityMeasure P]
{Ο† : A β†’ Spin N β†’ ℝ} (hm : Measurable Ο†) {K : ℝ} (hK : 0 ≀ K)
(hΟ† : βˆ€ y x, |Ο† y x| ≀ K) (r : ℝβ‰₯0) {Ξ± : ℝ} (hr : (r:ℝ) ≀ Ξ±*N)
(hmin : βˆ€ v ∈ Icc (1:ℝ) 2, enrichedCoordinateObjective P r n b h u j Ξ½ Ο† (u j) ≀
enrichedCoordinateObjective P r n b h u j Ξ½ Ο† v)
(he : perturbationScale N ≀ 1/8) (hs : contactStep N ≀ 1/4)
{m : β„•} (D : (Fin (m+1) β†’ Spin N Γ— LabeledLeaf n) β†’ ℝ)
{B : ℝ} (hB : 0 ≀ B) (hD : βˆ€ Οƒ, |D Οƒ| ≀ B) :
|enrichedMonomialResidual P r n b h u Ξ½ Ο† (monomialIndex j).1 (monomialIndex j).2 D| ≀
contactGGRate N j
(4*(∫ T, (Real.log (rawTreeTotal n T).toReal)^2 βˆ‚(rawCascadeLaw n b : Measure (RawTree n)))+
H+4+5*K^2*Ξ±) B := by
have hua : βˆ€ i, |u i| ≀ 2 := fun i => abs_le.mpr ⟨by linarith [(hu i).1],(hu i).2⟩
have hint := enriched_coordinate_minimum_interior hN n b hb hh h0 u hua j ν P hm hK hφ r hmin he hs
have hn : (0:ℝ) < N := by exact_mod_cast hN
have hstep : 0 < contactStep N := Real.rpow_pos_of_pos hn _
have hepos : 0 < perturbationScale N := Real.rpow_pos_of_pos hn _
have ha := perturbationAmplitude_pos hN j
have hg := enriched_gg_at_coordinate_minimum hN n b hb hh h0 hH u hua j ν P hm hK hφ r hr
hstep (one_div_pos.mpr hepos) hint.1 hint.2 hmin D hB hD
change |perturbationAmplitude N j*u j| *
|enrichedMonomialResidual P r n b h u Ξ½ Ο† (monomialIndex j).1 (monomialIndex j).2 D| ≀ _ at hg
have hau : perturbationAmplitude N j ≀ |perturbationAmplitude N j*u j| := by
rw [abs_of_pos (mul_pos ha (lt_of_lt_of_le zero_lt_one (hu j).1))]
nlinarith [(hu j).1]
apply (le_div_iffβ‚€ ha).2
calc
_ = perturbationAmplitude N j*
|enrichedMonomialResidual P r n b h u Ξ½ Ο† (monomialIndex j).1 (monomialIndex j).2 D| := by ring
_ ≀ |perturbationAmplitude N j*u j| *
|enrichedMonomialResidual P r n b h u Ξ½ Ο† (monomialIndex j).1 (monomialIndex j).2 D| :=
mul_le_mul_of_nonneg_right hau (abs_nonneg _)
_ ≀ _ := hg
def enrichedPerturbationObjective {N : β„•} {A : Type*} [MeasurableSpace A]
(P : Measure A) (r : ℝβ‰₯0) (n : β„•) (b h : β„• β†’ ℝ)
(Ξ½ : Measure (Spin N)) (Ο† : A β†’ Spin N β†’ ℝ) (u : Fin N β†’ ℝ) : ℝ :=
-enrichedMeanPressure P r n b h u Ξ½ Ο† +
βˆ‘ j : Fin N, perturbationWeight j*(u j-3/2)^2
lemma enriched_minimum_coordinate {N : β„•} {A : Type*} [MeasurableSpace A]
(P : Measure A) (r : ℝβ‰₯0) (n : β„•) (b h : β„• β†’ ℝ)
(Ξ½ : Measure (Spin N)) (Ο† : A β†’ Spin N β†’ ℝ) (u : Fin N β†’ ℝ)
(hu : βˆ€ j, u j ∈ Icc (1:ℝ) 2)
(hmin : βˆ€ v : Fin N β†’ ℝ, (βˆ€ j, v j ∈ Icc (1:ℝ) 2) β†’
enrichedPerturbationObjective P r n b h Ξ½ Ο† u ≀ enrichedPerturbationObjective P r n b h Ξ½ Ο† v)
(j : Fin N) (v : ℝ) (hv : v ∈ Icc (1:ℝ) 2) :
enrichedCoordinateObjective P r n b h u j Ξ½ Ο† (u j) ≀
enrichedCoordinateObjective P r n b h u j Ξ½ Ο† v := by
classical
have huv : βˆ€ i, Function.update u j v i ∈ Icc (1:ℝ) 2 := by
intro i
by_cases hi : i = j
Β· subst i; simpa only [Function.update_self] using hv
Β· simpa only [Function.update_of_ne hi] using hu i
have hc := hmin (Function.update u j v) huv
unfold enrichedPerturbationObjective at hc
rw [← Finset.add_sum_erase _ _ (Finset.mem_univ j),
← Finset.add_sum_erase _ _ (Finset.mem_univ j)] at hc
have he : (βˆ‘ i ∈ Finset.univ.erase j, perturbationWeight i*(Function.update u j v i-3/2)^2) =
βˆ‘ i ∈ Finset.univ.erase j, perturbationWeight i*(u i-3/2)^2 := by
apply Finset.sum_congr rfl
intro i hi
rw [Function.update_of_ne (Finset.mem_erase.mp hi).1]
rw [he,Function.update_self] at hc
unfold enrichedCoordinateObjective
rw [Function.update_eq_self]
linarith
end IsingPerceptron
open MeasureTheory ProbabilityTheory Filter Set
open scoped BigOperators Topology ENNReal NNReal BoundedContinuousFunction
namespace IsingPerceptron
def newReplicaEmbedding (k : β„•) (e : Equiv.Perm (Fin k)) : Fin (k+1) β†’ β„• :=
Fin.cases k (fun j => (e j).val)
lemma newReplicaEmbedding_injective (k : β„•) (e : Equiv.Perm (Fin k)) :
Function.Injective (newReplicaEmbedding k e) := by
intro a
refine Fin.cases ?_ (fun a => ?_) a
Β· intro b
refine Fin.cases ?_ (fun b => ?_) b
Β· exact fun _ => rfl
Β· intro hab
have hlt := (e b).isLt
simp only [newReplicaEmbedding,Fin.cases_zero,Fin.cases_succ] at hab
omega
Β· intro b
refine Fin.cases ?_ (fun b => ?_) b
Β· intro hab
have hlt := (e a).isLt
simp only [newReplicaEmbedding,Fin.cases_zero,Fin.cases_succ] at hab
omega
Β· intro hab
apply congrArg Fin.succ
apply e.injective
apply Fin.val_injective
exact hab
lemma sum_nonzero_permutation {m : β„•} (e : Equiv.Perm (Fin (m+1))) (f : Fin (m+1) β†’ ℝ) :
(βˆ‘ l : Fin m, f (e l.succ)) = βˆ‘ j ∈ Finset.univ.erase (e 0), f j := by
classical
have he := Equiv.sum_comp e f
rw [Fin.sum_univ_succ,← Finset.add_sum_erase _ _ (Finset.mem_univ (e 0))] at he
exact add_left_cancel he
lemma jointEntry_monomial_le (x : JointEntry) (p d : β„•) : |x.1.1^p*x.2.1^d| ≀ 1 := by
rw [abs_mul,abs_pow,abs_pow]
have h1 : |x.1.1| ≀ 1 := abs_le.mpr x.1.2
have h2 : |x.2.1| ≀ 1 := abs_le.mpr ⟨by linarith [x.2.2.1],x.2.2.2⟩
exact (mul_le_mul (pow_le_oneβ‚€ (abs_nonneg _) h1)
(pow_le_oneβ‚€ (abs_nonneg _) h2) (pow_nonneg (abs_nonneg _) _) zero_le_one).trans_eq
(one_mul 1)
def monomialPair (n p d : β„•) {N : β„•} (x y : Spin N Γ— LabeledLeaf n) : ℝ :=
spinOverlap x.1 y.1^p*treeOverlap n x.2 y.2^d
lemma abs_monomialPair_le_one (n p d : β„•) {N : β„•} (x y : Spin N Γ— LabeledLeaf n) :
|monomialPair n p d x y| ≀ 1 := jointEntry_monomial_le (enrichedJointEntry n x y) p d
def finiteJointBlock {N m : β„•} (n : β„•) (Οƒ : Fin m β†’ Spin N Γ— LabeledLeaf n) : JointBlock m :=
fun i j => enrichedJointEntry n (Οƒ i) (Οƒ j)
def permutedBlockTest {N m : β„•} (n : β„•) (e : Equiv.Perm (Fin m))
(D : JointBlock m β†’ ℝ) (Οƒ : Fin m β†’ Spin N Γ— LabeledLeaf n) : ℝ :=
D (finiteJointBlock n (Οƒ ∘ e.symm))
lemma enrichedArrayLawTest_integral {N : β„•} (hN : 0 < N) (n : β„•) (b : β„• β†’ ℝ)
{h : β„• β†’ ℝ} (hh : Monotone h) (h0 : 0 ≀ h 0)
(u : Fin N β†’ ℝ) (hu : βˆ€ j, |u j| ≀ 2)
(Ξ½ : Measure (Spin N)) [IsProbabilityMeasure Ξ½]
{A : Type*} [MeasurableSpace A] (P : Measure A) [IsProbabilityMeasure P]
{Ο† : A β†’ Spin N β†’ ℝ} (hm : Measurable Ο†) {K : ℝ} (hK : 0 ≀ K)
(hΟ† : βˆ€ y x, |Ο† y x| ≀ K) (r : ℝβ‰₯0)
(F : JointArray β†’ ℝ) (hF : Measurable F)
{m : β„•} (D : (Fin m β†’ Spin N Γ— LabeledLeaf n) β†’ ℝ) {C : ℝ} (hD : βˆ€ Οƒ, |D Οƒ| ≀ C)
(ΞΉ : Fin m β†’ β„•) (hi : Function.Injective ΞΉ)
(he : βˆ€ Οƒ, F (sampledOverlapArray (enrichedJointEntry n) Οƒ) = D (fun i => Οƒ (ΞΉ i))) :
(∫ x, F x βˆ‚(enrichedArrayLaw P r n b h u Ξ½ hm : Measure JointArray)) =
enrichedReplicaAverage P r n b h u Ξ½ Ο† D := by
rw [enrichedArrayLaw_integral _ _ _ _ _ _ _ _ _ hF]
simp_rw [he]
exact enrichedReplicaLaw_integral hN n b hh h0 u hu ν P hm hK hφ r D hD ι hi
lemma permutedBlockTest_embedding {N m : β„•} (n : β„•) (e : Equiv.Perm (Fin m))
(D : JointBlock m β†’ ℝ) (Οƒ : β„• β†’ Spin N Γ— LabeledLeaf n) :
permutedBlockTest n e D (fun j => Οƒ (e j)) =
D (jointBlockView m (sampledOverlapArray (enrichedJointEntry n) Οƒ)) := by
unfold permutedBlockTest
apply congrArg D
funext i j
simp [finiteJointBlock,jointBlockView,sampledOverlapArray]
lemma enrichedArrayLaw_residual {N : β„•} (hN : 0 < N) (n : β„•) (b : β„• β†’ ℝ)
{h : β„• β†’ ℝ} (hh : Monotone h) (h0 : 0 ≀ h 0)
(u : Fin N β†’ ℝ) (hu : βˆ€ j, |u j| ≀ 2)
(Ξ½ : Measure (Spin N)) [IsProbabilityMeasure Ξ½]
{A : Type*} [MeasurableSpace A] (P : Measure A) [IsProbabilityMeasure P]
{Ο† : A β†’ Spin N β†’ ℝ} (hm : Measurable Ο†) {K : ℝ} (hK : 0 ≀ K)
(hΟ† : βˆ€ y x, |Ο† y x| ≀ K) (r : ℝβ‰₯0)
{m : β„•} (e : Equiv.Perm (Fin (m+1))) (D : JointBlock (m+1) β†’ ℝ)
(hDc : Continuous D) {B : ℝ} (hB : 0 ≀ B) (hD : βˆ€ x, |D x| ≀ B) (p d : β„•) :
jointMonomialResidual (enrichedArrayLaw P r n b h u Ξ½ hm) (m+1) (e 0) D p d =
enrichedMonomialResidual P r n b h u Ξ½ Ο† p d (permutedBlockTest n e D) := by
classical
let ΞΌ : Measure JointArray := enrichedArrayLaw P r n b h u Ξ½ hm
let D' := permutedBlockTest (N := N) n e D
have hD' : βˆ€ Οƒ, |D' Οƒ| ≀ B := fun Οƒ => hD _
have hcD : Continuous (fun x => D (jointBlockView (m+1) x)) :=
hDc.comp (continuous_jointBlockView _)
have hmono (x y : Spin N Γ— LabeledLeaf n) := abs_monomialPair_le_one n p d x y
have hnew : (∫ x, D (jointBlockView (m+1) x)*(x (e 0,m+1)).1.1^p*(x (e 0,m+1)).2.1^d βˆ‚ΞΌ) =
enrichedReplicaAverage P r n b h u Ξ½ Ο†
(fun Ο„ : Fin (m+1+1) β†’ Spin N Γ— LabeledLeaf n =>
D' (Fin.tail Ο„)*monomialPair n p d ((Fin.tail Ο„) 0) (Ο„ 0)) := by
refine enrichedArrayLawTest_integral hN n b hh h0 u hu ν P hm hK hφ r _
(hcD.mul (by fun_prop) |>.mul (by fun_prop) |>.measurable) _ (C := B)
(fun Ο„ => ?_) (newReplicaEmbedding (m+1) e) (newReplicaEmbedding_injective _ e) ?_
Β· rw [abs_mul]
exact (mul_le_mul (hD' _) (hmono _ _) (abs_nonneg _) hB).trans_eq (mul_one B)
Β· intro Οƒ
change D (jointBlockView (m+1) (sampledOverlapArray (enrichedJointEntry n) Οƒ)) *
(enrichedJointEntry n (Οƒ (e 0)) (Οƒ (m+1))).1.1^p *
(enrichedJointEntry n (Οƒ (e 0)) (Οƒ (m+1))).2.1^d =
D' (fun i => Οƒ ((e i).val)) * monomialPair n p d (Οƒ (e 0)) (Οƒ (m+1))
rw [show D' (fun i => Οƒ ((e i).val)) =
D (jointBlockView (m+1) (sampledOverlapArray (enrichedJointEntry n) Οƒ)) from
permutedBlockTest_embedding n e D Οƒ]
simp only [enrichedJointEntry,monomialPair,mul_assoc]
have hblock : (∫ x, D (jointBlockView (m+1) x) βˆ‚ΞΌ) =
enrichedReplicaAverage P r n b h u Ξ½ Ο† D' := by
apply enrichedArrayLawTest_integral hN n b hh h0 u hu ν P hm hK hφ r _ hcD.measurable
D' hD' (fun j => (e j).val) (Fin.val_injective.comp e.injective)
intro Οƒ
exact (permutedBlockTest_embedding n e D Οƒ).symm
have hpair : (∫ x, (x (0,1)).1.1^p*(x (0,1)).2.1^d βˆ‚ΞΌ) =
enrichedReplicaAverage P r n b h u Ξ½ Ο†
(fun Ο„ : Fin 2 β†’ Spin N Γ— LabeledLeaf n => monomialPair n p d (Ο„ 1) (Ο„ 0)) := by
refine enrichedArrayLawTest_integral hN n b hh h0 u hu ν P hm hK hφ r _ (by fun_prop)
_ (C := 1) (fun Ο„ => hmono _ _) ![1,0] ?_ ?_
Β· intro a b hab
fin_cases a <;> fin_cases b <;> simp_all
Β· intro Οƒ
rfl
have hsumBound (Οƒ : Fin (m+1) β†’ Spin N Γ— LabeledLeaf n) :
|D' Οƒ*(βˆ‘ l : Fin m, monomialPair n p d (Οƒ 0) (Οƒ l.succ))| ≀ B*m := by
rw [abs_mul]
apply mul_le_mul (hD' _) _ (abs_nonneg _) hB
calc
_ ≀ βˆ‘ l : Fin m, |monomialPair n p d (Οƒ 0) (Οƒ l.succ)| := Finset.abs_sum_le_sum_abs _ _
_ ≀ βˆ‘ _ : Fin m, (1:ℝ) := Finset.sum_le_sum (fun l _ => hmono _ _)
_ = _ := by simp
have hsum : (βˆ‘ j ∈ Finset.univ.erase (e 0),
∫ x, D (jointBlockView (m+1) x)*(x (e 0,j)).1.1^p*(x (e 0,j)).2.1^d βˆ‚ΞΌ) =
enrichedReplicaAverage P r n b h u Ξ½ Ο†
(fun Οƒ => D' Οƒ*(βˆ‘ l : Fin m, monomialPair n p d (Οƒ 0) (Οƒ l.succ))) := by
have hI (j : Fin (m+1)) : Integrable
(fun x : JointArray => D (jointBlockView (m+1) x)*(x (e 0,j)).1.1^p*(x (e 0,j)).2.1^d) ΞΌ :=
compact_integrable (hcD.mul (by fun_prop) |>.mul (by fun_prop))
rw [← integral_finsetSum _ (fun j _ => hI j)]
apply enrichedArrayLawTest_integral hN n b hh h0 u hu ν P hm hK hφ r _
(by apply Finset.measurable_sum; intro j hj; exact (hcD.mul (by fun_prop) |>.mul (by fun_prop)).measurable)
_ hsumBound (fun j => (e j).val) (Fin.val_injective.comp e.injective)
intro Οƒ
rw [show D' (fun j => Οƒ ((e j).val)) =
D (jointBlockView (m+1) (sampledOverlapArray (enrichedJointEntry n) Οƒ)) from
permutedBlockTest_embedding n e D Οƒ]
rw [sum_nonzero_permutation e (fun j => monomialPair n p d (Οƒ (e 0)) (Οƒ j)),Finset.mul_sum]
apply Finset.sum_congr rfl
intro j hj
simp only [sampledOverlapArray,enrichedJointEntry,monomialPair,mul_assoc]
unfold jointMonomialResidual
rw [hnew,hblock,hpair,hsum]
rfl
end IsingPerceptron
open MeasureTheory ProbabilityTheory Filter Set
open scoped BigOperators Topology ENNReal NNReal BoundedContinuousFunction
namespace IsingPerceptron
lemma jointMonomialResidual_zero (ΞΌ : Measure JointArray) [IsProbabilityMeasure ΞΌ]
(m : β„•) (i : Fin (m+1)) (D : JointBlock (m+1) β†’ ℝ) :
jointMonomialResidual ΞΌ (m+1) i D 0 0 = 0 := by
classical
simp only [jointMonomialResidual,pow_zero,mul_one,integral_const,probReal_univ,
smul_eq_mul,Finset.sum_const,Finset.card_erase_of_mem (Finset.mem_univ i),
Finset.card_univ,Fintype.card_fin,Nat.add_sub_cancel,nsmul_eq_mul,Nat.cast_add,Nat.cast_one]
ring
lemma enrichedArrayLaw_residual_bound {N : β„•} (hN : 0 < N) (n : β„•) (b : β„• β†’ ℝ)
(hb : CascadeExponents n b) {h : β„• β†’ ℝ} (hh : Monotone h) (h0 : 0 ≀ h 0)
{H : ℝ} (hH : h n ≀ H) (u : Fin N β†’ ℝ) (hu : βˆ€ j, u j ∈ Icc (1:ℝ) 2) (j : Fin N)
(Ξ½ : Measure (Spin N)) [IsProbabilityMeasure Ξ½]
{A : Type*} [MeasurableSpace A] (P : Measure A) [IsProbabilityMeasure P]
{Ο† : A β†’ Spin N β†’ ℝ} (hm : Measurable Ο†) {K : ℝ} (hK : 0 ≀ K)
(hΟ† : βˆ€ y x, |Ο† y x| ≀ K) (r : ℝβ‰₯0) {Ξ± : ℝ} (hr : (r:ℝ) ≀ Ξ±*N)
(hmin : βˆ€ v : Fin N β†’ ℝ, (βˆ€ j, v j ∈ Icc (1:ℝ) 2) β†’
enrichedPerturbationObjective P r n b h Ξ½ Ο† u ≀ enrichedPerturbationObjective P r n b h Ξ½ Ο† v)
(he : perturbationScale N ≀ 1/8) (hs : contactStep N ≀ 1/4)
{m : β„•} (i : Fin (m+1)) (D : JointBlock (m+1) β†’ ℝ) (hDc : Continuous D)
{B : ℝ} (hB : 0 ≀ B) (hD : βˆ€ x, |D x| ≀ B) :
|jointMonomialResidual (enrichedArrayLaw P r n b h u Ξ½ hm) (m+1) i D
(monomialIndex j).1 (monomialIndex j).2| ≀
contactGGRate N j
(4*(∫ T, (Real.log (rawTreeTotal n T).toReal)^2 βˆ‚(rawCascadeLaw n b : Measure (RawTree n)))+
H+4+5*K^2*Ξ±) B := by
classical
have hua : βˆ€ l, |u l| ≀ 2 := fun l => abs_le.mpr ⟨by linarith [(hu l).1],(hu l).2⟩
have hg := enrichedMonomialResidual_bound hN n b hb hh h0 hH u hu j ν P hm hK hφ r hr
(enriched_minimum_coordinate P r n b h Ξ½ Ο† u hu hmin j) he hs
(permutedBlockTest n (Equiv.swap 0 i) D) hB (fun Οƒ => hD _)
have ht := enrichedArrayLaw_residual hN n b hh h0 u hua ν P hm hK hφ r
(Equiv.swap 0 i) D hDc hB hD (monomialIndex j).1 (monomialIndex j).2
rw [Equiv.swap_apply_left] at ht
rw [ht]
exact hg
theorem enriched_minimizers_jointGG
(N : β„• β†’ β„•) (hN : βˆ€ k, 0 < N k) (hNlim : Tendsto N atTop atTop)
(n : β„•) (b : β„• β†’ ℝ) (hb : CascadeExponents n b)
(h : β„• β†’ β„• β†’ ℝ) (hh : βˆ€ k, Monotone (h k)) (h0 : βˆ€ k, 0 ≀ h k 0)
(H : ℝ) (hH : βˆ€ k, h k n ≀ H)
(u : (k : β„•) β†’ Fin (N k) β†’ ℝ) (hu : βˆ€ k j, u k j ∈ Icc (1:ℝ) 2)
(Ξ½ : (k : β„•) β†’ Measure (Spin (N k))) [βˆ€ k, IsProbabilityMeasure (Ξ½ k)]
(A : β„• β†’ Type*) [βˆ€ k, MeasurableSpace (A k)]
(P : (k : β„•) β†’ Measure (A k)) [βˆ€ k, IsProbabilityMeasure (P k)]
(Ο† : (k : β„•) β†’ A k β†’ Spin (N k) β†’ ℝ) (hm : βˆ€ k, Measurable (Ο† k))
(K : ℝ) (hK : 0 ≀ K) (hΟ† : βˆ€ k y x, |Ο† k y x| ≀ K)
(r : β„• β†’ ℝβ‰₯0) (Ξ± : ℝ) (hr : βˆ€ k, (r k:ℝ) ≀ Ξ±*N k)
(hmin : βˆ€ k (v : Fin (N k) β†’ ℝ), (βˆ€ j, v j ∈ Icc (1:ℝ) 2) β†’
enrichedPerturbationObjective (P k) (r k) n b (h k) (Ξ½ k) (Ο† k) (u k) ≀
enrichedPerturbationObjective (P k) (r k) n b (h k) (Ξ½ k) (Ο† k) v)
(ΞΌ : ProbabilityMeasure JointArray)
(hL : Tendsto (fun k => enrichedArrayLaw (P k) (r k) n b (h k) (u k) (Ξ½ k) (hm k)) atTop (𝓝 ΞΌ)) :
HasEntryGhirlandaGuerra (fun x i j => x (i,j)) (ΞΌ : Measure JointArray) := by
apply jointGG_of_weak_monomial_residuals hL
intro m hm2 i D hDc p d
cases m with
| zero => omega
| succ m =>
by_cases hpd : p+d = 0
Β· have hp : p = 0 := by omega
have hd : d = 0 := by omega
subst p d
simpa only [jointMonomialResidual_zero] using
(tendsto_const_nhds : Tendsto (fun _ : β„• => (0:ℝ)) atTop (𝓝 0))
· obtain ⟨j,hj⟩ := monomialIndex_surjective p d (by omega)
let BD := BoundedContinuousFunction.mkOfCompact ⟨D,hDc⟩
have hD : βˆ€ x, |D x| ≀ β€–BDβ€– := fun x => by
simpa only [BD,BoundedContinuousFunction.mkOfCompact_apply,ContinuousMap.coe_mk,Real.norm_eq_abs] using BD.norm_coe_le_norm x
let L := 4*(∫ T, (Real.log (rawTreeTotal n T).toReal)^2
βˆ‚(rawCascadeLaw n b : Measure (RawTree n)))+H+4+5*K^2*Ξ±
have he : βˆ€αΆ  k in atTop, perturbationScale (N k) ≀ 1/8 :=
(perturbationScale_tendsto.comp hNlim).eventually (eventually_le_nhds (by norm_num))
have hs : βˆ€αΆ  k in atTop, contactStep (N k) ≀ 1/4 :=
(contactStep_tendsto.comp hNlim).eventually (eventually_le_nhds (by norm_num))
have hjN : βˆ€αΆ  k in atTop, j < N k := hNlim.eventually (eventually_gt_atTop j)
apply squeeze_zero_norm' _ ((contactGGRate_tendsto j L β€–BDβ€–).comp hNlim)
filter_upwards [he,hs,hjN] with k he hs hjN
let j' : Fin (N k) := ⟨j,hjN⟩
have ht := enrichedArrayLaw_residual_bound (hN k) n b hb (hh k) (h0 k) (hH k)
(u k) (hu k) j' (ν k) (P k) (hm k) hK (hφ k) (r k) (hr k) (hmin k)
he hs i D hDc (norm_nonneg BD) hD
simpa only [j',hj,Prod.fst,Prod.snd,Real.norm_eq_abs,Function.comp_def,L] using ht
end IsingPerceptron
end
end OAI