Download data/lean/OAI/Probability/CriticalPercolation/Exploration/QueryNormalized.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 3.28 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/CriticalPercolation/Exploration/QueryNormalized.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/CriticalPercolation/Exploration/QueryNormalized.lean
-
curl -L -o QueryNormalized.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/CriticalPercolation/Exploration/QueryNormalized.lean
3.28 kB
| import Mathlib | |
| import OAI.Probability.CriticalPercolation.Exploration.QueryBand | |
| import OAI.Probability.CriticalPercolation.Exploration.Score | |
| import OAI.Probability.CriticalPercolation.Criticality.DyadicBound | |
| namespace OAI | |
| section | |
| section | |
| noncomputable section | |
| namespace CriticalPercolation.SearchTree | |
| open scoped Classical | |
| open FiniteProduct | |
| variable {E R : Type*} [Fintype E] [DecidableEq E] | |
| lemma normalized_centered_bound (t : SearchTree E R) (used : Finset E) (ht : t.Valid used) | |
| (p : β) (hp : p β Set.Icc 0 1) (w : E β Prop β β) | |
| (hw : β e, β b, w e b = 1) (hn : β e b, 0β€w e b) | |
| (hf : LazyDFS.Fresh w p used) (K : β) : | |
| expect w (fun Ο => |t.centeredSum p Ο| * | |
| min (1/(4:β)^K) (1/(t.queryCount Ο : β))) β€ 6/(2:β)^K := by | |
| let N := Fintype.card E + 1 | |
| let a (k : β) := min (1/(4:β)^K) (1/(4:β)^k) | |
| let b (k : β) (Ο : E β Prop) := | |
| if 4^k β€ t.queryCount Ο β§ t.queryCount Ο < 4^(k+1) | |
| then |t.centeredSum p Ο| else 0 | |
| have ha (k : β) : 0β€a k := by dsimp [a]; positivity | |
| have hb (k : β) (Ο : E β Prop) : 0β€b k Ο := by | |
| dsimp [b]; split_ifs <;> positivity | |
| have hpoint (Ο : E β Prop) : |t.centeredSum p Ο| * | |
| min (1/(4:β)^K) (1/(t.queryCount Ο : β)) β€ | |
| β k β Finset.range N, b k Ο * a k := by | |
| by_cases hT : t.queryCount Ο = 0 | |
| Β· rw [t.centeredSum_eq_zero_of_count Ο hT p,abs_zero,zero_mul] | |
| exact Finset.sum_nonneg (fun k _ => mul_nonneg (hb k Ο) (ha k)) | |
| Β· let k := Nat.log 4 (t.queryCount Ο) | |
| have hklo : 4^k β€ t.queryCount Ο := Nat.pow_log_le_self 4 hT | |
| have hkhi : t.queryCount Ο < 4^(k+1) := Nat.lt_pow_succ_log_self (by omega) _ | |
| have hkN : k β Finset.range N := by | |
| apply Finset.mem_range.mpr | |
| have h1 := Nat.log_le_self 4 (t.queryCount Ο) | |
| have h2 := t.queryCount_le_card used ht Ο | |
| dsimp [k,N] | |
| omega | |
| calc | |
| _ β€ b k Ο * a k := by | |
| have hband : 4^k β€ t.queryCount Ο β§ t.queryCount Ο < 4^(k+1) := β¨hklo,hkhiβ© | |
| simp only [b,ite_eq_left hband] | |
| apply mul_le_mul_of_nonneg_left _ (abs_nonneg _) | |
| apply min_le_min le_rfl | |
| apply one_div_le_one_div_of_le (by positivity : (0:β)<(4:β)^k) | |
| exact_mod_cast hklo | |
| _ β€ _ := Finset.single_le_sum (fun j _ => mul_nonneg (hb j Ο) (ha j)) hkN | |
| calc | |
| _ β€ expect w (fun Ο => β k β Finset.range N, b k Ο * a k) := expect_mono hn hpoint | |
| _ = β k β Finset.range N, expect w (b k) * a k := by | |
| simp only [expect,Finset.mul_sum] | |
| rw [Finset.sum_comm] | |
| apply Finset.sum_congr rfl | |
| intro k _ | |
| rw [Finset.sum_mul] | |
| apply Finset.sum_congr rfl | |
| intro Ο _ | |
| ring | |
| _ β€ β k β Finset.range N, (2:β)^(k+1)*a k := by | |
| apply Finset.sum_le_sum | |
| intro k _ | |
| exact mul_le_mul_of_nonneg_right (t.band_centered_bound used ht p hp w hw hn hf k) (ha k) | |
| _ = β k β Finset.range N, | |
| min ((2:β)^(k+1)/4^K) ((2:β)^(k+1)/4^k) := by | |
| apply Finset.sum_congr rfl | |
| intro k _ | |
| dsimp [a] | |
| rw [mul_min_of_nonneg _ _ (by positivity)] | |
| simp only [mul_one_div] | |
| _ β€ _ := dyadic_sum_bound N K | |
| end CriticalPercolation.SearchTree | |
| end | |
| end | |
| end | |
| end OAI | |