Download lean/OAI/Combinatorics/ExpectationThreshold/SelectorEntropyDyadic.lean from roseking/openAI-math-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.15 kB
-
https://huggingface.co/datasets/roseking/openAI-math-dataset/resolve/main/lean/OAI/Combinatorics/ExpectationThreshold/SelectorEntropyDyadic.lean
- Command line
-
hf download hf://datasets/roseking/openAI-math-dataset/lean/OAI/Combinatorics/ExpectationThreshold/SelectorEntropyDyadic.lean
-
curl -L -o SelectorEntropyDyadic.lean https://huggingface.co/datasets/roseking/openAI-math-dataset/resolve/main/lean/OAI/Combinatorics/ExpectationThreshold/SelectorEntropyDyadic.lean
1.15 kB
| import Mathlib.Basic.Real.Basic | |
| import Mathlib.Data.Fintype.BigOperators | |
| import Mathlib.Tactic.NormNum | |
| import Mathlib.Tactic.Ring | |
| namespace OAI | |
| /-! | |
| # Finite dyadic mass for the selector entropy estimate | |
| The positive dyadic levels have total mass at most one, including when there | |
| are no levels. | |
| -/ | |
| open scoped BigOperators | |
| namespace TalagrandThreshold | |
| private lemma selector_dyadic_range_sum (s : ℕ) : | |
| (∑ i ∈ Finset.range s, (1 / 2 : ℝ) ^ (i + 1)) = 1 - (1 / 2 : ℝ) ^ s := by | |
| induction s with | |
| | zero => simp | |
| | succ s ih => | |
| rw [Finset.sum_range_succ, ih] | |
| simp only [pow_succ] | |
| ring | |
| /-- The dyadic weights of all positive selector levels sum to at most one. -/ | |
| theorem selector_dyadic_sum_le_one (s : ℕ) : | |
| (∑ i : Fin s, (1 / 2 : ℝ) ^ (i.val + 1)) ≤ 1 := by | |
| calc | |
| (∑ i : Fin s, (1 / 2 : ℝ) ^ (i.val + 1)) = | |
| ∑ i ∈ Finset.range s, (1 / 2 : ℝ) ^ (i + 1) := | |
| Fin.sum_univ_eq_sum_range (fun i : ℕ => (1 / 2 : ℝ) ^ (i + 1)) s | |
| _ = 1 - (1 / 2 : ℝ) ^ s := selector_dyadic_range_sum s | |
| _ ≤ 1 := sub_le_self _ (pow_nonneg (by norm_num) s) | |
| end TalagrandThreshold | |
| end OAI | |