Download data/lean/OAI/Analysis/BackwardIntertwiners/CoefficientSupport.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 14.3 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Analysis/BackwardIntertwiners/CoefficientSupport.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Analysis/BackwardIntertwiners/CoefficientSupport.lean
-
curl -L -o CoefficientSupport.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Analysis/BackwardIntertwiners/CoefficientSupport.lean
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 | |