Documentation

CslibFrontier.Probability.MoserTardos.Coupling

Coupled runs of the Moser–Tardos algorithm #

Two runs of the Moser–Tardos algorithm, one on a table of samples from μ and one on a table of samples from ν, can share randomness: give each table entry (v, k) a pair of samples drawn from a coupling of μ v and ν v, independently for each entry. If the selection rule is non-anticipating, meaning it sees only the log and the current assignment (Cslib.Probability.MoserTardos.historyRule), then the two runs stay identical for as long as the entries the first run reads agree (run_eq_of_agree). So the runs can differ only if some entry read by the first run is a disagreeing pair.

Whether the first run ever reads entry (v, k) does not depend on that entry (dependsOn_le_uses), so it is independent of whether the pair at (v, k) disagrees. A union bound over the entries read then bounds the probability that the runs differ by ∑ v, η v · E[N v] (coupledTable_diverge_le), where η v is the disagreement probability of the coupling at v and N v is the number of samples of v that the first run reads. The bound counts samples actually read: comparing the two infinite tables would not work, since some entry eventually disagrees.

When the rule stops only once no event occurs, the first run almost surely stops at a good assignment, and away from divergence the second run stops at the same step with the same assignment. So the two runs output the same assignment avoiding every event except with the divergence probability (coupledTable_not_agreeGood_le, correlated_not_agreeGood_le).

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

Main definitions #

Main results #

Implementation notes #

The coordinates take values in countable types with the discrete measurable structure, so every event determined by finitely many table entries is measurable (MeasureTheory.measurableSet_of_dependsOn) and the rule needs no measurability assumption. The event AgreeGood need not be measurable; its complement is bounded through measure_mono_ae, which holds for outer measure.

correlatedCoupling is Holenstein's protocol (Cslib.Probability.CorrelatedSampling.seed): the seed at each table entry is a sequence of uniform points of α v × [0, 1] whose law depends only on α v, and each run computes its sample from the seed and its own distribution alone. So the two runs can be carried out by parties who share the seed table but each know only their own distributions. The coupling's marginal and termination results (correlatedCoupling_map_fst, correlatedCoupling_map_snd, correlated_ae_terminate) assume that each alphabet has measurable singletons (MeasurableSingletonClass), which the protocol uses for the measurability of its graph regions; the discrete measurable structure on a finite alphabet satisfies it.

The divergence and output bounds use no hypothesis on Q: they need only the first run's expected sample counts, and the second run stops whenever the runs agree. Almost-sure termination of both runs (coupledTable_ae_terminate) does need the local-lemma hypothesis for Q as well.

References #

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

The non-anticipating selection rule given by r: after the log w, it selects r w a, where a is the current assignment. Unlike a general rule, it cannot read table entries the algorithm has not yet used.

theorem Cslib.Probability.MoserTardos.historyRule_valid {V : Type u_1} {ι : Type u_2} [DecidableEq V] {α : V → Type u_3} {vbl : ι → Finset V} {A : ι → Set ((v : V) → α v)} {r : List ι → ((v : V) → α v) → Option ι} (hr : ∀ (w : List ι) (a : (v : V) → α v) (i : ι), r w a = some i → a ∈ A i) (T : (p : V × ℕ) → α p.1) (w : List ι) (i : ι) :
historyRule vbl r T w = some i → current vbl T w ∈ A i

A valid r, one that only selects events occurring in the given assignment, gives a valid selection rule.

theorem Cslib.Probability.MoserTardos.uses_eq_sum_count {V : Type u_1} {ι : Type u_2} [DecidableEq V] {vbl : ι → Finset V} [Fintype ι] [DecidableEq ι] (w : List ι) (v : V) :
uses vbl w v = ∑ i : ι with v ∈ vbl i, List.count i w

How often v has been resampled: the number of steps of w on events containing v.

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

The log after n steps has at most n entries.

