Download data/lean/OAI/Combinatorics/DiscreteConvexity/CoveringRegularization.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 10.8 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/DiscreteConvexity/CoveringRegularization.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Combinatorics/DiscreteConvexity/CoveringRegularization.lean
-
curl -L -o CoveringRegularization.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/DiscreteConvexity/CoveringRegularization.lean
10.8 kB
| import OAI.Combinatorics.DiscreteConvexity.CoveringBasic | |
| import OAI.Combinatorics.DiscreteConvexity.CoveringBinomialBounds | |
| import Mathlib.Combinatorics.Enumerative.DoubleCounting | |
| namespace OAI | |
| /-! | |
| # Weighted-degree regularization | |
| The initial family is the actual family of high weighted-degree subsets. | |
| Double counting bounds its cost. An edge surviving this deletion has bounded | |
| weighted degree at every one of its subsets. Grouping surviving edges by their | |
| intersection with `B` gives the extension estimates used for pair sampling and | |
| for residual tuples. No regularity property is assumed separately. | |
| -/ | |
| namespace TalagrandDiscreteConvexity.Covering | |
| open scoped BigOperators | |
| variable {V : Type*} [Fintype V] [DecidableEq V] | |
| /-- Count incidences between edges and subsets of cardinality at most `r`. -/ | |
| theorem incidence_count (H : Family V) (r : β) | |
| (hH : β e β H, e.card = r) : | |
| (β I β Finset.univ.filter (fun I : Finset V => I.card β€ r), | |
| (H.filter (fun e => I β e)).card) = H.card * 2 ^ r := by | |
| classical | |
| let K : Finset (Finset V) := Finset.univ.filter (fun I => I.card β€ r) | |
| have hbelow (e : Finset V) (he : e β H) : | |
| K.filter (fun I => I β e) = e.powerset := by | |
| apply Finset.ext | |
| intro I | |
| simp only [K, Finset.mem_filter, Finset.mem_univ, true_and, Finset.mem_powerset] | |
| constructor | |
| Β· exact fun h => h.2 | |
| Β· intro hIe | |
| exact β¨(Finset.card_le_card hIe).trans_eq (hH e he), hIeβ© | |
| calc | |
| (β I β K, (H.filter (fun e => I β e)).card) = | |
| β e β H, (K.filter (fun I => I β e)).card := by | |
| exact Finset.sum_card_bipartiteAbove_eq_sum_card_bipartiteBelow | |
| (fun I e : Finset V => I β e) | |
| _ = β _e β H, 2 ^ r := by | |
| apply Finset.sum_congr rfl | |
| intro e he | |
| rw [hbelow e he, Finset.card_powerset, hH e he] | |
| _ = H.card * 2 ^ r := by simp | |
| omit [Fintype V] in | |
| theorem weightedDegree_nonneg {H : Family V} {rho : β} {r : β} {I : Finset V} | |
| (hΟ : 0 β€ rho) : 0 β€ weightedDegree H rho r I := by | |
| classical | |
| exact mul_nonneg (Nat.cast_nonneg _) (pow_nonneg hΟ _) | |
| /-- The weighted incidence identity is valid even at `rho = 0`. -/ | |
| theorem weighted_incidence_count (H : Family V) (rho : β) (r : β) | |
| (hH : β e β H, e.card = r) : | |
| (β I β Finset.univ.filter (fun I : Finset V => I.card β€ r), | |
| weightedDegree H rho r I * rho ^ I.card) = | |
| (2 : β) ^ r * (H.card : β) * rho ^ r := by | |
| classical | |
| let K : Finset (Finset V) := Finset.univ.filter (fun I => I.card β€ r) | |
| have hcast : (β I β K, ((H.filter (fun e => I β e)).card : β)) = | |
| (H.card : β) * (2 : β) ^ r := by | |
| simpa only [Nat.cast_sum, Nat.cast_mul, Nat.cast_pow, Nat.cast_ofNat] using | |
| congrArg (fun n : β => (n : β)) (incidence_count H r hH) | |
| calc | |
| (β I β K, weightedDegree H rho r I * rho ^ I.card) = | |
| (β I β K, ((H.filter (fun e => I β e)).card : β)) * rho ^ r := by | |
| rw [Finset.sum_mul] | |
| apply Finset.sum_congr rfl | |
| intro I hI | |
| have hIr : I.card β€ r := (Finset.mem_filter.mp hI).2 | |
| rw [weightedDegree, mul_assoc, β pow_add, Nat.sub_add_cancel hIr] | |
| _ = ((H.card : β) * (2 : β) ^ r) * rho ^ r := by rw [hcast] | |
| _ = (2 : β) ^ r * (H.card : β) * rho ^ r := by | |
| rw [mul_comm (H.card : β) ((2 : β) ^ r)] | |
| /-- The initial generators cost at most their weighted-incidence budget divided | |
| by the high-degree threshold. -/ | |
| theorem initial_cost_le {H : Family V} {rho T : β} {r : β} | |
| (hΟ : 0 β€ rho) (hT : 0 < T) (hH : β e β H, e.card = r) : | |
| cost rho (initialFamily H rho r T) β€ | |
| Tβ»ΒΉ * (2 : β) ^ r * (H.card : β) * rho ^ r := by | |
| classical | |
| let K : Finset (Finset V) := Finset.univ.filter (fun I => I.card β€ r) | |
| have hsub : initialFamily H rho r T β K := by | |
| intro I hI | |
| exact Finset.mem_filter.mpr β¨Finset.mem_univ _, (mem_initialFamily.mp hI).1β© | |
| have hbudget : T * cost rho (initialFamily H rho r T) β€ | |
| (2 : β) ^ r * (H.card : β) * rho ^ r := by | |
| calc | |
| T * cost rho (initialFamily H rho r T) = | |
| β I β initialFamily H rho r T, T * rho ^ I.card := by | |
| rw [cost, Finset.mul_sum] | |
| _ β€ β I β initialFamily H rho r T, | |
| weightedDegree H rho r I * rho ^ I.card := by | |
| apply Finset.sum_le_sum | |
| intro I hI | |
| exact mul_le_mul_of_nonneg_right (mem_initialFamily.mp hI).2.le | |
| (pow_nonneg hΟ _) | |
| _ β€ β I β K, weightedDegree H rho r I * rho ^ I.card := by | |
| apply Finset.sum_le_sum_of_subset_of_nonneg hsub | |
| intro I _ _ | |
| exact mul_nonneg (weightedDegree_nonneg hΟ) (pow_nonneg hΟ _) | |
| _ = (2 : β) ^ r * (H.card : β) * rho ^ r := | |
| weighted_incidence_count H rho r hH | |
| calc | |
| cost rho (initialFamily H rho r T) β€ | |
| ((2 : β) ^ r * (H.card : β) * rho ^ r) / T := by | |
| apply (le_div_iffβ hT).mpr | |
| simpa only [mul_comm] using hbudget | |
| _ = Tβ»ΒΉ * (2 : β) ^ r * (H.card : β) * rho ^ r := by | |
| rw [div_eq_mul_inv] | |
| ac_rfl | |
| /-- Actual survival implies the weighted-degree bound at every subset of the | |
| surviving edge. -/ | |
| theorem regular_weightedDegree_le {H : Family V} {rho T : β} {r : β} | |
| (hH : β e β H, e.card = r) {e I : Finset V} | |
| (he : e β regularEdges H rho r T) (hIe : I β e) : | |
| weightedDegree H rho r I β€ T := by | |
| have heH : e β H := (mem_regularEdges.mp he).1 | |
| have hIr : I.card β€ r := (Finset.card_le_card hIe).trans_eq (hH e heH) | |
| apply le_of_not_gt | |
| intro hlarge | |
| exact (mem_regularEdges.mp he).2 I (mem_initialFamily.mpr β¨hIr, hlargeβ©) hIe | |
| /-- Each nonempty intersection class contributes at most `T`, and the empty | |
| classes contribute zero. -/ | |
| private theorem regular_intersection_sum_le {H : Family V} {rho T : β} {r : β} | |
| (hΟ : 0 β€ rho) (hT : 0 β€ T) (hH : β e β H, e.card = r) | |
| (B I : Finset V) : | |
| (β e β (regularEdges H rho r T).filter (fun e => e β© B = I), | |
| rho ^ (e \ B).card) β€ T := by | |
| classical | |
| let F := (regularEdges H rho r T).filter (fun e => e β© B = I) | |
| by_cases hne : F.Nonempty | |
| Β· obtain β¨eβ, heββ© := hne | |
| have heβreg := (Finset.mem_filter.mp heβ).1 | |
| have heβI : eβ β© B = I := (Finset.mem_filter.mp heβ).2 | |
| have hIeβ : I β eβ := by rw [β heβI]; exact Finset.inter_subset_left | |
| have hdegree := regular_weightedDegree_le hH heβreg hIeβ | |
| have hsub : F β H.filter (fun e => I β e) := by | |
| intro e he | |
| obtain β¨hereg, heIβ© := Finset.mem_filter.mp he | |
| refine Finset.mem_filter.mpr β¨(mem_regularEdges.mp hereg).1, ?_β© | |
| rw [β heI] | |
| exact Finset.inter_subset_left | |
| have hcards : (F.card : β) β€ ((H.filter (fun e => I β e)).card : β) := | |
| Nat.cast_le.mpr (Finset.card_le_card hsub) | |
| calc | |
| (β e β F, rho ^ (e \ B).card) = (F.card : β) * rho ^ (r - I.card) := by | |
| calc | |
| (β e β F, rho ^ (e \ B).card) = β _e β F, rho ^ (r - I.card) := by | |
| apply Finset.sum_congr rfl | |
| intro e he | |
| obtain β¨hereg, heIβ© := Finset.mem_filter.mp he | |
| have hecard := hH e (mem_regularEdges.mp hereg).1 | |
| have hpartition := Finset.card_sdiff_add_card_inter e B | |
| rw [heI, hecard] at hpartition | |
| have hdiff : (e \ B).card = r - I.card := by omega | |
| rw [hdiff] | |
| _ = (F.card : β) * rho ^ (r - I.card) := by simp | |
| _ β€ weightedDegree H rho r I := | |
| mul_le_mul_of_nonneg_right hcards (pow_nonneg hΟ _) | |
| _ β€ T := hdegree | |
| Β· have hF : F = β := Finset.not_nonempty_iff_eq_empty.mp hne | |
| change (β e β F, rho ^ (e \ B).card) β€ T | |
| rw [hF, Finset.sum_empty] | |
| exact hT | |
| /-- Extension cost for actual regular edges, with the exact number of possible | |
| intersections with `B`. -/ | |
| theorem regular_extension_le_card {H : Family V} {rho T : β} {r : β} | |
| (hΟ : 0 β€ rho) (hT : 0 β€ T) (hH : β e β H, e.card = r) (B : Finset V) : | |
| (β e β regularEdges H rho r T, rho ^ (e \ B).card) β€ | |
| T * ((B.powerset.filter (fun I => I.card β€ r)).card : β) := by | |
| classical | |
| let D := B.powerset.filter (fun I => I.card β€ r) | |
| have hmap : β e β regularEdges H rho r T, e β© B β D := by | |
| intro e he | |
| refine Finset.mem_filter.mpr β¨Finset.mem_powerset.mpr Finset.inter_subset_right, ?_β© | |
| exact (Finset.card_le_card Finset.inter_subset_left).trans_eq | |
| (hH e (mem_regularEdges.mp he).1) | |
| calc | |
| (β e β regularEdges H rho r T, rho ^ (e \ B).card) = | |
| β I β D, β e β (regularEdges H rho r T).filter (fun e => e β© B = I), | |
| rho ^ (e \ B).card := | |
| (Finset.sum_fiberwise_of_maps_to hmap (fun e => rho ^ (e \ B).card)).symm | |
| _ β€ β _I β D, T := by | |
| apply Finset.sum_le_sum | |
| intro I _ | |
| exact regular_intersection_sum_le hΟ hT hH B I | |
| _ = T * (D.card : β) := by simp [mul_comm] | |
| /-- The exact binomial extension bound from the covering lemma. -/ | |
| theorem regular_extension_le_choose {H : Family V} {rho T : β} {r : β} | |
| (hΟ : 0 β€ rho) (hT : 0 β€ T) (hH : β e β H, e.card = r) (B : Finset V) : | |
| (β e β regularEdges H rho r T, rho ^ (e \ B).card) β€ | |
| T * (β i β Finset.range (r + 1), (Nat.choose B.card i : β)) := by | |
| calc | |
| _ β€ T * ((B.powerset.filter (fun I => I.card β€ r)).card : β) := | |
| regular_extension_le_card hΟ hT hH B | |
| _ = _ := by rw [card_subsets_card_le, Nat.cast_sum] | |
| /-- The polynomial version used for extending a residual tuple prefix. -/ | |
| theorem regular_extension_le_pow {H : Family V} {rho T : β} {r : β} | |
| (hΟ : 0 β€ rho) (hT : 0 β€ T) (hH : β e β H, e.card = r) (B : Finset V) : | |
| (β e β regularEdges H rho r T, rho ^ (e \ B).card) β€ | |
| T * (1 + (B.card : β)) ^ r := by | |
| have hc : ((B.powerset.filter (fun I => I.card β€ r)).card : β) β€ | |
| (((1 + B.card) ^ r : β) : β) := | |
| Nat.cast_le.mpr (card_subsets_card_le_pow B r) | |
| have hc' : ((B.powerset.filter (fun I => I.card β€ r)).card : β) β€ | |
| (1 + (B.card : β)) ^ r := by | |
| simpa only [Nat.cast_pow, Nat.cast_add, Nat.cast_one] using hc | |
| exact (regular_extension_le_card hΟ hT hH B).trans (mul_le_mul_of_nonneg_left hc' hT) | |
| /-- An `r`-element prefix gives the sharper factor `2^r`, used for pairs. -/ | |
| theorem regular_extension_le_two_pow {H : Family V} {rho T : β} {r : β} | |
| (hΟ : 0 β€ rho) (hT : 0 β€ T) (hH : β e β H, e.card = r) | |
| {B : Finset V} (hB : B.card = r) : | |
| (β e β regularEdges H rho r T, rho ^ (e \ B).card) β€ (2 : β) ^ r * T := by | |
| have h := regular_extension_le_choose hΟ hT hH B | |
| rw [hB, β Nat.cast_sum, Nat.sum_range_choose, Nat.cast_pow, Nat.cast_ofNat] at h | |
| simpa only [mul_comm] using h | |
| end TalagrandDiscreteConvexity.Covering | |
| end OAI | |