Download lean/OAI/Probability/CriticalPercolation/Growth/RealSparseDoubling.lean from roseking/openAI-math-dataset: direct link, hf CLI and curl.
- Browser
- Download file 3.74 kB
-
https://huggingface.co/datasets/roseking/openAI-math-dataset/resolve/main/lean/OAI/Probability/CriticalPercolation/Growth/RealSparseDoubling.lean
- Command line
-
hf download hf://datasets/roseking/openAI-math-dataset/lean/OAI/Probability/CriticalPercolation/Growth/RealSparseDoubling.lean
-
curl -L -o RealSparseDoubling.lean https://huggingface.co/datasets/roseking/openAI-math-dataset/resolve/main/lean/OAI/Probability/CriticalPercolation/Growth/RealSparseDoubling.lean
3.74 kB
| import Mathlib | |
| namespace OAI | |
| section | |
| noncomputable section | |
| open scoped Classical | |
| namespace CriticalPercolation.HarmonicAnalysis | |
| lemma sparse_real_doubling (f : ℕ → ℝ) (hf : Monotone f) | |
| (R₀ : ℕ) (hpos : ∀ n≥R₀, 0<f n) (C : ℝ) (hC : 0≤C) | |
| (d b : ℕ) (hb : 2≤b) (hpoly : ∀ R, ∃ n≥R, f n≤C*(n:ℝ)^d) : | |
| ∀ R : ℕ, ∃ n≥max R R₀, f (b*n)≤(b:ℝ)^(d+1)*f n := by | |
| intro R | |
| by_contra! hbad | |
| let a := max (max R R₀) 1 | |
| have ha : 0<a := by dsimp [a]; omega | |
| have haR : max R R₀≤a := le_max_left _ _ | |
| have hfapos : 0<f a := hpos a ((le_max_right R R₀).trans haR) | |
| have hgrow : ∀ k : ℕ, ((b:ℝ)^(d+1))^k*f a≤f (b^k*a) := by | |
| intro k | |
| induction k with | |
| | zero => simp | |
| | succ k ih => | |
| have hr : max R R₀≤b^k*a := haR.trans (by | |
| have hh : 1≤b^k := Nat.one_le_pow k b (by omega) | |
| nlinarith) | |
| have hh := (hbad (b^k*a) hr).le | |
| calc | |
| _ = (b:ℝ)^(d+1)*(((b:ℝ)^(d+1))^k*f a) := by rw [pow_succ]; ring | |
| _ ≤ (b:ℝ)^(d+1)*f (b^k*a) := mul_le_mul_of_nonneg_left ih (by positivity) | |
| _ ≤ f (b*(b^k*a)) := hh | |
| _ = _ := by congr 1; rw [pow_succ]; ring | |
| obtain ⟨N,hN⟩ := exists_nat_gt (C*((b*a:ℕ):ℝ)^d/f a) | |
| have hNF : C*((b*a:ℕ):ℝ)^d<(N:ℝ)*f a := (div_lt_iff₀ hfapos).mp hN | |
| obtain ⟨n,hn,hnpoly⟩ := hpoly (b*a*(N+1)) | |
| have hnA : b*(N+1)≤n/a := (Nat.le_div_iff_mul_le ha).mpr (by nlinarith) | |
| have hnAp : n/a≠0 := by nlinarith | |
| let k := Nat.log b (n/a) | |
| let P := b^k | |
| have hP : P≤n/a := Nat.pow_log_le_self b hnAp | |
| have hP' : n/a<b*P := by | |
| have hh := Nat.lt_pow_of_log_lt (b := b) (x := k+1) (y := n/a) hb | |
| (show Nat.log b (n/a)<k+1 by omega) | |
| simpa only [pow_succ,Nat.mul_comm] using hh | |
| have hNP : N<P := by nlinarith | |
| have hNP' : (N:ℝ)<P := by exact_mod_cast hNP | |
| have hPA : P*a≤n := (Nat.le_div_iff_mul_le ha).mp hP | |
| have hnupper : n<(b*P)*a := (Nat.div_lt_iff_lt_mul ha).mp hP' | |
| have hlow : (P:ℝ)^d*((P:ℝ)*f a)≤f n := by | |
| have hh := (hgrow k).trans (hf hPA) | |
| have he : (P:ℝ)^d*((P:ℝ)*f a) = ((b:ℝ)^(d+1))^k*f a := by | |
| dsimp [P] | |
| push_cast | |
| rw [←mul_assoc,←pow_succ,←pow_mul,←pow_mul,Nat.mul_comm k (d+1)] | |
| rw [he] | |
| exact hh | |
| have hupper : f n≤(P:ℝ)^d*(C*((b*a:ℕ):ℝ)^d) := by | |
| have hnupper' : (n:ℝ)≤((b*P)*a:ℕ) := by exact_mod_cast hnupper.le | |
| have hh := mul_le_mul_of_nonneg_left (pow_le_pow_left₀ (Nat.cast_nonneg _) hnupper' d) hC | |
| apply hnpoly.trans | |
| convert hh using 1 | |
| push_cast | |
| ring | |
| have hPpos : (0:ℝ)<(P:ℝ)^d := by | |
| apply pow_pos | |
| exact_mod_cast (show 0<P by dsimp [P]; positivity) | |
| have hsmall : C*((b*a:ℕ):ℝ)^d<(P:ℝ)*f a := | |
| hNF.trans (mul_lt_mul_of_pos_right hNP' hfapos) | |
| exact (not_lt_of_ge (hlow.trans hupper)) (mul_lt_mul_of_pos_left hsmall hPpos) | |
| lemma exists_local_ratio (f : ℕ → ℝ) (L : ℕ) (hL : 0<L) | |
| (C : ℝ) (hC : 0<C) (hbound : f L≤C^L*f 0) : | |
| ∃ i<L, f (i+1)≤C*f i := by | |
| by_contra! hbad | |
| have hgrow : ∀ i≤L, C^i*f 0≤f i := by | |
| intro i hi | |
| induction i with | |
| | zero => simp | |
| | succ i ih => | |
| have hh := ih (by omega) | |
| calc | |
| _ = C*(C^i*f 0) := by rw [pow_succ]; ring | |
| _ ≤ C*f i := mul_le_mul_of_nonneg_left hh hC.le | |
| _ ≤ _ := (hbad i (by omega)).le | |
| have hlast := hbad (L-1) (by omega) | |
| rw [Nat.sub_add_cancel (by omega : 1≤L)] at hlast | |
| have hg := mul_le_mul_of_nonneg_left (hgrow (L-1) (by omega)) hC.le | |
| have he : C*(C^(L-1)*f 0)=C^L*f 0 := by | |
| rw [←mul_assoc,←pow_succ',Nat.sub_add_cancel (by omega : 1≤L)] | |
| rw [he] at hg | |
| exact (not_lt_of_ge hbound) (hg.trans_lt hlast) | |
| end CriticalPercolation.HarmonicAnalysis | |
| end | |
| end | |
| end OAI | |