Fact 2 with (13)–(14) — with probability ≥ 1 − 2(nm)^{−1/3}, d(s∗, t′_i) ≤ d(s∗, t_i) + 2ε|P| for all i
ProvedClosestString.PTAS.fact_2Fix strings () of length , , an admissible tuple of length- substrings (Figure 3, step 1) with agreement set and , a string of length , length- substrings of , and . Let be the string with and . Let be the multiset of independent uniform positions of (step 1(b)), and for each let be any length- substring of that minimizes the objective of step 1(c)(i) for ,
Then, with probability at least over ,
In the proof of Theorem 9, is an optimal center, the substrings closest to it and the tuple the one of Fact 1; then the substrings found from the sample are almost as close to as the optimal ones. The probability bound is the last sentence of the proof (p. 11), obtained from (13)–(14).
Differences from the source:
- generalization: s an optimal center, t_i the substrings closest to s, t_{i1},…,t_{ir} satisfying Fact 1 → any string s, any substrings t_i of s_i, any admissible tuple; reason: the proof of Fact 2 uses none of these properties; the paper's choice is a special case
- generalization: t′_i "defined as in step 1(c)(i)" → t′_i = sel R i for any selection sel that minimizes the step-1(c)(i) objective for every R and i; reason: covers every tie-breaking rule, in particular the smallest-start rule of the algorithm's definition
- reading: "With high probability" → probability at least 1 − 2(nm)^{−1/3}; reason: the value the proof derives (p. 11)
- reading: log(nm) → Real.log, the natural logarithm; reason: (11) needs exp(−ε²|R|/2) ≤ (nm)^{−2}, i.e. |R| ≥ (4/ε²) ln(nm), which is exactly the printed computation with ln
- encoding: R a multiset of uniformly random positions from P → sampleLaw P k: product of k uniform laws on P; the Dirac mass at the constant multiset 0 when P = ∅; reason: when P = ∅ the sample is never read (weight |P|/|R| = 0) and the event holds surely; same instances
- encoding: positions 1..L, s_1..s_n, substrings → 0-based Fin L, Fin n; substrings by start position p with p + L ≤ m; real-valued objective; reason: relabelling; changes no instance
import Mathlib import Definitions.Def_ClosestString_PTAS_Algorithm
namespace ClosestString.PTAS
/-- **Fact 2** with (13)–(14) (Li, Ma & Wang, arXiv:cs/0002012v1, statement p. 10, probability in the
last sentence of its proof, p. 11), for any center `s` of length `L`, any substrings `t_i` of the
`s_i` (start positions `t i`), any admissible tuple `τ` and any `ε > 0`: let `P = P_τ`,
`s∗ = s` on `P` and `t_{i1}` on `Q_τ`, and let `t′_i = sel R i` be any substring that step 1(c)(i)
of Figure 3 may choose for `y = s|R` (any minimizer of the step-1(c)(i) objective). Over the random multiset `R` of `⌈(4/ε²) ln(nm)⌉` independent
uniform positions of `P`, with probability at least `1 − 2(nm)^{−1/3}`,
`d(s∗, t′_i) ≤ d(s∗, t_i) + 2ε|P|` for all `i`. -/
theorem fact_2 {A : Type*} [Fintype A] [DecidableEq A] {n m L r : ℕ} [NeZero n] [NeZero L]
[NeZero r] (S : Fin n → Fin m → A) (hL : L ≤ m) (τ : AdmTuple n m L r) (s : Fin L → A)
(t : Fin n → Start m L) (ε : ℝ) (hε : 0 < ε)
(sel : (Fin (sampleSize n m ε) → Fin L) → Fin n → Start m L)
(hsel : ∀ R i p, score S τ (fun a => s (R a)) R i (sel R i) ≤ score S τ (fun a => s (R a)) R i p) :
ENNReal.ofReal (1 - 2 * ((n : ℝ) * m) ^ (-(1 / 3 : ℝ))) ≤
sampleLaw (diffP S τ) (sampleSize n m ε)
{R | ∀ i : Fin n,
(hammingDist (splice (diffP S τ) s (firstStr S τ))
(substr (S i) (sel R i)) : ℝ)
≤ hammingDist (splice (diffP S τ) s (firstStr S τ)) (substr (S i) (t i))
+ 2 * ε * (diffP S τ).card} := by sorry
end ClosestString.PTAS
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.