Documentation

CslibFrontier.Probability.MoserTardos.TotalVariation

The output law of the Moser–Tardos algorithm is stable under perturbation #

The output of a Moser–Tardos run with a non-anticipating rule (historyRule) is the assignment at which the rule stops, or none if it never stops (output). Its law under the resampling table of a family of distributions P is the output law outputLaw vbl r P, a distribution on Option (∀ v, α v). Under the local-lemma hypothesis it puts no mass on none (outputLaw_none), and for a rule that stops only when no event occurs it puts mass only on assignments avoiding every event (outputLaw_some_eq_zero).

Coupling two runs entry by entry, the output laws are at statistical distance at most the divergence probability (dist_outputLaw_le). With an optimal coupling at each entry, whose disagreement probability is exactly d_TV(P v, Q v) (Cslib.Probability.PMF.exists_coupling_toReal_eq_dist), and the first-disagreement bound in the symmetric case e p (d + 1) ≤ 1 (coupledTable_diverge_le_two_mul), this gives d_TV(MT(P), MT(Q)) ≤ 2 ∑ v, d_TV(P v, Q v) (dist_outputLaw_le_two_mul).

The statement and its proof route are original (cslib-frontier issue #6718).

Main definitions #

Main results #

Implementation notes #

Only the first family P needs the local-lemma hypothesis in dist_outputLaw_le_two_mul: the output none records non-termination, so two runs that never diverge have equal outputs whether or not they stop. The bound is the companion of correlated_diverge_le. Optimal couplings halve the constant 4, but they depend on both distributions, so they do not give a protocol in which each run knows only its own distribution.

References #

theorem Cslib.Probability.MoserTardos.run_eq_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} {m : ℕ} (h : sel T (run sel T m) = none) {n : ℕ} (hmn : m ≤ n) :
run sel T n = run sel T m

Once the rule stops, the log stays fixed.

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

The output of the run of historyRule r on the table T: the assignment at the first step at which the rule stops, or none if it never stops.

theorem Cslib.Probability.MoserTardos.output_eq_some_iff {V : Type u_1} {ι : Type u_2} [DecidableEq V] {α : V → Type u_3} {vbl : ι → Finset V} {r : List ι → ((v : V) → α v) → Option ι} {T : (p : V × ℕ) → α p.1} {a : (v : V) → α v} :
output vbl r T = some a ↔ ∃ (n : ℕ), historyRule vbl r T (run (historyRule vbl r) T n) = none ∧ current vbl T (run (historyRule vbl r) T n) = a

The run outputs a exactly when the rule stops at some step with current assignment a.

theorem Cslib.Probability.MoserTardos.output_eq_none_iff {V : Type u_1} {ι : Type u_2} [DecidableEq V] {α : V → Type u_3} {vbl : ι → Finset V} {r : List ι → ((v : V) → α v) → Option ι} {T : (p : V × ℕ) → α p.1} :
output vbl r T = none ↔ ∀ (n : ℕ), historyRule vbl r T (run (historyRule vbl r) T n) ≠ none

The run outputs none exactly when the rule never stops.

theorem Cslib.Probability.MoserTardos.dependsOn_run_current {V : Type u_1} {ι : Type u_2} [DecidableEq V] {α : V → Type u_3} {vbl : ι → Finset V} {r : List ι → ((v : V) → α v) → Option ι} [Fintype V] (n : ℕ) :
DependsOn (fun (T : (p : V × ℕ) → α p.1) => (run (historyRule vbl r) T n, current vbl T (run (historyRule vbl r) T n))) ↑(Finset.univ ×ˢ Finset.range (n + 1))

The log and the current assignment after n steps depend only on the entries (v, k) with k ≤ n.

theorem Cslib.Probability.MoserTardos.measurableSet_output_preimage {V : Type u_1} {ι : Type u_2} [DecidableEq V] {α : V → Type u_3} {vbl : ι → Finset V} {r : List ι → ((v : V) → α v) → Option ι} [(v : V) → MeasurableSpace (α v)] [∀ (v : V), Countable (α v)] [∀ (v : V), MeasurableSingletonClass (α v)] [Finite V] (o : Option ((v : V) → α v)) :

Every fibre of the output is measurable.

theorem Cslib.Probability.MoserTardos.output_eq_of_not_diverge {V : Type u_1} {ι : Type u_2} [DecidableEq V] {α : V → Type u_3} {vbl : ι → Finset V} {r : List ι → ((v : V) → α v) → Option ι} {T : (p : V × ℕ) → α p.1 × α p.1} (hT : ¬Diverge vbl r T) :
output vbl r (fstTable T) = output vbl r (sndTable T)

Two coupled runs that do not diverge have the same output.

noncomputable def Cslib.Probability.MoserTardos.outputLaw {V : Type u_1} {ι : Type u_2} [Fintype V] [DecidableEq V] {α : V → Type u_3} [(v : V) → Fintype (α v)] [(v : V) → MeasurableSpace (α v)] [∀ (v : V), MeasurableSingletonClass (α v)] (vbl : ι → Finset V) (r : List ι → ((v : V) → α v) → Option ι) (P : (v : V) → PMF (α v)) :
PMF (Option ((v : V) → α v))

The output law of the Moser–Tardos run of historyRule r with the distributions P: the law of output vbl r under the resampling table of P.