theorem Cslib.Probability.MoserTardos.uses_le_length {V : Type u_1} {ι : Type u_2} [DecidableEq V] {vbl : ι → Finset V} (w : List ι) (v : V) :
uses vbl w v ≤ w.length

A variable is resampled at most as often as there are steps.

theorem Cslib.Probability.MoserTardos.uses_run_mono {V : Type u_1} {ι : Type u_2} [DecidableEq V] {α : V → Type u_3} {vbl : ι → Finset V} (sel : ((p : V × ℕ) → α p.1) → List ι → Option ι) (T : (p : V × ℕ) → α p.1) (v : V) :
Monotone fun (n : ℕ) => uses vbl (run sel T n) v

The number of resamplings of a variable grows along the run.

theorem Cslib.Probability.MoserTardos.run_eq_of_agree {V : Type u_1} {ι : Type u_2} [DecidableEq V] {α : V → Type u_3} {vbl : ι → Finset V} (r : List ι → ((v : V) → α v) → Option ι) {T T' : (p : V × ℕ) → α p.1} (n : ℕ) :
(∀ m < n, ∀ (u : V), T (u, uses vbl (run (historyRule vbl r) T m) u) = T' (u, uses vbl (run (historyRule vbl r) T m) u)) → run (historyRule vbl r) T n = run (historyRule vbl r) T' n

Agreement. Under a non-anticipating rule, two tables that agree on every entry read by the first n steps on T give the same log after n steps.

def Cslib.Probability.MoserTardos.horizon {V : Type u_1} [DecidableEq V] [Fintype V] (n : ℕ) (v : V) (k : ℕ) :

The table entries read by the first n + 1 steps, other than (v, k).

theorem Cslib.Probability.MoserTardos.run_eq_of_agree_horizon {V : Type u_1} {ι : Type u_2} [DecidableEq V] {α : V → Type u_3} {vbl : ι → Finset V} [Fintype V] (r : List ι → ((v : V) → α v) → Option ι) {T T' : (p : V × ℕ) → α p.1} {n m : ℕ} {v : V} {k : ℕ} (h : ∀ p ∈ horizon n v k, T p = T' p) (hm : m ≤ n) (hk : uses vbl (run (historyRule vbl r) T m) v < k) :
run (historyRule vbl r) T m = run (historyRule vbl r) T' m

If v has been resampled fewer than k times after m ≤ n steps, the run so far has not read entry (v, k): tables that agree on horizon n v k give the same log after m steps.

theorem Cslib.Probability.MoserTardos.dependsOn_le_uses {V : Type u_1} {ι : Type u_2} [DecidableEq V] {α : V → Type u_3} {vbl : ι → Finset V} [Fintype V] (r : List ι → ((v : V) → α v) → Option ι) (n : ℕ) (v : V) (k : ℕ) :
DependsOn (fun (T : (p : V × ℕ) → α p.1) => k ≤ uses vbl (run (historyRule vbl r) T n) v) ↑(horizon n v k)

Reading (v, k) does not depend on (v, k). Whether v has been resampled at least k times after n steps depends only on the entries in horizon n v k, which exclude (v, k).

theorem Cslib.Probability.MoserTardos.tsum_ite_exists_le_le {U : ℕ → ℕ} (hU : Monotone U) :
(∑' (k : ℕ), if ∃ (n : ℕ), k ≤ U n then 1 else 0) ≤ 1 + ⨆ (n : ℕ), ↑(U n)

Tail sum. For a monotone count U, the number of k with k ≤ U n for some n is at most 1 + sup U.

theorem Cslib.Probability.MoserTardos.le_weight_of_exp_mul_le (d : ℕ) {p : ℝ} (hp : Real.exp 1 * p * (↑d + 1) ≤ 1) :
p ≤ 1 / (↑d + 2) * (1 - 1 / (↑d + 2)) ^ d

The symmetric weights. If e p (d + 1) ≤ 1, then p ≤ x (1 - x) ^ d for x = 1 / (d + 2), since (1 + 1 / (d + 1)) ^ (d + 1) ≤ e.

theorem Cslib.Probability.MoserTardos.card_filter_mem_le {ι : Type u_1} [Fintype ι] {V : Type u_2} [DecidableEq V] (vbl : ι → Finset V) (Γ : ι → Finset ι) (hΓ : ∀ (i j : ι), j ≠ i → ¬Disjoint (vbl i) (vbl j) → j ∈ Γ i) {d : ℕ} (hΓd : ∀ (i : ι), (Γ i).card ≤ d) (v : V) :
{i : ι | v ∈ vbl i}.card ≤ d + 1

The events containing a variable pairwise share it, so if every event has at most d neighbours in Γ, at most d + 1 events contain any one variable.

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

The coupled table: an independent pair of samples T (v, k) ∼ κ v for every table entry, where κ v couples the two runs' distributions of v.

Instances For
    theorem Cslib.Probability.MoserTardos.coupledTable_def {V : Type u_1} {α : V → Type u_3} [(v : V) → MeasurableSpace (α v)] (κ : (v : V) → MeasureTheory.Measure (α v × α v)) :
    def Cslib.Probability.MoserTardos.fstTable {V : Type u_1} {α : V → Type u_3} (T : (p : V × ℕ) → α p.1 × α p.1) (p : V × ℕ) :
    α p.1

    The first run's table.

    def Cslib.Probability.MoserTardos.sndTable {V : Type u_1} {α : V → Type u_3} (T : (p : V × ℕ) → α p.1 × α p.1) (p : V × ℕ) :
    α p.1

    The second run's table.

    theorem Cslib.Probability.MoserTardos.coupledTable_map_fstTable {V : Type u_1} {α : V → Type u_3} [(v : V) → MeasurableSpace (α v)] (κ : (v : V) → MeasureTheory.Measure (α v × α v)) [∀ (v : V), MeasureTheory.IsProbabilityMeasure (κ v)] :

    The first run's table is a resampling table for the first marginals of the couplings.

    theorem Cslib.Probability.MoserTardos.coupledTable_map_sndTable {V : Type u_1} {α : V → Type u_3} [(v : V) → MeasurableSpace (α v)] (κ : (v : V) → MeasureTheory.Measure (α v × α v)) [∀ (v : V), MeasureTheory.IsProbabilityMeasure (κ v)] :

    The second run's table is a resampling table for the second marginals of the couplings.

    def Cslib.Probability.MoserTardos.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) :

    The two runs on the coupled table T diverge: at some step their logs or their current assignments differ.

    theorem Cslib.Probability.MoserTardos.setOf_diverge_subset {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 | Diverge vbl r T} ⊆ ⋃ (v : V), ⋃ (k : ℕ), (⋃ (n : ℕ), {T : (p : V × ℕ) → α p.1 × α p.1 | k ≤ uses vbl (run (historyRule vbl r) (fstTable T) n) v}) ∩ {T : (p : V × ℕ) → α p.1 × α p.1 | (T (v, k)).1 ≠ (T (v, k)).2}

    The runs diverge only if some entry (v, k) that the first run reads is a disagreeing pair.

    theorem Cslib.Probability.MoserTardos.coupledTable_read_inter_disagree {V : Type u_1} {ι : Type u_2} [DecidableEq V] {α : V → Type u_3} [(v : V) → MeasurableSpace (α v)] (κ : (v : V) → MeasureTheory.Measure (α v × α v)) [∀ (v : V), MeasureTheory.IsProbabilityMeasure (κ v)] [∀ (v : V), Countable (α v)] [∀ (v : V), MeasurableSingletonClass (α v)] (vbl : ι → Finset V) (r : List ι → ((v : V) → α v) → Option ι) [Finite V] (v : V) (k : ℕ) :
    (coupledTable κ) ((⋃ (n : ℕ), {T : (p : V × ℕ) → α p.1 × α p.1 | k ≤ uses vbl (run (historyRule vbl r) (fstTable T) n) v}) ∩ {T : (p : V × ℕ) → α p.1 × α p.1 | (T (v, k)).1 ≠ (T (v, k)).2}) = (table fun (v : V) => MeasureTheory.Measure.map Prod.fst (κ v)) {T : (p : V × ℕ) → α p.1 | ∃ (n : ℕ), k ≤ uses vbl (run (historyRule vbl r) T n) v} * (κ v) {x : α v × α v | x.1 ≠ x.2}

    Independence of reading and disagreeing. The probability that the first run reads entry (v, k) and the pair there disagrees factors.

    theorem Cslib.Probability.MoserTardos.tsum_table_read_le {V : Type u_1} {ι : Type u_2} [DecidableEq V] {α : V → Type u_3} [(v : V) → MeasurableSpace (α v)] [∀ (v : V), Countable (α v)] [∀ (v : V), MeasurableSingletonClass (α v)] (vbl : ι → Finset V) (r : List ι → ((v : V) → α v) → Option ι) [Finite V] (μ : (v : V) → MeasureTheory.Measure (α v)) [∀ (v : V), MeasureTheory.IsProbabilityMeasure (μ v)] (v : V) :
    ∑' (k : ℕ), (table μ) {T : (p : V × ℕ) → α p.1 | ∃ (n : ℕ), k ≤ uses vbl (run (historyRule vbl r) T n) v} ≤ 1 + ∫⁻ (T : (p : V × ℕ) → α p.1), ⨆ (n : ℕ), ↑(uses vbl (run (historyRule vbl r) T n) v) ∂table μ

    Expected samples read. The expected number of samples of v read by a run, 1 for the initial sample plus one per resampling of v, bounds the sum over k of the probability that the run reads entry (v, k).

    theorem Cslib.Probability.MoserTardos.coupledTable_diverge_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 : V), MeasureTheory.IsProbabilityMeasure (κ v)] [∀ (v : V), Countable (α v)] [∀ (v : V), MeasurableSingletonClass (α v)] (vbl : ι → Finset V) (r : List ι → ((v : V) → α v) → Option ι) :
    (coupledTable κ) {T : (p : V × ℕ) → α p.1 × α p.1 | Diverge vbl r T} ≤ ∑ v : V, (κ v) {x : α v × α v | x.1 ≠ x.2} * (1 + ∫⁻ (T : (p : V × ℕ) → α p.1), ⨆ (n : ℕ), ↑(uses vbl (run (historyRule vbl r) T n) v) ∂table fun (v : V) => MeasureTheory.Measure.map Prod.fst (κ v))

    The first-disagreement bound. Let both runs use the non-anticipating rule historyRule r on the coupled table. The probability that they diverge is at most ∑ v, η v · E[N v]. Here η v is the probability that the coupling κ v gives two different samples, and N v is the number of samples of v that the first run reads, 1 plus the number of resamplings of v.

    theorem Cslib.Probability.MoserTardos.coupledTable_diverge_le_of_lll {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 : V), MeasureTheory.IsProbabilityMeasure (κ v)] [∀ (v : V), Countable (α v)] [∀ (v : V), MeasurableSingletonClass (α v)] (vbl : ι → Finset V) (r : List ι → ((v : V) → α v) → Option ι) [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 fun (v : V) => MeasureTheory.Measure.map Prod.fst (κ v)).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) :
    (coupledTable κ) {T : (p : V × ℕ) → α p.1 × α p.1 | Diverge vbl r T} ≤ ∑ v : V, (κ v) {x : α v × α v | x.1 ≠ x.2} * (1 + ∑ i : ι with v ∈ vbl i, ENNReal.ofReal (x i / (1 - x i)))

    Divergence under the local-lemma hypothesis. Suppose the first run's distributions satisfy the hypothesis of the asymmetric local lemma with weights x, and r only selects occurring events. Then the two runs diverge with probability at most ∑ v, η v · (1 + ∑_{i ∋ v} x i / (1 - x i)), where η v is the disagreement probability of the coupling at v.

    theorem Cslib.Probability.MoserTardos.lll_of_symm {V : Type u_1} {ι : Type u_2} {α : V → Type u_3} [(v : V) → MeasurableSpace (α v)] {A : ι → Set ((v : V) → α v)} (m : MeasureTheory.Measure ((v : V) → α v)) (Γ : ι → Finset ι) {d : ℕ} (hΓd : ∀ (i : ι), (Γ i).card ≤ d) {p : ℝ} (hP : ∀ (i : ι), m.real (A i) ≤ p) (hp : Real.exp 1 * p * (↑d + 1) ≤ 1) :
    (∀ (x : ι), 1 / (↑d + 2) ∈ Set.Ico 0 1) ∧ ∀ (i : ι), m.real (A i) ≤ 1 / (↑d + 2) * ∏ _j ∈ Γ i, (1 - 1 / (↑d + 2))

    The symmetric hypothesis e p (d + 1) ≤ 1, with at most d neighbours per event, gives the asymmetric one with the weights x = 1 / (d + 2).

    theorem Cslib.Probability.MoserTardos.coupledTable_diverge_le_two_mul {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 : V), MeasureTheory.IsProbabilityMeasure (κ v)] [∀ (v : V), Countable (α v)] [∀ (v : V), MeasurableSingletonClass (α v)] (vbl : ι → Finset V) (r : List ι → ((v : V) → α v) → Option ι) [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) {d : ℕ} (hΓd : ∀ (i : ι), (Γ i).card ≤ d) {p : ℝ} (hP : ∀ (i : ι), (MeasureTheory.Measure.pi fun (v : V) => MeasureTheory.Measure.map Prod.fst (κ v)).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) :
    (coupledTable κ) {T : (p : V × ℕ) → α p.1 × α p.1 | Diverge vbl r T} ≤ 2 * ∑ v : V, (κ v) {x : α v × α v | x.1 ≠ x.2}

    The symmetric case. Suppose every event has at most d neighbours in Γ and probability at most p under the first run's distributions, with e p (d + 1) ≤ 1, and r only selects occurring events. Then each variable is read at most twice in expectation, and the two runs diverge with probability at most 2 ∑ v, η v.

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

    The two runs on the coupled table T agree on a good output: after the same n steps both stop, with the same log and the same assignment, and no event A i occurs in it.

    theorem Cslib.Probability.MoserTardos.agreeGood_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 ι) {A : ι → Set ((v : V) → α v)} {T : (p : V × ℕ) → α p.1 × α p.1} (hstop : ∀ (w : List ι) (a : (v : V) → α v), r w a = none → ∀ (i : ι), a ∉ A i) (hT : ¬Diverge vbl r T) (hfst : ∃ (n : ℕ), historyRule vbl r (fstTable T) (run (historyRule vbl r) (fstTable T) n) = none) :
    AgreeGood vbl r A T

    If the runs do not diverge and the first run stops, both stop at the same step with the same assignment, and a rule that stops only when no event occurs leaves a good assignment.

    theorem Cslib.Probability.MoserTardos.coupledTable_not_agreeGood_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 : V), MeasureTheory.IsProbabilityMeasure (κ v)] (vbl : ι → Finset V) (r : List ι → ((v : V) → α v) → Option ι) [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 fun (v : V) => MeasureTheory.Measure.map Prod.fst (κ v)).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) (hstop : ∀ (w : List ι) (a : (v : V) → α v), r w a = none → ∀ (i : ι), a ∉ A i) :
    (coupledTable κ) {T : (p : V × ℕ) → α p.1 × α p.1 | ¬AgreeGood vbl r A T} ≤ (coupledTable κ) {T : (p : V × ℕ) → α p.1 × α p.1 | Diverge vbl r T}

    The runs output the same good assignment. Under the asymmetric local-lemma hypothesis for the first run's distributions, for a valid r that stops only when no event occurs, the two runs fail to stop together at one assignment avoiding every event with probability at most the divergence probability. The second run's termination is not assumed: it follows from agreement.

    theorem Cslib.Probability.MoserTardos.coupledTable_ae_terminate {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 : V), MeasureTheory.IsProbabilityMeasure (κ v)] (vbl : ι → Finset V) (r : List ι → ((v : V) → α v) → Option ι) [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 y : ι → ℝ} (hx : ∀ (i : ι), x i ∈ Set.Ico 0 1) (hy : ∀ (i : ι), y i ∈ Set.Ico 0 1) (hP : ∀ (i : ι), (MeasureTheory.Measure.pi fun (v : V) => MeasureTheory.Measure.map Prod.fst (κ v)).real (A i) ≤ x i * ∏ j ∈ Γ i, (1 - x j)) (hQ : ∀ (i : ι), (MeasureTheory.Measure.pi fun (v : V) => MeasureTheory.Measure.map Prod.snd (κ v)).real (A i) ≤ y i * ∏ j ∈ Γ i, (1 - y j)) (hr : ∀ (w : List ι) (a : (v : V) → α v) (i : ι), r w a = some i → a ∈ A i) :
    ∀ᵐ (T : (p : V × ℕ) → α p.1 × α p.1) ∂coupledTable κ, (∃ (n : ℕ), historyRule vbl r (fstTable T) (run (historyRule vbl r) (fstTable T) n) = none) ∧ ∃ (n : ℕ), historyRule vbl r (sndTable T) (run (historyRule vbl r) (sndTable T) n) = none

    Both runs terminate. If each run's distributions satisfy the asymmetric local-lemma hypothesis, with weights x and y, then almost surely both runs stop. The local-lemma hypothesis for the second run cannot be dropped. Take one coin, a second-run distribution that always gives true, and the rule that resamples whenever the coin shows true. The second run's table is then almost surely all true, and on that table the rule resamples forever.

    noncomputable def Cslib.Probability.MoserTardos.correlatedCoupling {V : Type u_1} {α : V → Type u_3} [(v : V) → Fintype (α v)] [(v : V) → MeasurableSpace (α v)] (P Q : (v : V) → PMF (α v)) (v : V) :

    The correlated-sampling coupling of P v and Q v, by Holenstein's protocol (Cslib.Probability.CorrelatedSampling.seed): both parties read one shared seed, a sequence of uniform points of α v × [0, 1] whose law depends only on α v, and each computes its sample from the seed and its own distribution alone (Cslib.Probability.CorrelatedSampling.seedSample). The Nonempty instance needed for the seed is a proposition, so it does not make the seed depend on P.

    Instances For
      instance Cslib.Probability.MoserTardos.instIsProbabilityMeasureProdCorrelatedCoupling {V : Type u_1} {α : V → Type u_3} [(v : V) → Fintype (α v)] [(v : V) → MeasurableSpace (α v)] [∀ (v : V), MeasurableSingletonClass (α v)] (P Q : (v : V) → PMF (α v)) (v : V) :
      theorem Cslib.Probability.MoserTardos.correlatedCoupling_map_fst {V : Type u_1} {α : V → Type u_3} [(v : V) → Fintype (α v)] [(v : V) → MeasurableSpace (α v)] [∀ (v : V), MeasurableSingletonClass (α v)] (P Q : (v : V) → PMF (α v)) (v : V) :

      The first party samples from P v. Each alphabet α v has measurable singletons (MeasurableSingletonClass), which Holenstein's protocol uses for the measurability of its graph regions.

      theorem Cslib.Probability.MoserTardos.correlatedCoupling_map_snd {V : Type u_1} {α : V → Type u_3} [(v : V) → Fintype (α v)] [(v : V) → MeasurableSpace (α v)] [∀ (v : V), MeasurableSingletonClass (α v)] (P Q : (v : V) → PMF (α v)) (v : V) :

      The second party samples from Q v. Each alphabet α v has measurable singletons (MeasurableSingletonClass), as in correlatedCoupling_map_fst.

      theorem Cslib.Probability.MoserTardos.correlatedCoupling_disagree_le {V : Type u_1} {α : V → Type u_3} [(v : V) → Fintype (α v)] [(v : V) → MeasurableSpace (α v)] [∀ (v : V), MeasurableSingletonClass (α v)] (P Q : (v : V) → PMF (α v)) (v : V) :
      (correlatedCoupling P Q v) {x : α v × α v | x.1 ≠ x.2} ≤ ENNReal.ofReal (2 * dist (P v) (Q v))

      The two samples differ with probability at most twice the statistical distance.

      theorem Cslib.Probability.MoserTardos.correlated_diverge_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)] [Finite ι] (P Q : (v : V) → PMF (α v)) (vbl : ι → Finset V) (r : List ι → ((v : V) → α v) → Option ι) (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) {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) :
      (coupledTable (correlatedCoupling P Q)) {T : (p : V × ℕ) → α p.1 × α p.1 | Diverge vbl r T} ≤ ENNReal.ofReal (4 * ∑ v : V, dist (P v) (Q v))

      Replicable Moser–Tardos (original). Two runs of the Moser–Tardos algorithm with a non-anticipating rule r, one sampling from the product of the P v and one from the product of the Q v, share the randomness of correlated sampling at every table entry: a seed whose law does not depend on P or Q, from which each run computes its samples using only its own distributions. Each run on its own is an ordinary Moser–Tardos run (correlatedCoupling_map_fst, correlatedCoupling_map_snd). Suppose every event has at most d neighbours in Γ and probability at most p under P, with e p (d + 1) ≤ 1, and r only selects occurring events. Then the two runs diverge with probability at most 4 ∑ v, d_TV(P v, Q v), independently of d and of the number of events.

      theorem Cslib.Probability.MoserTardos.correlated_not_agreeGood_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)] [Finite ι] (P Q : (v : V) → PMF (α v)) (vbl : ι → Finset V) (r : List ι → ((v : V) → α v) → Option ι) (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) {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) (hstop : ∀ (w : List ι) (a : (v : V) → α v), r w a = none → ∀ (i : ι), a ∉ A i) :
      (coupledTable (correlatedCoupling P Q)) {T : (p : V × ℕ) → α p.1 × α p.1 | ¬AgreeGood vbl r A T} ≤ ENNReal.ofReal (4 * ∑ v : V, dist (P v) (Q v))

      Replicable output under correlated sampling. In the symmetric case, for a valid r that stops only when no event occurs, the two runs output the same assignment avoiding every event, except with probability at most 4 ∑ v, d_TV(P v, Q v).

      theorem Cslib.Probability.MoserTardos.correlated_ae_terminate {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)] [Finite ι] (P Q : (v : V) → PMF (α v)) (vbl : ι → Finset V) (r : List ι → ((v : V) → α v) → Option ι) (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) {d : ℕ} (hΓd : ∀ (i : ι), (Γ i).card ≤ d) {p : ℝ} (hP : ∀ (i : ι), (MeasureTheory.Measure.pi fun (v : V) => (P v).toMeasure).real (A i) ≤ p) (hQ : ∀ (i : ι), (MeasureTheory.Measure.pi fun (v : V) => (Q 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) :
      ∀ᵐ (T : (p : V × ℕ) → α p.1 × α p.1) ∂coupledTable (correlatedCoupling P Q), (∃ (n : ℕ), historyRule vbl r (fstTable T) (run (historyRule vbl r) (fstTable T) n) = none) ∧ ∃ (n : ℕ), historyRule vbl r (sndTable T) (run (historyRule vbl r) (sndTable T) n) = none

      Both runs terminate under correlated sampling. In the symmetric case for both P and Q, almost surely both runs stop. Each alphabet α v has measurable singletons (MeasurableSingletonClass), as in correlatedCoupling_map_fst.