Documentation

MetropolizedBackwardSampling.Paper

The results of the paper #

Each result of the paper Metropolized backward sampling for conditional sequential Monte Carlo and of its supplementary material is stated here, in the order of the paper, with the hypotheses of the paper and the formalization assumptions listed in the notes of the blueprint. The docstring of each statement contains a quotation of the paper and the label of the result.

Conventions:

Section 2: the forced move and the coupling kernel #

theorem CSMC.Paper.lem_forced {N : ℕ} {p : Fin N → ℝ} (hp : IsProbVector p) :
IsReversible p (forced p) ∧ (∀ (i j : Fin N), i ≠ j → p j ≤ forced p i j) ∧ ∀ (φ : Fin N → ℝ), dirForm p (forced p) φ ≤ expect p φ ^ 2

Lemma 1 (lem:forced, Section 2.2). 'The kernel F_p is reversible with respect to p. For i ≠ j, F_p(i, j) ≥ p_j. For every φ : [N] → ℝ, ⟨φ, F_p φ⟩_p ≤ p(φ)².'

theorem CSMC.Paper.forced_fin_two {p : Fin 2 → ℝ} (hp : IsProbVector p) (h0 : 0 < p 0) (h1 : 0 < p 1) :
forced p 0 1 = min 1 (p 1 / p 0)

The forced move for two particles (Section 2.2). 'For N = 2 and p_1, p_2 > 0, F_p(1, 2) = min{1, p_2/p_1} is the Metropolis acceptance probability'. The indices 1 and 2 are 0 and 1 in Lean.