theorem Cslib.Probability.MoserTardos.outputLaw_apply {V : Type u_1} {ι : Type u_2} [Fintype V] [DecidableEq V] {α : V → Type u_3} [(v : V) → Fintype (α v)] [(v : V) → MeasurableSpace (α v)] [∀ (v : V), MeasurableSingletonClass (α v)] (vbl : ι → Finset V) (r : List ι → ((v : V) → α v) → Option ι) (P : (v : V) → PMF (α v)) (o : Option ((v : V) → α v)) :
(outputLaw vbl r P) o = (table fun (v : V) => (P v).toMeasure) (output vbl r ⁻¹' {o})
theorem Cslib.Probability.MoserTardos.outputLaw_none {V : Type u_1} {ι : Type u_2} [Fintype V] [DecidableEq V] {α : V → Type u_3} [(v : V) → Fintype (α v)] [(v : V) → MeasurableSpace (α v)] [∀ (v : V), MeasurableSingletonClass (α v)] (vbl : ι → Finset V) (r : List ι → ((v : V) → α v) → Option ι) [Finite ι] (P : (v : V) → PMF (α v)) (A : ι → Set ((v : V) → α v)) (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 fun (v : V) => (P v).toMeasure).real (A i) ≤ x i * ∏ j ∈ Γ i, (1 - x j)) (hr : ∀ (w : List ι) (a : (v : V) → α v) (i : ι), r w a = some i → a ∈ A i) :
(outputLaw vbl r P) none = 0

Termination. Under the local-lemma hypothesis, for a rule that only selects occurring events, the output law puts no mass on non-termination.

theorem Cslib.Probability.MoserTardos.outputLaw_some_eq_zero {V : Type u_1} {ι : Type u_2} [Fintype V] [DecidableEq V] {α : V → Type u_3} [(v : V) → Fintype (α v)] [(v : V) → MeasurableSpace (α v)] [∀ (v : V), MeasurableSingletonClass (α v)] (vbl : ι → Finset V) (r : List ι → ((v : V) → α v) → Option ι) {A : ι → Set ((v : V) → α v)} (hstop : ∀ (w : List ι) (a : (v : V) → α v), r w a = none → ∀ (i : ι), a ∉ A i) (P : (v : V) → PMF (α v)) {a : (v : V) → α v} {i : ι} (ha : a ∈ A i) :
(outputLaw vbl r P) (some a) = 0

Good outputs. A rule that stops only when no event occurs outputs only assignments avoiding every event.

theorem Cslib.Probability.MoserTardos.dist_outputLaw_le {V : Type u_1} {ι : Type u_2} [Fintype V] [DecidableEq V] {α : V → Type u_3} [(v : V) → Fintype (α v)] [(v : V) → MeasurableSpace (α v)] [∀ (v : V), MeasurableSingletonClass (α v)] (vbl : ι → Finset V) (r : List ι → ((v : V) → α v) → Option ι) (P Q : (v : V) → PMF (α v)) (κ : (v : V) → MeasureTheory.Measure (α v × α v)) [∀ (v : V), MeasureTheory.IsProbabilityMeasure (κ v)] (hκP : ∀ (v : V), MeasureTheory.Measure.map Prod.fst (κ v) = (P v).toMeasure) (hκQ : ∀ (v : V), MeasureTheory.Measure.map Prod.snd (κ v) = (Q v).toMeasure) :
dist (outputLaw vbl r P) (outputLaw vbl r Q) ≤ ((coupledTable κ) {T : (p : V × ℕ) → α p.1 × α p.1 | Diverge vbl r T}).toReal

Coupling inequality for Moser–Tardos runs. If the coupling κ v has marginals P v and Q v, the output laws of the runs with P and with Q are at statistical distance at most the probability that the coupled runs diverge.

theorem Cslib.Probability.MoserTardos.dist_outputLaw_le_two_mul {V : Type u_1} {ι : Type u_2} [Fintype V] [DecidableEq V] {α : V → Type u_3} [(v : V) → Fintype (α v)] [(v : V) → MeasurableSpace (α v)] [∀ (v : V), MeasurableSingletonClass (α v)] (vbl : ι → Finset V) (r : List ι → ((v : V) → α v) → Option ι) [Finite ι] (P Q : (v : V) → PMF (α v)) (A : ι → Set ((v : V) → α v)) (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) {d : ℕ} (hΓd : ∀ (i : ι), (Γ i).card ≤ d) {p : ℝ} (hP : ∀ (i : ι), (MeasureTheory.Measure.pi fun (v : V) => (P v).toMeasure).real (A i) ≤ p) (hp : Real.exp 1 * p * (↑d + 1) ≤ 1) (hr : ∀ (w : List ι) (a : (v : V) → α v) (i : ι), r w a = some i → a ∈ A i) :
dist (outputLaw vbl r P) (outputLaw vbl r Q) ≤ 2 * ∑ v : V, dist (P v) (Q v)

Total-variation stability of Moser–Tardos (original). Let r be a non-anticipating rule that only selects occurring events. Suppose every event has at most d neighbours in Γ and probability at most p under the product of the P v, with e p (d + 1) ≤ 1. Then the output laws of the runs with P and with Q satisfy d_TV(MT(P), MT(Q)) ≤ 2 ∑ v, d_TV(P v, Q v), independently of d and of the number of events. No hypothesis on Q is needed: the output none records non-termination.