Lemma 7 — δ_{k,k} = k − μ_k and δ_{k,k+1} = δ_{k+1,k} = 5 + (μ_{k+1} + μ_k)π
ProvedMasekPaterson.Necessity.center_diagonalsdynamic-programmingedit-distancep2o-batch-p100ap2o-gran-per-chapterp2o-plan-paperp2o-v1
In the §4.1 example, with , for every natural number :
These are the exact values of the edit distances on the main diagonal and on the two adjacent diagonals of the edit matrix. The main diagonal consists of integers, while the adjacent diagonals carry integer multiples of plus .
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 7: for all `k`, (a) `δ_{k,k} = k - μ_k` and
(b) `δ_{k,k+1} = δ_{k+1,k} = 5 + (μ_{k+1} + μ_k) π`. -/
theorem center_diagonals (k : ℕ) :
exDelta k k = (k : ℝ) - (mu k : ℝ) ∧
(exDelta k (k + 1) = exDelta (k + 1) k ∧
exDelta (k + 1) k = 5 + ((mu (k + 1) : ℝ) + (mu k : ℝ)) * Real.pi) := by sorry
end MasekPaterson.Necessity
Source
Masek, Paterson, A Faster Algorithm Computing String Edit Distances, J. Comput. System Sci. 20, 1980, p. 30, Lemma 7
Read-back
What the Lean code literally says, in plain math · claude-opus-5-5
The setting is the specific example: , the cost function , the sequences , and . Also , where editDist is the imported edit distance (not shown) and , .
For every natural number , all three of the following hold, with real arithmetic:
Degenerate cases.
- The subtraction is real, not truncated.
- At the claims are (edit distance between two empty lists) and , since .
Human review
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.