Download data/lean/OAI/Combinatorics/ExpectationThreshold/RoundingExpectation.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 4.88 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/ExpectationThreshold/RoundingExpectation.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Combinatorics/ExpectationThreshold/RoundingExpectation.lean
-
curl -L -o RoundingExpectation.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/ExpectationThreshold/RoundingExpectation.lean
4.88 kB
| import OAI.Combinatorics.ExpectationThreshold.Basic | |
| import OAI.Combinatorics.ExpectationThreshold.ProbabilitySubsetProduct | |
| import Mathlib.Algebra.Order.GroupWithZero.Basic | |
| import Mathlib.Tactic.NormNum | |
| import Mathlib.Tactic.Ring | |
| namespace OAI | |
| /-! | |
| # The upper expectation bound for rounding | |
| The score sums over nonempty subsets of the original ground set. Its moments | |
| come from the actual coordinate product law. Nonemptiness saves a factor of | |
| one fifth in the fractional-cover cost. | |
| -/ | |
| open scoped BigOperators | |
| namespace TalagrandThreshold | |
| noncomputable section | |
| variable {Ξ± : Type*} [Fintype Ξ±] [DecidableEq Ξ±] | |
| /-- The nonnegative subset-product score used by the rounding argument. -/ | |
| def productScore (g : Finset Ξ± β β) (Y : Ξ± β β) : β := | |
| β S β (Finset.univ.erase β : Finset (Finset Ξ±)), g S * β x β S, Y x | |
| theorem productScore_nonneg {g : Finset Ξ± β β} {Y : Ξ± β β} | |
| (hg : β S, 0 β€ g S) (hY : β x, 0 β€ Y x) : 0 β€ productScore g Y := by | |
| exact Finset.sum_nonneg fun S _ => | |
| mul_nonneg (hg S) (Finset.prod_nonneg fun x _ => hY x) | |
| variable {Ξ© : Type*} [Fintype Ξ©] | |
| /-- Independence of the coordinates gives the full subset-product expectation. -/ | |
| theorem expectation_productScore (Ξ½ : FiniteLaw Ξ©) (g : Finset Ξ± β β) (Y : Ξ© β β) : | |
| (FiniteLaw.pi (fun _ : Ξ± => Ξ½)).expectation | |
| (fun Ο => productScore g (fun x => Y (Ο x))) = | |
| β S β (Finset.univ.erase β : Finset (Finset Ξ±)), | |
| g S * (Ξ½.expectation Y) ^ S.card := by | |
| classical | |
| calc | |
| _ = β S β (Finset.univ.erase β : Finset (Finset Ξ±)), | |
| (FiniteLaw.pi (fun _ : Ξ± => Ξ½)).expectation | |
| (fun Ο => g S * β x β S, Y (Ο x)) := by | |
| unfold FiniteLaw.expectation productScore | |
| simp only [Finset.mul_sum] | |
| exact Finset.sum_comm | |
| _ = _ := by | |
| apply Finset.sum_congr rfl | |
| intro S _ | |
| rw [FiniteLaw.expectation_smul, FiniteLaw.expectation_pi_subset_product_const] | |
| /-- A nonempty product gains at least one factor of one fifth. -/ | |
| theorem one_fifth_pow_le {r : β} (hr : 0 β€ r) {k : β} (hk : 0 < k) : | |
| (r / 5) ^ k β€ (1 / 5) * r ^ k := by | |
| have hsmall : (1 / 5 : β) ^ k β€ 1 / 5 := | |
| pow_le_of_le_one (by norm_num) (by norm_num) (Nat.ne_of_gt hk) | |
| calc | |
| (r / 5) ^ k = (1 / 5 : β) ^ k * r ^ k := by | |
| rw [β mul_pow] | |
| congr 1 | |
| ring | |
| _ β€ (1 / 5) * r ^ k := mul_le_mul_of_nonneg_right hsmall (pow_nonneg hr k) | |
| /-- The product score costs at most one fifth of the fractional-cover cost. -/ | |
| theorem expectation_productScore_le (Ξ½ : FiniteLaw Ξ©) (g : Finset Ξ± β β) | |
| (Y : Ξ© β β) {r : β} (hg : β S, 0 β€ g S) (hY : β Ο, 0 β€ Y Ο) | |
| (hr : 0 β€ r) (hmean : Ξ½.expectation Y β€ r / 5) : | |
| (FiniteLaw.pi (fun _ : Ξ± => Ξ½)).expectation | |
| (fun Ο => productScore g (fun x => Y (Ο x))) β€ | |
| (1 / 5) * fracCost r g := by | |
| classical | |
| have hmean0 := Ξ½.expectation_nonneg hY | |
| rw [expectation_productScore] | |
| calc | |
| (β S β (Finset.univ.erase β : Finset (Finset Ξ±)), | |
| g S * (Ξ½.expectation Y) ^ S.card) β€ | |
| β S β (Finset.univ.erase β : Finset (Finset Ξ±)), | |
| (1 / 5) * (g S * r ^ S.card) := by | |
| apply Finset.sum_le_sum | |
| intro S hS | |
| have hne : S.Nonempty := | |
| Finset.nonempty_iff_ne_empty.mpr (Finset.mem_erase.mp hS).1 | |
| have hpower : (Ξ½.expectation Y) ^ S.card β€ (1 / 5) * r ^ S.card := | |
| (pow_le_pow_leftβ hmean0 hmean S.card).trans | |
| (one_fifth_pow_le hr (Finset.card_pos.mpr hne)) | |
| calc | |
| g S * (Ξ½.expectation Y) ^ S.card β€ g S * ((1 / 5) * r ^ S.card) := | |
| mul_le_mul_of_nonneg_left hpower (hg S) | |
| _ = (1 / 5) * (g S * r ^ S.card) := by ring | |
| _ = (1 / 5) * β S β (Finset.univ.erase β : Finset (Finset Ξ±)), | |
| g S * r ^ S.card := (Finset.mul_sum _ _ _).symm | |
| _ β€ (1 / 5) * fracCost r g := by | |
| apply mul_le_mul_of_nonneg_left _ (by norm_num : (0 : β) β€ 1 / 5) | |
| unfold fracCost | |
| exact Finset.sum_le_sum_of_subset_of_nonneg (Finset.erase_subset _ _) | |
| (fun S _ _ => mul_nonneg (hg S) (pow_nonneg hr S.card)) | |
| /-- The budget one half gives the upper bound one tenth for the same score. -/ | |
| theorem expectation_productScore_le_tenth (Ξ½ : FiniteLaw Ξ©) (g : Finset Ξ± β β) | |
| (Y : Ξ© β β) {r : β} (hg : β S, 0 β€ g S) (hY : β Ο, 0 β€ Y Ο) | |
| (hr : 0 β€ r) (hmean : Ξ½.expectation Y β€ r / 5) (hcost : fracCost r g β€ 1 / 2) : | |
| (FiniteLaw.pi (fun _ : Ξ± => Ξ½)).expectation | |
| (fun Ο => productScore g (fun x => Y (Ο x))) β€ 1 / 10 := by | |
| calc | |
| _ β€ (1 / 5) * fracCost r g := expectation_productScore_le Ξ½ g Y hg hY hr hmean | |
| _ β€ (1 / 5 : β) * (1 / 2) := | |
| mul_le_mul_of_nonneg_left hcost (by norm_num : (0 : β) β€ 1 / 5) | |
| _ = 1 / 10 := by norm_num | |
| end | |
| end TalagrandThreshold | |
| end OAI | |