Documentation

CslibFrontier.Probability.MoserTardos

The Moser–Tardos algorithmic local lemma #

Let finitely many mutually independent random variables σ v ∼ μ v be given, and finitely many events A i, each determined by the variables in a finite set vbl i. The Moser–Tardos algorithm [MT10] starts from a random assignment and, while some event occurs, picks one such event and resamples its variables. The randomness is the table table μ: independent samples T (v, n) ∼ μ v, where T (v, n) is the value of v after its n-th resampling. The paper calls these the sample lists P_v^(n).

A selection rule sel T w names the event to resample after the log w (latest first), or returns none to stop. run sel T n is the log after n steps and resamplings sel i T the total number of resamplings of A i (possibly ∞). A rule is valid when it only selects events that occur in the current assignment. The paper allows any rule, deterministic or randomized. A rule here may depend on the whole table, future samples included. So the bounds below hold for every valid rule, and a randomized rule's own coins can be averaged over afterwards.

Main definitions #

Main results #

Assume x i ∈ [0, 1) and Pr[A i] ≤ x i ∏ j ∈ Γ i, (1 - x j) for every i, where Γ i contains every other event sharing a variable with A i (the hypothesis of the asymmetric local lemma).

Implementation notes #

A rule may be any function of the table and the log, measurable or not. For such a rule the expectation ∫⁻ in lintegral_resamplings_le is the lower Lebesgue integral. The proof shows more: the count is dominated, for every valid rule at once, by the measurable rule-independent function T ↦ ⨆ (w valid on T), w.count i (resamplings_le_iSup_count, measurable_iSup_count). The integral of that function is at most x i / (1 - x i), so the bound holds for the outer expectation too (exists_measurable_ge_resamplings). To bound this function, the proof dominates the number of steps labelled i of a valid log by the number of proper structures in shapes vbl i H whose checks pass (Cslib.Probability.MoserTardos.exists_witnesses). That number is measurable, and its expectation is at most x i / (1 - x i) by Lemma 2.1 and the counting bound Cslib.Probability.MoserTardos.sum_prod_shapes_le.

References #

noncomputable def Cslib.Probability.MoserTardos.table {V : Type u_1} {α : V → Type u_2} [(v : V) → MeasurableSpace (α v)] (μ : (v : V) → MeasureTheory.Measure (α v)) :
MeasureTheory.Measure ((p : V × ℕ) → α p.1)

The resampling table: mutually independent samples T (v, n) ∼ μ v for every variable v and every n : ℕ.

