math / data /lean /OAI /Analysis /BackwardIntertwiners /WeightSeparation.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
12.5 kB
import OAI.Analysis.BackwardIntertwiners.CoefficientSupport
namespace OAI
namespace BackwardIntertwiners
open Filter
open scoped Topology
noncomputable section
structure QuadraticWeights (w : β„€ β†’ ℝ) : Prop where
positive : βˆ€ j, 0 < w j
decreasing : Antitone w
convex_negative : DiscreteConvex (fun n => Real.log (w (-(n : β„€))))
concave_positive : DiscreteConvex (fun n => -Real.log (w n))
root_sum : Summable (fun j : β„€ => if j = 0 then 0 else w j ^ (1 / (j : ℝ)))
quadratic : βˆƒ a : ℝ, Real.log 3 < a ∧
Tendsto (fun n : β„• => Real.log (w n) / (n : ℝ)^2) atTop (𝓝 (-a)) ∧
Tendsto (fun n : β„• => Real.log (w (-(n : β„€))) / (n : ℝ)^2) atTop (𝓝 a)
def SupportSeparation (w : β„€ β†’ ℝ) : Prop :=
βˆ€ b c : β„€ β†’ β„‚,
(βˆƒ j, b j β‰  0) β†’ (βˆƒ j, c j β‰  0) β†’
(βˆ€ j, β€–b jβ€– ≀ w j) β†’ (βˆ€ j, β€–c jβ€– * w j ≀ 1) β†’
(βˆ€ r : β„•, 1 ≀ r β†’ (βˆ‘' j : β„€, b j * c (j - r)) = 0) β†’
βˆƒ t h : β„€, b t β‰  0 ∧ c h β‰  0 ∧
(βˆ€ j, t < j β†’ b j = 0) ∧ (βˆ€ j, j < h β†’ c j = 0) ∧ t ≀ h
def reflectedWeight (w : β„€ β†’ ℝ) (j : β„€) : ℝ := (w (-j))⁻¹
lemma reflectedWeight_pos {w : β„€ β†’ ℝ} (hw : βˆ€ j, 0 < w j) (j : β„€) :
0 < reflectedWeight w j := inv_pos.mpr (hw _)
lemma reflectedWeight_antitone {w : β„€ β†’ ℝ} (hw : βˆ€ j, 0 < w j) (hdec : Antitone w) :
Antitone (reflectedWeight w) := by
intro i j hij
exact (inv_le_invβ‚€ (hw _) (hw _)).mpr (hdec (neg_le_neg hij))
lemma reflected_positiveLog (w : β„€ β†’ ℝ) : positiveLog (reflectedWeight w) = negativeLog w := by
funext n
simp [positiveLog, negativeLog, reflectedWeight, Real.log_inv]
lemma reflected_negativeLog (w : β„€ β†’ ℝ) : negativeLog (reflectedWeight w) = positiveLog w := by
funext n
simp [positiveLog, negativeLog, reflectedWeight, Real.log_inv]
lemma reflected_stepRatio_summable {w : β„€ β†’ ℝ} (hs : Summable (stepRatio w)) :
Summable (stepRatio (reflectedWeight w)) := by
have hh := hs.comp_injective (i := fun j : β„€ => -j-1) (by
intro a b hab; dsimp only at hab; omega)
apply hh.congr
intro j
dsimp [stepRatio, reflectedWeight]
have e₁ : -j-1+1 = -j := by omega
have eβ‚‚ : -(j+1) = -j-1 := by omega
rw [e₁, eβ‚‚, inv_div_inv]
lemma reflected_correlations {b c : β„€ β†’ β„‚}
(hz : βˆ€ r : β„•, 1 ≀ r β†’ (βˆ‘' j : β„€, b j * c (j-r)) = 0) :
βˆ€ r : β„•, 1 ≀ r β†’ (βˆ‘' j : β„€, c (-j) * b (-(j-r))) = 0 := by
intro r hr
let e : β„€ ≃ β„€ := ⟨fun j => (r:β„€)-j, fun j => (r:β„€)-j, by intro j; dsimp only; omega, by intro j; dsimp only; omega⟩
calc (βˆ‘' j : β„€, c (-j) * b (-(j-r))) =
βˆ‘' j : β„€, b (e j) * c (e j-r) := by
apply tsum_congr
intro j
dsimp [e]
have e₁ : (r:β„€)-j = -(j-r) := by omega
have eβ‚‚ : (r:β„€)-j-r = -j := by omega
rw [e₁, show -(j-(r:β„€))-(r:β„€) = -j by omega, mul_comm]
_ = βˆ‘' j : β„€, b j * c (j-r) := e.tsum_eq (fun j : β„€ => b j * c (j-r))
_ = 0 := hz r hr
lemma reflected_bounds {w : β„€ β†’ ℝ} (hw : βˆ€ j, 0 < w j) {b c : β„€ β†’ β„‚}
(hb : βˆ€ j, β€–b jβ€– ≀ w j) (hc : βˆ€ j, β€–c jβ€–*w j ≀ 1) :
(βˆ€ j, β€–c (-j)β€– ≀ reflectedWeight w j) ∧
(βˆ€ j, β€–b (-j)β€–*reflectedWeight w j ≀ 1) := by
constructor
Β· intro j
simpa only [reflectedWeight, one_div] using (le_div_iffβ‚€ (hw (-j))).mpr (hc (-j))
Β· intro j
dsimp [reflectedWeight]
rw [← div_eq_mul_inv]
exact (div_le_one (hw _)).mpr (hb _)
theorem normalized_support_separation {w : β„€ β†’ ℝ} (hw : βˆ€ j, 0 < w j)
(hdec : Antitone w) (hw0 : w 0 = 1)
(hP : DiscreteConvex (negativeLog w)) (hQ : DiscreteConvex (positiveLog w))
{lam Ξ΄ : ℝ} (hlam : Real.log 3 < lam) (hΞ΄ : lam < Ξ΄)
(hqp : βˆ€αΆ  n : β„• in atTop, Ξ΄*(n:ℝ)^2 ≀ negativeLog w n)
(hqq : βˆ€αΆ  n : β„• in atTop, Ξ΄*(n:ℝ)^2 ≀ positiveLog w n) :
SupportSeparation w := by
intro b c hbn hcn hb hc hz
have hΞ΄0 : 0 < Ξ΄ := lt_trans (lt_trans (Real.log_pos (by norm_num : (1:ℝ)<3)) hlam) hΞ΄
have hP0 : negativeLog w 0 = 0 := by simp [negativeLog, hw0]
have hQ0 : positiveLog w 0 = 0 := by simp [positiveLog, hw0]
have hs := stepRatio_summable hw hw0 hP hQ hΞ΄0 hqp hqq
have hb_bd : βˆƒ m : β„€, βˆ€ j : β„€, b j β‰  0 β†’ j ≀ m := by
by_cases hc_bd : βˆƒ m : β„€, βˆ€ j : β„€, c j β‰  0 β†’ m ≀ j
· obtain ⟨h, hch, hh⟩ := Int.exists_least_of_bdd hc_bd hcn
apply bounded_above_of_min hw hdec hw0 hs hQ hΞ΄0 hqq hb hc hch ?_ hz
intro j hj
by_contra hne
have := hh j hne
omega
Β· by_contra hbu
have hcu : Β¬βˆƒ m : β„€, βˆ€ j : β„€, c (-j) β‰  0 β†’ j ≀ m := by
rintro ⟨m, hm⟩
apply hc_bd
refine ⟨-m, ?_⟩
intro j hj
have hh := hm (-j) (by simpa using hj)
omega
exact no_both_unbounded (bounds_of_weight hw hb hc) hP hQ hP0 hQ0 hlam hΞ΄ hqp hqq
(nat_support_unbounded hbu) (nat_support_unbounded hcu) hz
obtain ⟨t, hbt, ht⟩ := Int.exists_greatest_of_bdd hb_bd hbn
have hc_bd : βˆƒ m : β„€, βˆ€ j : β„€, c j β‰  0 β†’ m ≀ j := by
have hwr0 : reflectedWeight w 0 = 1 := by simp [reflectedWeight, hw0]
have hQr : DiscreteConvex (positiveLog (reflectedWeight w)) := by
rw [reflected_positiveLog]; exact hP
have hqpr : βˆ€αΆ  n : β„• in atTop, Ξ΄*(n:ℝ)^2 ≀ positiveLog (reflectedWeight w) n := by
simpa only [reflected_positiveLog] using hqp
obtain ⟨hbr, hcr⟩ := reflected_bounds hw hb hc
have hzref := reflected_correlations hz
have hm := bounded_above_of_min (reflectedWeight_pos hw) (reflectedWeight_antitone hw hdec)
hwr0 (reflected_stepRatio_summable hs) hQr hΞ΄0 hqpr hbr hcr
(h := -t) (by simpa using hbt) (by
intro j hj
by_contra hne
have hh := ht (-j) hne
omega) hzref
obtain ⟨m, hm⟩ := hm
refine ⟨-m, ?_⟩
intro j hj
have hh := hm (-j) (by simpa using hj)
omega
obtain ⟨h, hch, hh⟩ := Int.exists_least_of_bdd hc_bd hcn
have hbmax : βˆ€ j : β„€, t < j β†’ b j = 0 := by
intro j hj
by_contra hne
have := ht j hne
omega
have hcmin : βˆ€ j : β„€, j < h β†’ c j = 0 := by
intro j hj
by_contra hne
have := hh j hne
omega
refine ⟨t, h, hbt, hch, hbmax, hcmin, ?_⟩
by_contra! hth
let r := (t-h).toNat
have hr : 1 ≀ r := by dsimp [r]; omega
have hri : (r:β„€) = t-h := by dsimp [r]; omega
have he : (βˆ‘' j : β„€, b j * c (j-r)) = b t * c h := by
rw [tsum_eq_single t]
Β· congr 2
omega
Β· intro j hj
by_cases hbj : b j = 0
Β· simp [hbj]
Β· have htj := ht j hbj
rw [hcmin _ (by omega), mul_zero]
have hzero := hz r hr
rw [he] at hzero
exact (mul_ne_zero hbt hch) hzero
lemma DiscreteConvex.add_const {G : β„• β†’ ℝ} (h : DiscreteConvex G) (c : ℝ) :
DiscreteConvex (fun n => G n+c) := by
intro i j hij
simpa only [add_sub_add_right_eq_sub] using h hij
lemma eventually_quadratic_lower {G : β„• β†’ ℝ} {a Ξ΄ : ℝ} (hΞ΄a : Ξ΄ < a)
(ht : Tendsto (fun n => G n / (n:ℝ)^2) atTop (𝓝 a)) :
βˆ€αΆ  n : β„• in atTop, Ξ΄*(n:ℝ)^2 ≀ G n := by
filter_upwards [ht (eventually_gt_nhds hΞ΄a), eventually_ge_atTop 1] with n hn hn1
have hnpos : 0 < (n:ℝ)^2 := sq_pos_of_pos (Nat.cast_pos.mpr (by omega))
exact ((lt_div_iffβ‚€ hnpos).mp hn).le
theorem quadratic_support_separation (w : β„€ β†’ ℝ) (hw : QuadraticWeights w) :
SupportSeparation w := by
let W := fun j : β„€ => w j / w 0
have hw0 : 0 < w 0 := hw.positive 0
have hWpos (j : β„€) : 0 < W j := div_pos (hw.positive j) hw0
have hWdec : Antitone W := by
intro i j hij
exact div_le_div_of_nonneg_right (hw.decreasing hij) hw0.le
have hW0 : W 0 = 1 := div_self (ne_of_gt hw0)
have hlog (j : β„€) : Real.log (w j / w 0) = Real.log (w j) - Real.log (w 0) :=
Real.log_div (ne_of_gt (hw.positive j)) (ne_of_gt hw0)
have hP : DiscreteConvex (negativeLog W) := by
have heq : negativeLog W = fun n : β„• => Real.log (w (-(n:β„€))) + -Real.log (w 0) := by
funext n
simp only [negativeLog, W, hlog, sub_eq_add_neg]
rw [heq]
exact hw.convex_negative.add_const _
have hQ : DiscreteConvex (positiveLog W) := by
have heq : positiveLog W = fun n : β„• => -Real.log (w n) + Real.log (w 0) := by
funext n
simp only [positiveLog, W, hlog]
ring
rw [heq]
exact hw.concave_positive.add_const _
obtain ⟨a, ha, hqa, hpa⟩ := hw.quadratic
have hnat : Tendsto (fun n : β„• => (n:ℝ)^2) atTop atTop := by
exact (tendsto_pow_atTop (by norm_num : 2 β‰  0)).comp tendsto_natCast_atTop_atTop
have hsmall : Tendsto (fun n : β„• => Real.log (w 0) / (n:ℝ)^2) atTop (𝓝 0) := by
simpa only [div_eq_mul_inv, mul_zero, Function.comp_def] using
(tendsto_inv_atTop_zero.comp hnat).const_mul (Real.log (w 0))
have htP : Tendsto (fun n : β„• => negativeLog W n / (n:ℝ)^2) atTop (𝓝 a) := by
simpa only [negativeLog, W, hlog, sub_div, sub_zero] using hpa.sub hsmall
have htQ : Tendsto (fun n : β„• => positiveLog W n / (n:ℝ)^2) atTop (𝓝 a) := by
have heq : (fun n : β„• => positiveLog W n / (n:ℝ)^2) =
(fun n : β„• => -(Real.log (w n) / (n:ℝ)^2) + Real.log (w 0) / (n:ℝ)^2) := by
funext n
simp only [positiveLog, W, hlog]
ring
rw [heq]
simpa only [neg_neg, add_zero] using hqa.neg.add hsmall
obtain ⟨lam, hlam, hlama⟩ := exists_between ha
obtain ⟨δ, hδ, hδa⟩ := exists_between hlama
have hsep := normalized_support_separation hWpos hWdec hW0 hP hQ hlam hΞ΄
(eventually_quadratic_lower hΞ΄a htP) (eventually_quadratic_lower hΞ΄a htQ)
intro b c hbn hcn hb hc hz
let C : β„‚ := (w 0 : β„‚)
have hC : C β‰  0 := by dsimp [C]; exact_mod_cast (ne_of_gt hw0)
have hCnorm : β€–Cβ€– = w 0 := by simpa [C] using Real.norm_of_nonneg hw0.le
let b' := fun j => b j / C
let c' := fun j => C * c j
have hbn' : βˆƒ j, b' j β‰  0 := by
obtain ⟨j, hj⟩ := hbn
exact ⟨j, div_ne_zero hj hC⟩
have hcn' : βˆƒ j, c' j β‰  0 := by
obtain ⟨j, hj⟩ := hcn
exact ⟨j, mul_ne_zero hC hj⟩
have hb' (j : β„€) : β€–b' jβ€– ≀ W j := by
dsimp [b', W]
rw [norm_div, hCnorm]
exact div_le_div_of_nonneg_right (hb j) hw0.le
have hc' (j : β„€) : β€–c' jβ€– * W j ≀ 1 := by
dsimp [c', W]
rw [norm_mul, hCnorm]
have he : w 0 * β€–c jβ€– * (w j / w 0) = β€–c jβ€– * w j := by field_simp
rw [he]
exact hc j
have hz' (r : β„•) (hr : 1 ≀ r) : (βˆ‘' j : β„€, b' j * c' (j-r)) = 0 := by
have he (j : β„€) : b' j * c' (j-r) = b j * c (j-r) := by
dsimp [b', c']
field_simp
simp only [he]
exact hz r hr
have hh := hsep b' c' hbn' hcn' hb' hc' hz'
simpa [b', c', hC] using hh
lemma SupportSeparation.of_bounded {w : β„€ β†’ ℝ} (hsep : SupportSeparation w)
{b c : β„€ β†’ β„‚} (hbn : βˆƒ j, b j β‰  0) (hcn : βˆƒ j, c j β‰  0)
{B C : ℝ} (hB : 0 < B) (hC : 0 < C)
(hb : βˆ€ j, β€–b jβ€– ≀ B*w j) (hc : βˆ€ j, β€–c jβ€–*w j ≀ C)
(hz : βˆ€ r : β„•, 1 ≀ r β†’ (βˆ‘' j : β„€, b j * c (j-r)) = 0) :
βˆƒ t h : β„€, b t β‰  0 ∧ c h β‰  0 ∧
(βˆ€ j, t < j β†’ b j = 0) ∧ (βˆ€ j, j < h β†’ c j = 0) ∧ t ≀ h := by
have hBC : (B:β„‚) β‰  0 := by exact_mod_cast (ne_of_gt hB)
have hCC : (C:β„‚) β‰  0 := by exact_mod_cast (ne_of_gt hC)
let b' := fun j => b j / (B:β„‚)
let c' := fun j => c j / (C:β„‚)
have hbn' : βˆƒ j, b' j β‰  0 := by
obtain ⟨j, hj⟩ := hbn
exact ⟨j, div_ne_zero hj hBC⟩
have hcn' : βˆƒ j, c' j β‰  0 := by
obtain ⟨j, hj⟩ := hcn
exact ⟨j, div_ne_zero hj hCC⟩
have hb' (j : β„€) : β€–b' jβ€– ≀ w j := by
dsimp [b']
rw [norm_div, Complex.norm_real, Real.norm_of_nonneg hB.le]
exact (div_le_iffβ‚€ hB).mpr (by simpa only [mul_comm] using hb j)
have hc' (j : β„€) : β€–c' jβ€–*w j ≀ 1 := by
dsimp [c']
rw [norm_div, Complex.norm_real, Real.norm_of_nonneg hC.le, div_mul_eq_mul_div]
exact (div_le_one hC).mpr (hc j)
have hz' (r : β„•) (hr : 1 ≀ r) : (βˆ‘' j : β„€, b' j * c' (j-r)) = 0 := by
have he (j : β„€) : b' j * c' (j-r) = (b j*c (j-r)) / ((B:β„‚)*(C:β„‚)) := by
dsimp [b', c']; ring
simp only [he, tsum_div_const, hz r hr, zero_div]
have hh := hsep b' c' hbn' hcn' hb' hc' hz'
simpa [b', c', hBC, hCC] using hh
end
end BackwardIntertwiners
end OAI