Manuscript Offprint
arXiv:2610.12938Conditional Indexing Lower Bounds and Normalization Boundaries for Elastic Subsequence Matching
Abstract
We study static indexes for exact subsequence matching over all equal-length windows of a time series. Under deterministic SETH, for every fixed and , we exclude preprocessing together with worst-case query time on domains containing the reduction's polylogarithmic query lengths. The bounded-error counterpart assumes randomized SETH. The results cover specified warping, bottleneck, edit, subsequence, local-alignment, and complexity-adjusted scores. Their reductions share a data-independent query interface but require different arguments for all-window soundness. We give complete representative proofs for the distinct mechanisms and state the changes needed by related scores. For soft-DTW, integer scaling yields an exact Boolean-predicate reduction in Word-RAM; a model with exact transcendental primitives requires a separate assumption. For independent window-wise Z-normalization, balanced coordinate gadgets and shifted-window moment bounds yield exact lower bounds for squared-cost DTW and discrete Fréchet distance. We give finite-word comparisons and a specified length-dependent rounding rule preserving these gaps. Raw and normalized discrete Fréchet constructions also exclude feasible-solution approximation within any fixed factor below two. Finally, we prove conditional signal-attenuation bounds for normalized anchor constructions and a fast index under the all-window common-mean promise.
1 Introduction
Subsequence matching asks which contiguous part of a long time series resembles a short query. Elastic scores accommodate local misalignment, missing observations, and differences in sampling, using warping paths, edit operations, or matched subsequences [8, 19, 47]. The indexing question is whether preprocessing the target can guarantee a polynomial saving over linear query time on every legal input. We study a static target S of length N, an online query Q of length m, and all contiguous length-m windows of S. The decision predicate asks whether any such window has distance at most a supplied threshold, or similarity at least a threshold. This candidate domain is part of the problem: windows may start at any position, including inside an encoding block or across two blocks.
We give reductions from Orthogonal Vectors Indexing for the measures in Table 1. The target encoding depends only on the stored vectors, while the query encoding depends only on the online vector. Correctness must account for every physical window and every permitted alignment. This requires different arguments for different scores: edit operations may remove anchors, warping paths may repeat matches, subsequence alignments may skip symbols, and local alignments may restart. We bound these alternatives and give finite-word representations for the constructed inputs and thresholds.
Under randomized SETH, the same exclusion holds for every fixed per-input two-sided error , allowing c to depend also on p. Error is measured jointly over preprocessing and query randomness; both running-time bounds are worst case over inputs and random choices. The raw and independently normalized DFD constructions additionally exclude feasible-solution approximation with each fixed , under the corresponding deterministic or randomized assumption and output guarantee.
Proof. Each score section supplies its all-window equivalence, target/query separability, size bound, and numerical certificate. Lemmas 2.3 and 3.3 give the exact indexing exclusions. The two DFD approximation results use their explicit distance-1 versus distance-2 gaps (up to a common normalization factor) and polynomial-in-m verification of the returned feasible window or coupling. □
The statement concerns fixed, exactly implementable
Corresponding author.
parameter slices; a uniform algorithm accepting parameters explicitly is also ruled out if its input domain contains a proved slice. It does not establish an unconditional bound, a result for constant , or a result for every prescribed small coefficient in . The short-hand conditional refers only to a uniform domain covering the hard lengths needed for the exponents in question.
The constructions start from a bounded asymmetric embedding of Boolean vectors. For each measure, we use its recurrence to rule out alignments that could invalidate the encoded distance gap. The arguments use direct anchor matches, cumulative costs, projection onto complete cores, or mandatory endpoint costs. Derivative DTW requires an inverse construction and a bound on derivatives across block boundaries [36]. For CID, we also control the multiplicative complexity factor [6].
Soft-DTW requires an additional entropy bound. Scaling the integer input costs preserves a strict gap after soft aggregation, giving an exact decision reduction on the Word-RAM. The reduction does not evaluate exponentials. The model with unit-cost exact transcendental operations has a separate OnlineOV assumption. For approximate score evaluation, we state the uniform error bound needed to preserve the decision gap.
Independent window normalization is handled by a different embedding. Zero-sum, equal-energy coordinate gadgets give common moments to the canonical blocks, while explicit perturbation bounds control all shifted windows. The cost at the first cell then excludes those windows for squared-cost DTW and DFD. We give exact comparisons of the resulting quadratic-root expressions and a length-dependent dyadic rounding rule that preserves the gap. We also examine when normalization attenuates amplitude-based constructions. In particular, requiring a common mean for all windows forces periodicity and leaves at most m distinct windows; the normalized reduction only requires equal moments on canonical blocks.
Organization of the proofs. The common complexity argument is proved once in Section 2. The remaining proofs are organized by the mechanism that excludes an unintended witness. Section 4 gives the complete first-departure argument for additive DTW; bottleneck aggregation, positive weights, and fixed path restrictions reuse it with explicit changes to the threshold. Section 5 treats actual edit transitions, with ERP as the complete alignment-column argument and separate sketches for the variation and Split/Merge costs. Section 7 proves the repeated-anchor and buffered-core arguments before transferring the latter to Swale. The inverse-derivative boundary calculation, the soft-min gap, and the independently normalized moment estimates have distinct premises and are proved separately. A proof sketch specifies the inherited lemma and the changed inequalities; all statements retain their parameter and output restrictions.
The constructions and their quantitative gaps are collected in Table 2. In addition to the indexing exclusions, Section 9 establishes explicit perturbation bounds for absolute-cost DTW, soft-DTW, and DFD under a shared anchor skeleton. It also gives an -space index with preprocessing and polynomial-in-m query time on the all-window common-mean promise. These auxiliary results delimit the normalization argument and are separate from the positive normalized lower bounds.
1.2 Related work
Subsequence search and preprocessing. Feature-space subsequence indexing [24], exact DTW indexes [35, 41], and large-scale search with pruning and early abandonment [42] reduce practical search costs. KV-Match addresses normalization and time warping [49]; FSMDTW reduces the average overhead of candidate-window lower-bound evaluation [18]. Stronger safe distance bounds improve filtering [38, 48]. These numerical lower bounds support algorithms; our conditional running-time lower bounds address a different question and do not preclude those improvements.
A direct predecessor is Chao et al. [17], who give conditional query lower bounds for raw subsequence matching after polynomial preprocessing and connect a zero-bandwidth slice to raw DTW. The present reductions treat the specified elastic paths, all shifted equal-length windows, fixed parameter restrictions, and independent normalization. Goldenberg, Rubinstein, and Saha [27] study comparison after separately preprocessing two strings, with related hardness under BP-SETH. That result has a different query object and hypothesis from our static-text, all-window SETH formulation.
Sequence complexity and low-distance DTW. Conditional pairwise lower bounds for edit distance, DTW, LCS, and Fréchet distance underpin fine-grained sequence complexity [2, 5, 12, 13]. Faster low-distance or approximate algorithms [37], comparison to a fixed sequence [1], and dynamic DTW data structures [15] make input and resource restrictions particularly important when comparing bounds.
Boneh, Golan, and Kociumaka [11] give low-distance DTW and pattern-matching reductions. We observe that specializing the query vector family to a singleton in their Section 5.1 construction makes the text depend only on the data family and dimension, while the pattern depends only on the online vector and has length . Combining this separation with OnlineOV gives fixed-text indexing hardness for their setting. Their seven-symbol unit-mismatch cost and arbitrary nonempty substring domain differ from the numerical absolute costs and equal-length windows considered here. The latter require separate soundness arguments.
| Score family | Score on one window and query | Proved setting and consequence |
| DTW / cDTW | Global endpoints; unrestricted or fixed Sakoe–Chiba band; exact indexing lower bound | |
| cWDTW | Fixed exactly implementable weights with a uniform positive lower bound | |
| Itakura-DTW | DTW formula with | Fixed path rule containing the complete diagonal on the hard lengths |
| Discrete Fréchet | Exact indexing and feasible approximation with each fixed | |
| ERP | Global edit columns with gap value ; fixed representable gaps by common translation | |
| TWED | Minimum sum of the three transition costs in (7) | Local unit timestamps, infinite boundaries, fixed |
| MSM | Minimum Move and Split/Merge costs in (9) | Fixed exactly implementable penalty and the stated initialization |
| cDDTW | Endpoint-trimmed internal derivative; absolute local cost; fixed band or unrestricted paths | |
| LCSS | Fixed integer-symbol tolerance slice, without an additional time band | |
| EDR | Minimum number of substitutions, insertions, and deletions | Matches cost zero; other edits cost one; fixed tolerance slice |
| Swale | Fixed reward and one-sided gap cost ; global recurrence with no mismatch diagonal | |
| TS-SW | Zero-restart local recurrence and unit gap penalty; exact lower bound with a positive vanishing gap | |
| Raw CID | Positive-complexity raw inputs; exact squared rational comparison | |
| Soft-DTW | Absolute path cost, fixed positive rational ; exact Word-RAM predicate; separate extended-model assumption | |
| Normalized squared DTW / DFD | Independent positive-variance normalization; exact finite-word predicates | |
| Ordinary normalized DFD | Square root of normalized squared DFD | Exact rational-threshold indexing and each fixed feasible approximation factor |
| Rounded normalized scores | Replace each local square by | Prescribed dyadic ; subsequent DP operations are exact integer operations |
Table 1: Score definitions and scope of the indexing results. The shared exponent, length-domain and randomness conventions are in Theorem 1.1. Symbols , CE, , and the edit recurrences are defined in their score sections. The normalized construction uses squared local costs; the raw DTW rows use absolute costs. Table 2 gives the numerical separations.
Fréchet queries and proximity structures. Blank [9] establishes one-dimensional discrete Fréchet whole-curve query hardness after polynomial preprocessing, including a below-two approximation barrier. Gudmundsson et al. [29] prove preprocessing barriers for two-dimensional continuous Fréchet whole-trajectory queries. Bringmann et al. [14] study preprocessing-query bounds for continuous Fréchet near-neighbor search over curve sets. Whole curves, a curve collection, and all windows of one text have different candidate domains: discarding text prefixes and suffixes can create a match, so whole-curve soundness does not establish all-window soundness. The general themes of preprocessing hardness and a factor-two DFD barrier are consequently established background.
Curve hashing and deterministic approximate near-neighbor structures [22, 25] use approximation and curve-complexity restrictions. Aronov et al. [4] consider DTW proximity problems with segment queries, again a distinct query domain. These results concern different candidate families and approximation guarantees from those in Table 1. OnlineOV itself is prior work [26, 28]; our self-contained derivation records the exponent order and randomized interface needed for the reductions.
Sections 2 and 3 give the computational model and reduction lemmas. Sections 4–7 treat the raw scores, and Section 8 treats soft-DTW. Sections 9 and 10 address normalization.
2 Preliminaries
2.1 Static subsequence queries
For a sequence of length , let contain all consecutive length- windows. Preprocessing receives only and constructs an index . Subsequently a query supplies a sequence , a threshold , and any explicit score parameters. A query reads the stored index without modifying it. For a finite-valued minimizing score , write
For a maximizing similarity, use the maximum and reverse the threshold inequality. Preprocessing is independent of Q and . Window starts range over every physical position, including those inside an encoding block or crossing a boundary.
Definition 2.1 (Query-length domain). A query-length domain is a prescribed family with . Correctness and the stated query-time bound must hold uniformly for every legal query with . Supporting all lengths means ; a single size-dependent slice may instead have . Equal-length windows are defined relative to the current query and do not require .
A parameter fixed in a theorem is independent of n and d; the reduction's constants may depend on it. A uniform parameterized algorithm accepts the parameter explicitly and must handle all legal values. Restricting that algorithm to a proved fixed slice is therefore valid. Query time includes reading the query, threshold, and explicit parameters, as well as producing the required output. The hard queries below have , so their input-reading cost is .
2.2 Computation and complexity hypotheses
We use a uniform Word-RAM with word length . The same finite algorithms apply at all input sizes. All hard inputs have explicitly encoded integers or rationals occupying words, and every required primitive is implemented by word operations. Most encodings have polynomial magnitude in ; inverse-derivative reconstruction has magnitudes and still uses bits. Section 3.5 gives the numerical criterion. The separately specified extended Real-RAM for soft-DTW is not part of this default model.
Preprocessing and query times are worst case over legal inputs and, when applicable, all random choices. For each fixed target and query, correctness probability is taken jointly over preprocessing and query randomness. A fixed error bound concerns that input; it does not promise simultaneous correctness of all possible queries. The SAT reductions below use a fixed query collection, and amplification supplies the batch guarantee they require.
Deterministic SETH asserts that for every some fixed k-SAT has no deterministic algorithm on v variables [31, 32]. Randomized SETH makes the same assertion for algorithms with error at most 1/3 on each input and worst-case running time. We use the deterministic assumption for deterministic indexes and the randomized assumption for randomized indexes. Randomized SETH appears in lattice hardness [3, 7]; the preprocessing BDD result uses a separate nonuniform hypothesis, while the random-algebraic approximation work of Bukh et al. [16] uses a one-sided Monte Carlo formulation. These conventions are distinct from the two-sided per-input assumption adopted here.
2.3 The OnlineOV lower bound
Online Orthogonal Vectors (OnlineOV) preprocesses an ordered family of vectors in and answers, for an online vector , whether some . Repeated records are allowed. Its preprocessing-query tradeoffs are established background [26, 28]; the quantifiers used here are recorded explicitly. All complexity logarithms are base two; soft-min formulas explicitly use natural logarithms.
Lemma 2.2 (Amplification with preprocessing randomness). Fix and suppose its joint preprocessing-and-query error is at most . Run an odd number K of independent copies of the entire index and answer by majority. The error is at most
For and fixed , it is at most when
Preprocessing time, stored space, and query time increase by at most a factor K.
Proof. Let indicate an incorrect answer in copy . Independence includes the preprocessing coins, so are independent and have expectations at most . An incorrect majority requires . Hoeffding's inequality [30] gives the bound; the choice of gives the stated power of . Constructing and querying copies gives the resource bounds. Repeating queries against only one randomized preprocessing outcome would not supply this independence.
Lemma 2.3 (Parameter-sensitive OnlineOV lower bound). Fix and . Under deterministic SETH, there exists such that, for every fixed , no uniform OnlineOV index on dimensions has preprocessing and query time . Under randomized SETH the same holds for every fixed , allowing also to depend on , with the joint per-input error and worst-case time conventions above.
Proof. We first prove the deterministic statement. Put and . Deterministic SETH supplies a fixed clause width for which -SAT on variables has no algorithm. Sparsification with parameter produces at most formulas, each with at most clauses for a fixed depending on [32]. Here suppresses only polynomial factors in .
For one sparse formula, assign variables on the data side and the remaining variables on the query side. A coordinate is one exactly when the partial assignment leaves the corresponding clause unsatisfied. A data vector and query vector are orthogonal if and only if their combined assignment satisfies the formula. Keep all assignment records, even when two records give the same vector. Thus
Choose a fixed large enough that for all sufficiently large . For every fixed , zero padding yields dimension without changing orthogonality. The same algorithm and padding rule apply at every sufficiently large input size.
The supposed index preprocesses in time and answers the whole query family in
Generating all query vectors takes and is absorbed because . Data generation is absorbed as well. Summing over the sparse formulas gives , which is strictly faster than the excluded bound.
For the randomized statement use randomized SETH to choose k, and amplify each index using Lemma 2.2. Taking makes each fixed query's error at most . The complete collection of sparse formulas and partial-assignment queries is determined by the SAT input, independently of all answers. A union bound over this collection gives total error below 1/3 for sufficiently large v; no independence between different queries is required. The factor K is polynomial in v, so the same exponent contradiction holds. This proves the randomized claim under its own hypothesis.
The order is essential: first fix the desired preprocessing exponent and query saving, and only then select the logarithmic dimension coefficient. This does not give hardness for every small fixed c.
In particular, the deterministic quantifiers are
where are fixed before varies; the randomized statement fixes before choosing . For a fixed small , storing the answers to all Boolean queries takes at most preprocessing time and permits direct lookup. This is why an arbitrary polynomial preprocessing budget cannot be excluded by fixing one universal dimension coefficient.
3 Reduction framework
The reduction has two maps: the stored vectors determine one long target, and an arriving vector determines one short query and its threshold. We first give these maps for the common numerical construction. We then prove the indexing transfer once and collect the witness and numerical lemmas used to instantiate it. Score-specific sections change the encoding only where their recurrence requires it.
3.1 The common encoding
The common numerical construction starts with the following bounded embedding. Its two encoding families are asymmetric: only cross-family distances encode orthogonality.
Lemma 3.1 (Bounded cross-family embedding). For , concatenate the coordinate gadgets
to obtain in time. Then
For every common scale , translation , and ,
Proof. The four Boolean pairs give local cost and local cost . Sum the former and maximize the latter over coordinates. Translation cancels in every difference; positive scaling multiplies its absolute value by .
For and , define
Its length is . Given the ordered family , concatenate , and set . A canonical window is a whole block; every other length-m window starts at a nonzero phase within a block. Paths start at , end at , and use steps , , ; a band restricts visited cells to .
For the unweighted absolute-cost construction, the two maps are therefore
The target has n blocks and is fixed before q is known. Each canonical window is compared with the query through one stored vector. The common anchors encode coordinate positions; the bounded data values encode orthogonality. On the canonical diagonal the anchors cancel, leaving under absolute summation and 1 versus 2 under bottleneck aggregation. Choosing the anchor separation then makes an unintended local match exceed the decision threshold.
For example, at with , the data blocks for bits zero and one are and . The query for bit one is . Their diagonal absolute costs are one and three. The first-departure argument in Section 4 shows why a low-cost path cannot avoid this distinction, while its first-cell argument deals with every shifted window. The example illustrates the maps; the proof quantifies over all dimensions, stored vectors, and physical offsets.
For each score three tasks remain: exhibit an accepted canonical window in a Yes instance; exclude a nonorthogonal canonical witness; and account for all other windows. The third task is essential because a shifted window can combine parts of two vectors. The buffered constructions in Section 7 use a slightly different form: any accepted window containing a complete core certifies an orthogonal core, while every window without one is rejected. Thus rejecting every noncanonical window even in a Yes instance is a sufficient template, not a necessary property of a reduction.
3.2 Transfer to static indexing
Definition 3.2 (Uniform index-preserving reduction). A reduction consists of a data encoder and a query encoder , with public dimension and model parameters. The first encoder does not use the query; the second does not inspect the stored data. The encoders are uniform for all sufficiently large . Their construction times are and , their lengths are at most and , and these bounds are uniform over input contents. Every generated value and required construction operation is legal in the declared model. Finally, orthogonality is equivalent to the threshold predicate over all physical windows, not only the designated block starts.
Lemma 3.3 (Index-preserving transfer). Suppose a deterministic reduction constructs a target of length , in time using only , and constructs in time using only and public parameters. Suppose all encoded quantities occupy words and (1) is equivalent to OnlineOV, including every window. For any fixed and , the respective SETH assumption excludes preprocessing and query time , provided the allowed query lengths include the reduction's hard family for the coefficient selected in Lemma 2.3. The randomized version preserves every fixed joint per-input error bound .
Proof. Fix , and also when randomness is allowed. Apply Lemma 2.3 with
to select a sufficient fixed , and put . A hypothetical target index yields an OnlineOV preprocessing algorithm by first computing and then building the index on . Its time is
On the arrival of , generate and invoke the target query algorithm once. This takes
For sufficiently large n these two bounds are respectively and , contradicting the selected OnlineOV lower bound. The hard-length coverage premise ensures that every generated query is within the target index's correctness and time guarantees.
Both encoding maps are deterministic and independent of the target index's random coins. Their all-window equivalence therefore makes the composed OnlineOV answer incorrect exactly when the target index's answer is incorrect. This preserves the joint per-input error p without a new amplification step. Worst-case running time over random choices is preserved as well. The reduction needs the returned Boolean answer, not an evaluation of the score by the encoder.
More generally, if and , then for any fixed and , sufficiently large satisfies , , and . Indeed, the vanishing exponent terms are eventually smaller than , , and , respectively. Thus the exponent slack can be made arbitrarily small; the transfer proof uses one convenient fixed choice.
Here and below, “hard length coverage” means that there is such that for every and every reduction input , with the selected and all other external parameters fixed. Each construction below specifies its own and target size. For example, the normalized construction has , raw DTW has , and the inverse-derivative construction adds two physical endpoint samples. Correctness and time guarantees must hold uniformly over the declared length domain. The result applies to an index supporting all lengths, and to restricted domains with this coverage. It asserts neither that constant-length queries are hard nor an unconditional bound.
3.3 Block encodings
A data encoder concatenates query-independent containers , possibly with boundary strings. Each container has a designated length-m canonical window ; the query encoder produces of length . Containers, boundaries, query length, and their generation costs are in our constructions, so and query generation is . Canonical windows refer to designated starting positions. Every other physical starting position must also be accounted for.
Lemma 3.4 (Phase and cyclic-order obstruction). For a seamless concatenation of length-m blocks, a length-m window at offset 0 < t < m is a suffix of length m - t followed by the next block's prefix of length t. Suppose each block has distinct anchors , , at common positions , with no data symbol equal to an anchor. The query contains these anchors once in the same order and also has disjoint data symbols. Every global order-preserving alignment of an offset window must delete an anchor, pair an anchor with data, or pair two different anchors. For paths without gaps, one of the latter two events is unavoidable.
Proof. The two lengths follow by counting positions before and after the block boundary. There is a unique s with ; the window's anchor order is . If none of the listed events occurs, all anchors on both sides must be paired with their same-named counterpart. In particular, and would need to appear in the same order on both sides, a contradiction. Repeated pairings cannot reverse their order.
The certificate can be written as
where ori records minimization or maximization and M specifies the computational model, including its parameter representation. For minimization its central obligation is
for maximization replace with . Every offset is quantified, and each optimum ranges over all legal witnesses at that offset. The threshold is generated from the query and public parameters. The certificate also records the separate sizes and construction times of the two encoders, their uniformity in , and the legality of all required numerical operations. These obligations are shared by the score-specific arguments below.
Proposition 3.5 (Certificate closure). A reduction certificate consists of its two encoders, orientation, query length, threshold, parameter domain, and machine model. Besides the resource conditions of Lemma 3.3, it must prove that an orthogonal vector gives an accepted canonical window, and that a No OnlineOV instance has no accepted physical window. Such a certificate yields the corresponding deterministic or randomized indexing lower bound in its declared model and covered length domain.
Proof. Completeness gives the forward implication of the threshold predicate; the all-window No condition gives the reverse implication. For a maximization score first apply Proposition 3.11, then Lemma 3.3.
A useful stronger sufficient template rejects each nonorthogonal canonical window and every noncanonical window separately. It is not required: a shifted buffered window may retain a full data core and be accepted in a Yes instance. A valid alternative proves that any accepted such window certifies an orthogonal core. In either form, the proof covers every physical offset and every legal witness, including offsets within containers or boundary encodings. An order obstruction alone is not a numerical cost bound.
3.4 Alignment bounds
Lemma 3.6 (Dominance, charging, projection, and initialization). Let range over the legal global witnesses and let be the threshold. Each of the following is a sufficient exclusion rule.
-
Dominance. If a witness cost dominates each of its actual nonnegative local event costs, and every bad witness contains an event of cost at least , no bad witness has cost at most .
-
Cumulative charging. If with nonnegative charges, and every bad witness has total charge at least with , every low-cost witness is good. For maximization replace this bound by and require .
-
Core projection. Suppose every full witness projects to a legal core witness . If , then . For maximization, reversing both inequalities gives .
-
Initial barrier. If every witness pays an unavoidable and all subsequent increments are nonnegative, the window is rejected.
Proof. For dominance, the total is at least . For charging it is at least (or at most ). For projection each projected witness is feasible for the core optimization; taking the appropriate extremum proves the stated bound. For initialization the remaining nonnegative sum cannot remove .
Sum and maximum aggregation satisfy dominance; averaging and soft-min need not. Charges require a valid total-cost inequality, without counting the same operation more than the inequality allows. A core projection must preserve consumption and order, not just discard unwanted costs. Local restarts can bypass an initial barrier. Thus cheap deletion, repeated matching, split/merge operations, and rewards must be checked against the actual recurrence for each score.
3.5 Arithmetic and soft minima
Lemma 3.7 (Entropy-robust soft minimum). Let a nonempty finite witness family satisfy , uniformly over all relevant windows. For , put
Then
Consequently, a Yes witness of cost at most a and a uniform No lower bound b give a strict soft-min threshold whenever ; choose . If every complete witness cost is scaled by , it suffices that .
Proof. The partition sum lies between and . Apply the decreasing function . The Yes bound uses the upper inequality and the No bound the lower inequality. Scaling all witness costs replaces a, b by , . Scaling data coordinates alone is insufficient for this last inference unless its effect on every witness is proved.
Here denotes the natural logarithm. The lemma is algebraic; it does not itself provide exact transcendental machine operations.
For an integer put bits. A rational is represented by an integer numerator and a positive integer denominator, with total bit length the sum of their lengths. Reduction legality concerns the required intermediate values as well as the final input: cross products before comparison and values before cancellation must also fit. Since and for fixed ,
Proposition 3.8 (Finite-word numerical criterion). For and with fixed c, assume every input, threshold, and intermediate quantity needed by the reduction is rational , , with for fixed constants a, b. If each required primitive is implemented by word operations, the reduction is valid on a Word-RAM. The values use bits; polynomial bounds in d improve this to bits.
Proof. Taking binary logarithms gives bits for each numerator and denominator, and . Thus each value occupies a constant number of words. The assumed primitive implementation supplies the operation bound. Under polynomial amplitudes the same calculation gives bits.
Polynomially many integer additions, or rational additions with a common bounded denominator, increase bit length only by ; a fixed number of multiplications preserves bits. General unequal-denominator sums require a separate bound on final and intermediate numerators and denominators, including cross-products before cancellation. A constant number of words is not automatically one word, nor does representation alone establish a primitive's time.
Corollary 3.9 (Bounded algebraic closure). Suppose atomic numerators and denominators have magnitude . Consider quantities formed by additions, subtractions, absolute values, maxima and minima, together with a fixed number of multiplications. If all final and required intermediate numerators and denominators still have magnitude , each is representable in machine words on the hard family. The same assertion with polynomial-in-d magnitude gives bits.
Proof sketch. Apply Proposition 3.8 to the asserted magnitude bounds. Integer or common-denominator sums of polynomially many terms add only bits; fixed-degree products add only a constant factor to the bit bound. For unrelated rational denominators the magnitude premise must be checked explicitly, including intermediate cross products. This is a representation conclusion; the primitive-operation condition remains part of the model.
Proposition 3.10 (Uniform numerical error). Suppose Yes scores satisfy and No scores satisfy . If a computed score satisfies on all reduction instances, and , comparison with separates them, assuming these quantities can be represented and compared in the declared model. For a soft-min score with underlying cost bounds , the sufficient condition is .
Proof. The computed Yes value is at most and the No value is at least ; the midpoint lies strictly between them. For soft-min substitute the bounds and from Lemma 3.7, and use their midpoint .
This is a sufficient certificate for a score-estimation implementation, not a necessary output of an exact Boolean index. An exact predicate reduction generates finite inputs and thresholds and invokes the assumed index; it need not evaluate the score itself. In particular, an formula does not prevent a Word-RAM lower bound for its mathematically exact threshold predicate. Excluding a stronger machine with unit-cost exact transcendental primitives requires an OnlineOV assumption in that stronger model. Numerical error and randomized answer error are separate quantities.
3.6 Decision and approximation
Proposition 3.11 (Elementary transfer rules). The conclusion of Lemma 3.3 also applies to the following variants, subject to its size, uniformity, model, and length-domain conditions.
-
A finite-valued maximization score H with threshold can be replaced by with threshold .
-
A hard slice with a parameter fixed independently of n, d implies hardness of the uniform problem accepting that parameter as input. Hardness for every fixed parameter requires a reduction for each such parameter; its constants may depend on that parameter.
-
A Yes bound and a No bound suffice whenever and the threshold predicate is exact, even if .
-
A threshold-sensitive witness-or-failure output, an exact optimum, or a complete report is at least as hard as decision, provided its claimed time includes the necessary output and decision costs.
Proof. For the first claim, . For the second, restrict the uniform algorithm to the hard slice. For the third, a positive gap preserves the strict No inequality. For the last, test failure, compare the returned optimum with the threshold, or test whether the report is empty. A returned location alone must either include the threshold guarantee or permit verification within the claimed time. These transformations preserve the stated error probability.
An exact lower bound alone gives no constant-factor approximation lower bound. Rubinstein's independent ANN theorem states that, under SETH, for fixed preprocessing and query exponents and , some rules out deterministic -ANN with preprocessing and queries under Euclidean, Manhattan, Hamming, and edit distance [43]. Its transfer to another score needs an additional reduction.
Proposition 3.12 (Multiplicative-gap interface). Suppose a reduction satisfies all the conditions of Lemma 3.3 except that its decision equivalence is replaced by the uniformly comparable bounds
where , , and . Then the same conditional lower bound holds for this gap decision problem, whose answer is unrestricted between its two promise regions. It also holds for an algorithm returning a feasible cost with
for all sufficiently large N, when the returned cost can be compared with within the transfer's query budget.
Proof. Every reduction instance lies in a promise region. In a Yes instance, ; in a No instance, . This comparator answers OnlineOV, so the transfer lemma applies with unchanged error semantics.
For example, a Yes threshold and a No lower bound , for constant , permit
Choose a fixed representable ; the No inequality is then strict. This excludes suitable high-accuracy ratios, not an arbitrary fixed constant ratio.
4 DTW and discrete Fréchet
We apply the alternating encoding of Section 3.1. Its first-departure and first-cell bounds are the representative all-window argument for global path scores.
| Score | Query length | Yes value or bound | Bound in a No instance | Certificate |
|---|---|---|---|---|
| Raw DTW / cDTW | Theorem 4.2 | |||
| Raw DFD | Theorem 4.2 | |||
| cWDTW | Corollary 4.4 | |||
| ERP | Lemma 5.1 | |||
| TWED | Lemma 5.2 | |||
| MSM | Lemma 5.3 | |||
| cDDTW (physical) | Theorem 6.3 | |||
| LCSS | Lemma 7.1 | |||
| EDR | Theorem 7.4 | |||
| Swale | Theorem 7.6 | |||
| TS-SW | Theorem 7.8 | |||
| Raw squared CID | Theorem 6.5 | |||
| Soft-DTW | Lemma 8.2 | |||
| Normalized squared DTW | Theorem 10.3 | |||
| Normalized squared DFD | Theorem 10.3 | |||
| Normalized DFD | Corollary 10.5 | |||
| Rounded normalized squared scores | Below or | Above or | Corollary 10.8 |
Table 2: Quantitative all-window separations. Minima and maxima range over every equal-length window. Here , is the fixed Swale reward, is the diagonal weight, is the integer scale in (17), and is the common variance of canonical normalized blocks. The rounded thresholds are and . An admissible Itakura restriction inherits the raw DTW row. Parameter and model restrictions are those in Table 1 and the cited statements.
Lemma 4.1 (First departure and first cell). For alternating blocks with common anchors and data in , every non-diagonal endpoint-to-endpoint path in a canonical window contains a local absolute difference at least . Every path in a noncanonical window contains such a difference at its first cell. These statements hold before imposing any band restriction.
Proof. Fix a canonical block and a nondiagonal path. Before its first horizontal or vertical step the path has visited only for some . That departure enters or ; a diagonal step cannot be the first departure. Odd positions contain anchors and even positions contain data. If is odd, the departure pairs the data at position with an anchor at position . If is even, it pairs the next anchor with data at position . In both directions and both parities the anchor has value at least and the data value is at most , proving the first bound. It is a statement about an actual visited cell, not merely about the order of two anchors.
Now let a window start at offset of a block. The query's first value is . The window's first value is either data in or a later anchor with . In the former case its difference from is at least , and in the latter case it is at least . Every global path visits the first cell , independently of the remaining contents of the window. These are all possible starting positions in the concatenated target, so the bound includes windows crossing a block boundary. Both arguments hold in the unrestricted path family and therefore in any allowed subset.
Here DTW uses the sum of absolute local differences, unit state weights, fixed endpoints, and no division by path length [8, 44]. DFD minimizes the maximum absolute difference on the same monotone grid paths [23]. Writing , their recurrences are
Initialize the first cell with its local cost and use only legal predecessors; cells outside a chosen band are unavailable. The output is the state . The path family is finite and nonempty, so both minima are attained. One window is evaluated in time. Lemma 4.1 is common to the sum and bottleneck recurrences; only the threshold comparison changes.
Theorem 4.2 (Raw DTW and DFD). For every fixed integer band , and also for the unconstrained path family, the exact equal-length-window DTW and DFD problems have the conditional indexing lower bounds of Lemma 3.3 under the respective deterministic and randomized SETH assumptions. Their hard lengths are .
Proof for DTW. For DTW set , , and . The encoders use the same alternating block shape; data blocks depend only on the stored vectors and the query block depends only on v. On a canonical window the full diagonal has zero anchor costs and data cost
Thus an orthogonal data vector gives a legal path of cost d. This proves completeness without assuming that every path is diagonal.
For soundness, fix any window and any legal path. In a canonical window a nondiagonal path contains a first-departure cell of cost at least by Lemma 4.1; nonnegative summation already exceeds the threshold. A remaining canonical path is diagonal and, in a No instance, costs at least . In a noncanonical window the mandatory first cell has cost at least , regardless of the two data blocks that the window intersects. These cases exhaust all windows and all paths. We force only threshold-feasible paths to be diagonal; an optimal path in a No block need not be diagonal.
Every Yes witness is diagonal and therefore satisfies each fixed nonnegative band. A path restriction cannot introduce an accepted No witness. The construction has , query length , and construction times and . Its symbols have polynomial magnitude in d. Finite local costs and DP sums also have polynomial magnitude, because a path uses at most cells. Lemma 3.3 supplies both indexing exclusions. If bandwidth is an explicit query parameter, restrict the proposed uniform index to one fixed band.
Proof sketch for DFD. Use the same encoders with and threshold 1. The diagonal bottleneck is 1 for an orthogonal pair and 2 otherwise by (3). Every nondiagonal canonical path and every shifted-window path has a cell of cost at least . A bottleneck maximum dominates that cell, just as the nonnegative path sum did in the DTW proof. Thus the all-window optimum is 1 in Yes instances and 2 in No instances, with the upper bound 2 supplied by any canonical diagonal. The same path-restriction and resource arguments finish the transfer.
Corollary 4.3 (DFD approximation below two). Fix . The same lower bounds exclude an index returning a valid window with
or a valid window together with a feasible coupling whose bottleneck satisfies that bound. In the randomized case, feasibility and the approximation guarantee must hold jointly with probability at least 1 - p for every fixed input, where is fixed.
Proof. Choose a fixed rational with . Retain during preprocessing at an additional cost. For a returned window, compute its exact DFD in time and test whether it is below . For an explicitly returned coupling, one may instead verify its feasibility and compute its bottleneck in time. On success, the Yes value is at most , whereas every No feasible value is at least . Invalid output is treated as failure. The extra poly query work is absorbed by the exponent slack in Lemma 3.3, and the error is at most .
This statement does not cover arbitrary underestimating values or expected approximation guarantees. At the present gap no longer separates the cases: on the constructed instances, any canonical diagonal is already a feasible 2-approximation. This observation is only about the construction, not a general 2-approximate index.
Corollary 4.4 (Positive weights and fixed path restrictions). The same conditional lower bounds hold for cWDTW with local cost if the rule is fixed independently of input size, , and for a fixed constant . Its required weights must be uniformly exactly generated and represented in words, and required multiplication and comparison must take Word-RAM operations. They also hold for any fixed Itakura-style path rule whose permitted paths form a subset of the standard monotone paths and contain the complete diagonal at every sufficiently large hard length.
Proof sketch. Reuse Lemma 4.1 and the DTW proof, choosing a fixed positive integer with , scale , and threshold . The diagonal costs , while an excluded path incurs a weighted cell cost at least . The weight-generation premise supplies exact constant-word arithmetic. For the fixed path restriction, the canonical diagonal remains a Yes witness and its path set is a subset of the unrestricted No case. No new all-window or index-transfer argument is needed.
The length-dependent modified logistic weights of the original WDTW proposal [34] need not satisfy the uniform positive lower bound, and their transcendental evaluation does not automatically meet the exact Word-RAM condition. Likewise, the historical Itakura formulation [33], modern window constraints [35], and alternative step weights must not be identified without checking the stated path-subset premise. None of these results silently replaces absolute loss by squared loss or a path-length average.
5 Edit distances
The edit operations of these three measures require different locking arguments. ERP charges the magnitude of a deleted anchor; TWED charges same-side variation; MSM can charge only its fixed penalty when an element lies between its two neighbors. We therefore verify their actual recurrences separately.
Throughout this section, let and be the concatenated 2d-coordinate codes of Lemma 3.1. Thus all data coordinates lie in , where , and
For a scale , set and reuse the alternating block from Section 3.1:
Its length is . Given , concatenate these blocks without separators to obtain , and let . An aligned block is a canonical window. Every other length-m window consists of a proper block suffix and the next block's prefix. In particular, its first element is either a data value or for , and hence differs from by at least .
5.1 ERP
For gap value g, one-dimensional ERP [19] is the minimum cost of a global order-preserving edit alignment. With prefix states , its recurrence is
with , , and . The output is . The reduction fixes , , and threshold d. An alignment consists of columns , , or ; each input position is consumed exactly once. A direct anchor match means the actual column , not merely visiting a DP state.
Lemma 5.1 (ERP locking and all-window separation). Every canonical alignment of cost at most d directly matches all same-name anchors. Moreover,
Proof. First consider a canonical alignment. Every query position occurs in exactly one alignment column. For a query anchor , that column has one of three forbidden forms unless it is the direct match : a gap column costs ; an anchor-data column costs at least ; an unequal-anchor column costs at least . Nonnegativity of all columns implies that a total-cost-d alignment contains every direct same-name anchor column. This conclusion concerns the actual consumed pair, not just the presence of a DP state with matching indices.
These anchor columns occur in increasing order. Between and , each side contains exactly one data element, and . The legal subalignment either substitutes one for the other or consumes both through separate gap columns. The triangle inequality gives
Thus the minimum chamber cost is exactly . Chambers use disjoint alignment columns, so their lower bounds sum without counting any operation twice. A canonical threshold-feasible alignment consequently has cost at least . Conversely the diagonal supplies exactly this cost. In particular an orthogonal canonical block passes, and a nonorthogonal canonical block cannot pass.
It remains to treat every shifted window. Put and let be its offset from the preceding block start. The window is the suffix of one block followed by the corresponding-length prefix of the next. Since the two blocks put the same anchors at the same positions, its anchor order is
For clarity, this covers a cut at either an anchor or a data position: s counts the anchors in the removed prefix. Suppose there were a shifted alignment of cost at most d. The same three column-cost inequalities would force every query anchor to match its unique same-name window anchor. But the pair appears in opposite orders in the window and query. A global order-preserving alignment cannot contain both direct matches. Hence some anchor must be consumed by one of the forbidden columns, already costing more than d. This contradiction is independent of the data values in the two neighboring blocks. Combining the canonical and shifted cases proves both directions of the all-window equivalence.
The gap-0 restriction is sufficient for the main lower bound. For any fixed exactly representable g, translating every data value and anchor by g, and using gap g, leaves every term of (6) unchanged. This gives the corresponding fixed-gap slice whenever the translation is legal in the computational model. Translating the data alone while leaving the gap fixed would not justify this extension.
5.2 TWED
We use the following unit-timestamp slice of TWED [39]. For each query and each candidate window, reset timestamps to and set . Fix independently of the input size. Define
Then
Initialize and for positive . A finite witness is a predecessor chain to , so its first step is necessarily . These boundary conditions and local timestamp resetting are part of the problem definition; we make no claim for free endpoints, finite boundary initialization, or arbitrary timestamp conventions. Zero parameters are permitted as scoring slices without asserting metric identity on the full space of time-stamped sequences.
Use (5) with and threshold 2d.
Lemma 5.2 (TWED all-window separation). For the stated TWED slice,
Proof sketch. We use the initial-barrier and nonnegative-cost rules of Lemma 3.6, checking the TWED increments directly. An adjacent anchor-data pair has variation at least ; the boundary pair has variation 2dC. Thus every horizontal or vertical transition after the first step costs more than 2d. The infinite boundary states force that first step to be , so a threshold-feasible canonical chain must be completely diagonal.
On this diagonal the time penalties vanish. Every data discrepancy appears once in the current term and once in the predecessor term; the virtual initial and final anchor discrepancies are zero. The cost is , which gives the canonical Yes/No distinction. For every shifted window, the forced first step alone costs at least . Nonnegative later increments cannot remove this barrier. These inequalities replace ERP's alignment-column argument and cover all window phases.
5.3 MSM
For fixed , the one-dimensional MSM recurrence [46] uses the closed interval and the cost
Here compares query prefix to window prefix . Initialize
where the latter two equations apply for indices at least 2. For ,
The output is . The proof concerns predecessor chains of this standard DP, with diagonal Move and vertical/horizontal Split/Merge steps. It does not assume a normal form for arbitrary edit-operation scripts. Although the formulas and argument also make sense for , we reserve “MSM metric” for .
Set in (5), and use threshold d.
Lemma 5.3 (MSM all-window separation). Every canonical predecessor chain of cost at most d is the diagonal Move chain. Furthermore,
Proof sketch. Use the first-departure organization of Lemma 4.1, now with the actual Split/Merge cost (8). At the first departure from , if is odd then the two old elements are the same anchor and the new element is data below both. If is even, both old elements are data and the new element is an anchor above both. In either parity, for either a horizontal or vertical departure, the new element lies outside the interval of the two old elements. The nonconstant branch of therefore charges at least . This includes departures on the initialized first row or column. All other increments are nonnegative.
Consequently every threshold-feasible canonical chain is diagonal, with cost . A shifted window instead has mandatory initialization , which no subsequent operation can cancel. These two cases prove the all-window equivalence. The argument does not require an optimal No-instance chain to be diagonal.
5.4 Indexing lower bounds
Theorem 5.4 (Exact indexing for the three editing measures). Fix ERP gap , the TWED slice above with , or MSM with . Parameters are independent of input size and exactly implementable in the declared Word-RAM model; fixed rational parameters suffice. Under deterministic SETH, for every fixed and , there is no uniform exact static index with preprocessing and worst-case query time on a domain covering the corresponding hard lengths. Under randomized SETH, the same statement holds for randomized indexes with any fixed per-input error probability .
Proof sketch. Apply Lemma 3.3 once to the three preceding all-window certificates. Their data and query maps are independent, have construction times and , and give and . The scales are and the largest anchors , with constants depending only on fixed parameters. For fixed rational parameters, a common constant denominator makes all input values, thresholds and finite DP values polynomial-in-d integers. The TWED symbol is a DP sentinel. More general fixed representations must satisfy the same exact-operation premise. These facts establish the common resource conditions, so the deterministic and randomized conclusions follow with the dimension coefficient selected after the target exponents and error bound.
6 Derivative DTW and CID
6.1 Endpoint-trimmed derivative DTW
For a physical sequence , use the internal Keogh derivative estimator
Our cDDTW is the endpoint-to-endpoint, absolute-local-cost DTW of these two derivative sequences, with fixed integer band or with no band. Endpoints are trimmed. This is a precisely specified variant of the derivative approach of Keogh and Pazzani [36]; it does not identify the present score with the squared-loss, endpoint-replication convention of their original implementation. Differentiation is performed independently on each candidate physical window.
Use the raw block from Lemma 3.1, where , , and . A physical realization has length and is constructed as follows. Starting with , set
Thus exactly. Construct and ; the inverse recurrence restarts with two zeros in every block. No extra separators are inserted.
Lemma 6.1 (Inverse-recurrence bit bound). The physical coordinates and the intermediates in (10) are integers of bits and are generated in Word-RAM time per block when .
Proof. Let bound every desired derivative and put . Then and , whence . All coordinates and recurrence intermediates have magnitude at most . A constant number of -bit words suffices per coordinate; the constant may depend on the already fixed dimension coefficient. The recurrence takes word operations.
Lemma 6.2 (The two boundary derivatives). At a boundary from a completed physical block to the next two zeros, the only derivative values differing from internal prescribed values are
They satisfy ; in particular both have magnitude greater than for all sufficiently large .
Proof. Write . Equation (10) gives and . Since is odd, all anchor contributions to are positive, and all data contributions are nonpositive. Keeping the first anchor and bounding every negative data term gives
Indeed, the negative terms have magnitude at most . Let , a nonnegative polynomial in . Summing gives and . Consequently
For sufficiently large , , so both magnitudes are at least . Discarding finitely many small dimensions does not affect the indexing reduction.
Theorem 6.3 (All physical windows for cDDTW). For the stated derivative variant, some length-M window of S has score at most d against Q if and only if some is orthogonal to v. Hence the deterministic and randomized conditional indexing bounds of Lemma 3.3 hold, with hard lengths .
Proof. For a canonical physical window, differentiation recovers the raw block. Orthogonality gives a diagonal cost . In a No instance its diagonal cost is ; any other path has cost at least by Lemma 4.1.
Every noncanonical physical window crosses one block boundary. If the boundary is between positions 1 and 2 of this window, trimming retains as an internal derivative; if it is between M - 1 and M, trimming retains . Every other boundary position retains both. Thus an extreme derivative survives every shift, including those nearest the two endpoints. Every endpoint-to-endpoint path consumes this derivative, whereas every query derivative has absolute value at most B. Lemma 6.2 forces a local cost greater than d, regardless of the bandwidth.
The data length is , and construction times are and . Derivatives of arbitrary integer physical windows lie in ; they need not be integers. Multiply local costs, sums, and the threshold by four to perform exact integer DP. Lemma 6.1 bounds these quantities by . Both resource and all-window requirements of the transfer lemma hold.
6.2 Raw CID
For positive-complexity sequences, define
We analyze this raw formula [6], without independent window-wise Z-normalization. Its extension to zero-complexity inputs requires a convention not used here. Comparing to a rational is equivalent to comparing to . The squared comparison uses integer sums and cross multiplication, so it needs no square-root primitive.
Use a different Boolean embedding:
The four squared distances are 1, 1, 1, 5, respectively. Concatenating these pairs gives .
This identity uses only cross-family pairs. For example the conflicting Boolean pair has squared cost , whereas each other pair has squared cost one. No same-family isometry is needed. All data coordinates lie in for . Form raw anchored blocks and with . Their common length is .
Lemma 6.4 (Complexity-factor control). For every pair of canonical blocks, .
Proof. With , expansion of adjacent squared differences gives
Each summand in is nonnegative and increasing on , since . Therefore
Moreover,
where . In particular , and the ratio of any two canonical complexity squares is bounded by .
Theorem 6.5 (Raw CID separation). If an orthogonal pair exists, a canonical window satisfies . In a No instance every window satisfies . Thus exact squared CID decision has the conditional indexing bounds of Lemma 3.3.
Proof. Every canonical block has positive complexity because adjacent anchor and data values differ. Every shifted window crosses a boundary and contains its two adjacent distinct anchors ; it too has positive complexity. Thus all comparisons lie within the domain.
An orthogonal canonical pair has squared Euclidean distance ; Lemma 6.4 makes its squared CID strictly less than . A nonorthogonal canonical pair has squared Euclidean distance at least , and . In a shifted window the first sample is either data in or a later anchor , , whereas . Its squared Euclidean distance is at least , again a lower bound on squared CID.
Take the rational squared threshold . All coordinates, adjacent-difference sums, Euclidean sums, and cross products are polynomial in , hence have bits. Data and query construction take and time, and . The transfer lemma applies to these exact finite-word comparisons.
Corollary 6.6 (Certified CID score error). Suppose the squared score of every compared window is estimated with absolute error at most a uniform . Comparing the minimum estimated score to still separates the constructed Yes and No instances.
Proof. Every Yes witness has estimated square below . Every No window has estimated square at least .
This is a sufficient error certificate, not a guarantee for arbitrary floating-point evaluation. The exact index theorem does not rely on such an evaluation strategy.
For completeness, its exact predicate can be written using only integer arithmetic. With , , and , the squared score is . For a rational threshold with , compare
All factors and products are polynomial in d on the construction, including on shifted windows. This supplies the finite-word predicate without computing either complexity square root.
7 Discrete alignment scores
This section treats LCSS, EDR, Swale, and a specified Smith–Waterman-type time-series score. A large numerical anchor cannot by itself penalize a unit-cost mismatch or a freely skipped symbol. We instead use distinct phase alphabets, repeated anchors, alignment projection, and the reward lost by a truncated local alignment. All symbols below are encoded as distinct integers. For any fixed, exactly representable tolerance , the relation therefore means equality of symbols. The convention at is explicitly non-strict. None of the three symbolic constructions applies window-wise Z-normalization.
7.1 LCSS
The time-series LCSS formulation of Vlachos et al. [47] also includes a temporal constraint. Our slice maximizes the length of a common subsequence with the above tolerance and no additional time band. For positive tolerance, strict and non-strict amplitude tests agree on this integer encoding; the zero-tolerance convention is as stated above. We write this score as .
For each , take a private alphabet and set
The four pairs share exactly one symbol except the pair , which shares none. Thus their local LCSS is . Take fresh, mutually distinct anchors and . Define
The target is the concatenation of the n data blocks .
Lemma 7.1 (All-window LCSS separation). For a canonical block,
Every noncanonical length-m window Y satisfies , independently of the data vectors. Consequently,
Proof. Give each anchor run and each coordinate gadget its own phase, ordered as in the query. Distinct phases use disjoint alphabets. Within a canonical block, matches therefore cannot move from one coordinate to another or from data to an anchor. Each anchor run contributes at most M and each coordinate contributes exactly at its local optimum. Concatenating these local optima respects the common phase order, so the upper bound is attained and gives .
Write a shifted window as AB, a nonempty proper suffix of one block followed by a nonempty proper prefix of the next. The cut may split an anchor run or a coordinate gadget. Phases in A are later than phases in B, with the sole possible exception of that split phase appearing at both ends. A matched subsequence has nondecreasing query phase ranks. Consequently, if it uses symbols from both A and B, every chosen symbol must belong to the split phase: any strictly later phase chosen in A would prevent returning to an earlier phase in B, and the reverse alternative is excluded by the cut positions.
There are now three exhaustive cases. If matches use only A, the removed nonempty prefix contains at least one copy of the initial anchor . All other phases contribute at most their canonical bounds, and cannot be supplied by another phase, so the score is at most . If matches use only B, the missing suffix contains at least one copy of the final anchor and gives the same bound. If both parts are used, the query has at most M occurrences of the split anchor, or at most two symbols of the split coordinate phase. Its score is therefore at most . These bounds also cover a cut exactly between phases, where using both parts is impossible. Scores are integers, hence every shifted window has score at most .
An orthogonal stored vector gives a canonical window of score . In a No instance canonical windows lose at least one coordinate match and shifted windows lose at least one match by the preceding classification. Taking the maximum over all window starts proves the equivalence.
The construction has , an alphabet of size , and -bit symbol codes. The proof does not establish hardness for an independently fixed finite temporal band: that restriction would require a new legality argument for the matches.
7.2 EDR
EDR assigns zero cost to a tolerance match and unit cost to a mismatching substitution, insertion, or deletion [20]. On our integer slice it is unit-cost Levenshtein distance, written E. This is the raw recurrence on the encoded input, independently of normalization used in applications. Use fresh, coordinate-private alphabets and define
Here each is a new private anchor. Both cores have length 3d. A nonconflicting local pair has one equal position and one mismatch; the conflicting pair has no common symbol. Its EDR is therefore : a single edit cannot turn one of the latter length-two strings into the other. Disjoint phase alphabets also give
For equal-length strings of length , one has
Indeed, a script of cost t deletes or substitutes at most t source symbols; its remaining source symbols give a common subsequence of length at least . Equation (11) and a diagonal substitution script now prove the exact identity
Let Z be a fresh buffer symbol, , and set
The threshold is . A canonical window has M buffer symbols on either side of one complete core. Consecutive core starts are separated by , so .
Lemma 7.2 (Full-core projection). If a length-m window X contains a complete data core , then all its other symbols are Z, and
Proof. Consecutive data cores are separated by buffer symbols. A window containing one complete core of length 3d and even one symbol of the next or previous core would span at least positions. Thus all positions outside the contained core are buffer symbols.
Fix any global edit alignment between this window and the query. Regard it as an ordered list of columns, each consuming one symbol on at least one side. Transform each column as follows. Preserve a column that consumes two core symbols. If it pairs one core symbol with a buffer symbol, replace the buffer symbol by a gap. Preserve a column that already pairs a core symbol with a gap. Delete every column with no core symbol.
Every core symbol of each side is still consumed exactly once, and the relative order on each side is unchanged. No retained column has two gaps. The resulting list is therefore a legal global edit alignment between the two cores, even if many buffer symbols were matched to core symbols in the original alignment. Since the buffer symbol is absent from both core alphabets, a core-buffer column is a mismatch of cost one; its replacement is a gap column of the same cost. Preserved columns keep their cost, and deleted columns have nonnegative cost. The projection never increases total cost. Each original column is processed once, so an original substitution cannot be charged twice. This proves the inequality for every full alignment, and minimizing over such alignments yields the claimed distance bound.
Lemma 7.3 (Partial-core windows). If a length-m window contains no complete core, then
Proof. Such a window has the form , where A and B are proper suffix and prefix portions of adjacent cores, with . Their core phase sequence is cyclically shifted; the underlying vectors may differ. In particular, AB cannot equal the query core: its first symbol is not the private initial anchor . Since both have length 3d, they have at most 3d - 1 core matches. This also follows by separating the two sides of the phase cut, as in Lemma 7.1.
A common subsequence using no core symbol has at most 2M buffer matches. If it uses a core symbol in A, the central buffer can only match the query's right buffer; if it uses a core symbol in B, it can only match the left buffer. If it uses both sides, the central buffer lies between two core matches and cannot match either query buffer. Thus any subsequence with a core match has at most M buffer matches and 3d - 1 core matches. These are alternative cases, giving the maximum in (14), not the sum of both buffer allowances. Equation (12) with m = 7d proves the EDR bound.
Theorem 7.4 (EDR all-window certificate). The construction satisfies
Proof. An orthogonal canonical window has cost d by (13), matching its buffers for free. In a No instance, a full-core window costs at least by Lemma 7.2, and any other window costs at least by Lemma 7.3. □
7.3 Swale
We use the global threshold-match recurrence of Morse and Patel [40], with fixed reward +r and single-sided gap penalty -r, for an exactly representable fixed r > 0. There is no mismatching diagonal transition. With and , the recurrence is
Let . Equality here implements the fixed tolerance slice.
Lemma 7.5 (Swale–LCSS identity). For arbitrary lengths and ,
Proof. For each pair of prefixes, put . The boundary values agree with those of W. At equal last symbols, the LCSS value is the previous diagonal value plus one, so T increases by r. At unequal symbols, the LCSS value is the maximum of the two neighboring values, and the corresponding T recurrence subtracts r. Induction on proves the identity.
Reuse the EDR cores and double-buffer target and query, with , , and threshold .
Theorem 7.6 (Swale all-window separation). A full-core window associated with u satisfies
with equality on a canonical window. Every partial-core window has . Consequently an orthogonal canonical window has score 4dr, whereas every window in a No instance has score at most , and
Proof sketch. The window classification is exactly that used for EDR. In a full-core window at most 2M buffer symbols match. Removing those matches leaves a core common subsequence, bounded by (11); canonical windows attain both allowances. Substitution in Lemma 7.5 gives canonical score and the same upper bound for other full-core windows. For a partial-core window, Lemma 7.3 gives , hence
These cases establish the two threshold directions. The EDR edit projection is not being identified with a Swale alignment: the transferred object is the already proved core-subsequence and buffer bound.
Other reward/gap ratios, additional mismatch transitions, or time bands are not included in this certificate.
7.4 TS-SW
We define a real-valued time-series score inspired by the local restart recurrence of Smith and Waterman [45]. The original paper supplies the local-alignment mechanism, not this particular numeric scoring function or its hardness result. With zero boundary values, let
and let . Both the reward constant 4 and the unit gap penalty are fixed independently of d. For clarity, the numeric gadgets used here are
Concatenate them coordinate-wise and divide every coordinate by to obtain . The four local cases give
Let and, for a vector , define
Concatenate the data blocks ; the query is . Set and .
Lemma 7.7 (Full-consumption rigidity). For two length-m sequences and any scoring rule with and unit gap penalties, a local traceback of score at least consumes all positions by exactly m diagonal events and has no gap event.
Proof. Follow the traceback from its zero restart state in the forward direction. Let count its diagonal consumption events, including the event entering the first matched cell, and let count horizontal and vertical gap events. Its score is at most , and monotonicity gives . If , the score is at most . Thus , which already consumes all positions on both sides. No gap, omitted prefix, or omitted suffix is possible. The matched cells are exactly . There are consumption events but only moves between successive matched cells.
Theorem 7.8 (TS-SW all-window certificate). For the fixed score defined above,
Every No-instance window has score at most .
Proof sketch. The canonical full diagonal has score . Each of its increments is positive, so an orthogonal canonical block is a valid local Yes witness. By Lemma 7.7, any other traceback either is the full diagonal or uses at most diagonal consumption events and scores at most . A nonorthogonal canonical full diagonal loses at least . On a shifted window its first difference is at least , so even the full diagonal scores at most . These are all possibilities, and gives the stated uniform No gap.
The input coordinates have denominator d and magnitude ; they and the threshold have -bit encodings. The strictly positive gap 2/d suffices for exact rational comparison. It tends to zero and yields no fixed positive additive-error or fixed-factor approximation lower bound by this argument.
Corollary 7.9 (Conditional indexing lower bounds). Fix the stated exactly representable tolerance and, for Swale, reward parameters. For each and , Deterministic SETH excludes a uniform exact static index with preprocessing and worst-case query time for each of these four slices. Under Randomized SETH the same holds with any fixed per-query two-sided error , jointly over preprocessing and query randomness. The query-length domain must cover the hard family generated by the dimension coefficient chosen after and, in the randomized case, p.
Proof sketch. Invoke Lemma 3.3 with the all-window bounds of Lemma 7.1 and Theorems 7.4, 7.6, and 7.8. The query lengths are , 7d, 7d, and , respectively; target lengths equal n times these lengths. Construction takes and time. Integer symbol codes, or the TS-SW rationals of denominator d, use bits. For Swale a fixed exactly implementable reward multiplies integer counts. For a maximizing score, Proposition 3.11 reverses the threshold polarity. Deterministic encoders preserve the error event, so the common transfer supplies both hypotheses without repeating their exponent calculation.
8 Soft-DTW
Fix a positive rational temperature , with fixed positive integers , and a fixed band or the unconstrained path set . We study the following absolute-loss specialization of the soft-min path framework [21, 44]:
Here is the natural logarithm, paired with the natural exponential. This is the raw soft-DTW score, which can be negative; it is not the bias-corrected soft-DTW divergence [10]. Absolute local loss is not everywhere differentiable, and no differentiability, nonnegativity, or metric axiom is needed below.
Lemma 8.1 (Entropy bound). For any finite nonempty path family of size H and ,
In particular, the length-m grid has , also after a band restriction that retains its diagonal.
Proof sketch. Apply Lemma 3.7 with . A length-m monotone grid path uses at most steps from three possible step types, so the number of paths is at most . A band that retains the diagonal keeps the path family nonempty and can only decrease this count.
More generally, if minimum witness costs are at most A in Yes instances and at least B in No instances, a strict soft-score separation follows from . Uniformly scaling all witness costs by replaces this sufficient condition by . The actual construction below also increases anchor separation, so that every noncanonical witness satisfies the required cost bound.
Lemma 8.2 (Integer construction and all-window soft gap). Let and set
Use blocks and query . If some is orthogonal to , a window has . Otherwise every window has . The data and query constructions take and time, respectively, and use polynomial-in-d integers.
Proof. Since and , the fixed integer satisfies without any transcendental computation in the construction. Hence, for ,
An orthogonal canonical diagonal has cost , so Lemma 8.1 gives the Yes bound. In a No canonical block, the diagonal costs at least . All other canonical paths, and every path in a shifted window, contain a local difference at least
by Lemma 4.1, now with . Every No window therefore satisfies
Only the data gadgets are multiplied by ; the new common anchors have the values prescribed above. Here
, the largest symbol is , and any integer path cost is . All these discrete quantities use bits. None of the construction steps evaluates , , or .
Theorem 8.3 (Exact soft-DTW predicates in Word-RAM). For fixed positive rational and fixed W (or no band), consider a uniform Word-RAM index that, on finitely encoded integer sequences and an integer threshold, returns the exact mathematical truth value of . Deterministic SETH excludes preprocessing together with worst-case query time , for any fixed and . Under Randomized SETH the same holds for fixed per-input error probability . The query-length domain must contain the hard lengths selected after these constants.
Proof sketch. Lemma 8.2 gives a deterministic all-window reduction with integer input and threshold, , and construction times and . Apply Lemma 3.3, with its adjusted OnlineOV exponents . The encoder never evaluates , , or the soft score; it invokes the hypothetical Word-RAM Boolean predicate once. Thus the composed procedure stays in Word-RAM and preserves the per-input error event. The soft-score separation, rather than an assumed transcendental primitive, is what establishes its correctness.
The theorem supplies neither exact transcendental Word-RAM primitives nor an algorithm for evaluating . A mathematical real-valued formula can define a predicate on finite inputs without changing the machine model of a hypothetical algorithm solving that predicate.
Extended Real-RAM statement. For completeness, consider a separate model: one uniform finite program with a finite set of built-in real constants independent of input size, unit-cost exact arithmetic, comparison, exp, and ln. Inputs remain finitely encoded, and an infinite table depending on n, c, or the input is forbidden. Assume directly that in this model, for every fixed preprocessing exponent and saving , there is such that for every fixed , OnlineOV on is incompatible with preprocessing and query time . The time guarantee is uniform over all sufficiently large n. For randomized indexes require the corresponding branch for every fixed per-input error , allowing c to depend on p.
Corollary 8.4 (Model-relative soft-DTW lower bound). Under this direct extended-Real-RAM OnlineOV hypothesis, the time exclusions in Theorem 8.3 also hold for indexes in that extended model, with the matching deterministic or randomized branch.
Proof sketch. Use the same integer encoders and all-window gap from Lemma 8.2. The resource calculation in Lemma 3.3 now contradicts the stated OnlineOV hypothesis in the extended model, with . This changes the assumed source lower bound, not the numerical construction or its error event.
Ordinary SETH is not asserted to imply this stronger machine-model hypothesis. Rejecting it removes this extended-model conclusion, not the Word-RAM Boolean-predicate theorem.
Finite-precision scores. If a score-producing implementation certifies uniformly on every window of every constructed instance, then the threshold separates the estimated Yes and No scores: the former is at most that threshold and the latter is strictly greater. Taking a minimum over all windows preserves the same error bound. More generally, Yes scores at most A and No scores strictly above B are separated by the midpoint whenever the uniform error is at most . This conditional numerical transfer uses the complexity assumption appropriate to the implementation's machine model; it does not certify a specific floating-point implementation.
An exact log-sum-exp rearrangement is
Its largest exponential is 1, which prevents all terms from underflowing together because of a large common cost. Terms with very large excess costs may still underflow, and summation and rounding errors still require a uniform bound. A black-box exact Boolean predicate and a rounded score with a proved error guarantee are different promises; the former needs no numerical error certificate for the reduction in Theorem 8.3.
9 Effects of normalization
For a nonconstant length-m real sequence, write , , and . The following boundary statements concern explicit hypotheses on a construction, not a general impossibility of normalized reductions.
Proposition 9.1 (Affine invariance and common moments). For , . If a query and every relevant window share mean and positive standard deviation , and a score satisfies
then . Thresholds and additive gaps scale by this factor whenever the common statistics and comparisons are legal in the declared model.
Proof. Mean and standard deviation transform as and . For the second statement apply the homogeneity identity with and .
For the normalized sequence instead changes sign. Multiplying only a subset of coordinates is not a common affine transformation. More importantly, common moments of canonical blocks do not establish common moments for every sliding window.
Proposition 9.2 (Common window means and periodicity). For , all length-m windows of have the same mean if and only if
Under this condition every window has the same contents as one of the first windows.
Proof. If , adjacent sums satisfy . Equality of all window means is therefore equivalent to the displayed periodicity condition. For any start , choose with . Since , periodicity identifies the entire window at with the one at . This also proves the stated bound near the end of the target.
Corollary 9.3 (A static index for the common-mean promise). Assume target symbols admit exact -time comparison, and that a score depends only on window contents, the query, and explicit parameters. If one window of length m is scored in time, the common-mean promise admits preprocessing, space, and query time
Preprocessing does not need to know the query length.
Proof sketch. Store and, for every , the flag valid. The total number of comparisons is . A query in the promise domain passes its flag check and needs only the first windows from Proposition 9.2. Copying these windows takes time and scoring them takes , with . Store only the target and the flags, giving linear space.
For and this is a polylogarithmic query bound. Consequently, forcing a common mean on every window cannot establish a near-linear query exclusion for every polynomial preprocessing exponent. Queries outside this promise may use a separate scan. A score depending on absolute window positions needs a separate argument; local timestamps reset within the window are part of its contents. Positive variance is still required when the score uses Z-normalization. The common-moment identity in Proposition 9.1 remains valid, but our positive normalized construction balances only canonical blocks and bounds shifted-window perturbations separately.
Lemma 9.4 (Perturbation under a shared anchor skeleton). Let X, Y have the same length m and anchor positions and values, and differ only on bounded data coordinates with bounded differences. Suppose, uniformly in the family, that
and all centered coordinates have magnitude , where . Then
Proof. At coordinate i, the difference is
Both terms are by the hypotheses. Take the maximum or sum over all coordinates. In particular, normalization can perturb anchor coordinates even when their original values agree.
Theorem 9.5 (Conditional attenuation of the data signal). Assume Lemma 9.4 holds for the Yes/No constructions being compared with the same query. Suppose the normalized score is -Lipschitz in its first input in on this family. Their score difference is at most . If this quantity tends to zero, the bounded data perturbation alone cannot generate a fixed positive additive gap. For a pointwise additive score , it suffices that is uniformly -Lipschitz; then .
Proof. Apply the Lipschitz bound to the conclusion of Lemma 9.4. For the additive instance, .
For the shared skeleton containing a constant fraction of evenly spaced anchors , with and bounded data values, the centered scale is . Indeed, the anchor second moment is , while two constant fractions of anchors are separated by , giving a matching variance lower bound. For corresponding bounded data perturbations, the mean changes by ; centering is an orthogonal projection, so the standard deviation changes by at most . Hence a pointwise score with has signal at most . These stability and Lipschitz conditions are not asserted for every elastic dynamic program or every shifted window. Path repetition may increase , and a new normalized encoding may carry another signal. Positive shrinking gaps still support exact predicates by Proposition 3.11; a specified finite-precision score needs its own gap-preservation argument.
Proposition 9.6 (Perturbation of absolute-cost path scores). Let X, Y, Q have length m and . Fix the same nonempty, value-independent set
of monotone endpoint-to-endpoint paths with steps , , . Define
where is fixed. Then
Proof. For each cell, the reverse triangle inequality bounds the change in absolute cost by . A monotone path visits at most cells. With , every path cost therefore changes by at most . Taking the minimum preserves this bound, proving the DTW assertion.
For soft-DTW, let and define analogously. The same pathwise inequalities give
Applying proves the second bound. For DFD the maximum along one path changes by at most ; minimizing over the unchanged path family proves the third. Neither the optimal path nor the minimizing witness needs to remain the same after perturbation.
Corollary 9.7 (Signal bounds for a normalized anchor skeleton). Under all the hypotheses of Lemma 9.4, compare and with the same normalized query and the same value-independent path family. Absolute-cost DTW and raw soft-DTW change by ; the DFD bottleneck changes by . For and the arithmetic anchor skeleton with , these bounds become and , respectively.
Proof sketch. Lemma 9.4 gives . Substitute this bound into Proposition 9.6. The sum and soft-min bounds use the path-length factor; the bottleneck bound does not.
These are conditional bounds for the compared sequences, not a claim that every shifted window has the required moments. The path family must be unchanged by the perturbation, and TWED or MSM requires its own analysis. The soft-DTW estimate is an identity about real scores; it grants no exact transcendental Word-RAM primitive. A positive gap that tends to zero can still support an exact threshold reduction. The next section supplies such a construction with independently verified moments and finite-word comparisons.
10 Normalized DTW and DFD
Raw-score reductions do not automatically survive independent window normalization. We balance the moments of canonical blocks and bound, rather than eliminate, their changes in every shifted window. This section concerns squared local loss for DTW; it does not substitute squared loss for the absolute loss used elsewhere in the paper.
Scores and input domain. For an integer sequence of positive population variance, put
Let consist of the global monotone paths from to with steps , , , either unrestricted or restricted to any fixed nonnegative Sakoe–Chiba band. The diagonal is legal in either case. Define
Ordinary normalized discrete Fréchet distance is . There is no division by path length or outer square root in . The index receives raw integers and a rational threshold. Each window and the query use their own moments; irrational normalized coordinates are not assumed to be input machine words. The legal instance domain requires positive variance for the query and every compared window. Our construction satisfies this requirement. Write for all contiguous length-m windows of S.
10.1 Balanced encoding
For use the six-coordinate gadgets
Every gadget has coordinate sum zero and squared norm two. Disjoint supports, except that , give
For Boolean vectors , concatenate the respective gadgets to obtain , where
Define the anchored block
For an ordered data family , allowing repetitions, set
Thus , without additional separators. The n complete blocks are the canonical windows; the others are shifted windows.
Lemma 10.1 (Moments of every window). All canonical blocks and queries share sum H, squared sum E, mean , and variance , where
Every shifted window X has sum and squared sum , with , . Consequently
and , .
Proof. The anchors are and the d gadgets each contribute sum zero and squared sum two. Summing these terms gives H, E and the displayed variance identity. Its lower bound follows from
A shifted window is a proper suffix of one block followed by a proper prefix of the next. Each physical phase occurs once, so its anchor multiset is unchanged. A shift by replaces the first data coordinates of the left block with the corresponding prefix of the right block. Complete gadgets have identical moments, leaving at most one partial gadget. The seven prefix sums of , including the empty prefix, are respectively
and their prefix squared sums are
Their differences give , , including shifts at anchor and gadget boundaries. When there are no shifted windows. Expanding the variance gives . Since , , and ,
Thus , proving positivity and the bound on .
Lemma 10.2 (Normalized first-cell barrier). For every shifted window X,
Proof. Let be its first element and . The element is a data coordinate in or an anchor with ; hence and . Lemma 10.1, and the derivative of for , imply
Since the query starts with C,
The last two terms have total absolute value strictly less than
both summands decrease for . Subtracting this error from proves the claim.
Theorem 10.3 (Exact identities over all windows). For let . Then
Thus thresholds 4d/v and 1/v, respectively, decide whether A contains a vector orthogonal to q.
Proof. A canonical block and query share their moments. On the diagonal the anchors cancel, so (18) gives squared DTW cost and squared DFD cost or . Any nondiagonal path has a first horizontal or vertical departure from the diagonal. As anchors alternate with data, that cell aligns an anchor and a data coordinate and costs at least
It exceeds every canonical diagonal cost for either score. Hence the diagonal is optimal in every canonical block. Every path in a shifted window visits , whose cost, by Lemma 10.2, exceeds , since . Both path sum and bottleneck dominate this cell. All shifted windows are therefore more expensive than all canonical candidates. Minimizing the canonical costs proves the identities.
10.2 Exact comparisons and indexing
Lemma 10.4 (Exact comparison without real-root primitives). On the constructed instances, raw inputs, rational thresholds, and the integer coefficients needed for exact normalized squared-score dynamic programming have bits. One window can be evaluated in Word-RAM operations, using a constant number of machine words per coefficient when .
Proof. For a fixed window and query put
and define similarly. Both values are positive, and . With , a local squared cost is
Every local cost for this window shares the same root. Path summation adds the two integer coefficients; bottleneck maxima and DP minima select existing expressions. No operation raises the algebraic degree. To compare expressions, determine the sign of . For , use the sign of . For , the sign is negative; for , it is the sign of . For , the sign is positive; for , it is the sign of . These branches cover equality, including square , without squaring across an unchecked sign. Comparison to a rational threshold first clears its positive denominator. Thus it suffices to compare each window with the common threshold; values from different quadratic fields need not be compared directly.
Raw values are and , so and . The local coefficients are , . A path visits at most cells. Its coefficients and all squared comparison products remain , hence have bits. They fit a constant number of -bit words on the hard family. Standard DP uses states and constant work per state. Finally for , and the thresholds are and , also rational with -bit numerators and denominators. The reduction generates raw integers and these rationals, without first evaluating any normalized coordinates.
Corollary 10.5 (Rational threshold for ordinary DFD). The same construction reduces orthogonality to ordinary normalized DFD with rational threshold .
Proof. The two optimal values are and . The variance bound gives . Writing therefore yields
Integer binary search using squared comparisons computes in poly time with -bit integers.
Theorem 10.6 (Window-normalized indexing lower bounds). Fix and . Under deterministic SETH, no uniform Word-RAM exact index for , , or has preprocessing and worst-case query time , when its length domain covers the hard family selected below. Under randomized SETH the same exclusion holds for each fixed per-input two-sided error . This probability includes preprocessing and query randomness, and time is worst-case over all random choices.
Proof sketch. Apply the full transfer proof of Lemma 3.3. For its selected fixed , set . The data encoder uses only , takes time, and gives . The query and squared thresholds take time; the rational ordinary-DFD threshold takes poly time. Theorem 10.3 gives all-window equivalence and Lemma 10.4 supplies finite-word comparisons. Thus the same adjusted exponents contradict OnlineOV hardness. The required lengths are . Deterministic encoders preserve the index's joint per-input error event, so the randomized branch follows under randomized SETH.
Corollary 10.7 (Feasible-window approximation below two). For every fixed , Theorem 10.6 also excludes an index returning a feasible window with
The conclusion also applies when a window and a feasible coupling with that cost guarantee are returned. In the randomized case feasibility and the guarantee must hold jointly with probability at least 1 - p for each fixed input.
Proof sketch. Reuse the feasible-output verification reduction of Corollary 4.3. Choose a fixed rational with , retain , and reject invalid output. For a returned window, evaluate its exact squared DFD by Lemma 10.4 and compare with . A successful Yes output has squared score at most ; every feasible No output has squared score at least . A returned feasible coupling with the promised bottleneck likewise upper-bounds its window's exact distance. The extra verification time is absorbed by the common transfer. Feasibility and approximation must hold jointly with probability at least ; this argument does not cover , an expectation-only promise, or an arbitrary underestimating value.
10.3 Dyadic rounding
The exact squared DTW gap 4/v decreases with d. Nevertheless a prespecified precision growing only with query length preserves it. The following result concerns its stated score definition, rather than an unspecified floating-point implementation.
Corollary 10.8 (Length-dependent dyadic rounding). Let be the least power of two not smaller than . Independently normalize each positive-variance window and query, replace each local squared cost with , and perform all subsequent DP additions, maxima and minima exactly on integers with common denominator . Exact rational-threshold indexing for these rounded squared DTW and squared DFD scores obeys Theorem 10.6, under its respective deterministic or randomized assumption and hard-length coverage.
Proof. Use the same construction. Since and , its common canonical variance satisfies . Every local rounding error is strictly smaller than
A path has at most cells, so its sum loses less than . This also bounds the error after minimizing over paths: evaluate the exact cost on a rounded-optimal path for the lower bound, and use downward rounding for the upper bound. The same reasoning applies to the finite minimum over all windows. In particular, neither the optimal path nor the optimal window needs to remain unchanged. By Theorem 10.3, exact squared DTW has yes value and no value at least . Therefore the rounded scores remain strictly separated by the rational threshold
For squared DFD a path maximum loses less than 1/R, and both levels of minimization preserve that error. Its values 1/v and 4/v remain strictly separated by .
For any positive-variance length-m sequence, , so and . A local quantized integer is at most , and a path integer sum is less than . Since , all these integers are polynomial in . The exact floor does not require an approximate square root. Using (19), testing an integer means testing the sign of
The sign branches in Lemma 10.4 decide it exactly. Binary search between the accepted lower bound 0 and rejected upper bound obtains in comparisons. All operands, including squared comparison products, are still on the construction. A window can therefore be evaluated in finite-word operations. If its final DP integer is , threshold comparisons can be written without roots as
The rule is fixed independently of the data and target index exponents; its construction uses integer doublings. Data construction still costs , and query construction costs . The same adjusted exponents and deterministic reduction maps used in Theorem 10.6 give the two SETH consequences. Single-window evaluation certifies the score's finite-word semantics; the reduction does not enumerate all windows when answering a query.
The precision is fractional bits, or on the hard family. Corollary 10.8 does not certify fixed IEEE precision, rounded normalized coordinates, or fresh rounding at each DP update. Nor do these results cover normalized absolute-loss DTW, free endpoints, path-length normalization, or other elastic scores without separate arguments. Raw subsequence indexing already has a direct predecessor [17]; the additional steps here are the balanced canonical moments, all-shift perturbation bounds, independently normalized first-cell barrier, and exact finite-word comparison.
11 Discussion
The reductions establish conditional indexing lower bounds for the measures and parameter restrictions in Table 1. They construct a static target independently of the query and preserve the decision over all equal-length windows. The dimension coefficient is selected after the preprocessing and query exponents; constant query lengths and an arbitrary prescribed small logarithmic coefficient are outside these bounds. Deterministic and randomized indexes use their respective SETH assumptions.
The required alignment arguments depend on the measure. Anchors and mandatory endpoints suffice for several global path scores. Edit operations require additional cost bounds, derivative DTW requires control of the inverse recurrence and block boundaries, and subsequence and local scores require bounds on skipped or unconsumed positions. CID adds a global complexity factor, while soft-DTW adds the entropy of the path family.
Independent normalization admits exact lower bounds when canonical moments agree and shifted moments can be controlled. The resulting shrinking gap is consistent with the conditional attenuation bound in Section 9. Requiring every adjacent window to have the same mean would instead impose periodicity.
On that promise, Corollary 9.3 gives an explicit quadratic-preprocessing, linear-space index. Under the separately stated moment-stability premises, Proposition 9.6 and Corollary 9.7 quantify the attenuation for absolute-cost DTW, soft-DTW and DFD. The squared-DTW and TS-SW gaps prove exact hardness; they do not give fixed-factor approximation hardness. For raw and normalized DFD, the gap excludes each fixed feasible approximation factor below two. The endpoint two is a limit of these constructions, not a general approximation upper bound.
The exact quadratic-field comparisons and the prescribed dyadic rule use finite-word arithmetic. Their guarantees concern those operations, and do not extend to arbitrary IEEE arithmetic, intermediate rounding, or other local losses. The cSoft-DTW Word-RAM reduction invokes an exact predicate; its extension to unit-cost exact transcendental operations assumes OnlineOV hardness in that model.
Approximation, restricted input distributions, other query-length domains, free endpoints, and other normalization rules remain separate questions. The worst-case bounds are compatible with practical gains from filtering and early abandonment.
Verification status. The results are supported by the paper proofs and proof sketches above. We do not claim an end-to-end machine-checked formalization. A reproducible Lean or Rocq/Coq development would need to supply the score-specific all-window semantics, the complete parameter-sensitive OnlineOV argument, the joint probability space for randomized preprocessing and queries, and the machine resource bounds. Checking local Boolean identities or a conditional dependency interface alone does not verify these remaining obligations. The normalized moment estimates, quadratic-root comparisons, and prescribed rounding rule are also part of those obligations.
References
[1] Amir Abboud and Virginia Vassilevska Williams. Fine-grained hardness for edit distance to a fixed sequence. In 48th International Colloquium on Automata, Languages, and Programming, volume 198 of Leibniz International Proceedings in Informatics (LIPIcs), pages 7:1–7:14. Schloss Dagstuhl–Leibniz-Zentrum für Informatik, 2021. doi: 10.4230/LIPIcs.ICALP.2021.7.
[2] Amir Abboud, Arturs Backurs, and Virginia Vassilevska Williams. Tight hardness results for LCS and other sequence similarity measures. In 2015 IEEE 56th Annual Symposium on Foundations of Computer Science, FOCS '15, pages 59–78. IEEE, 2015. doi: 10.1109/FOCS.2015.14.
[3] Divesh Aggarwal and Noah Stephens-Davidowitz. (Gap/S)ETH hardness of SVP. In Proceedings of the 50th Annual ACM SIGACT Symposium on Theory of Computing, STOC '18, pages 228–238. ACM, 2018. doi: 10.1145/3188745.3188840. URL https://arxiv.org/abs/1712.00942.
[4] Boris Aronov, Matthew J. Katz, and Elad Sulami. Dynamic time warping-based proximity problems. In 45th International Symposium on Mathematical Foundations of Computer Science, volume 170
of Leibniz International Proceedings in Informatics (LIPIcs), pages 9:1–9:12. Schloss Dagstuhl–Leibniz-Zentrum für Informatik, 2020. doi: 10.4230/LIPIcs.MFCS.2020.9.
[5] Arturs Backurs and Piotr Indyk. Edit distance cannot be computed in strongly subquadratic time (unless SETH is false). In Proceedings of the Forty-Seventh Annual ACM Symposium on Theory of Computing, STOC '15, pages 51–58. ACM, 2015. doi:10.1145/2746539.2746612.
[6] Gustavo E. A. P. A. Batista, Eamonn J. Keogh, Oben Moses Tataw, and Vinícius M. A. de Souza. CID: An efficient complexity-invariant distance for time series. Data Mining and Knowledge Discovery, 28(3):634–669, 2014. doi: 10.1007/s10618-013-0312-3.
[7] Huck Bennett and Chris Peikert. Hardness of bounded distance decoding on lattices in norms. In 35th Computational Complexity Conference (CCC 2020), volume 169 of Leibniz International Proceedings in Informatics (LIPIcs), pages 36:1–36:21. Schloss Dagstuhl–Leibniz-Zentrum für Informatik, 2020. doi: 10.4230/LIPIcs.CCC.2020.36.
[8] Donald J. Berndt and James Clifford. Using dynamic time warping to find patterns in time series. In Proceedings of the AAAI Workshop on Knowledge Discovery in Databases, pages 359–370, 1994. URL https://cdn.aaai.org/Workshops/1994/WS-94-03/WS94-03-031.pdf.
[9] Lotte Blank. Fréchet distance in the imbalanced case. In 42nd International Symposium on Computational Geometry (SoCG 2026), volume 367 of Leibniz International Proceedings in Informatics (LIPIcs), pages 17:1–17:17. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2026. doi: 10.4230/LIPIcs.SoCG.2026.17. URL https://drops.dagstuhl.de/entities/document/10.4230/LIPIcs.SoCG.2026.17.
[10] Mathieu Blondel, Arthur Mensch, and Jean-Philippe Vert. Differentiable divergences between time series. In Proceedings of the 24th International Conference on Artificial Intelligence and Statistics, volume 130 of Proceedings of Machine Learning Research, pages 3853–3861. PMLR, 2021. URL https://proceedings.mlr.press/v130/blondel21a.html.
[11] Itai Boneh, Shay Golan, and Tomasz Kociumaka. Dynamic time warping in the low-distance regime, 2026. URL https://arxiv.org/abs/2609.40249. Preprint; the authors report acceptance to FOCS 2026.
[12] Karl Bringmann. Why walking the dog takes time: Fréchet distance has no strongly subquadratic algorithms unless SETH fails. In 2014 IEEE 55th
Annual Symposium on Foundations of Computer Science, FOCS '14, pages 661–670. IEEE, 2014. doi:10.1109/FOCS.2014.76.
[13] Karl Bringmann and Marvin Künnemann. Quadratic conditional lower bounds for string problems and dynamic time warping. In 2015 IEEE 56th Annual Symposium on Foundations of Computer Science, FOCS '15, pages 79–97. IEEE, 2015. doi: 10.1109/FOCS.2015.15.
[14] Karl Bringmann, Anne Driemel, André Nusser, and Ioannis Psarros. Tight bounds for approximate near neighbor searching for time series under the fréchet distance. In Proceedings of the 2022 Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 517–550, 2022. doi: 10.1137/1.9781611977073.25. URL https://arxiv.org/abs/2107.07792.
[15] Karl Bringmann, Nick Fischer, Ivor van der Hoog, Evangelos Kipouridis, Tomasz Kociumaka, and Eva Rotenberg. Dynamic dynamic time warping. In Proceedings of the 2024 Annual ACM-SIAM Symposium on Discrete Algorithms, SODA '24, pages 208–242. SIAM, 2024. doi: 10.1137/1.9781611977912.10.
[16] Boris Bukh, Karthik C. S., and Bhargav Narayanan. Applications of random algebraic constructions to hardness of approximation. In 2021 IEEE 62nd Annual Symposium on Foundations of Computer Science, FOCS '21, pages 237–244. IEEE, 2021. doi:10.1109/FOCS52979.2021.00032. URL https://arxiv.org/abs/2111.05518. The conference took place in February 2022.
[17] Zemin Chao, Hong Gao, Yinan An, and Jianzhong Li. The inherent time complexity and an efficient algorithm for subsequence matching problem. Proceedings of the VLDB Endowment, 15(7):1453–1465, 2022. doi: 10.14778/3523210.3523222. URL https://www.vldb.org/pvldb/vol15/p1453-chao.pdf.
[18] Zemin Chao, Qiaoyi Zheng, Zhixin Qi, and Hongzhi Wang. FSMDTW: A fast index-free subsequence matching algorithm for dynamic time warping. Proceedings of the VLDB Endowment, 18(10):3628–3640, 2025. doi: 10.14778/3748191.3748220.
[19] Lei Chen and Raymond T. Ng. On the marriage of -norms and edit distance. In Proceedings of the Thirtieth International Conference on Very Large Data Bases, pages 792–803, 2004. doi: 10.1016/B978-012088469-8.50070-X.
[20] Lei Chen, M. Tamer Özsu, and Vincent Oria. Robust and fast similarity search for moving object trajectories. In Proceedings of the 2005 ACM SIGMOD International Conference on Management of Data, pages 491–502. ACM, 2005. doi: 10.1145/1066157.1066213.
[21] Marco Cuturi and Mathieu Blondel. Soft-DTW: A differentiable loss function for time-series. In Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pages 894–903. PMLR, 2017. URL https://proceedings.mlr.press/v70/cuturi17a.html.
[22] Anne Driemel and Francesco Silvestri. Locality-sensitive hashing of curves. In 33rd International Symposium on Computational Geometry, volume 77 of Leibniz International Proceedings in Informatics (LIPIcs), pages 37:1–37:16. Schloss Dagstuhl-Leibniz-Zentrum für Informatik, 2017. doi: 10.4230/LIPIcs.SoCG.2017.37.
[23] Thomas Eiter and Heikki Mannila. Computing discrete fréchet distance. Technical Report CD-TR 94/64, Technical University of Vienna, Information Systems Department, 1994. URL https://www.kr.tuwien.ac.at/staff/eiter/et-archive/files/cdtr9464.pdf.
[24] Christos Faloutsos, M. Ranganathan, and Yannis Manolopoulos. Fast subsequence matching in time-series databases. In Proceedings of the 1994 ACM SIGMOD International Conference on Management of Data, pages 419–429. ACM, 1994. doi: 10.1145/191839.191925.
[25] Arnold Filtser, Omrit Filtser, and Matthew J. Katz. Approximate nearest neighbor for curves—simple, efficient, and deterministic. In 47th International Colloquium on Automata, Languages, and Programming, volume 168 of Leibniz International Proceedings in Informatics (LIPIcs), pages 48:1–48:19. Schloss Dagstuhl–Leibniz-Zentrum für Informatik, 2020. doi:10.4230/LIPIcs.ICALP.2020.48.
[26] Karthik Gajulapalli, Alexander Golovnev, Samuel King, and Sidhant Saraogi. Online orthogonal vectors revisited. In Proceedings of the 2026 Annual ACM-SIAM Symposium on Discrete Algorithms, SODA '26, pages 5641–5668. SIAM, 2026. doi:10.1137/1.9781611978971.201.
[27] Elazar Goldenberg, Aviad Rubinstein, and Barna Saha. Does preprocessing help in fast sequence comparisons? In Proceedings of the 52nd Annual ACM SIGACT Symposium on Theory of Computing, pages 657–670, 2020. doi: 10.1145/3357713.3384300. URL https://arxiv.org/abs/2108.09115.
[28] Isaac Goldstein, Moshe Lewenstein, and Ely Porat. Orthogonal vectors indexing. In 28th International Symposium on Algorithms and Computation, volume 92 of Leibniz International Proceedings in Informatics (LIPIcs), pages 40:1–40:12. Schloss Dagstuhl–Leibniz-Zentrum für Informatik, 2017. doi:10.4230/LIPIcs.ISAAC.2017.40.
[29] Joachim Gudmundsson, Martin P. Seybold, and Sampson Wong. Map matching queries on realistic input graphs under the fréchet distance. ACM Transactions on Algorithms, 20(2):1–33, 2024. doi: 10.1145/3643683. URL https://eprints.cs.univie.ac.at/8043/1/Map_matching_queries.pdf.
[30] Wassily Hoeffding. Probability inequalities for sums of bounded random variables. Journal of the American Statistical Association, 58(301):13–30, 1963. doi:10.1080/01621459.1963.10500830.
[31] Russell Impagliazzo and Ramamohan Paturi. On the complexity of k-SAT. Journal of Computer and System Sciences, 62(2):367–375, 2001. doi: 10.1006/jcss.2000.1727.
[32] Russell Impagliazzo, Ramamohan Paturi, and Francis Zane. Which problems have strongly exponential complexity? Journal of Computer and System Sciences, 63(4):512–530, 2001. doi: 10.1006/jcss.2001.1774.
[33] Fumitada Itakura. Minimum prediction residual principle applied to speech recognition. IEEE Transactions on Acoustics, Speech, and Signal Processing, 23(1):67–72, 1975. doi: 10.1109/TASSP.1975.1162641.
[34] Young-Seon Jeong, Myong K. Jeong, and Olufemi A. Omitaomu. Weighted dynamic time warping for time series classification. Pattern Recognition, 44(9): 2231–2240, 2011. doi: 10.1016/j.patcog.2010.09.022.
[35] Eamonn J. Keogh. Exact indexing of dynamic time warping. In Proceedings of the 28th International Conference on Very Large Data Bases, pages 406–417, 2002. doi: 10.1016/B978-155860869-6/50043-3.
[36] Eamonn J. Keogh and Michael J. Pazzani. Derivative dynamic time warping. In Proceedings of the 2001 SIAM International Conference on Data Mining, pages 1–11. SIAM, 2001. doi: 10.1137/1.9781611972719.1.
[37] William Kuszmaul. Dynamic time warping in strongly subquadratic time: Algorithms for the low-distance regime and approximate evaluation. In 46th International Colloquium on Automata, Languages, and Programming, volume 132 of Leibniz International Proceedings in Informatics (LIPIcs), pages 80:1–80:15. Schloss Dagstuhl–Leibniz-Zentrum für Informatik, 2019. doi: 10.4230/LIPIcs.ICALP.2019.80.
[38] Daniel Lemire. Faster retrieval with a two-pass dynamic-time-warping lower bound. Pattern Recognition, 42(9):2169–2180, 2009. doi: 10.1016/j.patcog.2008.11.030.
[39] Pierre-François Marteau. Time warp edit distance with stiffness adjustment for time series matching. IEEE Transactions on Pattern Analysis and Machine Intelligence, 31(2):306–318, 2009. doi:10.1109/TPAMI.2008.76.
[40] Michael D. Morse and Jignesh M. Patel. An efficient and accurate method for evaluating time series similarity. In Proceedings of the 2007 ACM SIGMOD International Conference on Management of Data, pages 569–580. ACM, 2007. doi: 10.1145/1247480.1247544.
[41] Vit Niennattrakul, Pongsakorn Ruengronghirunya, and Chotirat Ann Ratanamahatana. Exact indexing for massive time series databases under time warping distance. Data Mining and Knowledge Discovery, 21(3):509–541, 2010. doi: 10.1007/s10618-010-0165-y.
[42] Thanawin Rakthanmanon, Bilson Campana, Abdullah Mueen, Gustavo E. A. P. A. Batista, M. Brandon Westover, Qiang Zhu, Jesin Zakaria, and Eamonn J. Keogh. Searching and mining trillions of time series subsequences under dynamic time warping. In Proceedings of the 18th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pages 262–270. ACM, 2012. doi:10.1145/2339530.2339576.
[43] Aviad Rubinstein. Hardness of approximate nearest neighbor search. In Proceedings of the 50th Annual ACM SIGACT Symposium on Theory of Computing, STOC '18, pages 1260–1268. ACM, 2018. doi: 10.1145/3188745.3188916.
[44] Hiroaki Sakoe and Seibi Chiba. Dynamic programming algorithm optimization for spoken word recognition. IEEE Transactions on Acoustics, Speech, and Signal Processing, 26(1):43–49, 1978. doi:10.1109/TASSP.1978.1163055.
[45] Temple F. Smith and Michael S. Waterman. Identification of common molecular subsequences. Journal of Molecular Biology, 147(1):195–197, 1981. doi:10.1016/0022-2836(81)90087-5.
[46] Alexandra Stefan, Vassilis Athitsos, and Gautam Das. The move-split-merge metric for time series. IEEE Transactions on Knowledge and Data Engineering, 25(6):1425–1438, 2013. doi: 10.1109/TKDE.2012.88.
[47] Michail Vlachos, George Kollios, and Dimitrios Gunopulos. Discovering similar multidimensional trajectories. In Proceedings of the 18th International Conference on Data Engineering, pages 673–684. IEEE, 2002. doi: 10.1109/ICDE.2002.994784.
[48] Geoffrey I. Webb and François Petitjean. Tight lower bounds for dynamic time warping. Pattern
Recognition, 115:107895, 2021. doi: 10.1016/j.patcog.2021.107895.
[49] Jiaye Wu, Peng Wang, Ningting Pan, Chen Wang, Wei Wang, and Jianmin Wang. KV-Match: A subsequence matching approach supporting normalization and time warping. In 2019 IEEE 35th International Conference on Data Engineering, ICDE '19, pages 866–877. IEEE, 2019. doi: 10.1109/ICDE.2019.00082.