Instances For
    theorem Cslib.Probability.MoserTardos.table_def {V : Type u_1} {α : V → Type u_2} [(v : V) → MeasurableSpace (α v)] (μ : (v : V) → MeasureTheory.Measure (α v)) :
    table μ = MeasureTheory.Measure.infinitePi fun (p : V × ℕ) => μ p.1
    theorem Cslib.Probability.MoserTardos.table_map_read {V : Type u_1} {α : V → Type u_2} [(v : V) → MeasurableSpace (α v)] (μ : (v : V) → MeasureTheory.Measure (α v)) [∀ (v : V), MeasureTheory.IsProbabilityMeasure (μ v)] [Fintype V] (c : V → ℕ) :
    MeasureTheory.Measure.map (fun (T : (p : V × ℕ) → α p.1) (v : V) => T (v, c v)) (table μ) = MeasureTheory.Measure.pi μ

    Reading one sample of every variable from the table gives the product distribution.

    theorem Cslib.Probability.MoserTardos.measurable_read {V : Type u_1} {α : V → Type u_2} [(v : V) → MeasurableSpace (α v)] (c : V → ℕ) :
    Measurable fun (T : (p : V × ℕ) → α p.1) (v : V) => T (v, c v)
    theorem Cslib.Probability.MoserTardos.measurableSet_check {V : Type u_1} {ι : Type u_2} [DecidableEq V] {α : V → Type u_3} [(v : V) → MeasurableSpace (α v)] (vbl : ι → Finset V) (A : ι → Set ((v : V) → α v)) (hAm : ∀ (i : ι), MeasurableSet (A i)) (S : Finset (ι × ℕ)) :
    MeasurableSet {T : (p : V × ℕ) → α p.1 | Check vbl A S T}
    theorem Cslib.Probability.MoserTardos.measure_check_eq_prod {V : Type u_1} {ι : Type u_2} [Fintype V] [DecidableEq V] {α : V → Type u_3} [(v : V) → MeasurableSpace (α v)] (μ : (v : V) → MeasureTheory.Measure (α v)) [∀ (v : V), MeasureTheory.IsProbabilityMeasure (μ v)] (vbl : ι → Finset V) (A : ι → Set ((v : V) → α v)) (hAm : ∀ (i : ι), MeasurableSet (A i)) (hA : ∀ (i : ι), DependsOn (fun (x : (i : V) → α i) => x ∈ A i) ↑(vbl i)) {S : Finset (ι × ℕ)} (hS : Proper vbl S) :
    (table μ) {T : (p : V × ℕ) → α p.1 | Check vbl A S T} = ∏ p ∈ S, (MeasureTheory.Measure.pi μ) (A p.1)

    The witness-structure lemma [MoserTardos2010, Lemma 2.1(ii)]: a proper structure passes its check with probability exactly ∏ p ∈ S, Pr[A p.1]. With the coupling check_witness, this bounds the probability that the structure occurs in the log, as in the paper.

    theorem Cslib.Probability.MoserTardos.table_witness_le {V : Type u_1} {ι : Type u_2} [Fintype V] [DecidableEq V] {α : V → Type u_3} [(v : V) → MeasurableSpace (α v)] (μ : (v : V) → MeasureTheory.Measure (α v)) [∀ (v : V), MeasureTheory.IsProbabilityMeasure (μ v)] (vbl : ι → Finset V) [DecidableEq ι] (A : ι → Set ((v : V) → α v)) (hAm : ∀ (i : ι), MeasurableSet (A i)) (hA : ∀ (i : ι), DependsOn (fun (x : (i : V) → α i) => x ∈ A i) ↑(vbl i)) (S : Finset (ι × ℕ)) :
    (table μ) {T : (p : V × ℕ) → α p.1 | ∃ (i : ι) (w : List ι), IsLog vbl A T (i :: w) ∧ witness vbl i w = S} ≤ ∏ p ∈ S, (MeasureTheory.Measure.pi μ) (A p.1)

    Lemma 2.1(ii) of [MT10]: the probability that a fixed structure S occurs as the witness structure of a step of some valid log on the table is at most ∏ p ∈ S, Pr[A p.1]. The event is measured by the outer measure, so no measurability is needed.

    theorem Cslib.Probability.MoserTardos.lintegral_iSup_count_le_of_pass {V : Type u_1} {ι : Type u_2} {α : V → Type u_3} [(v : V) → MeasurableSpace (α v)] (μ : (v : V) → MeasureTheory.Measure (α v)) [∀ (v : V), MeasureTheory.IsProbabilityMeasure (μ v)] [Fintype V] [DecidableEq V] [DecidableEq ι] [Fintype ι] (vbl : ι → Finset V) (R : ι → ι → Prop) [DecidableRel R] (hRr : ∀ (i : ι), R i i) (A : ι → Set ((v : V) → α v)) (Pass : Finset (ι × ℕ) → ((p : V × ℕ) → α p.1) → Prop) (hPass_meas : ∀ (S : Finset (ι × ℕ)), MeasurableSet {T : (p : V × ℕ) → α p.1 | Pass S T}) (hPass_prob : ∀ (S : Finset (ι × ℕ)), (table μ) {T : (p : V × ℕ) → α p.1 | Pass S T} ≤ ∏ p ∈ S, (MeasureTheory.Measure.pi μ) (A p.1)) (hPass_witness : ∀ (T : (p : V × ℕ) → α p.1) (i : ι) (H : ℕ) (w : List ι), IsLog vbl A T w → w.length ≤ H → ∃ (W : Finset (Finset (ι × ℕ))), W.card = List.count i w ∧ ∀ S ∈ W, S ∈ shapesRel R i H ∧ Pass S T) (Γ : ι → Finset ι) (hΓ : ∀ (i j : ι), j ≠ i → R i j → j ∈ Γ i) {x : ι → ℝ} (hx : ∀ (i : ι), x i ∈ Set.Ico 0 1) (hP : ∀ (i : ι), (MeasureTheory.Measure.pi μ).real (A i) ≤ x i * ∏ j ∈ Γ i, (1 - x j)) (i : ι) :
    ∫⁻ (T : (p : V × ℕ) → α p.1), ⨆ (w : List ι), ⨆ (_ : IsLog vbl A T w), ↑(List.count i w) ∂table μ ≤ ENNReal.ofReal (x i / (1 - x i))

    Generalized Moser–Tardos expectation bound for all valid logs at once, over any reflexive dependency relation R and any measurable witness-structure check Pass bounded in probability by ∏ p ∈ S, Pr[A p.1]. Both Theorem 1.2 and Lopsided Theorem 6.1 specialize this lemma.

    theorem Cslib.Probability.MoserTardos.lintegral_iSup_count_le {V : Type u_1} {ι : Type u_2} {α : V → Type u_3} [(v : V) → MeasurableSpace (α v)] (μ : (v : V) → MeasureTheory.Measure (α v)) [∀ (v : V), MeasureTheory.IsProbabilityMeasure (μ v)] [Fintype V] [DecidableEq V] [DecidableEq ι] [Finite ι] (vbl : ι → Finset V) (A : ι → Set ((v : V) → α v)) (hAm : ∀ (i : ι), MeasurableSet (A i)) (hA : ∀ (i : ι), DependsOn (fun (x : (i : V) → α i) => x ∈ A i) ↑(vbl i)) (Γ : ι → Finset ι) (hΓ : ∀ (i j : ι), j ≠ i → ¬Disjoint (vbl i) (vbl j) → j ∈ Γ i) {x : ι → ℝ} (hx : ∀ (i : ι), x i ∈ Set.Ico 0 1) (hP : ∀ (i : ι), (MeasureTheory.Measure.pi μ).real (A i) ≤ x i * ∏ j ∈ Γ i, (1 - x j)) (i : ι) :
    ∫⁻ (T : (p : V × ℕ) → α p.1), ⨆ (w : List ι), ⨆ (_ : IsLog vbl A T w), ↑(List.count i w) ∂table μ ≤ ENNReal.ofReal (x i / (1 - x i))

    Moser–Tardos, for all valid logs at once [MoserTardos2010, Theorem 1.2]. Under the local-lemma hypothesis, the expected supremum, over all valid logs w on the table, of the number of resamplings of A i in w is at most x i / (1 - x i).

    def Cslib.Probability.MoserTardos.run {V : Type u_1} {ι : Type u_2} {α : V → Type u_3} (sel : ((p : V × ℕ) → α p.1) → List ι → Option ι) (T : (p : V × ℕ) → α p.1) :
    ℕ → List ι

    The log (latest first) of the Moser–Tardos algorithm after n steps on the table T, under the selection rule sel. At each step sel T w names the event to resample after the log w, or returns none, after which the log stays fixed.

    theorem Cslib.Probability.MoserTardos.run_zero {V : Type u_1} {ι : Type u_2} {α : V → Type u_3} (sel : ((p : V × ℕ) → α p.1) → List ι → Option ι) (T : (p : V × ℕ) → α p.1) :
    run sel T 0 = []
    theorem Cslib.Probability.MoserTardos.run_succ_of_eq_none {V : Type u_1} {ι : Type u_2} {α : V → Type u_3} {sel : ((p : V × ℕ) → α p.1) → List ι → Option ι} {T : (p : V × ℕ) → α p.1} {n : ℕ} (h : sel T (run sel T n) = none) :
    run sel T (n + 1) = run sel T n
    theorem Cslib.Probability.MoserTardos.run_succ_of_eq_some {V : Type u_1} {ι : Type u_2} {α : V → Type u_3} {sel : ((p : V × ℕ) → α p.1) → List ι → Option ι} {T : (p : V × ℕ) → α p.1} {n : ℕ} {i : ι} (h : sel T (run sel T n) = some i) :
    run sel T (n + 1) = i :: run sel T n
    theorem Cslib.Probability.MoserTardos.isLog_run {V : Type u_1} {ι : Type u_2} {α : V → Type u_3} [DecidableEq V] (vbl : ι → Finset V) (A : ι → Set ((v : V) → α v)) {sel : ((p : V × ℕ) → α p.1) → List ι → Option ι} (hsel : ∀ (T : (p : V × ℕ) → α p.1) (w : List ι) (i : ι), sel T w = some i → current vbl T w ∈ A i) (T : (p : V × ℕ) → α p.1) (n : ℕ) :
    IsLog vbl A T (run sel T n)

    Under a valid selection rule, which only selects occurring events, every prefix of the run is a valid log.

    noncomputable def Cslib.Probability.MoserTardos.resamplings {V : Type u_1} {ι : Type u_2} {α : V → Type u_3} [DecidableEq ι] (sel : ((p : V × ℕ) → α p.1) → List ι → Option ι) (i : ι) (T : (p : V × ℕ) → α p.1) :

    The number of resamplings of A i performed by the algorithm on the table T under the rule sel (possibly ∞).

    theorem Cslib.Probability.MoserTardos.resamplings_def {V : Type u_1} {ι : Type u_2} {α : V → Type u_3} [DecidableEq ι] (sel : ((p : V × ℕ) → α p.1) → List ι → Option ι) (i : ι) (T : (p : V × ℕ) → α p.1) :
    resamplings sel i T = ⨆ (n : ℕ), ↑(List.count i (run sel T n))
    theorem Cslib.Probability.MoserTardos.resamplings_le_iSup_count {V : Type u_1} {ι : Type u_2} {α : V → Type u_3} [DecidableEq V] [DecidableEq ι] (vbl : ι → Finset V) (A : ι → Set ((v : V) → α v)) {sel : ((p : V × ℕ) → α p.1) → List ι → Option ι} (hsel : ∀ (T : (p : V × ℕ) → α p.1) (w : List ι) (i : ι), sel T w = some i → current vbl T w ∈ A i) (i : ι) (T : (p : V × ℕ) → α p.1) :
    resamplings sel i T ≤ ⨆ (w : List ι), ⨆ (_ : IsLog vbl A T w), ↑(List.count i w)

    Under a valid selection rule, the number of resamplings of A i is at most the largest number of steps labelled i in a valid log on the table, a bound that does not depend on the rule.

    noncomputable def Cslib.Probability.MoserTardos.greedy {V : Type u_1} {ι : Type u_2} {α : V → Type u_3} [DecidableEq V] (vbl : ι → Finset V) (A : ι → Set ((v : V) → α v)) (T : (p : V × ℕ) → α p.1) (w : List ι) :

    The selection rule resampling some occurring event, if there is one.

    theorem Cslib.Probability.MoserTardos.greedy_eq_some {V : Type u_1} {ι : Type u_2} {α : V → Type u_3} [DecidableEq V] (vbl : ι → Finset V) {A : ι → Set ((v : V) → α v)} {T : (p : V × ℕ) → α p.1} {w : List ι} {i : ι} (h : greedy vbl A T w = some i) :
    current vbl T w ∈ A i
    theorem Cslib.Probability.MoserTardos.greedy_eq_none {V : Type u_1} {ι : Type u_2} {α : V → Type u_3} [DecidableEq V] (vbl : ι → Finset V) {A : ι → Set ((v : V) → α v)} {T : (p : V × ℕ) → α p.1} {w : List ι} (h : greedy vbl A T w = none) (i : ι) :
    current vbl T w ∉ A i
    theorem Cslib.Probability.MoserTardos.measurableSet_isLog {V : Type u_1} {ι : Type u_2} [DecidableEq V] {α : V → Type u_3} [(v : V) → MeasurableSpace (α v)] (vbl : ι → Finset V) (A : ι → Set ((v : V) → α v)) (hAm : ∀ (i : ι), MeasurableSet (A i)) (w : List ι) :
    MeasurableSet {T : (p : V × ℕ) → α p.1 | IsLog vbl A T w}

    Valid logs form a measurable set of tables.

    theorem Cslib.Probability.MoserTardos.measurable_iSup_count {V : Type u_1} {ι : Type u_2} [DecidableEq V] {α : V → Type u_3} [(v : V) → MeasurableSpace (α v)] (vbl : ι → Finset V) [DecidableEq ι] [Countable ι] (A : ι → Set ((v : V) → α v)) (hAm : ∀ (i : ι), MeasurableSet (A i)) (i : ι) :
    Measurable fun (T : (p : V × ℕ) → α p.1) => ⨆ (w : List ι), ⨆ (_ : IsLog vbl A T w), ↑(List.count i w)

    The largest number of steps labelled i in a valid log is a measurable function of the table.

    theorem Cslib.Probability.MoserTardos.length_le_sum_iSup_count {V : Type u_1} {ι : Type u_2} [DecidableEq V] {α : V → Type u_3} (vbl : ι → Finset V) [DecidableEq ι] [Fintype ι] (A : ι → Set ((v : V) → α v)) {T : (p : V × ℕ) → α p.1} {w : List ι} (hw : IsLog vbl A T w) :
    ↑w.length ≤ ∑ i : ι, ⨆ (w' : List ι), ⨆ (_ : IsLog vbl A T w'), ↑(List.count i w')

    The length of a valid log is at most the sum over the events of the largest number of steps labelled with that event in a valid log on the same table.

    theorem Cslib.Probability.MoserTardos.lintegral_resamplings_le_of_bound {V : Type u_1} {ι : Type u_2} [DecidableEq V] {α : V → Type u_3} [(v : V) → MeasurableSpace (α v)] (μ : (v : V) → MeasureTheory.Measure (α v)) (vbl : ι → Finset V) [DecidableEq ι] (A : ι → Set ((v : V) → α v)) {i : ι} {c : ENNReal} (hc : ∫⁻ (T : (p : V × ℕ) → α p.1), ⨆ (w : List ι), ⨆ (_ : IsLog vbl A T w), ↑(List.count i w) ∂table μ ≤ c) {sel : ((p : V × ℕ) → α p.1) → List ι → Option ι} (hsel : ∀ (T : (p : V × ℕ) → α p.1) (w : List ι) (j : ι), sel T w = some j → current vbl T w ∈ A j) :
    ∫⁻ (T : (p : V × ℕ) → α p.1), resamplings sel i T ∂table μ ≤ c

    Generic deduction from an upper bound on ⨆ (w valid), w.count i to the expected resampling count of A i under any valid rule.

    theorem Cslib.Probability.MoserTardos.exists_measurable_ge_resamplings_of_bound {V : Type u_1} {ι : Type u_2} [DecidableEq V] {α : V → Type u_3} [(v : V) → MeasurableSpace (α v)] (μ : (v : V) → MeasureTheory.Measure (α v)) (vbl : ι → Finset V) [DecidableEq ι] [Countable ι] (A : ι → Set ((v : V) → α v)) (hAm : ∀ (i : ι), MeasurableSet (A i)) {i : ι} {c : ENNReal} (hc : ∫⁻ (T : (p : V × ℕ) → α p.1), ⨆ (w : List ι), ⨆ (_ : IsLog vbl A T w), ↑(List.count i w) ∂table μ ≤ c) :
    ∃ (g : ((p : V × ℕ) → α p.1) → ENNReal), Measurable g ∧ ∫⁻ (T : (p : V × ℕ) → α p.1), g T ∂table μ ≤ c ∧ ∀ (sel : ((p : V × ℕ) → α p.1) → List ι → Option ι), (∀ (T : (p : V × ℕ) → α p.1) (w : List ι) (j : ι), sel T w = some j → current vbl T w ∈ A j) → ∀ (T : (p : V × ℕ) → α p.1), resamplings sel i T ≤ g T

    Generic deduction from an expectation bound on ⨆ (w valid), w.count i to a measurable rule-independent dominating function.

    theorem Cslib.Probability.MoserTardos.lintegral_sum_iSup_count_le_of_bound {V : Type u_1} {ι : Type u_2} [DecidableEq V] {α : V → Type u_3} [(v : V) → MeasurableSpace (α v)] (μ : (v : V) → MeasureTheory.Measure (α v)) (vbl : ι → Finset V) [DecidableEq ι] [Fintype ι] (A : ι → Set ((v : V) → α v)) (hAm : ∀ (i : ι), MeasurableSet (A i)) {c : ι → ENNReal} (hc : ∀ (i : ι), ∫⁻ (T : (p : V × ℕ) → α p.1), ⨆ (w : List ι), ⨆ (_ : IsLog vbl A T w), ↑(List.count i w) ∂table μ ≤ c i) :
    ∫⁻ (T : (p : V × ℕ) → α p.1), ∑ i : ι, ⨆ (w : List ι), ⨆ (_ : IsLog vbl A T w), ↑(List.count i w) ∂table μ ≤ ∑ i : ι, c i

    Generic deduction from per-event expected supremum bounds to a bound on the integral of the measurable majorant ∑ i, ⨆ (w valid), w.count i. Pointwise bounds by this sum, such as resamplings_le_iSup_count for a sequential run and length_le_sum_iSup_count for any valid log, turn into expectation bounds through it.

    theorem Cslib.Probability.MoserTardos.lintegral_sum_resamplings_le_of_bound {V : Type u_1} {ι : Type u_2} [DecidableEq V] {α : V → Type u_3} [(v : V) → MeasurableSpace (α v)] (μ : (v : V) → MeasureTheory.Measure (α v)) (vbl : ι → Finset V) [DecidableEq ι] [Fintype ι] (A : ι → Set ((v : V) → α v)) (hAm : ∀ (i : ι), MeasurableSet (A i)) {c : ι → ENNReal} (hc : ∀ (i : ι), ∫⁻ (T : (p : V × ℕ) → α p.1), ⨆ (w : List ι), ⨆ (_ : IsLog vbl A T w), ↑(List.count i w) ∂table μ ≤ c i) {sel : ((p : V × ℕ) → α p.1) → List ι → Option ι} (hsel : ∀ (T : (p : V × ℕ) → α p.1) (w : List ι) (j : ι), sel T w = some j → current vbl T w ∈ A j) :
    ∫⁻ (T : (p : V × ℕ) → α p.1), ∑ i : ι, resamplings sel i T ∂table μ ≤ ∑ i : ι, c i

    Generic deduction from per-event expected supremum bounds to the expected total number of resamplings.

    theorem Cslib.Probability.MoserTardos.ae_exists_forall_isLog_length_le_of_bound {V : Type u_1} {ι : Type u_2} [DecidableEq V] {α : V → Type u_3} [(v : V) → MeasurableSpace (α v)] (μ : (v : V) → MeasureTheory.Measure (α v)) (vbl : ι → Finset V) [Finite ι] (A : ι → Set ((v : V) → α v)) (hAm : ∀ (i : ι), MeasurableSet (A i)) (hc : ∀ [inst : DecidableEq ι] (i : ι), ∫⁻ (T : (p : V × ℕ) → α p.1), ⨆ (w : List ι), ⨆ (_ : IsLog vbl A T w), ↑(List.count i w) ∂table μ ≠ ⊤) :
    ∀ᵐ (T : (p : V × ℕ) → α p.1) ∂table μ, ∃ (N : ℕ), ∀ (w : List ι), IsLog vbl A T w → w.length ≤ N

    Generic deduction from finite per-event expected supremum bounds: almost surely the valid logs on the table have bounded length. Any procedure whose logs are valid and grow at every step, sequential or parallel, therefore stops almost surely.

    theorem Cslib.Probability.MoserTardos.ae_exists_run_eq_none_of_bound {V : Type u_1} {ι : Type u_2} [DecidableEq V] {α : V → Type u_3} [(v : V) → MeasurableSpace (α v)] (μ : (v : V) → MeasureTheory.Measure (α v)) (vbl : ι → Finset V) [Finite ι] (A : ι → Set ((v : V) → α v)) (hAm : ∀ (i : ι), MeasurableSet (A i)) (hc : ∀ [inst : DecidableEq ι] (i : ι), ∫⁻ (T : (p : V × ℕ) → α p.1), ⨆ (w : List ι), ⨆ (_ : IsLog vbl A T w), ↑(List.count i w) ∂table μ ≠ ⊤) {sel : ((p : V × ℕ) → α p.1) → List ι → Option ι} (hsel : ∀ (T : (p : V × ℕ) → α p.1) (w : List ι) (i : ι), sel T w = some i → current vbl T w ∈ A i) :
    ∀ᵐ (T : (p : V × ℕ) → α p.1) ∂table μ, ∃ (n : ℕ), sel T (run sel T n) = none

    Generic deduction from finite per-event expected supremum bounds to almost sure termination for every valid rule.

    theorem Cslib.Probability.MoserTardos.ae_exists_forall_notMem_run_of_bound {V : Type u_1} {ι : Type u_2} [DecidableEq V] {α : V → Type u_3} [(v : V) → MeasurableSpace (α v)] (μ : (v : V) → MeasureTheory.Measure (α v)) (vbl : ι → Finset V) [Finite ι] (A : ι → Set ((v : V) → α v)) (hAm : ∀ (i : ι), MeasurableSet (A i)) (hc : ∀ [inst : DecidableEq ι] (i : ι), ∫⁻ (T : (p : V × ℕ) → α p.1), ⨆ (w : List ι), ⨆ (_ : IsLog vbl A T w), ↑(List.count i w) ∂table μ ≠ ⊤) {sel : ((p : V × ℕ) → α p.1) → List ι → Option ι} (hsel : ∀ (T : (p : V × ℕ) → α p.1) (w : List ι) (i : ι), sel T w = some i → current vbl T w ∈ A i) (hstop : ∀ (T : (p : V × ℕ) → α p.1) (w : List ι), sel T w = none → ∀ (i : ι), current vbl T w ∉ A i) :
    ∀ᵐ (T : (p : V × ℕ) → α p.1) ∂table μ, ∃ (n : ℕ), ∀ (i : ι), current vbl T (run sel T n) ∉ A i

    Generic deduction from finite per-event expected supremum bounds to almost sure success for every valid rule that stops only when no event occurs.

    theorem Cslib.Probability.MoserTardos.ae_exists_forall_notMem_run_greedy_of_bound {V : Type u_1} {ι : Type u_2} [DecidableEq V] {α : V → Type u_3} [(v : V) → MeasurableSpace (α v)] (μ : (v : V) → MeasureTheory.Measure (α v)) (vbl : ι → Finset V) [Finite ι] (A : ι → Set ((v : V) → α v)) (hAm : ∀ (i : ι), MeasurableSet (A i)) (hc : ∀ [inst : DecidableEq ι] (i : ι), ∫⁻ (T : (p : V × ℕ) → α p.1), ⨆ (w : List ι), ⨆ (_ : IsLog vbl A T w), ↑(List.count i w) ∂table μ ≠ ⊤) :
    ∀ᵐ (T : (p : V × ℕ) → α p.1) ∂table μ, ∃ (n : ℕ), ∀ (i : ι), current vbl T (run (greedy vbl A) T n) ∉ A i

    Generic deduction from finite per-event expected supremum bounds to almost sure success of the greedy rule.

    theorem Cslib.Probability.MoserTardos.exists_forall_notMem_of_bound {V : Type u_1} {ι : Type u_2} [DecidableEq V] {α : V → Type u_3} [(v : V) → MeasurableSpace (α v)] (μ : (v : V) → MeasureTheory.Measure (α v)) [∀ (v : V), MeasureTheory.IsProbabilityMeasure (μ v)] (vbl : ι → Finset V) [Finite ι] (A : ι → Set ((v : V) → α v)) (hAm : ∀ (i : ι), MeasurableSet (A i)) (hc : ∀ [inst : DecidableEq ι] (i : ι), ∫⁻ (T : (p : V × ℕ) → α p.1), ⨆ (w : List ι), ⨆ (_ : IsLog vbl A T w), ↑(List.count i w) ∂table μ ≠ ⊤) :
    ∃ (σ : (v : V) → α v), ∀ (i : ι), σ ∉ A i

    Generic deduction from finite per-event expected supremum bounds to existence of a good assignment.

    theorem Cslib.Probability.MoserTardos.lintegral_resamplings_le {V : Type u_1} {ι : Type u_2} [Fintype V] [DecidableEq V] {α : V → Type u_3} [(v : V) → MeasurableSpace (α v)] (μ : (v : V) → MeasureTheory.Measure (α v)) [∀ (v : V), MeasureTheory.IsProbabilityMeasure (μ v)] (vbl : ι → Finset V) [DecidableEq ι] [Finite ι] (A : ι → Set ((v : V) → α v)) (hAm : ∀ (i : ι), MeasurableSet (A i)) (hA : ∀ (i : ι), DependsOn (fun (x : (i : V) → α i) => x ∈ A i) ↑(vbl i)) (Γ : ι → Finset ι) (hΓ : ∀ (i j : ι), j ≠ i → ¬Disjoint (vbl i) (vbl j) → j ∈ Γ i) {x : ι → ℝ} (hx : ∀ (i : ι), x i ∈ Set.Ico 0 1) (hP : ∀ (i : ι), (MeasureTheory.Measure.pi μ).real (A i) ≤ x i * ∏ j ∈ Γ i, (1 - x j)) {sel : ((p : V × ℕ) → α p.1) → List ι → Option ι} (hsel : ∀ (T : (p : V × ℕ) → α p.1) (w : List ι) (i : ι), sel T w = some i → current vbl T w ∈ A i) (i : ι) :
    ∫⁻ (T : (p : V × ℕ) → α p.1), resamplings sel i T ∂table μ ≤ ENNReal.ofReal (x i / (1 - x i))

    The Moser–Tardos theorem [MoserTardos2010, Theorem 1.2]. Let x i ∈ [0, 1) with Pr[A i] ≤ x i ∏ j ∈ Γ i, (1 - x j), where Γ i contains every other event sharing a variable with A i. Then for every selection rule that only resamples occurring events, the expected number of resamplings of A i is at most x i / (1 - x i).

    The rule is not assumed measurable, so ∫⁻ is the lower Lebesgue integral. The upper bound is nevertheless the full statement: exists_measurable_ge_resamplings dominates the count, for every valid rule, by one measurable function with the same bound.

    theorem Cslib.Probability.MoserTardos.exists_measurable_ge_resamplings {V : Type u_1} {ι : Type u_2} [Fintype V] [DecidableEq V] {α : V → Type u_3} [(v : V) → MeasurableSpace (α v)] (μ : (v : V) → MeasureTheory.Measure (α v)) [∀ (v : V), MeasureTheory.IsProbabilityMeasure (μ v)] (vbl : ι → Finset V) [DecidableEq ι] [Finite ι] (A : ι → Set ((v : V) → α v)) (hAm : ∀ (i : ι), MeasurableSet (A i)) (hA : ∀ (i : ι), DependsOn (fun (x : (i : V) → α i) => x ∈ A i) ↑(vbl i)) (Γ : ι → Finset ι) (hΓ : ∀ (i j : ι), j ≠ i → ¬Disjoint (vbl i) (vbl j) → j ∈ Γ i) {x : ι → ℝ} (hx : ∀ (i : ι), x i ∈ Set.Ico 0 1) (hP : ∀ (i : ι), (MeasureTheory.Measure.pi μ).real (A i) ≤ x i * ∏ j ∈ Γ i, (1 - x j)) (i : ι) :
    ∃ (g : ((p : V × ℕ) → α p.1) → ENNReal), Measurable g ∧ ∫⁻ (T : (p : V × ℕ) → α p.1), g T ∂table μ ≤ ENNReal.ofReal (x i / (1 - x i)) ∧ ∀ (sel : ((p : V × ℕ) → α p.1) → List ι → Option ι), (∀ (T : (p : V × ℕ) → α p.1) (w : List ι) (j : ι), sel T w = some j → current vbl T w ∈ A j) → ∀ (T : (p : V × ℕ) → α p.1), resamplings sel i T ≤ g T

    Theorem 1.2 for the outer expectation [MT10]. Under the local-lemma hypothesis there is a measurable function g of the table, with ∫⁻ g ≤ x i / (1 - x i), that bounds the number of resamplings of A i under every valid selection rule. So the bound holds for the upper (outer) expectation of the count as well, whether or not the rule is measurable.

    theorem Cslib.Probability.MoserTardos.lintegral_sum_resamplings_le {V : Type u_1} {ι : Type u_2} [Fintype V] [DecidableEq V] {α : V → Type u_3} [(v : V) → MeasurableSpace (α v)] (μ : (v : V) → MeasureTheory.Measure (α v)) [∀ (v : V), MeasureTheory.IsProbabilityMeasure (μ v)] (vbl : ι → Finset V) [DecidableEq ι] [Fintype ι] (A : ι → Set ((v : V) → α v)) (hAm : ∀ (i : ι), MeasurableSet (A i)) (hA : ∀ (i : ι), DependsOn (fun (x : (i : V) → α i) => x ∈ A i) ↑(vbl i)) (Γ : ι → Finset ι) (hΓ : ∀ (i j : ι), j ≠ i → ¬Disjoint (vbl i) (vbl j) → j ∈ Γ i) {x : ι → ℝ} (hx : ∀ (i : ι), x i ∈ Set.Ico 0 1) (hP : ∀ (i : ι), (MeasureTheory.Measure.pi μ).real (A i) ≤ x i * ∏ j ∈ Γ i, (1 - x j)) {sel : ((p : V × ℕ) → α p.1) → List ι → Option ι} (hsel : ∀ (T : (p : V × ℕ) → α p.1) (w : List ι) (i : ι), sel T w = some i → current vbl T w ∈ A i) :
    ∫⁻ (T : (p : V × ℕ) → α p.1), ∑ i : ι, resamplings sel i T ∂table μ ≤ ∑ i : ι, ENNReal.ofReal (x i / (1 - x i))

    The expected total number of resamplings [MoserTardos2010, Theorem 1.2]: at most ∑ i, x i / (1 - x i), for every valid selection rule.

    theorem Cslib.Probability.MoserTardos.ae_exists_run_eq_none {V : Type u_1} {ι : Type u_2} [Fintype V] [DecidableEq V] {α : V → Type u_3} [(v : V) → MeasurableSpace (α v)] (μ : (v : V) → MeasureTheory.Measure (α v)) [∀ (v : V), MeasureTheory.IsProbabilityMeasure (μ v)] (vbl : ι → Finset V) [Finite ι] (A : ι → Set ((v : V) → α v)) (hAm : ∀ (i : ι), MeasurableSet (A i)) (hA : ∀ (i : ι), DependsOn (fun (x : (i : V) → α i) => x ∈ A i) ↑(vbl i)) (Γ : ι → Finset ι) (hΓ : ∀ (i j : ι), j ≠ i → ¬Disjoint (vbl i) (vbl j) → j ∈ Γ i) {x : ι → ℝ} (hx : ∀ (i : ι), x i ∈ Set.Ico 0 1) (hP : ∀ (i : ι), (MeasureTheory.Measure.pi μ).real (A i) ≤ x i * ∏ j ∈ Γ i, (1 - x j)) {sel : ((p : V × ℕ) → α p.1) → List ι → Option ι} (hsel : ∀ (T : (p : V × ℕ) → α p.1) (w : List ι) (i : ι), sel T w = some i → current vbl T w ∈ A i) :
    ∀ᵐ (T : (p : V × ℕ) → α p.1) ∂table μ, ∃ (n : ℕ), sel T (run sel T n) = none

    Termination [MoserTardos2010, Theorem 1.2]: under the local-lemma hypothesis, for every valid selection rule, almost surely the rule stops (returns none) after finitely many steps.

    theorem Cslib.Probability.MoserTardos.ae_exists_forall_notMem_run {V : Type u_1} {ι : Type u_2} [Fintype V] [DecidableEq V] {α : V → Type u_3} [(v : V) → MeasurableSpace (α v)] (μ : (v : V) → MeasureTheory.Measure (α v)) [∀ (v : V), MeasureTheory.IsProbabilityMeasure (μ v)] (vbl : ι → Finset V) [Finite ι] (A : ι → Set ((v : V) → α v)) (hAm : ∀ (i : ι), MeasurableSet (A i)) (hA : ∀ (i : ι), DependsOn (fun (x : (i : V) → α i) => x ∈ A i) ↑(vbl i)) (Γ : ι → Finset ι) (hΓ : ∀ (i j : ι), j ≠ i → ¬Disjoint (vbl i) (vbl j) → j ∈ Γ i) {x : ι → ℝ} (hx : ∀ (i : ι), x i ∈ Set.Ico 0 1) (hP : ∀ (i : ι), (MeasureTheory.Measure.pi μ).real (A i) ≤ x i * ∏ j ∈ Γ i, (1 - x j)) {sel : ((p : V × ℕ) → α p.1) → List ι → Option ι} (hsel : ∀ (T : (p : V × ℕ) → α p.1) (w : List ι) (i : ι), sel T w = some i → current vbl T w ∈ A i) (hstop : ∀ (T : (p : V × ℕ) → α p.1) (w : List ι), sel T w = none → ∀ (i : ι), current vbl T w ∉ A i) :
    ∀ᵐ (T : (p : V × ℕ) → α p.1) ∂table μ, ∃ (n : ℕ), ∀ (i : ι), current vbl T (run sel T n) ∉ A i

    The algorithm finds a good assignment [MoserTardos2010, Theorem 1.2]: under the local-lemma hypothesis, for every valid selection rule that stops only when no event occurs, almost surely the run reaches, after finitely many resamplings, an assignment in which no event occurs.

    theorem Cslib.Probability.MoserTardos.ae_exists_forall_notMem_run_greedy {V : Type u_1} {ι : Type u_2} [Fintype V] [DecidableEq V] {α : V → Type u_3} [(v : V) → MeasurableSpace (α v)] (μ : (v : V) → MeasureTheory.Measure (α v)) [∀ (v : V), MeasureTheory.IsProbabilityMeasure (μ v)] (vbl : ι → Finset V) [Finite ι] (A : ι → Set ((v : V) → α v)) (hAm : ∀ (i : ι), MeasurableSet (A i)) (hA : ∀ (i : ι), DependsOn (fun (x : (i : V) → α i) => x ∈ A i) ↑(vbl i)) (Γ : ι → Finset ι) (hΓ : ∀ (i j : ι), j ≠ i → ¬Disjoint (vbl i) (vbl j) → j ∈ Γ i) {x : ι → ℝ} (hx : ∀ (i : ι), x i ∈ Set.Ico 0 1) (hP : ∀ (i : ι), (MeasureTheory.Measure.pi μ).real (A i) ≤ x i * ∏ j ∈ Γ i, (1 - x j)) :
    ∀ᵐ (T : (p : V × ℕ) → α p.1) ∂table μ, ∃ (n : ℕ), ∀ (i : ι), current vbl T (run (greedy vbl A) T n) ∉ A i

    The greedy run finds a good assignment [MoserTardos2010, Theorem 1.2]: under the local-lemma hypothesis, almost surely the greedy run reaches, after finitely many resamplings, an assignment in which no event occurs.

    theorem Cslib.Probability.MoserTardos.exists_forall_notMem {V : Type u_1} {ι : Type u_2} [Fintype V] {α : V → Type u_3} [(v : V) → MeasurableSpace (α v)] (μ : (v : V) → MeasureTheory.Measure (α v)) [∀ (v : V), MeasureTheory.IsProbabilityMeasure (μ v)] (vbl : ι → Finset V) [Finite ι] (A : ι → Set ((v : V) → α v)) (hAm : ∀ (i : ι), MeasurableSet (A i)) (hA : ∀ (i : ι), DependsOn (fun (x : (i : V) → α i) => x ∈ A i) ↑(vbl i)) (Γ : ι → Finset ι) (hΓ : ∀ (i j : ι), j ≠ i → ¬Disjoint (vbl i) (vbl j) → j ∈ Γ i) {x : ι → ℝ} (hx : ∀ (i : ι), x i ∈ Set.Ico 0 1) (hP : ∀ (i : ι), (MeasureTheory.Measure.pi μ).real (A i) ≤ x i * ∏ j ∈ Γ i, (1 - x j)) :
    ∃ (σ : (v : V) → α v), ∀ (i : ι), σ ∉ A i

    The variable local lemma, constructively [MoserTardos2010, Theorem 1.2]: under the local-lemma hypothesis some assignment avoids every event.