theorem CSMC.Paper.lem_coupling {N : ℕ} {p q : Fin N → ℝ} (hp : IsProbVector p) (hq : IsProbVector q) :
(∀ (i i' : Fin N), p i * coupling p q i i' = q i' * coupling q p i' i) ∧ (∀ (i i' : Fin N), i ≠ i' → q i' ≤ coupling p q i i') ∧ ∀ (φ : Fin N → ℝ), dirForm p (coupling p q) φ ≤ expect p φ * expect q φ

Lemma 2 (lem:coupling, Section 2.3). 'Let p and q be probability vectors on [N]. For all i, i' ∈ [N], p_i C_{p,q}(i, i') = q_{i'} C_{q,p}(i', i). For i ≠ i', C_{p,q}(i, i') ≥ q_{i'}. For every φ : [N] → ℝ, ⟨φ, C_{p,q} φ⟩_p ≤ p(φ) q(φ).'

Section 3: validity #

theorem CSMC.Paper.selectionRule_admissible {X : Type u_1} [MeasurableSpace X] {μ : MeasureTheory.Measure X} {n N : ℕ} (hN : 2 ≤ N) (M : FeynmanKac μ n) (r : SelectionRule) :
(∀ (y : Pos X n N), Admissible (M.weight y (Fin.last n)) (M.bsprob y) (M.ruleKernels N r y)) ∧ MeasurableKernels (M.ruleKernels N r)

The six selection rules satisfy the hypotheses of Algorithm 1 (Section 3). 'Proposition 1 applies to the six selection rules of Section 2, because the identity kernel, the Gibbs kernel, and, by Lemma 1, F_p are reversible with respect to p, whereas, for j ≠ j', the kernels K_{t,j,j'}(i, ·) = B_t(·|j') satisfy (3), and so do the kernels K_{t,j,j'} = C_{B_t(·|j), B_t(·|j')} of CM-BS, by the first part of Lemma 2.' Formalization: the kernels are also measurable functions of the particle positions, which is a hypothesis of Lemma 4 and of Proposition 1.

theorem CSMC.Paper.lem_extended {X : Type u_1} [MeasurableSpace X] {μ : MeasureTheory.Measure X} {n N : ℕ} [MeasureTheory.SigmaFinite μ] (hN : 2 ≤ N) (M : FeynmanKac μ n) :
have J := M.target.compProd ((ProbabilityTheory.Kernel.const (Traj X n) (unifIdx n N)).compProd (M.forwardPass N)); MeasureTheory.Measure.map (fun (z : Traj X n × Idx n N × Pos X n N × Anc n N) => (z.2.2.1, z.2.2.2, z.2.1 (Fin.last n))) J = M.exttarget N ∧ MeasureTheory.Measure.map (fun (z : Traj X n × Idx n N × Pos X n N × Anc n N) => (z.1, z.2.2.1, z.2.2.2, z.2.1 (Fin.last n))) J = MeasureTheory.Measure.map (fun (w : Pos X n N × Anc n N × Fin N) => (trajOf w.1 (traceBack w.2.1 w.2.2), w)) (M.exttarget N) ∧ M.exttarget N = (MeasureTheory.Measure.map Prod.fst (M.exttarget N)).compProd (kernelOfMassFn fun (y : Pos X n N) (ab : Anc n N × Fin N) => (M.weight y (Fin.last n) ab.2 * ∏ s : Fin n, ∏ i : Fin N, M.bsprob y s (ab.1 s i) i).toNNReal)

Lemma 3 (lem:extended, Section 3). 'Let x_{1:T} ∼ π and run steps (a) and (b) of Algorithm 1. Then (x, a, b_T) ∼ π̄, with x_{1:T} the trajectory traced back from b_T. Under π̄, conditionally on x, the indices b_T and a_t^n, t ∈ [T - 1], n ∈ [N], are independent, with the distributions W_T and B_t(·|n), respectively.' The first conjunct states that the distribution of (x, a, b_T) is π̄. The second states that the joint distribution of the reference trajectory and of (x, a, b_T) is the image of π̄ under the map which adds the trajectory traced back from b_T, so that the reference trajectory is the trajectory traced back from b_T. The third states that π̄ is the distribution of the particle positions under π̄ followed by the kernel with mass function (a, b_T) ↦ W_T^{b_T} ∏_{t,n} B_t(a_t^n|n). The proof of Lemma 3 in the supplement is not ours and is provided for completeness and ease of reference. The first part of Lemma 3 is due to Andrieu et al. (2010), in the form of Chopin and Singh (2015, Section 2.3). The second part is the observation of Chopin and Singh (2015, proof of Proposition 9).

theorem CSMC.Paper.lem_pair {X : Type u_1} [MeasurableSpace X] {μ : MeasureTheory.Measure X} {n N : ℕ} [MeasureTheory.SigmaFinite μ] (hN : 2 ≤ N) (M : FeynmanKac μ n) (K : Pos X n N → BackwardKernels (Fin N) n) (hK : ∀ (y : Pos X n N), Admissible (M.weight y (Fin.last n)) (M.bsprob y) (K y)) (hKm : MeasurableKernels K) :
MeasureTheory.Measure.map (fun (z : Traj X n × (Idx n N × Pos X n N × Anc n N) × Idx n N) => (z.2.1.2.1, z.2.1.1, z.2.2)) (M.target.compProd (M.algLaw K)) = (MeasureTheory.Measure.map Prod.fst (M.exttarget N)).compProd (M.pairChain K) ∧ ((∀ (y : Pos X n N) (s : Fin n) (j j' i i' : Fin N), j ≠ j' → (K y).step s j j' i i' = M.bsprob y s i' j') → MeasureTheory.Measure.map (fun (z : Traj X n × (Idx n N × Pos X n N × Anc n N) × Idx n N) => (z.2.1.2.1, z.2.1.1, z.2.2)) (M.target.compProd (M.algLawUsual K)) = (MeasureTheory.Measure.map Prod.fst (M.exttarget N)).compProd (M.pairChain K))

Lemma 4 (lem:pair, Section 3). 'Let x_{1:T} ∼ π and run Algorithm 1. Conditionally on x, b_T ∼ W_T and, given b_T, l_T ∼ K_T(b_T, ·). For t ∈ [T - 1], conditionally on x and (b_{t+1:T}, l_{t+1:T}), b_t ∼ B_t(·|b_{t+1}) and, given b_t, l_t ∼ K_{t,b_{t+1},l_{t+1}}(b_t, ·). If K_{t,j,j'}(i, ·) = B_t(·|j') for all j ≠ j' and t ∈ [T - 1], the same holds with l_t ∼ K_{t,l_{t+1},l_{t+1}}(a_t^{l_{t+1}}, ·) in Algorithm 1.d.' The conditional distributions of the first two sentences are those of the backward Markov chain pairChain K on pairs of indices, whose trajectories have the probabilities W_T^{b_T} K_T(b_T, l_T) ∏_t B_t(b_t|b_{t+1}) K_{t,b_{t+1},l_{t+1}}(b_t, l_t). By Lemma 3, the particle positions have their distribution under π̄.

theorem CSMC.Paper.prop_reversible {X : Type u_1} [MeasurableSpace X] {μ : MeasureTheory.Measure X} {n N : ℕ} [MeasureTheory.SigmaFinite μ] (hN : 2 ≤ N) (M : FeynmanKac μ n) (K : Pos X n N → BackwardKernels (Fin N) n) (hK : ∀ (y : Pos X n N), Admissible (M.weight y (Fin.last n)) (M.bsprob y) (K y)) (hKm : MeasurableKernels K) :

Proposition 1 (prop:reversible, Section 3). 'For any kernels K_T and K_{t,j,j'} as in Algorithm 1, the Markov kernel defined by Algorithm 1 is reversible with respect to π. In particular, it leaves π invariant.' The three conjuncts state that the kernel defined by Algorithm 1 is a Markov kernel, is reversible with respect to π, and leaves π invariant.

Section 4: comparison of the selection rules #

theorem CSMC.Paper.thm_ordering {X : Type u_1} [MeasurableSpace X] {μ : MeasureTheory.Measure X} {n N : ℕ} [MeasureTheory.SigmaFinite μ] (hN : 2 ≤ N) (M : FeynmanKac μ n) (t : Fin (n + 1)) {f : X → ℝ} (_hf : Measurable f) (hf2 : MeasureTheory.MemLp (fun (x : Traj X n) => f (x t)) 2 M.target) :

Theorem 1 (thm:ordering, Section 4.1), first part. 'Let t ∈ [T] and let f : X → ℝ be measurable with ∫ f(x_t)² π(x_{1:T}) dx_{1:T} < ∞. Then E_{M-BS}{f(x_t) f(x̃_t)} ≤ E_{FM-BS}{f(x_t) f(x̃_t)} ≤ E_{BS}{f(x_t) f(x̃_t)} ≤ E_{AT}{f(x_t) f(x̃_t)}, and the first inequality also holds with CM-BS in place of M-BS.' Formalization: the square-integrability is MemLp with exponent 2, which includes the measurability of x ↦ f(x_t) up to a null set, so that the measurability of f is not used in the proof.

Theorem 1 (thm:ordering, Section 4.1), second part. 'Moreover, P_{M-BS}(x̃_t ≠ x_t) ≥ P_{FM-BS}(x̃_t ≠ x_t) ≥ P_{BS}(x̃_t ≠ x_t) ≥ P_{AT}(x̃_t ≠ x_t), and the first inequality also holds with CM-BS in place of M-BS.' Formalization: the diagonal of X × X is measurable.

theorem CSMC.Paper.cor_pairs {X : Type u_1} [MeasurableSpace X] {μ : MeasureTheory.Measure X} {n N : ℕ} [MeasureTheory.SigmaFinite μ] (hN : 2 ≤ N) (M : FeynmanKac μ n) (s : Fin n) {f : X × X → ℝ} (_hf : Measurable f) (hf2 : MeasureTheory.MemLp (fun (x : Traj X n) => f (x s.castSucc, x s.succ)) 2 M.target) :

Corollary 1 (cor:pairs, Section 4.1), first part. 'Let t ∈ [T - 1] and let f : X² → ℝ be measurable with ∫ f(x_t, x_{t+1})² π(x_{1:T}) dx_{1:T} < ∞. Then E_{M-BS}{f(x_t, x_{t+1}) f(x̃_t, x̃_{t+1})} ≤ E_{FM-BS}{f(x_t, x_{t+1}) f(x̃_t, x̃_{t+1})} ≤ E_{BS}{f(x_t, x_{t+1}) f(x̃_t, x̃_{t+1})} ≤ E_{AT}{f(x_t, x_{t+1}) f(x̃_t, x̃_{t+1})}.' Formalization: the square-integrability is MemLp with exponent 2, which includes the measurability of x ↦ f(x_t, x_{t+1}) up to a null set, so that the measurability of f is not used in the proof.

theorem CSMC.Paper.cor_pairs_updateRate {X : Type u_1} [MeasurableSpace X] {μ : MeasureTheory.Measure X} {n N : ℕ} [MeasureTheory.SigmaFinite μ] [MeasurableEq X] (hN : 2 ≤ N) (M : FeynmanKac μ n) (s : Fin n) (hdist : ∀ᵐ (w : Pos X n N × Anc n N × Fin N) ∂M.exttarget N, ∀ (i j : Fin N), i ≠ j → w.1 (s.castSucc, i) ≠ w.1 (s.castSucc, j) ∧ w.1 (s.succ, i) ≠ w.1 (s.succ, j)) :

Corollary 1 (cor:pairs, Section 4.1), second part. 'If, moreover, the particles at time t and those at time t + 1 are almost surely pairwise distinct under π̄, then the probabilities of {(x̃_t, x̃_{t+1}) ≠ (x_t, x_{t+1})} are nonincreasing from M-BS to FM-BS, BS, and AT, and are at least as large under CM-BS as under FM-BS.' Formalization: the diagonal of X × X is measurable.

theorem CSMC.Paper.prop_washout {X : Type u_1} [MeasurableSpace X] {μ : MeasureTheory.Measure X} {n N : ℕ} [MeasureTheory.SigmaFinite μ] [MeasurableEq X] (hN : 2 ≤ N) (M : FeynmanKac μ n) (t : Fin (n + 1)) :
have P := fun (r : SelectionRule) => (M.target.compProd (M.csmc (M.ruleKernels N r))).real {z : Traj X n × Traj X n | z.2 t ≠ z.1 t}; have β := ∫ (w : Pos X n N × Anc n N × Fin N), ∏ s : Fin n with t ≤ s.castSucc, dobrushin (M.bsprob w.1 s) ∂M.exttarget N; 0 ≤ P SelectionRule.FMBS - P SelectionRule.BS ∧ P SelectionRule.FMBS - P SelectionRule.BS ≤ β ∧ ∀ (ε : ℝ), 0 < ε → ε ≤ 1 → (∀ (s : Fin n) (x x' x'' : X), ε * ↑(M.transdens s x' x'') ≤ ↑(M.transdens s x x'')) → β ≤ (1 - ε) ^ (n - ↑t)

Proposition 2 (prop:washout, Section 4.2). 'Let t ∈ [T]. Then 0 ≤ P_{FM-BS}(x̃_t ≠ x_t) - P_{BS}(x̃_t ≠ x_t) ≤ E(∏_{s=t}^{T-1} β_s), where the expectation is taken under π̄. If there is ε ∈ (0, 1] such that m_{s+1}(x, ·) ≥ ε m_{s+1}(x', ·) for all x, x' ∈ X and s ∈ [T - 1], then the right-hand side is at most (1 - ε)^{T-t}.' With T = n + 1 and the time t.val + 1 of the paper, T - t = n - t.val. The backward steps s ≥ t are those with t ≤ s.castSucc. The inequality between the densities is assumed at every point. Formalization: the diagonal of X × X is measurable.

theorem CSMC.Paper.prop_gain {X : Type u_1} [MeasurableSpace X] {μ : MeasureTheory.Measure X} {n N : ℕ} [MeasureTheory.SigmaFinite μ] [MeasurableEq X] (hN : 2 ≤ N) (M : FeynmanKac μ n) (s : Fin n) (hdist : ∀ᵐ (w : Pos X n N × Anc n N × Fin N) ∂M.exttarget N, ∀ (i j : Fin N), i ≠ j → w.1 (s.castSucc, i) ≠ w.1 (s.castSucc, j)) (r : SelectionRule) (hr : r = SelectionRule.MBS ∨ r = SelectionRule.CMBS) :
have P := fun (r' : SelectionRule) => (M.target.compProd (M.csmc (M.ruleKernels N r'))).real {z : Traj X n × Traj X n | z.2 s.castSucc ≠ z.1 s.castSucc}; (∀ (y : Pos X n N) (j j' : Fin N), 0 ≤ gain (M.bsprob y) (M.ruleKernels N r y) s j j') ∧ ∫ (z : Traj X n × (Idx n N × Pos X n N × Anc n N) × Idx n N), gain (M.bsprob z.2.1.2.1) (M.ruleKernels N r z.2.1.2.1) s (z.2.1.1 s.succ) (z.2.2 s.succ) ∂M.target.compProd (M.algLaw (M.ruleKernels N r)) ≤ P r - P SelectionRule.FMBS

Proposition 3 (prop:gain, Section 4.2). 'Let t ∈ [T - 1] and assume that the particles x_t^1, …, x_t^N are almost surely pairwise distinct under π̄. For j, j' ∈ [N], let γ_t(j, j') := ∑_i B_t(i|j) {B_t(i|j') - K_{t,j,j'}(i, i)}, with the kernels K_{t,j,j'} of M-BS. Then γ_t(j, j') ≥ 0 and P_{M-BS}(x̃_t ≠ x_t) - P_{FM-BS}(x̃_t ≠ x_t) ≥ E_{M-BS}{γ_t(b_{t+1}, l_{t+1})}. The same holds with CM-BS in place of M-BS, in both the kernels and the inequality.' Formalization: the diagonal of X × X is measurable.

theorem CSMC.Paper.gain_MBS_of_ne {n N : ℕ} (W : Fin N → ℝ) (B : Fin n → Matrix (Fin N) (Fin N) ℝ) (s : Fin n) {j j' : Fin N} (hjj' : j ≠ j') :
gain B (SelectionRule.MBS.kernels W B) s j j' = 0

Values of the gains (Section 4.2), for every number of particles. 'For j ≠ j', γ_t(j, j') = 0 for M-BS'.

theorem CSMC.Paper.gain_fin_two {n : ℕ} (W : Fin 2 → ℝ) {B : Fin n → Matrix (Fin 2) (Fin 2) ℝ} (hB : ∀ (s : Fin n) (j : Fin 2), IsProbVector fun (i : Fin 2) => B s i j) (s : Fin n) (j j' : Fin 2) :
gain B (SelectionRule.MBS.kernels W B) s j j = 2 * (1 - max (B s 0 j) (B s 1 j)) ^ 2 ∧ gain B (SelectionRule.CMBS.kernels W B) s j j = 2 * (1 - max (B s 0 j) (B s 1 j)) ^ 2 ∧ (j ≠ j' → gain B (SelectionRule.CMBS.kernels W B) s j j' = 2 * min (B s 0 j * B s 0 j') (B s 1 j * B s 1 j'))

Values of the gains for two particles (Section 4.2). 'For N = 2, γ_t(j, j) = 2{1 - max_i B_t(i|j)}² for both rules. [...] For CM-BS, the gain is also made at the other times, with γ_t(j, j') = 2 min_i B_t(i|j) B_t(i|j') for N = 2 and j ≠ j'.'

The coupling kernel for two particles (Section 4.3). 'With two particles, C_{p,p} = F_p for every probability vector p'.

theorem CSMC.Paper.prop_imh {X : Type u_1} [MeasurableSpace X] {μ : MeasureTheory.Measure X} {n : ℕ} [MeasureTheory.SigmaFinite μ] (M : FeynmanKac μ n) (hm : ∀ (s : Fin n) (x₁ x₂ x' : X), M.transdens s x₁ x' = M.transdens s x₂ x') :
have J := M.target.compProd (M.algLaw (M.ruleKernels 2 SelectionRule.CMBS)); MeasureTheory.Measure.map (fun (z : Traj X n × (Idx n 2 × Pos X n 2 × Anc n 2) × Idx n 2) => ((z.2.1.2.1, z.2.1.1), z.2.2)) J = (MeasureTheory.Measure.map (fun (z : Traj X n × (Idx n 2 × Pos X n 2 × Anc n 2) × Idx n 2) => (z.2.1.2.1, z.2.1.1)) J).compProd (kernelOfMassFn fun (yb : Pos X n 2 × Idx n 2) (l : Idx n 2) => (∏ t : Fin (n + 1), forced (M.weight yb.1 t) (yb.2 t) (l t)).toNNReal)

Proposition 4 (prop:imh, Section 4.3). 'Let N = 2, and assume that, for s ∈ [T - 1], m_{s+1}(x, x') does not depend on x. Then, under CM-BS and conditionally on x and b_{1:T}, the indices l_1, …, l_T are independent, with l_t ∼ F_{W_t}(b_t, ·).' The conclusion states that the joint distribution of the particle positions, the indices of the reference, and the indices of the output is the distribution of the first two followed by the kernel with mass function l ↦ ∏_t F_{W_t}(b_t, l_t).

theorem CSMC.Paper.coincidence_uniform {n N : ℕ} (hN : 2 ≤ N) {W : Fin N → ℝ} {B : Fin n → Matrix (Fin N) (Fin N) ℝ} (hW : ∀ (i : Fin N), W i = 1 / ↑N) (hB : ∀ (s : Fin n) (i j : Fin N), B s i j = 1 / ↑N) (t : Fin (n + 1)) :
∑ i : Fin N, marg W B (SelectionRule.CMBS.kernels W B) t i i = 0 ∧ ∑ i : Fin N, marg W B (SelectionRule.BS.kernels W B) t i i = 1 / ↑N ∧ (t ≠ Fin.last n → ∑ i : Fin N, marg W B (SelectionRule.FMBS.kernels W B) t i i = 1 / ↑N) ∧ ∑ i : Fin N, marg W B (SelectionRule.MBS.kernels W B) t i i = (1 - (-1 / ↑N) ^ (n - ↑t)) / (↑N + 1)

Probabilities with uniform weights (Section 4.3). 'If the probabilities W_T and B_t(·|j), t ∈ [T - 1], j ∈ [N], are uniform [...] By Lemma 4, l_t ≠ b_t almost surely for every t ∈ [T] under CM-BS, whereas P_𝐱(l_t = b_t) = 1/N under BS, and under FM-BS for t < T. Under M-BS, [...] P_𝐱(l_t = b_t) = (1 - (-1/N)^{T-t}) / (N + 1)'. P_𝐱 is the probability conditional on the particle positions 𝐱: by Lemma 4, P_𝐱(l_t = b_t) is ∑_i marg W B K t i i with the final weights W, the backward-sampling probabilities B, and the kernels K of the rule. With T = n + 1 and the time t.val + 1 of the paper, T - t = n - t.val.

Section S3: potential functions of the previous state and other resampling schemes #

theorem CSMC.Paper.lem_extended_previous {X : Type u_1} [MeasurableSpace X] {μ : MeasureTheory.Measure X} {n N : ℕ} [MeasureTheory.SigmaFinite μ] (_hN : 2 ≤ N) (M : PreviousState.Model μ n) {resdist : Fin n → (Fin N → X) → (Fin N → ℝ) → (Fin N → Fin N) → ℝ} (hr : ∀ (s : Fin n), PreviousState.IsUnbiasedResampling (resdist s)) (hrm : ∀ (s : Fin n) (a : Fin N → Fin N), Measurable fun (xw : (Fin N → X) × (Fin N → ℝ)) => resdist s xw.1 xw.2 a) (r : SelectionRule) :
have J := M.target.compProd (M.forwardPass resdist r.diagKernel); J = MeasureTheory.Measure.map (fun (w : Pos X n N × Anc n N × Idx n N) => (trajOf w.1 w.2.2, w)) (M.extMeasure resdist r.diagKernel) ∧ MeasureTheory.Measure.map Prod.snd J = M.extMeasure resdist r.diagKernel

Lemma S1 (lem:extended-previous, Section S3.2). 'Let x_{1:T} ∼ π and run steps (a) and (b) of Algorithm S1, with c drawn from the kernels K_{t,j,j} of one of the six selection rules. Then x_{1:T} = (x_1^{b_1}, …, x_T^{b_T}) and (x, a, b_{1:T}) has the density (S4).' The resampling schemes r_t (Definition S1) are resdist. The first conjunct states that the joint distribution of the reference trajectory and of (x, a, b_{1:T}) is the image of the distribution of (x, a, b_{1:T}) under the map which adds (x_1^{b_1}, …, x_T^{b_T}), so that x_{1:T} = (x_1^{b_1}, …, x_T^{b_T}). Formalization: the resampling schemes are measurable functions of the particles and the weights.

theorem CSMC.Paper.lem_extended_previous_marginal {X : Type u_1} [MeasurableSpace X] {μ : MeasureTheory.Measure X} {n N : ℕ} [MeasureTheory.SigmaFinite μ] (hN : 2 ≤ N) (M : PreviousState.Model μ n) {resdist : Fin n → (Fin N → X) → (Fin N → ℝ) → (Fin N → Fin N) → ℝ} (hrm : ∀ (s : Fin n) (a : Fin N → Fin N), Measurable fun (xw : (Fin N → X) × (Fin N → ℝ)) => resdist s xw.1 xw.2 a) (r : SelectionRule) :
ProbabilityTheory.IsMarkovKernel (M.refChain r.diagKernel) ∧ MeasureTheory.Measure.map (fun (w : Pos X n N × Anc n N × Idx n N) => (w.1, w.2.1)) (M.extMeasure resdist r.diagKernel) = M.posAncMeasure resdist ∧ MeasureTheory.Measure.map (fun (w : Pos X n N × Anc n N × Idx n N) => ((w.1, w.2.1), w.2.2)) (M.extMeasure resdist r.diagKernel) = (M.posAncMeasure resdist).compProd (M.refChain r.diagKernel)

The marginal density of (x, a) (Section S3.2, after Lemma S1). 'The density (S4) is the product of a function of (x, a) and of W_T^{b_T} ∏_{t=1}^{T-1} K_{t,b_{t+1},b_{t+1}}(a_t^{b_{t+1}}, b_t), which is a probability distribution of b_{1:T}. Hence the marginal density of (x, a) does not depend on the selection rule. Conditionally on (x, a), b_T ∼ W_T and, for t = T - 1, …, 1, given also b_{t+1:T}, b_t ∼ K_{t,b_{t+1},b_{t+1}}(a_t^{b_{t+1}}, ·).' The function of (x, a) is posAncDensity. The distribution with this density, posAncMeasure, does not depend on the selection rule. The kernel refChain r.diagKernel has the mass function b_{1:T} ↦ W_T^{b_T} ∏_t K_{t,b_{t+1},b_{t+1}}(a_t^{b_{t+1}}, b_t), under which b_T ∼ W_T and, given b_{t+1:T}, b_t ∼ K_{t,b_{t+1},b_{t+1}}(a_t^{b_{t+1}}, ·). The three conjuncts state that this mass function is a probability distribution of b_{1:T}, that (x, a) has the distribution posAncMeasure, and that (x, a, b_{1:T}) has the distribution of (x, a) followed by refChain r.diagKernel. Formalization: the resampling schemes are measurable functions of the particles and the weights.

theorem CSMC.Paper.lem_extended_previous_converse {X : Type u_1} [MeasurableSpace X] {μ : MeasureTheory.Measure X} {n N : ℕ} [MeasureTheory.SigmaFinite μ] (hN : 2 ≤ N) (M : PreviousState.Model μ n) {resdist : Fin n → (Fin N → X) → (Fin N → ℝ) → (Fin N → Fin N) → ℝ} (hr : ∀ (s : Fin n), PreviousState.IsUnbiasedResampling (resdist s)) (hrm : ∀ (s : Fin n) (a : Fin N → Fin N), Measurable fun (xw : (Fin N → X) × (Fin N → ℝ)) => resdist s xw.1 xw.2 a) (r : SelectionRule) :
MeasureTheory.Measure.map (fun (w : Pos X n N × Anc n N × Idx n N) => trajOf w.1 w.2.2) (M.extMeasure resdist r.diagKernel) = M.target

Converse of Lemma S1 (Section S3.2). 'Conversely, by Lemma S1, if (x, a, b_{1:T}) has the density (S4), then (x_1^{b_1}, …, x_T^{b_T}) ∼ π.' Formalization: the resampling schemes are measurable functions of the particles and the weights.

theorem CSMC.Paper.prop_previous_state {X : Type u_1} [MeasurableSpace X] {μ : MeasureTheory.Measure X} {n N : ℕ} [MeasureTheory.SigmaFinite μ] (hN : 2 ≤ N) (M : PreviousState.Model μ n) {resdist : Fin n → (Fin N → X) → (Fin N → ℝ) → (Fin N → Fin N) → ℝ} (hr : ∀ (s : Fin n), PreviousState.IsUnbiasedResampling (resdist s)) (hrm : ∀ (s : Fin n) (a : Fin N → Fin N), Measurable fun (xw : (Fin N → X) × (Fin N → ℝ)) => resdist s xw.1 xw.2 a) (K : Pos X n N × Anc n N → BackwardKernels (Fin N) n) (hK : ∀ (ya : Pos X n N × Anc n N), Admissible (M.weight ya.1 ya.2 (Fin.last n)) (M.bsprob ya.1 ya.2) (K ya)) (hKm : MeasurableKernels K) :

Proposition S1 (prop:previous-state, Section S3.2). 'For any kernels K_T and K_{t,j,j'} as in Algorithm S1, the Markov kernel defined by Algorithm S1 is reversible with respect to π.' The two conjuncts state that the kernel defined by Algorithm S1 is a Markov kernel and is reversible with respect to π. Formalization: the resampling schemes are measurable functions of the particles and the weights.

theorem CSMC.Paper.prop_orderings_thm_ordering {X : Type u_1} [MeasurableSpace X] {μ : MeasureTheory.Measure X} {n N : ℕ} [MeasureTheory.SigmaFinite μ] (hN : 2 ≤ N) (M : PreviousState.Model μ n) {resdist : Fin n → (Fin N → X) → (Fin N → ℝ) → (Fin N → Fin N) → ℝ} (hr : ∀ (s : Fin n), PreviousState.IsUnbiasedResampling (resdist s)) (hrm : ∀ (s : Fin n) (a : Fin N → Fin N), Measurable fun (xw : (Fin N → X) × (Fin N → ℝ)) => resdist s xw.1 xw.2 a) (t : Fin (n + 1)) {f : X → ℝ} (_hf : Measurable f) (hf2 : MeasureTheory.MemLp (fun (x : Traj X n) => f (x t)) 2 M.target) :

Proposition S2 (prop:orderings, Section S3.2), first part of Theorem 1. 'Let x̃_{1:T} be the output of Algorithm S1 started from x_{1:T} ∼ π. Theorem 1, Corollary 1, and Propositions 2 and 3 of the main text hold with the probabilities (S3), with the distribution (S4) in place of π̄, and, in Proposition 2, with m_{s+1}(x, ·) g_{s+1}(x, ·) ≥ ε m_{s+1}(x', ·) g_{s+1}(x', ·) in place of the condition on m_{s+1}.' Formalization: the resampling schemes are measurable functions of the particles and the weights.

theorem CSMC.Paper.prop_orderings_thm_ordering_updateRate {X : Type u_1} [MeasurableSpace X] {μ : MeasureTheory.Measure X} {n N : ℕ} [MeasureTheory.SigmaFinite μ] [MeasurableEq X] (hN : 2 ≤ N) (M : PreviousState.Model μ n) {resdist : Fin n → (Fin N → X) → (Fin N → ℝ) → (Fin N → Fin N) → ℝ} (hr : ∀ (s : Fin n), PreviousState.IsUnbiasedResampling (resdist s)) (hrm : ∀ (s : Fin n) (a : Fin N → Fin N), Measurable fun (xw : (Fin N → X) × (Fin N → ℝ)) => resdist s xw.1 xw.2 a) (t : Fin (n + 1)) :

Proposition S2 (prop:orderings, Section S3.2), second part of Theorem 1: the update rates of Algorithm S1 are ordered as in Theorem 1. Formalization: the resampling schemes are measurable functions of the particles and the weights. The diagonal of X × X is measurable.

theorem CSMC.Paper.prop_orderings_cor_pairs {X : Type u_1} [MeasurableSpace X] {μ : MeasureTheory.Measure X} {n N : ℕ} [MeasureTheory.SigmaFinite μ] (hN : 2 ≤ N) (M : PreviousState.Model μ n) {resdist : Fin n → (Fin N → X) → (Fin N → ℝ) → (Fin N → Fin N) → ℝ} (hr : ∀ (s : Fin n), PreviousState.IsUnbiasedResampling (resdist s)) (hrm : ∀ (s : Fin n) (a : Fin N → Fin N), Measurable fun (xw : (Fin N → X) × (Fin N → ℝ)) => resdist s xw.1 xw.2 a) (s : Fin n) {f : X × X → ℝ} (_hf : Measurable f) (hf2 : MeasureTheory.MemLp (fun (x : Traj X n) => f (x s.castSucc, x s.succ)) 2 M.target) :

Proposition S2 (prop:orderings, Section S3.2), first part of Corollary 1 for Algorithm S1. Formalization: the resampling schemes are measurable functions of the particles and the weights.

theorem CSMC.Paper.prop_orderings_cor_pairs_updateRate {X : Type u_1} [MeasurableSpace X] {μ : MeasureTheory.Measure X} {n N : ℕ} [MeasureTheory.SigmaFinite μ] [MeasurableEq X] (hN : 2 ≤ N) (M : PreviousState.Model μ n) {resdist : Fin n → (Fin N → X) → (Fin N → ℝ) → (Fin N → Fin N) → ℝ} (hr : ∀ (s : Fin n), PreviousState.IsUnbiasedResampling (resdist s)) (hrm : ∀ (s : Fin n) (a : Fin N → Fin N), Measurable fun (xw : (Fin N → X) × (Fin N → ℝ)) => resdist s xw.1 xw.2 a) (s : Fin n) (hdist : ∀ᵐ (w : Pos X n N × Anc n N × Idx n N) ∂M.extMeasure resdist gibbs, ∀ (i j : Fin N), i ≠ j → w.1 (s.castSucc, i) ≠ w.1 (s.castSucc, j) ∧ w.1 (s.succ, i) ≠ w.1 (s.succ, j)) :

Proposition S2 (prop:orderings, Section S3.2), second part of Corollary 1 for Algorithm S1, with the distribution (S4) of Algorithm S1 in place of π̄. Formalization: the resampling schemes are measurable functions of the particles and the weights. The diagonal of X × X is measurable.

theorem CSMC.Paper.prop_orderings_washout {X : Type u_1} [MeasurableSpace X] {μ : MeasureTheory.Measure X} {n N : ℕ} [MeasureTheory.SigmaFinite μ] [MeasurableEq X] (hN : 2 ≤ N) (M : PreviousState.Model μ n) {resdist : Fin n → (Fin N → X) → (Fin N → ℝ) → (Fin N → Fin N) → ℝ} (hr : ∀ (s : Fin n), PreviousState.IsUnbiasedResampling (resdist s)) (hrm : ∀ (s : Fin n) (a : Fin N → Fin N), Measurable fun (xw : (Fin N → X) × (Fin N → ℝ)) => resdist s xw.1 xw.2 a) (t : Fin (n + 1)) :
have P := fun (r : SelectionRule) => (M.target.compProd (M.csmc resdist (M.ruleKernels N r))).real {z : Traj X n × Traj X n | z.2 t ≠ z.1 t}; have β := ∫ (w : Pos X n N × Anc n N × Idx n N), ∏ s : Fin n with t ≤ s.castSucc, dobrushin (M.bsprob w.1 w.2.1 s) ∂M.extMeasure resdist gibbs; 0 ≤ P SelectionRule.FMBS - P SelectionRule.BS ∧ P SelectionRule.FMBS - P SelectionRule.BS ≤ β ∧ ∀ (ε : ℝ), 0 < ε → ε ≤ 1 → (∀ (s : Fin n) (x x' x'' : X), ε * (↑(M.transdens s x' x'') * ↑(M.pot s x' x'')) ≤ ↑(M.transdens s x x'') * ↑(M.pot s x x'')) → β ≤ (1 - ε) ^ (n - ↑t)

Proposition S2 (prop:orderings, Section S3.2), Proposition 2 for Algorithm S1, with the distribution (S4) of Algorithm S1 in place of π̄ and the condition m_{s+1}(x, ·) g_{s+1}(x, ·) ≥ ε m_{s+1}(x', ·) g_{s+1}(x', ·). Formalization: the resampling schemes are measurable functions of the particles and the weights. The diagonal of X × X is measurable.

theorem CSMC.Paper.prop_orderings_gain {X : Type u_1} [MeasurableSpace X] {μ : MeasureTheory.Measure X} {n N : ℕ} [MeasureTheory.SigmaFinite μ] [MeasurableEq X] (hN : 2 ≤ N) (M : PreviousState.Model μ n) {resdist : Fin n → (Fin N → X) → (Fin N → ℝ) → (Fin N → Fin N) → ℝ} (hr : ∀ (s : Fin n), PreviousState.IsUnbiasedResampling (resdist s)) (hrm : ∀ (s : Fin n) (a : Fin N → Fin N), Measurable fun (xw : (Fin N → X) × (Fin N → ℝ)) => resdist s xw.1 xw.2 a) (s : Fin n) (hdist : ∀ᵐ (w : Pos X n N × Anc n N × Idx n N) ∂M.extMeasure resdist gibbs, ∀ (i j : Fin N), i ≠ j → w.1 (s.castSucc, i) ≠ w.1 (s.castSucc, j)) (r : SelectionRule) (hr' : r = SelectionRule.MBS ∨ r = SelectionRule.CMBS) :
have P := fun (r' : SelectionRule) => (M.target.compProd (M.csmc resdist (M.ruleKernels N r'))).real {z : Traj X n × Traj X n | z.2 s.castSucc ≠ z.1 s.castSucc}; (∀ (y : Pos X n N) (a : Anc n N) (j j' : Fin N), 0 ≤ gain (M.bsprob y a) (M.ruleKernels N r (y, a)) s j j') ∧ ∫ (z : Traj X n × (Pos X n N × Anc n N × Idx n N) × Idx n N), gain (M.bsprob z.2.1.1 z.2.1.2.1) (M.ruleKernels N r (z.2.1.1, z.2.1.2.1)) s (z.2.1.2.2 s.succ) (z.2.2 s.succ) ∂M.target.compProd (M.algLaw resdist (M.ruleKernels N r)) ≤ P r - P SelectionRule.FMBS

Proposition S2 (prop:orderings, Section S3.2), Proposition 3 for Algorithm S1, with the distribution (S4) of Algorithm S1 in place of π̄ and the probabilities (S3) in the gains. Formalization: the resampling schemes are measurable functions of the particles and the weights. The diagonal of X × X is measurable.

theorem CSMC.Paper.prop_reduction {X : Type u_1} [MeasurableSpace X] {μ : MeasureTheory.Measure X} {n N : ℕ} [MeasureTheory.SigmaFinite μ] (hN : 2 ≤ N) (M : FeynmanKac μ n) (M' : PreviousState.Model μ n) (h₁ : M'.transdens₁ = M.transdens₁) (h₂ : M'.transdens = M.transdens) (h₃ : M'.pot₁ = M.pot 0) (h₄ : ∀ (s : Fin n) (x x' : X), M'.pot s x x' = M.pot s.succ x') (K : Pos X n N → BackwardKernels (Fin N) n) (hK : ∀ (y : Pos X n N), Admissible (M.weight y (Fin.last n)) (M.bsprob y) (K y)) (hKm : MeasurableKernels K) :
M'.target.compProd (M'.csmc (fun (x : Fin n) => PreviousState.multinomial) fun (ya : Pos X n N × Anc n N) => K ya.1) = M.target.compProd (M.csmc K)

Proposition S3 (prop:reduction, Section S3.2). 'Assume multinomial resampling, and that g_t(x_{t-1}, x_t) does not depend on x_{t-1} for 2 ≤ t ≤ T. Then, for x_{1:T} ∼ π and any kernels as in Algorithm 1, the reference and the output have the same joint distribution under Algorithm S1 as under Algorithm 1.' The model M' of Section S3 has the densities of the model M of the main text, with the potential functions g_1 and g_t(x_{t-1}, x_t) = g_t(x_t) of M.

theorem CSMC.Paper.prop_ancestors {X : Type u_1} [MeasurableSpace X] {μ : MeasureTheory.Measure X} {n N : ℕ} [MeasureTheory.SigmaFinite μ] (hN : 2 ≤ N) (M : PreviousState.Model μ n) {resdist : Fin n → (Fin N → X) → (Fin N → ℝ) → (Fin N → Fin N) → ℝ} (hr : ∀ (s : Fin n), PreviousState.IsUnbiasedResampling (resdist s)) (hrm : ∀ (s : Fin n) (a : Fin N → Fin N), Measurable fun (xw : (Fin N → X) × (Fin N → ℝ)) => resdist s xw.1 xw.2 a) :

Proposition S4 (prop:ancestors, Section S3.3). 'The Markov kernel defined by Algorithm S2 leaves π invariant. With the kernels of AT and FM-AT, it is reversible with respect to π.' In Algorithm S2, the kernels are those of AT, FM-AT, BS, FM-BS, or M-BS. Formalization: the resampling schemes are measurable functions of the particles and the weights.

theorem CSMC.Paper.prop_ancestors_sampling {X : Type u_1} [MeasurableSpace X] {μ : MeasureTheory.Measure X} {n N : ℕ} [MeasureTheory.SigmaFinite μ] (hN : 2 ≤ N) (M : PreviousState.Model μ n) {resdist : Fin n → (Fin N → X) → (Fin N → ℝ) → (Fin N → Fin N) → ℝ} (hr : ∀ (s : Fin n), PreviousState.IsUnbiasedResampling (resdist s)) (hrm : ∀ (s : Fin n) (a : Fin N → Fin N), Measurable fun (xw : (Fin N → X) × (Fin N → ℝ)) => resdist s xw.1 xw.2 a) :

Ancestor sampling in Algorithm S2 (Section S3.3, after Proposition S4). 'The proof uses Algorithm S2.a only through b_T ∼ W_T conditionally on (x, a), which holds for all the kernels of Lemma S1, so that the invariance also holds with ancestor sampling in Algorithm S2.a.' In the Markov kernel csmcAncWith resdist C r, c is drawn in Algorithm S2.a from C(B_t(·|x_{t+1}))(b_t, ·), as in Lemma S1, in place of c = b_t. The kernels of steps (b) and (c) are those of the selection rule r. The first conjunct is the invariance with ancestor sampling, that is, with the Gibbs kernels C(p)(i, ·) = p. The second is the invariance with the kernels K_{t,j,j} of each of the six selection rules r', those of Lemma S1. In Algorithm S2, the kernels are those of AT, FM-AT, BS, FM-BS, or M-BS. Formalization: the resampling schemes are measurable functions of the particles and the weights.