电气工程与系统科学 > 信号处理
[提交于 2026年11月30日]
标题:A Machine-Checked Theory of Dynamic Time Warping in Lean 4
查看原文 PDF 中文 PDF (下批处理) EasyResearch 阅读摘要:Dynamic time warping (DTW) is a standard dissimilarity measure for time series. In practice, large-scale DTW search depends on two ingredients whose correctness is usually argued on paper: global path constraints such as the Sakoe-Chiba band, and cheap lower bounds such as LB_Kim and LB_Keogh that prune candidates without false dismissals. We present a formalization of DTW in Lean 4 with mathlib, covering: warping paths and DTW as a minimum over them; correctness of the dynamic-programming recurrence; nonnegativity, symmetry and DTW(x,x)=0, with a machine-checked witness of the known failure of the triangle inequality; constrained and Sakoe-Chiba banded DTW; the LB_Kim, LB_KimFL, LB_Yi and LB_Keogh lower bounds, the last restated for an arbitrary global constraint; and an executable row-by-row implementation proved equal to the specification. The recurrence is proved once, for cell costs in an arbitrary linearly ordered additive commutative monoid. Instantiating it at the reals extended with a top element yields constrained DTW with no separate optimality proof. The development has no sorry, and every main theorem uses only Lean's standard axioms. To our knowledge it is the first formalization of DTW itself in a proof assistant. The mathematics is classical; the contribution is a checked, reusable development and the precision it forces.
提交历史
来自:Srihari Maruthachalam[v1] 2026年11月30日 星期一 12:39:58 UTC (15 KB)