Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

(11)–(12) — the sampled estimate ρ d^R + d^Q falls ε|P| below d with probability ≤ (nm)^{−2} and ε|P| above with probability ≤ (nm)^{−4/3}

Proved
ClosestString.PTAS.eq_11_12

by mikedeng1 · Oct 24, 2026 · Mathlib 0df444a (Lean v4.33.1)

hamming-distancep2o-batch-pfp2ap2o-gran-per-chapterp2o-plan-paperp2o-strengthenedp2o-v1probabilityrandom-sampling

Let u,vu,vu,v be strings of length LLL, PPP a nonempty set of positions and QQQ its complement. Let RRR be a multiset of kkk positions drawn independently and uniformly from PPP (with replacement), ρ=∣P∣/k\rho=|P|/kρ=∣P∣/k, and dR(u,v)d^R(u,v)dR(u,v) the number of entries of RRR (with multiplicity) at which uuu and vvv differ. Let ε>0\varepsilon>0ε>0 and N≥1N\ge1N≥1 with k≥(4/ε2)ln⁡Nk\ge(4/\varepsilon^2)\ln Nk≥(4/ε2)lnN. Then

Pr⁡(ρ dR(u,v)+dQ(u,v)≤d(u,v)−ε∣P∣)≤exp⁡ ⁣(−12ε2k) and ≤N−2,Pr⁡(ρ dR(u,v)+dQ(u,v)≥d(u,v)+ε∣P∣)≤N−4/3.\Pr\big(\rho\,d^R(u,v)+d^Q(u,v)\le d(u,v)-\varepsilon|P|\big)\le \exp\!\big(-\tfrac12\varepsilon^2 k\big)\ \text{and}\ \le N^{-2},\qquad \Pr\big(\rho\,d^R(u,v)+d^Q(u,v)\ge d(u,v)+\varepsilon|P|\big)\le N^{-4/3}.Pr(ρdR(u,v)+dQ(u,v)≤d(u,v)−ε∣P∣)≤exp(−21​ε2k) and ≤N−2,Pr(ρdR(u,v)+dQ(u,v)≥d(u,v)+ε∣P∣)≤N−4/3.

In the paper N=nmN=nmN=nm, k=∣R∣=⌈(4/ε2)log⁡(nm)⌉k=|R|=\lceil(4/\varepsilon^2)\log(nm)\rceilk=∣R∣=⌈(4/ε2)log(nm)⌉, u=s∗u=s^*u=s∗ and v=t′v=t'v=t′ or tit_iti​; these are the inequalities (11) and (12) of the proof of Fact 2. They say that the sampled distance, rescaled by ρ\rhoρ, is a good estimate of the distance on PPP.

Differences from the source:

  • generalization: N = nm, |R| = ⌈(4/ε²) log(nm)⌉, u = s∗, v = t′ or t_i → any real N ≥ 1, any k ≥ (4/ε²) ln N (including k = 0), any strings u, v; reason: the proof uses only |R| ≥ (4/ε²) ln(nm); the paper's choice is the case N = nm
  • 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 of P, ρ = |P|/|R| → R : Fin k → Fin L with law Measure.pi of k uniform laws on P; ρ = (|P| : ℝ)/k; reason: the paper's sampling with replacement; same law
Preamble
import Mathlib
import Definitions.Def_ClosestString_PTAS_Basic
Formal statement
namespace ClosestString.PTAS

open MeasureTheory

/-- **(11)–(12)** (proof of Fact 2, Li, Ma & Wang, arXiv:cs/0002012v1, p. 11): for strings `u, v`
of length `L`, a nonempty position set `P` with complement `Q`, a multiset `R` of `k` independent
uniform positions of `P`, `ρ = |P|/k`, `ε > 0` and `N ≥ 1` with `k ≥ (4/ε²) ln N`:
`Pr(ρ d^R(u,v) + d^Q(u,v) ≤ d(u,v) − ε|P|) ≤ exp(−ε²k/2)` and `≤ N^{−2}`, and
`Pr(ρ d^R(u,v) + d^Q(u,v) ≥ d(u,v) + ε|P|) ≤ N^{−4/3}`. -/
theorem eq_11_12 {A : Type*} [DecidableEq A] {L : ℕ} (u v : Fin L → A) (P : Finset (Fin L))
    (hP : P.Nonempty) (k : ℕ) (ε : ℝ) (hε : 0 < ε) (N : ℝ) (hN : 1 ≤ N)
    (hk : 4 / ε ^ 2 * Real.log N ≤ k) :
    Measure.pi (fun _ : Fin k => (PMF.uniformOfFinset P hP).toMeasure)
        {R | (P.card / k : ℝ) * distSample R u v + distOn Pᶜ u v
              ≤ (hammingDist u v : ℝ) - ε * P.card}
        ≤ ENNReal.ofReal (Real.exp (-(1 / 2) * ε ^ 2 * k)) ∧
      Measure.pi (fun _ : Fin k => (PMF.uniformOfFinset P hP).toMeasure)
        {R | (P.card / k : ℝ) * distSample R u v + distOn Pᶜ u v
              ≤ (hammingDist u v : ℝ) - ε * P.card}
        ≤ ENNReal.ofReal (N ^ (-(2 : ℝ))) ∧
      Measure.pi (fun _ : Fin k => (PMF.uniformOfFinset P hP).toMeasure)
        {R | (hammingDist u v : ℝ) + ε * P.card
              ≤ (P.card / k : ℝ) * distSample R u v + distOn Pᶜ u v}
        ≤ ENNReal.ofReal (N ^ (-(4 / 3 : ℝ))) := by sorry

end ClosestString.PTAS
Source
Li, Ma & Wang, On the Closest String and Substring Problems, arXiv:cs/0002012v1, p. 11, eqs. (11)–(12) (proof of Fact 2)
Human review
  • Endorsed by Shuze Chen · Oct 24, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 24, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me