Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lemma 6 — a path to (k+1, k) through the centre diagonal costs at least 5 + (μ_{k+1} + μ_k)π

Proved
MasekPaterson.Necessity.Pstar_split_bound

by mikedeng1 · Sep 27, 2026 · Mathlib 0df444a (Lean v4.33.1)

dynamic-programmingedit-distancep2o-batch-p100ap2o-gran-per-chapterp2o-plan-paperp2o-v1

In the §4.1 example, for all natural numbers kkk and k′k'k′ with 0≤k′≤k0 \le k' \le k0≤k′≤k,

P∗(0,0,k′)+5+P∗(k′+1,k′,k−k′)≥5+(μk+1+μk) π.P^*(0, 0, k') + 5 + P^*(k' + 1, k', k - k') \ge 5 + (\mu_{k+1} + \mu_k)\,\pi.P∗(0,0,k′)+5+P∗(k′+1,k′,k−k′)≥5+(μk+1​+μk​)π.

The left-hand side is the cost of a path that runs along eccentricity 000 from (0,0)(0,0)(0,0) to (k′,k′)(k', k')(k′,k′), deletes one character (cost 555), and runs along eccentricity at least 111 from (k′+1,k′)(k' + 1, k')(k′+1,k′) to (k+1,k)(k + 1, k)(k+1,k). The lemma says every such path costs at least as much as the path that deletes first and then follows the odd diagonal.

Preamble
import Mathlib
import Definitions.Def_MasekPaterson_Shared_editDist
import Definitions.Def_MasekPaterson_Necessity_editPaths
import Definitions.Def_MasekPaterson_Necessity_example
open MasekPaterson.Shared
Formal statement
namespace MasekPaterson.Necessity

/-- Lemma 6: for all `k'` with `0 ≤ k' ≤ k`,
`P*(0, 0, k') + 5 + P*(k' + 1, k', k - k') ≥ 5 + (μ_{k+1} + μ_k) π`. -/
theorem Pstar_split_bound (k k' : ℕ) (hk' : k' ≤ k) :
    5 + ((mu (k + 1) : ℝ) + (mu k : ℝ)) * Real.pi
      ≤ exPstar 0 0 k' + 5 + exPstar (k' + 1) k' (k - k') := by sorry

end MasekPaterson.Necessity
Source
Masek, Paterson, A Faster Algorithm Computing String Edit Distances, J. Comput. System Sci. 20, 1980, p. 29, Lemma 6
Read-back

What the Lean code literally says, in plain math · claude-opus-5-5

The setting is the specific example, with μ\muμ and P∗P^*P∗ as defined there. P∗(i,j,k)P^*(i,j,k)P∗(i,j,k) is the minimum cost of an edit path from (i,j)(i,j)(i,j) to (i+k,j+k)(i+k,j+k)(i+k,j+k) all of whose points have eccentricity ≥∣i−j∣\ge|i-j|≥∣i−j∣.

For all natural numbers k,k′k,k'k,k′ with k′≤kk'\le kk′≤k,

5+(μk+1+μk)π  ≤  P∗(0,0,k′)+5+P∗(k′+1, k′, k−k′).5+\big(\mu_{k+1}+\mu_k\big)\pi\;\le\;P^*(0,0,k')+5+P^*(k'+1,\,k',\,k-k').5+(μk+1​+μk​)π≤P∗(0,0,k′)+5+P∗(k′+1,k′,k−k′).
  • The first term on the right is the constrained minimum from (0,0)(0,0)(0,0) to (k′,k′)(k',k')(k′,k′). Its constraint (ecc≥0\mathrm{ecc}\ge0ecc≥0) is vacuous, so it equals the unconstrained minimum.
  • The last term is the minimum from (k′+1,k′)(k'+1,k')(k′+1,k′) to (k+1,k)(k+1,k)(k+1,k) over paths staying at eccentricity ≥1\ge1≥1.

Degenerate cases.

  • Because k′≤kk'\le kk′≤k is assumed, k−k′k-k'k−k′ involves no truncated natural subtraction.
  • For k=k′=0k=k'=0k=k′=0, both P∗P^*P∗ terms are 000 and μ1=μ0=0\mu_1=\mu_0=0μ1​=μ0​=0, so the claim reads 5≤55\le55≤5.
  • For k′=kk'=kk′=k, the last term is P∗(k+1,k,0)=0P^*(k+1,k,0)=0P∗(k+1,k,0)=0.
Human review
  • Endorsed by Shuze Chen · Sep 28, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Sep 28, 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