Download data/lean/OAI/Probability/SATComputability/DyadicMoment.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 7.26 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/SATComputability/DyadicMoment.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/SATComputability/DyadicMoment.lean
-
curl -L -o DyadicMoment.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/SATComputability/DyadicMoment.lean
7.26 kB
| import OAI.Probability.SATComputability.MaskDelay | |
| namespace OAI | |
| namespace FixedClauseThreshold.Computability | |
| open DilutedSpinGlass Filter | |
| open scoped BigOperators NNReal Topology | |
| theorem poissonKillProbability_le_one {n : β} [NeZero n] | |
| (U : Finset (DeletionCandidate n)) (k : β) (r : ββ₯0) : | |
| poissonKillProbability U k r β€ 1 := by | |
| have h := FiniteLaw.expect_nonneg (candidateBlock r k U) candidateAlive_nonneg | |
| rw [candidateBlock_expect_alive] at h | |
| linarith | |
| theorem positive_killing_in_dyadic_bin {n : β} [NeZero n] | |
| (U : Finset (DeletionCandidate n)) (hU : U.Nonempty) | |
| (hq : 0 < poissonKillProbability U 2 60) : β j, dyadicBin j U := by | |
| obtain β¨j, hj, hj'β© := exists_nat_pow_near_of_lt_one hq | |
| (poissonKillProbability_le_one U 2 60) | |
| (by norm_num : (0 : β) < 2β»ΒΉ) (by norm_num : (2 : β)β»ΒΉ < 1) | |
| refine β¨j+1, hU, ?_, ?_β© | |
| Β· simpa only [dyadicLevel, inv_pow] using hj.le | |
| Β· have he : 2*dyadicLevel (j+1) = ((2 : β)β»ΒΉ)^j := by | |
| simp only [dyadicLevel, inv_pow, pow_succ] | |
| norm_num | |
| ring | |
| rwa [he] | |
| noncomputable def dyadicLifetimeBound (j : β) : β := | |
| (4*(dyadicBlock j : β)/dyadicLevel j)^(1/5 : β) | |
| theorem dyadicLifetimeBound_nonneg (j : β) : 0 β€ dyadicLifetimeBound j := by | |
| unfold dyadicLifetimeBound | |
| positivity [dyadicLevel_pos j] | |
| theorem dyadic_lifetime_bound {n : β} [NeZero n] (r : ββ₯0) | |
| (hr : (1 : β)/8 β€ r) (m j : β) (U : Finset (DeletionCandidate n)) | |
| (hU : dyadicBin j U) : | |
| (FiniteLaw.pi (fun _ : Fin m => candidateBlock (n := n) r 3 Finset.univ)).expect | |
| (fun xs => (maskLifetime m U xs)^(1/5 : β)) β€ dyadicLifetimeBound j := by | |
| have h := maskLifetime_fractional_moment r 3 m (dyadicBlock j) U | |
| (show 0 < dyadicLevel j/4 by positivity [dyadicLevel_pos j]) | |
| (dyadic_block_kills U j r hr hU.2.1) | |
| convert h using 1 | |
| unfold dyadicLifetimeBound | |
| congr 1 | |
| field_simp | |
| theorem capped_lifetime_fractional_bound {n : β} [NeZero n] | |
| (r : ββ₯0) (k m M : β) (hm : m β€ M) (U : Finset (DeletionCandidate n)) : | |
| (FiniteLaw.pi (fun _ : Fin m => candidateBlock (n := n) r k Finset.univ)).expect | |
| (fun xs => (maskLifetime m U xs)^(1/5 : β)) β€ (M : β)^(1/5 : β) := by | |
| apply (FiniteLaw.expect_mono _ (g := fun _ => (M : β)^(1/5 : β)) (fun xs => Real.rpow_le_rpow | |
| (maskLifetime_nonneg U xs) ((maskLifetime_le U xs).trans (by exact_mod_cast hm)) | |
| (by norm_num : (0 : β) β€ 1/5))).trans_eq | |
| exact FiniteLaw.expect_const _ _ | |
| theorem dyadicLevel_rpow (j : β) : dyadicLevel j = (2 : β)^(-(j : β)) := by | |
| rw [dyadicLevel, Real.rpow_neg (by norm_num : (0 : β) β€ 2), Real.rpow_natCast] | |
| theorem dyadicBlock_growth (j : β) : | |
| (dyadicBlock j : β) β€ 128*((j : β)+122)^2 * (2 : β)^((j : β)/2) := by | |
| have he : (((j+1)/2 : β) : β) β€ (j : β)/2+1 := by | |
| have h : 2*((j+1)/2) β€ j+2 := by omega | |
| have h' : (2 : β)*((j+1)/2 : β) β€ (j : β)+2 := by exact_mod_cast h | |
| linarith | |
| have hp : (2 : β)^((j+1)/2) β€ 2*(2 : β)^((j : β)/2) := by | |
| rw [β Real.rpow_natCast] | |
| apply (Real.rpow_le_rpow_of_exponent_le (by norm_num) he).trans_eq | |
| rw [Real.rpow_add (by norm_num : (0 : β) < 2), Real.rpow_one] | |
| ring | |
| unfold dyadicBlock dyadicMultiplicity dyadicTruncation | |
| push_cast | |
| nlinarith [mul_le_mul_of_nonneg_left hp (show 0 β€ 64*((j : β)+122)^2 by positivity)] | |
| noncomputable def dyadicMomentCoefficient (j : β) : β := | |
| (dyadicLevel j)^2 * (4*(dyadicBlock j : β)/dyadicLevel j)^(6/5 : β) | |
| theorem dyadicMomentCoefficient_nonneg (j : β) : 0 β€ dyadicMomentCoefficient j := by | |
| unfold dyadicMomentCoefficient | |
| positivity [dyadicLevel_pos j] | |
| theorem dyadicMomentCoefficient_bound (j : β) : | |
| dyadicMomentCoefficient j β€ | |
| (512 : β)^(6/5 : β) * ((j : β)+122)^3 * ((2 : β)^(-1/5 : β))^j := by | |
| have hx : 0 < (j : β)+122 := by positivity | |
| have hpow : (2 : β)^((j : β)/2) * (2 : β)^(j : β) = | |
| (2 : β)^(3*(j : β)/2) := by | |
| rw [β Real.rpow_add (by norm_num : (0 : β) < 2)] | |
| congr 1 | |
| ring | |
| have hA : 4*(dyadicBlock j : β)/dyadicLevel j β€ | |
| 512*((j : β)+122)^2 * (2 : β)^(3*(j : β)/2) := by | |
| calc | |
| _ = 4*(dyadicBlock j : β)*(2 : β)^(j : β) := by | |
| simp only [dyadicLevel, div_eq_mul_inv, inv_inv, Real.rpow_natCast] | |
| _ β€ 4*(128*((j : β)+122)^2*(2 : β)^((j : β)/2)) * (2 : β)^(j : β) := by | |
| gcongr | |
| exact dyadicBlock_growth j | |
| _ = _ := by rw [show 4*(128*((j : β)+122)^2*(2 : β)^((j : β)/2)) * | |
| (2 : β)^(j : β) = 512*((j : β)+122)^2 * | |
| ((2 : β)^((j : β)/2)*(2 : β)^(j : β)) by ring, hpow] | |
| have hq : (dyadicLevel j)^2 = (2 : β)^(-2*(j : β)) := by | |
| rw [dyadicLevel_rpow, pow_two, β Real.rpow_add (by norm_num : (0 : β) < 2)] | |
| congr 1 | |
| ring | |
| have hxp : (((j : β)+122)^2)^(6/5 : β) = ((j : β)+122)^(12/5 : β) := by | |
| rw [β Real.rpow_natCast, β Real.rpow_mul hx.le] | |
| norm_num | |
| have htwo : ((2 : β)^(3*(j : β)/2))^(6/5 : β) = (2 : β)^(9*(j : β)/5) := by | |
| rw [β Real.rpow_mul (by norm_num : (0 : β) β€ 2)] | |
| congr 1 | |
| ring | |
| have he : (2 : β)^(-2*(j : β)) * (2 : β)^(9*(j : β)/5) = | |
| ((2 : β)^(-1/5 : β))^j := by | |
| rw [β Real.rpow_add (by norm_num : (0 : β) < 2), | |
| β Real.rpow_mul_natCast (by norm_num : (0 : β) β€ 2)] | |
| congr 1 | |
| ring | |
| calc | |
| _ β€ (dyadicLevel j)^2 * | |
| (512*((j : β)+122)^2*(2 : β)^(3*(j : β)/2))^(6/5 : β) := by | |
| exact mul_le_mul_of_nonneg_left | |
| (Real.rpow_le_rpow (by positivity [dyadicLevel_pos j]) hA (by norm_num)) (sq_nonneg _) | |
| _ = (512 : β)^(6/5 : β) * ((j : β)+122)^(12/5 : β) * | |
| ((2 : β)^(-1/5 : β))^j := by | |
| rw [Real.mul_rpow (by positivity) (by positivity), | |
| Real.mul_rpow (by norm_num : (0 : β) β€ 512) (sq_nonneg _), hq, hxp, htwo] | |
| calc | |
| _ = (512 : β)^(6/5 : β) * ((j : β)+122)^(12/5 : β) * | |
| ((2 : β)^(-2*(j : β))*(2 : β)^(9*(j : β)/5)) := by ring | |
| _ = _ := by rw [he] | |
| _ β€ _ := by | |
| gcongr | |
| rw [β Real.rpow_natCast] | |
| exact Real.rpow_le_rpow_of_exponent_le (by linarith [Nat.cast_nonneg (Ξ± := β) j]) (by norm_num) | |
| theorem dyadicMomentCoefficient_summable : Summable dyadicMomentCoefficient := by | |
| let Ο : β := 2^(-1/5 : β) | |
| have hΟ : βΟβ < 1 := by | |
| rw [Real.norm_eq_abs, abs_of_pos (Real.rpow_pos_of_pos (by norm_num) _)] | |
| exact Real.rpow_lt_one_of_one_lt_of_neg (by norm_num) (by norm_num) | |
| have hpoly : Summable (fun j : β => ((j : β)+122)^3*Ο^j) := by | |
| have h0 := (summable_geometric_of_norm_lt_one hΟ).mul_left (122^3 : β) | |
| have h1 := (summable_pow_mul_geometric_of_norm_lt_one 1 hΟ).mul_left (3*122^2 : β) | |
| have h2 := (summable_pow_mul_geometric_of_norm_lt_one 2 hΟ).mul_left (3*122 : β) | |
| have h3 := summable_pow_mul_geometric_of_norm_lt_one 3 hΟ | |
| apply (h3.add (h2.add (h1.add h0))).congr | |
| intro j | |
| ring | |
| apply Summable.of_nonneg_of_le dyadicMomentCoefficient_nonneg dyadicMomentCoefficient_bound | |
| simpa only [mul_assoc, Ο] using hpoly.mul_left ((512 : β)^(6/5 : β)) | |
| end FixedClauseThreshold.Computability | |
| end OAI | |