Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Claim 3 — min{ρ₀ − 1, ρ₂ − ρ₃, …, ρ_r − ρ_{r+1}} ≤ 1/(2r−1)

Proved
ClosestString.PTAS.claim_3

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

closest-stringcombinatoricshamming-distancep2o-batch-pfp2ap2o-gran-per-chapterp2o-plan-paperp2o-strengthenedp2o-v1

Let u1,…,unu_1,\dots,u_nu1​,…,un​ be strings of one length, ccc a string of that length and d≥0d\ge0d≥0 an integer with d(ui,c)≤dd(u_i,c)\le dd(ui​,c)≤d for every iii, and let r≥1r\ge1r≥1. With ρ0d=max⁡i,jd(ui,uj)\rho_0d=\max_{i,j}d(u_i,u_j)ρ0​d=maxi,j​d(ui​,uj​) and ρkd=min⁡i1,…,ikpi1,…,ik\rho_kd=\min_{i_1,\dots,i_k}p_{i_1,\dots,i_k}ρk​d=mini1​,…,ik​​pi1​,…,ik​​ as in Section 2 (index tuples with repetitions),

min⁡{ρ0−1, ρ2−ρ3, ρ3−ρ4, …, ρr−ρr+1} ≤ 12r−1,\min\{\rho_0-1,\ \rho_2-\rho_3,\ \rho_3-\rho_4,\ \dots,\ \rho_r-\rho_{r+1}\}\ \le\ \frac1{2r-1},min{ρ0​−1, ρ2​−ρ3​, ρ3​−ρ4​, …, ρr​−ρr+1​} ≤ 2r−11​,

that is, ρ0d−d≤d/(2r−1)\rho_0d-d\le d/(2r-1)ρ0​d−d≤d/(2r−1), or ρkd−ρk+1d≤d/(2r−1)\rho_kd-\rho_{k+1}d\le d/(2r-1)ρk​d−ρk+1​d≤d/(2r−1) for some 2≤k≤r2\le k\le r2≤k≤r.

Together with Claim 2 it proves Lemma 1: when ρ0>1+1/(2r−1)\rho_0>1+1/(2r-1)ρ0​>1+1/(2r−1) the first alternative is excluded.

Differences from the source:

  • reading: Section 2 defines Q_{i1,…,ik} for "k distinct numbers" → index tuples idx : Fin k → Fin n with repetitions allowed; reason: Lemma 1's own statement does not require distinct indices and Figure 3 allows repeats; with distinct indices Claim 3 needs ρ_{r+1}, which does not exist when n < r + 1 (never excluded)
  • generalization: s is the optimal Closest String center and d_opt = max_i d(s_i, s) → any center c and any d with d(u_i, c) ≤ d for all i; reason: the proof uses only the radius bound; c = s, d = d_opt is the paper's case, and Theorem 9 applies the result with u = t (p. 9)
  • encoding: ratios ρ₀ = max d(s_i,s_j)/d_opt and ρ_k = min p/d_opt → the inequality multiplied by d: maxPairDist − d ≤ d/(2r−1) or minMismatch k − minMismatch (k+1) ≤ d/(2r−1), in ℝ; the minimum written as a disjunction; reason: avoids dividing by d_opt, which may be 0; equivalent whenever d_opt > 0
  • reading: r, "the constant in the algorithm" → any integer r ≥ 1; reason: 1/(2r−1) needs r ≥ 1; the paper's r ≥ 2 is included
Preamble
import Mathlib
import Definitions.Def_ClosestString_PTAS_Basic
Formal statement
namespace ClosestString.PTAS

/-- **Claim 3** (Li, Ma & Wang, arXiv:cs/0002012v1, p. 4), multiplied out by `d`, for any strings
`u_1, …, u_n` of one length, any center `c` with `d(u_i, c) ≤ d` for all `i`, and `r ≥ 1`:
`min{ρ₀ − 1, ρ₂ − ρ₃, …, ρ_r − ρ_{r+1}} ≤ 1/(2r−1)`, i.e.
`max_{i,j} d(u_i, u_j) − d ≤ d/(2r−1)` or some `2 ≤ k ≤ r` has
`ρ_k d − ρ_{k+1} d ≤ d/(2r−1)`. -/
theorem claim_3 {A : Type*} [DecidableEq A] {n m : ℕ} (u : Fin n → Fin m → A) (c : Fin m → A)
    (d : ℕ) (hd : ∀ i, hammingDist (u i) c ≤ d) (r : ℕ) (hr : 1 ≤ r) :
    (maxPairDist u : ℝ) - d ≤ d / (2 * (r : ℝ) - 1) ∨
      ∃ k : ℕ, 2 ≤ k ∧ k ≤ r ∧
        (minMismatch u c k : ℝ) - minMismatch u c (k + 1) ≤ d / (2 * (r : ℝ) - 1) := by sorry

end ClosestString.PTAS
Source
Li, Ma & Wang, On the Closest String and Substring Problems, arXiv:cs/0002012v1, p. 4, Claim 3
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