math / data /lean /OAI /Analysis /BackwardIntertwiners /CoefficientSupport.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
14.3 kB
import OAI.Analysis.BackwardIntertwiners.ConvolutionBounds
namespace OAI
namespace BackwardIntertwiners
open Filter
open scoped Topology
noncomputable section
def coefficientObstacle (d : β„• β†’ β„‚) : Set β„• := {n | 0 < n ∧ d n β‰  0}
def coefficientEnvelope (d : β„• β†’ β„‚) : β„• β†’ ℝ :=
convexEnvelope (coefficientObstacle d) (fun n => -Real.log β€–d nβ€–)
namespace CoefficientEnvelope
variable {d : β„• β†’ β„‚} {G : β„• β†’ ℝ}
variable (hu : βˆ€ n : β„•, βˆƒ k, n < k ∧ d k β‰  0)
variable (hG : DiscreteConvex G) (hG0 : G 0 = 0)
variable (hb : βˆ€ n, β€–d nβ€– ≀ Real.exp (-G n))
include hu in
lemma unbounded : βˆ€ n : β„•, βˆƒ k, n < k ∧ k ∈ coefficientObstacle d := by
intro n
obtain ⟨k, hk, hd⟩ := hu n
exact ⟨k, hk, by exact ⟨by omega, hd⟩⟩
include hG hG0 hb in
lemma minorant : G ∈ convexMinorants (coefficientObstacle d) (fun n => -Real.log β€–d nβ€–) := by
refine ⟨hG0, hG, ?_⟩
intro n hn
have hn0 : 0 < β€–d nβ€– := norm_pos_iff.mpr hn.2
have hh := Real.log_le_log hn0 (hb n)
rw [Real.log_exp] at hh
linarith
include hu hG hG0 hb in
lemma properties :
coefficientEnvelope d 0 = 0 ∧ DiscreteConvex (coefficientEnvelope d) ∧
(βˆ€ n, G n ≀ coefficientEnvelope d n) ∧
(βˆ€ n, β€–d nβ€– ≀ Real.exp (-coefficientEnvelope d n)) ∧
(βˆ€ n, 0 < coefficientEnvelope d (n+2) - 2*coefficientEnvelope d (n+1) +
coefficientEnvelope d n β†’ β€–d (n+1)β€– = Real.exp (-coefficientEnvelope d (n+1))) := by
have hm := minorant hG hG0 hb
have he : (convexMinorants (coefficientObstacle d) (fun n => -Real.log β€–d nβ€–)).Nonempty := ⟨G, hm⟩
have hU := unbounded hu
refine ⟨ConvexEnvelope.zero hU he, ConvexEnvelope.convex hU he,
ConvexEnvelope.le_envelope hU hm, ?_, ?_⟩
Β· intro n
by_cases hn : n = 0
Β· subst n
simpa only [coefficientEnvelope, ConvexEnvelope.zero hU he, hG0] using hb 0
Β· by_cases hd : d n = 0
Β· simp only [hd, norm_zero]; exact (Real.exp_pos _).le
· have hbelow := ConvexEnvelope.below he (show n ∈ coefficientObstacle d from ⟨by omega, hd⟩)
have hlog : Real.log β€–d nβ€– ≀ -coefficientEnvelope d n := by
change coefficientEnvelope d n ≀ -Real.log β€–d nβ€– at hbelow
linarith
simpa only [Real.exp_log (norm_pos_iff.mpr hd)] using Real.exp_le_exp.mpr hlog
Β· intro n hn
obtain ⟨hd, hc⟩ := ConvexEnvelope.contact hU he n hn
change coefficientEnvelope d (n+1) = -Real.log β€–d (n+1)β€– at hc
rw [hc, neg_neg, Real.exp_log (norm_pos_iff.mpr hd.2)]
end CoefficientEnvelope
theorem no_both_unbounded {P Q : β„• β†’ ℝ} {b c : β„€ β†’ β„‚}
(hb : EnvelopeBounds P Q b c) (hP : DiscreteConvex P) (hQ : DiscreteConvex Q)
(hP0 : P 0 = 0) (hQ0 : Q 0 = 0) {lam Ξ΄ : ℝ}
(hlam : Real.log 3 < lam) (hΞ΄ : lam < Ξ΄)
(hqp : βˆ€αΆ  n : β„• in atTop, Ξ΄*(n : ℝ)^2 ≀ P n)
(hqq : βˆ€αΆ  n : β„• in atTop, Ξ΄*(n : ℝ)^2 ≀ Q n)
(hbu : βˆ€ n : β„•, βˆƒ k, n < k ∧ b (k : β„€) β‰  0)
(hcu : βˆ€ n : β„•, βˆƒ k, n < k ∧ c (-(k : β„€)) β‰  0)
(hz : βˆ€ r : β„•, 1 ≀ r β†’ (βˆ‘' j : β„€, b j * c (j-r)) = 0) : False := by
obtain ⟨hA0, hA, hPA, hcA, hcontactA⟩ :=
CoefficientEnvelope.properties hcu hP hP0 hb.c_neg
obtain ⟨hB0, hB, hQB, hbB, hcontactB⟩ :=
CoefficientEnvelope.properties hbu hQ hQ0 hb.b_pos
let A := coefficientEnvelope (fun n => c (-(n : β„€)))
let B := coefficientEnvelope (fun n => b (n : β„€))
apply no_correlation_of_envelopes (A := A) (B := B) (b := b) (c := c)
?_ hA hB hA0 hB0 hlam hΞ΄ ?_ ?_ hcontactA hcontactB hz
· refine ⟨hbB, ?_, ?_, hcA⟩
Β· intro n
exact (hb.b_neg n).trans (Real.exp_le_exp.mpr (hPA n))
Β· intro n
exact (hb.c_pos n).trans (Real.exp_le_exp.mpr (hQB n))
Β· filter_upwards [hqp] with n hn using hn.trans (hPA n)
Β· filter_upwards [hqq] with n hn using hn.trans (hQB n)
def boundedSideTail (B : β„• β†’ ℝ) (c : β„€ β†’ β„‚) (h : β„€) (p k : β„•) : ℝ :=
Real.exp (B p - B (p+k+1)) * β€–c (h+(k:β„€)+1)β€–
lemma boundedSideTail_nonneg (B : β„• β†’ ℝ) (c : β„€ β†’ β„‚) (h : β„€) (p k : β„•) :
0 ≀ boundedSideTail B c h p k := mul_nonneg (Real.exp_pos _).le (norm_nonneg _)
lemma boundedSideTail_mono {B : β„• β†’ ℝ} (hB : DiscreteConvex B)
(c : β„€ β†’ β„‚) (h : β„€) {pβ‚€ p : β„•} (hpp : pβ‚€ ≀ p) (k : β„•) :
boundedSideTail B c h p k ≀ boundedSideTail B c h pβ‚€ k := by
have hh := hB.increment_mono hpp (k+1)
unfold boundedSideTail
apply mul_le_mul_of_nonneg_right _ (norm_nonneg _)
apply Real.exp_le_exp.mpr
simp only [← Nat.add_assoc] at hh
linarith
lemma boundedSideTail_tendsto {B : β„• β†’ ℝ} (hB : DiscreteConvex B)
(hs : Tendsto (fun n => B (n+1)-B n) atTop atTop)
(c : β„€ β†’ β„‚) (h : β„€) {pβ‚€ : β„•} (hsum : Summable (boundedSideTail B c h pβ‚€)) :
Tendsto (fun p => βˆ‘' k, boundedSideTail B c h p k) atTop (𝓝 0) := by
have hpoint (k : β„•) : Tendsto (fun p => boundedSideTail B c h p k) atTop (𝓝 0) := by
have heq : (fun p => boundedSideTail B c h p k) =
(fun p => normalizedTailTerm B p k * (Real.exp (-B (k+1)) * β€–c (h+(k:β„€)+1)β€–)) := by
funext p
unfold boundedSideTail normalizedTailTerm
rw [← mul_assoc, ← Real.exp_add]
congr 2
ring
rw [heq]
simpa using (hB.tail_term_tendsto hs k).mul_const
(Real.exp (-B (k+1)) * β€–c (h+(k:β„€)+1)β€–)
have ht := tendsto_tsum_of_dominated_convergence hsum hpoint
(show βˆ€αΆ  p : β„• in atTop, βˆ€ k,
β€–boundedSideTail B c h p kβ€– ≀ boundedSideTail B c h pβ‚€ k from ?_)
Β· simpa using ht
Β· filter_upwards [eventually_ge_atTop pβ‚€] with p hp k
rw [Real.norm_eq_abs, abs_of_nonneg (boundedSideTail_nonneg _ _ _ _ _)]
exact boundedSideTail_mono hB c h hp k
theorem no_unbounded_against_min {B : β„• β†’ ℝ} {b c : β„€ β†’ β„‚}
(hB : DiscreteConvex B) (hB0 : B 0 = 0) {Ξ΄ : ℝ} (hΞ΄ : 0 < Ξ΄)
(hquad : βˆ€αΆ  n : β„• in atTop, Ξ΄*(n:ℝ)^2 ≀ B n)
(hb : βˆ€ n : β„•, β€–b nβ€– ≀ Real.exp (-B n))
(hc : βˆ€ n, 0 < B (n+2) - 2*B (n+1) + B n β†’
β€–b ((n+1:β„•):β„€)β€– = Real.exp (-B (n+1)))
{h : β„€} (hch : c h β‰  0) (hcmin : βˆ€ j : β„€, j < h β†’ c j = 0)
{pβ‚€ : β„•} (hsum : Summable (boundedSideTail B c h pβ‚€))
(hz : βˆ€ r : β„•, 1 ≀ r β†’ (βˆ‘' j : β„€, b j * c (j-r)) = 0) : False := by
have hchpos := norm_pos_iff.mpr hch
have ht := boundedSideTail_tendsto hB (hB.slopes_tendsto hB0 hΞ΄ hquad) c h hsum
obtain ⟨N, hN⟩ := eventually_atTop.1 (ht (eventually_lt_nhds hchpos))
obtain ⟨n, hn, hcurv⟩ := large_curvature hΞ΄ hΞ΄ hquad (max N (max pβ‚€ (h.toNat+1)))
let p := n+1
have hpβ‚€ : pβ‚€ ≀ p := by dsimp [p]; omega
have hpN : N ≀ p := by dsimp [p]; omega
have hph : h < (p : β„€) := by dsimp [p]; omega
have hcontact : β€–b (p : β„€)β€– = Real.exp (-B p) := hc n (by simpa using hcurv)
have htailsum : Summable (boundedSideTail B c h p) := by
apply hsum.of_norm_bounded
intro k
rw [Real.norm_eq_abs, abs_of_nonneg (boundedSideTail_nonneg _ _ _ _ _)]
exact boundedSideTail_mono hB c h hpβ‚€ k
let f := fun i : β„€ => b ((p:β„€)+i) * c (h+i)
have hfneg : βˆ€ k : β„•, f (-((k:β„€)+1)) = 0 := by
intro k
dsimp [f]
rw [hcmin _ (by omega), mul_zero]
have hfbound (k : β„•) : β€–f ((k:β„€)+1)β€– ≀ Real.exp (-B p) * boundedSideTail B c h p k := by
dsimp [f, boundedSideTail]
rw [norm_mul, ← mul_assoc, ← Real.exp_add]
have he : -B p + (B p - B (p+k+1)) = -B (p+k+1) := by ring
rw [he]
have hi : (p:β„€)+((k:β„€)+1) = ((p+k+1:β„•):β„€) := by omega
rw [hi]
simpa only [add_assoc] using mul_le_mul_of_nonneg_right (hb (p+k+1)) (norm_nonneg (c (h+(k:β„€)+1)))
have hfpos : Summable (fun k : β„• => β€–f ((k:β„€)+1)β€–) := by
apply (htailsum.mul_left (Real.exp (-B p))).of_norm_bounded
intro k
simpa only [Real.norm_eq_abs, abs_of_nonneg (norm_nonneg _)] using hfbound k
have hfn : Summable (fun k : β„• => β€–f (-((k:β„€)+1))β€–) := by
simp only [hfneg, norm_zero]
exact summable_zero
have hzcenter : (βˆ‘' i : β„€, f i) = 0 := by
let r := ((p:β„€)-h).toNat
have hr : 1 ≀ r := by dsimp [r]; omega
have hri : (r:β„€) = (p:β„€)-h := by dsimp [r]; omega
calc (βˆ‘' i : β„€, f i) = βˆ‘' i : β„€, b ((p:β„€)+i) * c (((p:β„€)+i)-(r:β„€)) := by
apply tsum_congr
intro i
dsimp [f]
congr 2
omega
_ = βˆ‘' j : β„€, b j * c (j-r) := by
simpa only [Equiv.coe_addLeft] using
(Equiv.addLeft (p:β„€)).tsum_eq (fun j : β„€ => b j * c (j-r))
_ = 0 := hz r hr
have hcentral := central_norm_le_of_correlation_zero f hfpos hfn hzcenter
simp only [hfneg, norm_zero, tsum_zero, add_zero] at hcentral
have hcentral' : Real.exp (-B p) * β€–c hβ€– ≀
Real.exp (-B p) * βˆ‘' k, boundedSideTail B c h p k := by
calc Real.exp (-B p) * β€–c hβ€– = β€–f 0β€– := by simp [f, hcontact]
_ ≀ βˆ‘' k : β„•, β€–f ((k:β„€)+1)β€– := hcentral
_ ≀ βˆ‘' k, Real.exp (-B p) * boundedSideTail B c h p k :=
hfpos.tsum_le_tsum hfbound (htailsum.mul_left _)
_ = _ := tsum_mul_left
have hle := (mul_le_mul_iff_rightβ‚€ (Real.exp_pos (-B p))).mp hcentral'
exact (not_lt_of_ge hle) (hN p hpN)
def positiveLog (w : β„€ β†’ ℝ) (n : β„•) : ℝ := -Real.log (w n)
def negativeLog (w : β„€ β†’ ℝ) (n : β„•) : ℝ := Real.log (w (-(n:β„€)))
def stepRatio (w : β„€ β†’ ℝ) (j : β„€) : ℝ := w (j+1) / w j
lemma stepRatio_summable {w : β„€ β†’ ℝ} (hw : βˆ€ j, 0 < w j) (hw0 : w 0 = 1)
(hP : DiscreteConvex (negativeLog w)) (hQ : DiscreteConvex (positiveLog w))
{Ξ΄ : ℝ} (hΞ΄ : 0 < Ξ΄)
(hqp : βˆ€αΆ  n : β„• in atTop, Ξ΄*(n:ℝ)^2 ≀ negativeLog w n)
(hqq : βˆ€αΆ  n : β„• in atTop, Ξ΄*(n:ℝ)^2 ≀ positiveLog w n) :
Summable (stepRatio w) := by
have hP0 : negativeLog w 0 = 0 := by simp [negativeLog, hw0]
have hQ0 : positiveLog w 0 = 0 := by simp [positiveLog, hw0]
have hsP := hP.summable_exp_neg_slope hP0 hΞ΄ hqp
have hsQ := hQ.summable_exp_neg_slope hQ0 hΞ΄ hqq
apply Summable.of_nat_of_neg_add_one
Β· apply hsQ.congr
intro n
unfold stepRatio positiveLog
have he : -(-Real.log (w (n+1)) - -Real.log (w n)) =
Real.log (w (n+1)) - Real.log (w n) := by ring
push_cast
rw [he, Real.exp_sub, Real.exp_log (hw _), Real.exp_log (hw _)]
Β· apply hsP.congr
intro n
unfold stepRatio negativeLog
have hi : -((n:β„€)+1)+1 = -(n:β„€) := by omega
rw [hi]
push_cast
rw [neg_sub, Real.exp_sub, Real.exp_log (hw _), Real.exp_log (hw _)]
lemma bounds_of_weight {w : β„€ β†’ ℝ} (hw : βˆ€ j, 0 < w j) {b c : β„€ β†’ β„‚}
(hb : βˆ€ j, β€–b jβ€– ≀ w j) (hc : βˆ€ j, β€–c jβ€– * w j ≀ 1) :
EnvelopeBounds (negativeLog w) (positiveLog w) b c := by
have hc' (j : β„€) : β€–c jβ€– ≀ (w j)⁻¹ := by
simpa only [one_div] using (le_div_iffβ‚€ (hw j)).mpr (hc j)
constructor
Β· intro n
simpa [positiveLog, Real.exp_log (hw _)] using hb n
Β· intro n
simpa [negativeLog, Real.exp_log (hw _)] using hb (-(n:β„€))
Β· intro n
simpa [positiveLog, Real.exp_neg, Real.exp_log (hw _)] using hc' n
Β· intro n
simpa [negativeLog, Real.exp_neg, Real.exp_log (hw _)] using hc' (-(n:β„€))
lemma boundedSideTail_summable {w : β„€ β†’ ℝ} (hw : βˆ€ j, 0 < w j)
(hdec : Antitone w) (hs : Summable (stepRatio w))
{B : β„• β†’ ℝ} (hBw : βˆ€ n : β„•, Real.exp (-B n) ≀ w n)
{c : β„€ β†’ β„‚} (hc : βˆ€ j, β€–c jβ€– * w j ≀ 1)
(h : β„€) {pβ‚€ : β„•} (hpβ‚€ : h+1 ≀ (pβ‚€:β„€)) :
Summable (boundedSideTail B c h pβ‚€) := by
have hsm := hs.comp_injective (i := fun k : β„• => h+(k:β„€)+1) (by
intro a b hab; dsimp only at hab; omega)
apply (hsm.mul_left (Real.exp (B pβ‚€))).of_norm_bounded
intro k
rw [Real.norm_eq_abs, abs_of_nonneg (boundedSideTail_nonneg _ _ _ _ _)]
change boundedSideTail B c h pβ‚€ k ≀ Real.exp (B pβ‚€) * stepRatio w (h+(k:β„€)+1)
have hwle : Real.exp (-B (pβ‚€+k+1)) ≀ w (h+(k:β„€)+1+1) := by
exact (hBw _).trans (hdec (by omega))
have hcw : β€–c (h+(k:β„€)+1)β€– ≀ 1 / w (h+(k:β„€)+1) :=
(le_div_iffβ‚€ (hw _)).mpr (hc _)
unfold boundedSideTail stepRatio
rw [Real.exp_sub, div_eq_mul_inv, ← Real.exp_neg, mul_assoc]
apply mul_le_mul_of_nonneg_left _ (Real.exp_pos _).le
calc Real.exp (-B (pβ‚€+k+1)) * β€–c (h+(k:β„€)+1)β€– ≀
w (h+(k:β„€)+1+1) * (1 / w (h+(k:β„€)+1)) :=
mul_le_mul hwle hcw (norm_nonneg _) (hw _).le
_ = _ := by ring
lemma nat_support_unbounded {d : β„€ β†’ β„‚}
(hu : Β¬βˆƒ m : β„€, βˆ€ j : β„€, d j β‰  0 β†’ j ≀ m) :
βˆ€ n : β„•, βˆƒ k, n < k ∧ d (k:β„€) β‰  0 := by
push Not at hu
intro n
obtain ⟨j, hd, hj⟩ := hu n
refine ⟨j.toNat, by omega, ?_⟩
have he : (j.toNat:β„€) = j := by omega
simpa only [he] using hd
lemma bounded_above_of_min {w : β„€ β†’ ℝ} (hw : βˆ€ j, 0 < w j)
(hdec : Antitone w) (hw0 : w 0 = 1) (hs : Summable (stepRatio w))
(hQ : DiscreteConvex (positiveLog w)) {Ξ΄ : ℝ} (hΞ΄ : 0 < Ξ΄)
(hqq : βˆ€αΆ  n : β„• in atTop, Ξ΄*(n:ℝ)^2 ≀ positiveLog w n)
{b c : β„€ β†’ β„‚} (hb : βˆ€ j, β€–b jβ€– ≀ w j) (hc : βˆ€ j, β€–c jβ€–*w j ≀ 1)
{h : β„€} (hch : c h β‰  0) (hcmin : βˆ€ j : β„€, j < h β†’ c j = 0)
(hz : βˆ€ r : β„•, 1 ≀ r β†’ (βˆ‘' j : β„€, b j * c (j-r)) = 0) :
βˆƒ m : β„€, βˆ€ j : β„€, b j β‰  0 β†’ j ≀ m := by
by_contra hu
have hbu := nat_support_unbounded hu
have hQ0 : positiveLog w 0 = 0 := by simp [positiveLog, hw0]
obtain ⟨hB0, hB, hQB, hbB, hcontactB⟩ :=
CoefficientEnvelope.properties hbu hQ hQ0 (bounds_of_weight hw hb hc).b_pos
let B := coefficientEnvelope (fun n => b (n:β„€))
have hquad : βˆ€αΆ  n : β„• in atTop, Ξ΄*(n:ℝ)^2 ≀ B n := by
filter_upwards [hqq] with n hn using hn.trans (hQB n)
have hBw (n : β„•) : Real.exp (-B n) ≀ w n := by
have hh := Real.exp_le_exp.mpr (neg_le_neg (hQB n))
simpa only [positiveLog, neg_neg, Real.exp_log (hw _)] using hh
exact no_unbounded_against_min hB hB0 hΞ΄ hquad hbB hcontactB hch hcmin
(boundedSideTail_summable hw hdec hs hBw hc h (pβ‚€ := h.toNat+1) (by omega)) hz
end
end BackwardIntertwiners
end OAI