introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
2.43 kB
import Mathlib.Data.Fintype.Powerset
import Mathlib.Data.Finset.Union
import Mathlib.Basic.Real.Basic
import Mathlib.Algebra.Order.BigOperators.Group.Finset
namespace OAI
/-!
# Finite families, containment covers, and exceptional sets
All families are ordinary finite sets: repeated generators carry no extra cost.
In contrast, the members of a union tuple may repeat. The exceptional family
uses containment in a union, without any monotonicity assumption on the input.
-/
namespace TalagrandDiscreteConvexity
open scoped BigOperators
abbrev Family (Ξ± : Type*) := Finset (Finset Ξ±)
variable {Ξ± : Type*} [Fintype Ξ±] [DecidableEq Ξ±]
noncomputable section
/-- The mass of a subset under independent Bernoulli coordinates. -/
def bernoulliMass (p : ℝ) (s : Finset Ξ±) : ℝ :=
p ^ s.card * (1 - p) ^ (Finset.univ \ s).card
/-- The Bernoulli measure of an arbitrary finite family. -/
def familyMeasure (p : ℝ) (D : Family Ξ±) : ℝ :=
βˆ‘ s ∈ D, bernoulliMass p s
/-- Cost at the specified density, counting each generator once. -/
def cost (p : ℝ) (G : Family Ξ±) : ℝ := βˆ‘ I ∈ G, p ^ I.card
/-- A cover supplies a contained generator for every target set. -/
def Covers (G A : Family Ξ±) : Prop := βˆ€ S ∈ A, βˆƒ I ∈ G, I βŠ† S
/-- Smallness is witnessed by an actual containment cover of cost at most one half. -/
def Small (p : ℝ) (A : Family Ξ±) : Prop :=
βˆƒ G : Family Ξ±, Covers G A ∧ cost p G ≀ 1 / 2
/-- A union of exactly `k` entries; repetitions are allowed. -/
def unionTuple {k : β„•} (f : Fin k β†’ Finset Ξ±) : Finset Ξ± :=
Finset.univ.biUnion f
/-- All unions of `k` members of a family. -/
def unionFamily (k : β„•) (D : Family Ξ±) : Family Ξ± := by
classical
exact Finset.univ.filter (fun S =>
βˆƒ f : Fin k β†’ Finset Ξ±, (βˆ€ j, f j ∈ D) ∧ unionTuple f = S)
/-- Sets contained in no union of `k` members of `D`. -/
def exceptional (k : β„•) (D : Family Ξ±) : Family Ξ± := by
classical
exact Finset.univ.filter (fun S =>
βˆ€ f : Fin k β†’ Finset Ξ±, (βˆ€ j, f j ∈ D) β†’ Β¬ S βŠ† unionTuple f)
/-- The subset represented by a Boolean coordinate vector. -/
def cubeSet (x : Ξ± β†’ Bool) : Finset Ξ± :=
Finset.univ.filter (fun i => x i = true)
/-- The indicator of a family on the Boolean cube. -/
def familyIndicator (D : Family Ξ±) (x : Ξ± β†’ Bool) : ℝ :=
if cubeSet x ∈ D then 1 else 0
end
end TalagrandDiscreteConvexity
end OAI