import Mathlib.Data.Fintype.Powerset import Mathlib.Data.Finset.Union import Mathlib.Basic.Real.Basic import Mathlib.Algebra.Order.Archimedean.Real.Basic import Mathlib.Algebra.Order.BigOperators.Group.Finset import Mathlib.Algebra.BigOperators.Group.Finset.Piecewise namespace OAI /-! # Containment covers and expectation thresholds Both costs use budget one half. Fractional coefficients are indexed by every subset of the ground set, without a support-size bound. The empty subset is included, and ordinary natural powers give `p^0 = 1`, including at zero. The thresholds are real suprema of feasible densities in the closed unit interval. -/ namespace TalagrandThreshold open scoped BigOperators abbrev Family (α : Type*) := Finset (Finset α) variable {α : Type*} [Fintype α] [DecidableEq α] noncomputable section def cost (p : ℝ) (G : Family α) : ℝ := ∑ S ∈ G, p ^ S.card def Covers (G F : Family α) : Prop := ∀ H ∈ F, ∃ S ∈ G, S ⊆ H def Small (p : ℝ) (F : Family α) : Prop := ∃ G : Family α, Covers G F ∧ cost p G ≤ 1 / 2 def fracCost (p : ℝ) (g : Finset α → ℝ) : ℝ := ∑ S : Finset α, g S * p ^ S.card def FractionalCover (F : Family α) (g : Finset α → ℝ) : Prop := (∀ S, 0 ≤ g S ∧ g S ≤ 1) ∧ ∀ H ∈ F, 1 ≤ ∑ S ∈ H.powerset, g S def FractionalSmall (p : ℝ) (F : Family α) : Prop := ∃ g : Finset α → ℝ, FractionalCover F g ∧ fracCost p g ≤ 1 / 2 def Increasing (F : Family α) : Prop := ∀ H ∈ F, ∀ K : Finset α, H ⊆ K → K ∈ F def integralFeasible (F : Family α) : Set ℝ := {p | 0 ≤ p ∧ p ≤ 1 ∧ Small p F} def fractionalFeasible (F : Family α) : Set ℝ := {p | 0 ≤ p ∧ p ≤ 1 ∧ FractionalSmall p F} /-- The integral expectation threshold. -/ def q (F : Family α) : ℝ := sSup (integralFeasible F) /-- The fractional expectation threshold. -/ def qf (F : Family α) : ℝ := sSup (fractionalFeasible F) omit [Fintype α] [DecidableEq α] in @[simp] theorem mem_integralFeasible {F : Family α} {p : ℝ} : p ∈ integralFeasible F ↔ 0 ≤ p ∧ p ≤ 1 ∧ Small p F := Iff.rfl omit [DecidableEq α] in @[simp] theorem mem_fractionalFeasible {F : Family α} {p : ℝ} : p ∈ fractionalFeasible F ↔ 0 ≤ p ∧ p ≤ 1 ∧ FractionalSmall p F := Iff.rfl end end TalagrandThreshold end OAI