Download data/lean/OAI/Combinatorics/ExpectationThreshold/TupleCoefficients.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 3.39 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/ExpectationThreshold/TupleCoefficients.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Combinatorics/ExpectationThreshold/TupleCoefficients.lean
-
curl -L -o TupleCoefficients.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/ExpectationThreshold/TupleCoefficients.lean
3.39 kB
| import Mathlib.Basic.Real.Basic | |
| import Mathlib.Algebra.BigOperators.Fin | |
| import Mathlib.Algebra.Order.BigOperators.Group.Finset | |
| import Mathlib.Tactic.Linarith | |
| import Mathlib.Tactic.NormNum | |
| import Mathlib.Tactic.Positivity | |
| import Mathlib.Tactic.Ring | |
| namespace OAI | |
| /-! | |
| # Coefficients for the finite tuple estimate | |
| Replacing `e` by `3` gives the coefficients `3 / 64^(i+1)`. Their finite | |
| sum has an explicit positive remainder below `1 / 21`. A finite product | |
| inequality then bounds the product of their complements from below. | |
| -/ | |
| namespace TalagrandThreshold | |
| open scoped BigOperators | |
| /-- The convenient rational upper bound on the selector's coefficient. -/ | |
| noncomputable def tupleCoefficient (i : β) : β := | |
| 3 / 64 ^ (i + 1) | |
| theorem tupleCoefficient_eq (i : β) : | |
| tupleCoefficient i = (3 / 64 : β) * (1 / 64 : β) ^ i := by | |
| simp only [tupleCoefficient, pow_succ, div_eq_mul_inv, mul_inv_rev, one_mul, | |
| inv_pow] | |
| ring | |
| theorem tupleCoefficient_pos (i : β) : 0 < tupleCoefficient i := by | |
| unfold tupleCoefficient | |
| positivity | |
| theorem tupleCoefficient_nonneg (i : β) : 0 β€ tupleCoefficient i := | |
| (tupleCoefficient_pos i).le | |
| theorem tupleCoefficient_le_first (i : β) : tupleCoefficient i β€ 3 / 64 := by | |
| rw [tupleCoefficient_eq] | |
| have hpow : (1 / 64 : β) ^ i β€ 1 := | |
| pow_le_oneβ (by norm_num) (by norm_num) | |
| nlinarith | |
| theorem tupleCoefficient_lt_one (i : β) : tupleCoefficient i < 1 := | |
| lt_of_le_of_lt (tupleCoefficient_le_first i) (by norm_num) | |
| /-- The exact finite geometric identity, including the empty sum. -/ | |
| theorem sum_tupleCoefficient_add_remainder (s : β) : | |
| (β i : Fin s, tupleCoefficient i.val) + | |
| (1 / 21 : β) * (1 / 64 : β) ^ s = 1 / 21 := by | |
| induction s with | |
| | zero => norm_num | |
| | succ s ih => | |
| rw [Fin.sum_univ_castSucc] | |
| simp only [Fin.val_castSucc, Fin.val_last] | |
| rw [tupleCoefficient_eq s, pow_succ] | |
| nlinarith [ih] | |
| theorem sum_tupleCoefficient_lt (s : β) : | |
| (β i : Fin s, tupleCoefficient i.val) < 1 / 21 := by | |
| have hrem : 0 < (1 / 21 : β) * (1 / 64 : β) ^ s := by positivity | |
| linarith [sum_tupleCoefficient_add_remainder s] | |
| theorem sum_tupleCoefficient_le (s : β) : | |
| (β i : Fin s, tupleCoefficient i.val) β€ 1 / 21 := | |
| (sum_tupleCoefficient_lt s).le | |
| /-- A finite product loses at most the sum of its factors' deficits. -/ | |
| theorem one_sub_sum_le_prod_one_sub {ΞΉ : Type*} [Fintype ΞΉ] | |
| (c : ΞΉ β β) (h0 : β i, 0 β€ c i) (h1 : β i, c i β€ 1) : | |
| 1 - β i, c i β€ β i, (1 - c i) := by | |
| classical | |
| suffices h : β s : Finset ΞΉ, | |
| 1 - β i β s, c i β€ β i β s, (1 - c i) by | |
| exact h Finset.univ | |
| intro s | |
| induction s using Finset.induction_on with | |
| | empty => simp | |
| | @insert a s ha ih => | |
| rw [Finset.sum_insert ha, Finset.prod_insert ha] | |
| have hs : 0 β€ β i β s, c i := | |
| Finset.sum_nonneg (fun i _ => h0 i) | |
| have hm := mul_le_mul_of_nonneg_left ih (sub_nonneg.mpr (h1 a)) | |
| nlinarith [mul_nonneg (h0 a) hs] | |
| theorem prod_one_sub_tupleCoefficient_gt (s : β) : | |
| (20 / 21 : β) < β i : Fin s, (1 - tupleCoefficient i.val) := by | |
| have hprod := one_sub_sum_le_prod_one_sub (fun i : Fin s => tupleCoefficient i.val) | |
| (fun i => tupleCoefficient_nonneg i.val) (fun i => (tupleCoefficient_lt_one i.val).le) | |
| have hsum := sum_tupleCoefficient_lt s | |
| linarith | |
| end TalagrandThreshold | |
| end OAI | |