1 Introduction

Background

In the 1990’s timed automata have been introduced by Alur and Dill [2]. They extend finite automata by clocks that can be compared against integer constants and provide a popular formalism to reason about the behavior of real-time systems with desirable algorithmic properties; for instance the reachability/emptiness problem is decidable and in fact PSPACE-complete [1].

For a more general means to specify the behavior of under-specified systems, such as embedded systems, Alur, Henzinger and Vardi [3] have introduced parametric timed automata (PTA) only a few years later. By a PTA we mean a parametric timed automaton over discrete time whose guards are of the form xp and xk, where x is a clock, p is a parameter ranging over unspecified non-negative integers and k is a constant ranging over the non-negative integers. A clock x is parametric if it appears in at least one guard of the form xp and non-parametric otherwise.

Towards the verification of safety properties, or loosely speaking ruling out the existence of an execution to a bad state, the reachability problem for PTA in turn asks for the existence of an assignment of the parameters to the non-negative integers such that reachability holds in the resulting timed automaton.

On the negative side, it has been shown in [3] that already for PTA that contain three parametric clocks reachability is undecidable — even in the presence of a single parameter [8].

On the positive side however, Alur, Henzinger and Vardi have shown in [3] that reachability is decidable for PTA that contain only one parametric clock but allowing arbitrarily many non-parametric clocks, yet by an algorithm whose running time is non-elementary.

For PTA over one parametric clock (and arbitrarily many non-parametric clocks), Bundala and Ouaknine have shown a first elementary complexity upper bound for the reachability problem; it is shown to be NEXP-hard and in 2NEXP [10]. The matching NEXP upper bound has been proven by Beneš et al. in [8] (also in the continuous time setting), we refer to [9] for an alternative proof by Bollig, Quaas and Sangnier using alternating 2-way automata.

Bundala and Ouaknine [10] have recently advanced the decidability and complexity status of the reachability problem for PTA over two parametric clocks [10] (and arbitrarily many non-parametric clocks): it is shown that in the presence of one parameter the reachability problem is decidable and hard for the complexity class PSPACENEXP. To the best of our knowledge, this is in fact the largest subclass of PTA for which reachability is known to be decidable. For showing the above-mentioned decidability result [10] provides a reduction from PTA over two parametric clocks to a suitable formalism of parametric one-counter automata. Such an approach via parametric one-counter automata has already successfully been applied to model checking freeze-LTL as shown by Demri and Sangnier [12] and Lechner et al. [21], yet notably over a weaker model of parametric one-counter automata than the one introduced in [10]. On this note, it is worth mentioning that inter-reductions between the reachability problem of (non-parametric) timed automata involving two clocks and one-counter automata have already been established by Haase et al. [16, 17].

Decidability of reachability in PTA over two parametric clocks (with arbitarily many non-parametric clocks and arbitarily many parameters) is still considered to be a challenging open problem to the best of our knowledge. For instance, as already remarked in [3], there is an easy reduction from the existential fragment of Presburger Arithmetic with divisibility to reachability in PTA over two parametric clocks.

Our contribution

Our main result (Theorem 5) states that reachability in parametric timed automata over two parametric clocks, arbitrarily many non-parametric clocks, and one integer-valued parameter, is EXPSPACE-complete. Our contribution is two-fold.

Inspired by [13, 14], for the EXPSPACE lower bound we make use of deep results from complexity theory, namely a serializability characterization of EXPSPACE (in turn originally based on Barrington’s Theorem [7]) and a logspace translation of numbers in Chinese remainder representation to binary representation due to Chiu, Davida, and Litow [11]. It is shown that with small PTA over two parametric clocks and one parameter one can simulate serializability computations.

For the EXPSPACE upper bound, we first give a careful exponential time reduction from PTA over two parametric clocks and one parameter to a (slight subclass of) parametric one-counter automata over one parameter based on a minor adjustment of a construction due to Bundala and Ouaknine [10]. In solving the reachability problem for parametric one-counter automata with one parameter, we provide a series of techniques to partition a fictitious run into several carefully chosen subruns that allow us to prove that it is sufficient to consider a parameter value of exponential magnitude. This allows us to show a doubly-exponential upper bound on the value of the only parameter of PTA with two parametric clocks and one parameter. We hope that extensions of our techniques lead to finally establishing decidability of the long-standing open problem of reachability in parametric timed automata with two parametric clocks (and arbitrarily many parameters) and, if decidability holds, determinining its precise computational complexity.

As the results in [3], our results hold for PTA over discrete time, where it is worth mentioning that in [3] parameters can both be integer-valued and rational-valued. Indeed, for PTA with closed (i.e. non-strict) clock constraints and parameters ranging over integers, techniques [19, 23] exist that allow to reduce the reachability problem over continuous time to discrete time. There is a plethora of variants of PTA that have recently been studied, we refer to [4] for an extensive overview by André.

Overview of this paper

In Section 2 we introduce general notations and state our main result. Our EXPSPACE lower bound can be found in Section 3. Section 4 introduces parametric one-counter automata and states an exponential time reduction from reachability in parametric timed automata with two parametric clocks and one parameter to reachability in parametric one-counter automata. Section 5 states the EXPSPACE upper bound and the central Small Parameter Theorem (Theorem 18). It also gives an overview of the proof of the Small Parameter Theorem, which itself stretches over Sections 6,7,8, and 9.

2 Preliminaries

We assume the reader is familiar with Turing machines and standard complexity classes such as LOGSPACE, PSPACE and EXPSPACE. We refer to [5, 24] for further details on complexity. We also assume the reader is familiar with (deterministic) finite automata and regular languages, we refer to [18] for more details on this.

By \(\mathbb {Z} \) we denote the integers and by \(\mathbb {N}=\{0,1,\ldots \}\) we denote the non-negative integers. For every \(a,b\in \mathbb {Z}\) with ab we define \([a,b]=\{k\in \mathbb {Z}\mid a\leq k\leq b\}\). For every n ≥ 1 we define \(n\mathbb {Z}=\{n\cdot z\mid z\in \mathbb {Z}\}\). For every number \(n\in \mathbb {N}\) we define \(\log (n)=\min \limits \{i+1\mid i\in \mathbb {N}, n\leq 2^{i}\}\), which is the smallest number of bits necessary to write down n in binary. For every finite alphabet A we denote by A the set of finite words over A and denote the empty word by ε. For all aA and all wA let |w|a denote the number of occurrences of the letter a in w. For every finite set \(M\subset \mathbb {N}\setminus \{0\}\) let \(\mathsf {LCM}(M)=\min \limits \{n\geq 1\mid \forall m\in M\setminus \{0\}: m|n\}\) denote the least common multiple of the elements in M. For any \(j \in \mathbb {N}\) let LCM(j) = LCM([1,j]) denote the least common multiple of the numbers {1,…,j}. For any two sets X and S, let XS denote the set of all functions from S to X. For any set S let \({\mathscr{P}}(S) = \{ X \mid X \subseteq S \}\) denote the power set of S.

A guard over a finite set of clocks Ω and a finite set of parameters P is a comparison of the form g = ωe, where ω ∈Ω, \(e\in P\cup \mathbb {N}\), and ⋈ ∈{<,≤,=,≥,>}; in case eP we call g parametric, and non-parametric otherwise. We denote by \(\mathcal {G}({\Omega },P)\) the set of guards over the set of clocks Ω and the set of parameters P. The size |g| of a guard g = ωe is defined as

$$ |g|=\left\{\begin{array}{ll} \log(e)&\text{if} e\in\mathbb{N}\\ 1 &\text{otherwise}. \end{array}\right. $$

A clock valuation is a function from Ω to \(\mathbb {N}\); we write \(\vec {0}\) to denote the clock valuation ω↦0. For each clock valuation v and each \(t\in \mathbb {N}\) we denote by v + t the clock valuation ωv(ω) + t. A parameter valuation is a function μ from P to \(\mathbb {N}\). For every guard g = ωp with pP (resp. g = ωk with \(k\in \mathbb {N}\)) we write vμg if v(ω)⋈μ(p) (resp. v(ω)⋈k; in this case we may also simply write vg). We define an empty guard g𝜖 over a non-empty finite set of clocks Ω and a finite set of parameters P to be of the form ω ≥ 0 for some ω ∈Ω. In particular, we define g𝜖 such that for all \(v \in \mathbb {N}^{\Omega }\) and all \(\mu \in \mathbb {N}^{P}\) we have vμg𝜖, hence g𝜖 can be used as a guard that is always true.

A parametric timed automaton as introduced in [3] is a finite automaton extended with a finite set of parameters P and a finite set of clocks Ω that all progress at the same rate and that can be individually reset to zero. Moreover, every transition is labeled by a guard over Ω and P and by a set of clocks to be reset. Formally, a parametric timed automaton (PTA for short) is a tuple \(\mathcal {A}=(Q,{\Omega },P,R,q_{init},F)\), where

  • Q is a non-empty finite set of control states,

  • Ω is a non-empty finite set of clocks,

  • P is a finite set of parameters,

  • \(R\subseteq Q\times \mathcal {G}({\Omega },P)\times {\mathscr{P}}({\Omega }) \times Q\) is a finite set of rules,

  • qinitQ is an initial control state, and

  • \(F\subseteq Q\) is a set of final control states.

A clock ω ∈Ω is called parametric if there exists some \((q,g,U,q^{\prime })\in R\) such that the guard g is of the form ωp, with ⋈ ∈{<,≤,=,≥,>} and pP. We also refer to \(\mathcal {A}\) as a (m,n)-PTA if m = |{ω ∈Ω∣ω is parametric}| is the number of parametric clocks and n = |P| is the number of parameters of \(\mathcal {A}\) — sometimes we also just write (m,∗)-PTA (resp. (∗,n)-PTA) when n (resp. m) is a priori not fixed.

The size of \(\mathcal {A}\) is defined as

$$ |\mathcal{A}| \ = \ |Q|+|{\Omega}|+|P|+|R|+\sum\limits_{(q,g,U,q^{\prime})\in R}|g|. $$

Let \({\mathsf {Consts}}(\mathcal {A}) = \{ c\in \mathbb {N} \mid \exists (q,g,U,q^{\prime })\in R, \ \exists \omega \in {\Omega } : g = \omega \bowtie c \}\) denote the set of constants that appear in the guards of the rules of \(\mathcal {A}\).

By \(\textsf {Conf}(\mathcal {A})=Q\times \mathbb {N}^{\Omega }\) we denote the set of configurations of \(\mathcal {A}\). We prefer however to denote a configuration by q(v) instead of (q,v).

Definition 1

For each parameter valuation \(\mu :P\rightarrow \mathbb {N}\) and each \((\delta ,t)\in R\times \mathbb {N}\) with \(\delta = (q,g,U,q^{\prime })\in R\), let \(\xrightarrow {\delta ,t,\mu }\) denote the binary relation \(\textsf {Conf}(\mathcal {A})\), where \(q(v)\xrightarrow {\delta ,t, \mu } q^{\prime }(v^{\prime })\) if v + tμg, \(v^{\prime }(u)=0\) for all uU and \(v^{\prime }(\omega )=v(\omega )+t\) for all ω ∈Ω∖ U.

A μ-run from q0(v0) to qn(vn) is a sequence \(q_{0}(v_{0})\xrightarrow {\delta _{1},t_{1},\mu } q_{1}(v_{1})\cdots \xrightarrow {\delta _{n},t_{n},\mu } q_{n}(v_{n})\); it is called reset-free if the set appearing in the third component is empty for all δi. We sometimes use the abbreviation \(q(v) {\xrightarrow {\mu }}^{*} q^{\prime }\left (v^{\prime } \right )\) to denote a μ-run of arbitrary length from q(v) to \(q^{\prime }(v^{\prime })\).

In case P = {p} is a singleton and μ(p) = N we prefer to say N-run instead of μ-run. We say reachability holds for \(\mathcal {A}\) if there is a μ-run from \(q_{init}(\vec {0})\) to some configuration q(v) for some qF, some \(v\in \mathbb {N}^{\Omega }\), and some \(\mu \in \mathbb {N}^{P}\). We refer to Fig. 1 for an instance of a PTA for which reachability holds.

Fig. 1
figure 1

An example of a PTA. The automaton consists of three states, the set of clocks is {x,y}, the set of parameters is {p}. The edges are represented by arrows labeled with the corresponding guard and the set of clocks U to be reset. A parameter valuation μ witnesses that reachability holds for this PTA if, and only, if and only if, \(\mu (p)\in 3\mathbb {Z}\)

In the particular case where P = {p} is a singleton for some parameter p and μ(p) = N we prefer to write \(q(v)\xrightarrow {N}q^{\prime }(v^{\prime })\) (resp. \(q(v){\xrightarrow {N}}^{*} q^{\prime }(v^{\prime }))\)) to denote \(q(v)\xrightarrow {\mu }q^{\prime }(v^{\prime })\) (resp. HCode \(q(v){\xrightarrow {\mu }}^{*} q^{\prime }(v^{\prime }))\)) and prefer to write ⊧N to denote ⊧μ.

It is worth mentioning that there are further modes of time valuations and guards which exist in the literature, we refer to [4] for a recent overview.

We are interested in the following decision problem.(m,n)-PTA-ReachabilityINPUT: A (m,n)-PTA \(\mathcal {A}\).QUESTION: Does reachability hold for \(\mathcal {A}\)?

Alur et al. have already shown in their seminal paper that PTA-Reachability is in general undecidable, already in presence of only three parametric clocks [3], Beneš et al. strengthened this when only one parameter is present [8].

Theorem 2 (8)

(3,1)-PTA-Reachability is undecidable.

To the contrary, (1,∗)-PTA-Reachability has recently been shown to be complete for NEXP, where a non-elementary upper bound was initially given by Alur et al. [3].

Theorem 3 (8,9,10)

(1,∗)-PTA-Reachability is NEXP-complete.

On the other end, decidability of (2,∗)-PTA-Reachability is still open to the best of our knowledge. In presence of one parameter the following is known.

Theorem 4 (10)

(2,1)-PTA-Reachability is decidable and PSPACENEXP-hard.

The following theorem states our main result.

Theorem 5

(2,1)-PTA-Reachability is EXPSPACE-complete.

3 Lower Bounds

In this section we show an EXPSPACE lower bound for (2,1)-PTA-Reachability. Section 3.1 introduces some auxiliary gadgets that show that on small (2,1)-PTA with two parametric clocks x and y and one parameter p one can perform both (i) PSPACE computations and (ii) compute xy mod p modulo numbers that are dynamically given in binary. Section 3.2 builds upon these auxiliary gadgets and shows how to implement serializability computations in a leaf language characterization of EXPSPACE [13], which is a simple padded variant of the leaf language characterization of PSPACE due to Hertrampf et al. [20].

3.1 PSPACE and Modulo Computations

For each \(i,n\in \mathbb {N}\) let Biti(n) denote the i-th least significant bit of the binary presentation of n, where the least significant bit is on the left, i.e. \(n={\sum }_{i\in \mathbb {N}}2^{i}\cdot \textsc {Bit}_{i}(n)\). For each m ≥ 1, by Binm(n) = Bit0(n)⋯Bitm− 1(n) we denote the sequence of the first m least significant bits of the binary representation of n. Conversely, given a binary string \(w=w_{0}{\cdots } w_{m-1}\in \{0,1\}^{m}\) of length m we denote by \(\textsc {Val}(w)={\sum }_{i=0}^{m-1} 2^{i}\cdot w_{i}\in [0,2^{m}-1]\) the value of w interpreted as a non-negative integer.

Let \(\mathcal {A}\) be a parametric timed automaton over a set of clocks Ω with two parametric clocks x and y. We say a valuation \(v:{\Omega } \rightarrow \mathbb {N}\) is bit-compatible if v(ζ) ∈{0,1} for all non-parametric clocks ζ ∈Ω of \(\mathcal {A}\). Assume moreover that Ω contains non-parametric clocks Θ+ ∪Θ, where Θ is some set and Θ+ = {𝜗+𝜗 ∈Θ} and Θ = {𝜗𝜗 ∈Θ} are two disjoint corresponding copies of Θ; in this case, for any valuation \(v:{\Omega } \rightarrow \mathbb {N}\) we define the mapping \(\widehat {v}:{\Theta } \rightarrow \{0,1\}\) as

$$ \widehat{v}(\vartheta)= \begin{cases}0 & \text{if} v(\vartheta^{+})=v(\vartheta^{-})\\ 1 & \text{otherwise}. \end{cases} $$

In the following we call such non-parametric clocks {𝜗+,𝜗𝜗 ∈Θ}, appearing as implicit pairs, bit clocks since they are used to encode bits. The following definition expresses when a parametric timed automaton over two parametric clocks and one parameter computes a function from \(\mathbb {N}\times \{0,1\}^{n}\) to {0,1}m. Notably, both before execution it assumes, and after execution it guarantees, a bit-compatible valuation that assigns its two parametric clocks values in the interval [0,N − 1], where N denotes the assigned value of its only parameter. In the following definition, it is important to note that the involved clocks are not (and in fact must not) assumed to be initially set to zero.

Definition 6

A (2,1)-PTA \(\mathcal {A}=(Q,{\Omega },\{p\},R,q_{init},\{q_{fin}\})\) whose parametric clocks are x and y and whose one parameter is p computes a function \(f:\mathbb {N}\times \{0,1\}^{n}\rightarrow \{0,1\}^{m}\) if its set of clocks Ω contains two disjoint sets of

  • non-parametric “input” bit clocks \(\{{in_{0}}^{+},{{in}_{0}}^{-},\ldots , {in}_{n-1}^{+},{in}_{n-1}^{-}\}\),

  • non-parametric “output” bit clocks \(\{{{out}_{0}}^{+},{{out}_{0}}^{-},\ldots , {{out}_{m-1}}^{+},{{out}_{m-1}}^{-}\}\),

such that for all \(N\in \mathbb {N}\) and all bit-compatible \(v_{0}:{\Omega } \rightarrow [0,N-1]\) we have

  1. 1.

    \(q_{init}(v_{0}){\xrightarrow {N}}^{*}q_{fin}(v^{\prime })\) for some bit-compatible \(v^{\prime }:{\Omega } \rightarrow [0,N-1]\) and

  2. 2.

    for all \(v^{\prime }:{\Omega } \rightarrow \mathbb {N}\) for which \(q_{init}(v_{0}){\xrightarrow {N}}^{*}q_{fin}(v^{\prime })\) we have

    • \(v^{\prime }\in [0,N-1]^{\Omega }\) is bit-compatible,

    • \(\widehat {v^{\prime }}(in_{i})=\widehat {v_{0}}(in_{i})\) for all i ∈ [0,n − 1],

    • \(v^{\prime }(x)-v^{\prime }(y)\equiv v_{0}(x)-v_{0}(y) \mod N\), and

    • \({\prod }_{j=0}^{m-1}\widehat {v^{\prime }}({out}_{j})= f(v_{0}(x)-v_{0}(y) \mod N,{\prod }_{i=0}^{n-1} \widehat {v_{0}}({in}_{i}))\), where \(\prod \) denotes concatenation.

Importantly, the execution of any N-run \(q_{init}(v_{0})\!\xrightarrow {N}\!q_{fin}(v^{\prime })\) does not have any side effects on the binary interpretation of the “input” bit clocks, i.e. the string \({\prod }_{i=0}^{n-1}\widehat {v_{0}}(in_{i})\) equals \({\prod }_{i=0}^{n-1}\widehat {v^{\prime }}(in_{i})\).

The following lemma essentially has its roots in the PSPACE-hardness proof for the emptiness problem for timed automata (without parameters) introduced by Alur and Dill [2], however constructed to satisfy the carefully chosen interface given by Definition 6.

Lemma 7

For every PSPACE-computable function \(g:\{0,1\}^{n}\rightarrow \{0,1\}^{m}\) one can compute in polynomial time in n + m a (2,1)-PTA computing the function \(f:\mathbb {N}\times \{0,1\}^{n}\rightarrow \{0,1\}^{m}\), where f(k,w) = g(w) for all \((k,w)\in \mathbb {N}\times \{0,1\}^{n}\).

Proof

Let us fix some PSPACE-computable function \(g:\{0,1\}^{n}\rightarrow \{0,1\}^{m}\). Let us moreover fix some t(n)-space bounded deterministic Turing machine \({\mathscr{M}}\) computing g, where t is some fixed polynomial.

We explicitly store the value of our input by making use of our non-parametric “input” bit clocks \(\{{in_{0}}^{+},{{in}_{0}}^{-},\ldots , {in}_{n-1}^{+},{in}_{n-1}^{-}\}\). Similarly, we explicitly store the value of our output with the non-parametric “output” bit clocks \(\{{{out}_{0}}^{+},{{out}_{0}}^{-},\ldots , {{out}_{m-1}}^{+},{{out}_{m-1}}^{-}\}\). Since f(k,w) = g(w) we need to provide a computation that presents g(w) ∈{0,1}m using the “output” bit clocks. Let Ω denote the set of clocks of the (2,1)-PTA \(\mathcal {A}\) whose construction we discuss next.

For every non-parametric clock in \(\mathcal {A}\) we reset it once it has value 2; this is achieved by suitable self-loops in every state of the construction except for the final control state qfin. Similarly, we establish that both of the parametric clocks x and y are being reset once they have reached value N. This way the difference between the values of x and y will stay unchanged modulo the valuation N of the only parameter p. Importantly, other than that neither x nor y will be modified during the following construction.

We will enforce that finally the values of all non-parametric clocks remain in {0,1} and that the two parametric clocks have a value in [0,N − 1] as follows. A final control state qfin is preceded by a final gadget in which no time elapses that verifies via a sequence of suitable guards that the parametric and non-parametric clocks are as required.

Let us consider now any pair of bit clocks 𝜗+ and 𝜗 and any current bit-compatible valuation \(v:{\Omega } \rightarrow \mathbb {N}\). We have \(\widehat {v}(\vartheta )=1\) if, and only if, either v(𝜗+) = 0 and v(𝜗) = 1 or conversely v(𝜗+) = 1 and v(𝜗) = 0. Similarly, when we want to set the value \(\widehat {v}(\vartheta )\) to 0, we reset both clocks 𝜗+ and 𝜗 at the same time, and when we want to set the value \(\widehat {v}(\vartheta )\) to 1, we reset 𝜗 when v(𝜗+) = 1 without resetting 𝜗+.

For simulating \({\mathscr{M}}\) our (2,1)-PTA \(\mathcal {A}\) will also use suitable O(t(n)) bit clocks, to store in binary the working tape of \({\mathscr{M}}\).

Given the current bit-compatible valuation \(v:{\Omega } \rightarrow \mathbb {N}\), it is thus possible to inspect the input bit string \({\prod }_{i=0}^{n-1} \widehat {v}({in}_{i})\), read and write the polynomially sized working tape, and to write the output \({\prod }_{j=0}^{m-1}\widehat {v}({out}_{j})\). Let us discuss this in more detail.

For simulating \({\mathscr{M}}\), we choose the control states of our (2,1)-PTA \(\mathcal {A}\) as

$$ S \times \{0, \ldots,n-1 \} \times \{0, \ldots,m-1 \}\times \{0, \ldots,t(n)-1\} \times \{0,1\} \times \{0,1\}, $$

where S is the set of states of \({\mathscr{M}}\). We then simulate any step of \({\mathscr{M}}\) from a state q, current position i on the input tape, current position j on the output tape, current position h on the working tape, reading letter a on the input tape, reading letter b on the working tape, changing to a new state \(q^{\prime }\), new input head position \(i^{\prime }\), new output head position \(j^{\prime }\), and new working head position \(h^{\prime }\). To do that, we add to \(\mathcal {A}\) sequences of suitable rules from control state (q,i,j,h,a,b) to control state \((q^{\prime },i^{\prime },j^{\prime },h^{\prime },a^{\prime },b^{\prime })\) for all \(a^{\prime },b^{\prime } \in \{0,1 \iffalse ,\triangleright ,\triangleleft \fi \}\), by using suitable guards and reset operations that serve two purposes: first, checking whether \(a^{\prime }\) and \(b^{\prime }\) are indeed the values of the \(i^{\prime }\)-th (resp. \(h^{\prime }\)-th) cell of the input (resp. working) tape and second, writing on the j-th (resp. h-th) cell of the output (resp. working) tape.

Letting qinit denote some suitable initial state one can thus achieve that for all bit-compatible \(v_{0}: {\Omega } \rightarrow [0,N-1]\) and all \(v^{\prime }:{\Omega } \rightarrow \mathbb {N}\), if \(q_{0}(v_{0}){\xrightarrow {N}}^{*}q_{fin}(v^{\prime })\) then \(v^{\prime }\) is again a bit-compatible valuation from Ω to [0,N − 1]. □

Remark 8

The proof of Lemma 7 shows that if \(g:\mathbb {N}\times \{0,1\}^{n}\rightarrow \{0,1\}^{m}\) is computable by a (2,1)-PTA, then so is the function \(f:\mathbb {N}\times \{0,1\}^{n+\ell }\rightarrow \{0,1\}^{m}\), where f(k,w) = g(k,w1wn) for all \(k\in \mathbb {N}\) and all \(w=w_{1}{\cdots } w_{n+\ell }\in \{0,1\}^{n+\ell }\): indeed, one can manipulate the 2 additional input bit clocks by repeatedly resetting them once they have value 2, enforcing that the associated \(\widehat {v}\)-values stay throughout unchanged and that their value is finally strictly smaller than 2.

The following lemma shows that (2,1)-PTA can compute modulo dynamically given numbers in binary.

Lemma 9

One can compute in polynomial time in n + m a (2,1)-PTA that computes the function \(f:\mathbb {N}\times \{0,1\}^{n}\rightarrow \{0,1\}^{m}\), where f(k,w) = Binm(k mod Val(w)).

Proof

We need to show that in time polynomial in n + m one can construct a (2,1)-PTA \(\mathcal {A}\) whose set of clocks Ω contains the “input” bit clocks \(\{{in_{0}}^{+},{{in}_{0}}^{-},\ldots ,\) \( {in}_{n-1}^{+},{in}_{n-1}^{-}\}\) and “output” bit clocks \(\{{{out}_{0}}^{+},{{out}_{0}}^{-},\ldots ,\) \( {{out}_{m-1}}^{+},{{out}_{m-1}}^{-}\}\) that computes f. Let us assume some parameter value \(N\in \mathbb {N}\) and some bit-compatible valuation \(v_{0}:{\Omega } \rightarrow [0,N-1]\) satisfying \(w={\prod }_{i=0}^{n-1}\widehat {v_{0}}({in}_{i})\).

Again, we establish here also that the parametric clocks x and y are being reset once they have reached value N — however we sometimes explicitly disallow x to reach value N in certain gadgets mentioned below. This will be the only modification of x and y. In the following, reading and writing the \(\widehat {v}(\vartheta )\)-value for every pair of bit clocks 𝜗+,𝜗, guaranteeing that v(𝜗+),v(𝜗) ∈{0,1}, and guaranteeing that the parametric clocks finally have values in [0,N − 1] can be done as in the proof of Lemma 7.

We need the eventual output bit string \({\prod }_{j=0}^{m-1}\widehat {v^{\prime }}({out}_{j})\) to be equal to

$$ f(v_{0}(x)-v_{0}(y) \mod N,w) = \textsc{Bin}_{m}((v_{0}(x)-v_{0}(y) \mod N) \mod \textsc{Val}(w)). $$

Our automaton starts in some initial control state qinit. From qinit we introduce a gadget that nondeterministically writes some value u ∈{0,1}m in our “output” bit clocks that satisfies Val(u) < Val(w). From the end of the latter gadget we have a rule that checks if our parametric clock x has value 0 (just after being reset with value N), leading to a control state qwait. Assume our current valuation then is \(v:{\Omega } \rightarrow \mathbb {N}\). From qwait we have a rule to a state qsub letting no time elapse from which we claim there is a gadget that allows us to loop in qsub for precisely \(\textsc {Val}(w)=\textsc {Val}({\prod }_{i=0}^{n-1} \widehat {v}({in}_{i})))\) time units. One constructs the latter gadget as follows. Subsequently for every i ∈ [0,n − 1] one reads \(\widehat {v}({in}_{i})\) and in case \(\widehat {v}(in_{i})=1\) lets precisely 2i time units elapse via a suitable auxiliary clock and in case \(\widehat {v}(in_{i})=0\) lets 0 time units elapse. The gadget ends with a sequence of rules leading back to qsub by letting 0 time units elapse that verify that the parametric clock x has a value strictly smaller than N. Importantly, the parametric clock x is exceptionally not reset inside this gadget.

Finally, we add a rule from qsub to a suitable gadget that lets precisely \(\textsc {Val}({\prod }_{j=0}^{m-1}\widehat {v}(out_{j}))\) time units elapse (analogously as done above), followed by a test that verifies that the value of y equals 0 (after just being reset at value N). In addition, we append this latter gadget with a final sequence of rules (again letting no time elapse) to our final control state qfin that test if both x and y have a value strictly smaller than N and test if all non-parametric clocks have a value strictly smaller than 2. Thus, every valuation \(v^{\prime }:{\Omega } \rightarrow \mathbb {N}\) for which \(q_{init}(v_{0}){\xrightarrow {N}}^{*}q_{fin}(v^{\prime })\) holds is a bit-compatible valuation from Ω to [0,N − 1].

It is worth noting that by construction precisely v0(x) − v0(y) mod N time units have passed in any computation qwait to qfin. Since we have repeatedly waited Val(w) time units and finally verified that the remaining time is the guessed value initially nondeterministically written to our “output” bit clocks, we have

$$ \begin{array}{@{}rcl@{}} \prod\limits_{j=0}^{m-1}\widehat{v^{\prime}}(out_{j})&=& \textsc{Bin}_{m}((v_{0}(x)-v_{0}(y) \mod N) \mod \prod\limits_{i=0}^{n-1} \widehat{v_{0}}({in}_{i})))\\ &=& f(v_{0}(x)-v_{0}(y) \mod N,{\prod}_{i=0}^{n-1} \widehat{v_{0}}({in}_{i})) \end{array} $$

for any valuation \(v^{\prime }:{\Omega } \rightarrow \mathbb {N}\) with \(q_{init}(v_{0}){\xrightarrow {N}}^{*}q_{fin}(v^{\prime })\), as required. □

3.2 An EXPSPACE Lower Bound via serializability

This section is devoted to showing the following lower bound.

Theorem 10

(2,1)-PTA-Reachability is EXPSPACE-hard.

For each language \(L\subseteq A^{*}\) let \(\chi _{L}:A^{*}\rightarrow \{0,1\}\) denote its characteristic function. By ≼n we denote the lexicographic order on n-bit strings, thus wnv if Val(w) ≤Val(v), e.g. 0101 ≼40011.

Our EXPSPACE lower bound proof makes use of the following leaf language view of EXPSPACE from [13], which is a padded adjustment of the leaf-language characterization of PSPACE from [20], which in turn has its roots in Barrington’s Theorem [7].

Theorem 11 (Theorem 2 in 13)

For every language \(L\subseteq \{0,1\}^{*}\) in EXPSPACE there exists a polynomial \(s:\mathbb {N}\rightarrow \mathbb {N}\), a regular language \({\Lambda } \subseteq \{0,1\}^{*}\), and a language KLOGSPACE such that for all w ∈{0,1}n we have

$$ w\in L\quad\Longleftrightarrow\quad \prod\limits_{m=0}^{2^{2^{s(n)}-1}}\chi_{K}(w\cdot\textsc{Bin}_{2^{s(n)}}(m))\in {\Lambda}, $$
(1)

where ⋅ and \(\prod \) denote string concatenation.

Let us fix any language L in EXPSPACE and assume \(L\subseteq \{0,1\}^{*}\) without loss of generality. Applying Theorem 11, let us fix the regular language \({\Lambda } \subseteq \{0,1\}^{*}\) along with some fixed deterministic finite automaton D = (QD,{0,1},q0,δD,FD) with L(D) = Λ, the fixed polynomial s and the fixed language KLOGSPACE. Let us moreover fix an input w ∈{0,1}n of length n for L. Figure 2 rephrases characterization (1) in Theorem 11 in terms of an execution of a program that returns 1 if, and only if, wL.

Fig. 2
figure 2

A program returning 1 if, and only if, wL (using the characterization in Theorem 11), where D = (QD,{0,1},q0,δD,FD) is some deterministic finite automaton such that L(D) = Λ

Making use of D, s and K we will translate our input w ∈{0,1}n in polynomial time (in |w| = n) to some (2,1)-PTA \(\mathcal {A}=(Q,{\Omega },P,R,q_{init},F)\) such that

  • Ω will contain precisely two parametric clocks x and y and further clocks that are non-parametric,

  • P = {p} is a singleton, and

  • wL if, and only, if reachability holds for \(\mathcal {A}\).

The following lemma gives us a gadget (2,1)-PTA that allows us to enforce that the parameter p can only be evaluated to numbers that are larger than \(2^{2^{s(n)}}\).

Lemma 12

One can compute in polynomial time in n some parametric timed automaton \(\mathcal {A}_{big}=(Q_{big},{\Omega }_{big},\{p\},R_{big},q_{big,init},\{q_{big,fin}\})\) with two parametric clocks x,y ∈Ωbig and one parameter p such that

  1. 1.

    \(q_{big,init}(\vec {0}){\xrightarrow {N}}^{*} q_{big,fin}(v^{\prime })\) for some \(v^{\prime }:{\Omega }_{big}\rightarrow \mathbb {N}\) for some \(N\in \mathbb {N}\), and

  2. 2.

    for all \(N\in \mathbb {N}\) and all \(v^{\prime }:{\Omega }_{big}\rightarrow \mathbb {N}\) we have \(q_{big,init}(\vec {0}){\xrightarrow {N}}^{*}q_{big,fin}(v^{\prime })\) implies \(N>2^{2^{s(n)}}\).

Proof

Without loss of generality we may assume 2s(n)+ 1 ≥ 10. Letting N denote the parameter value of its only parameter p, our (2,1)-PTA \(\mathcal {A}_{big}\) will test whether N − 1 is divisible by all numbers in the interval [1,2s(n)+ 1 − 1]. This will be sufficient since LCM([1,k]) ≥ 2k for all k ≥ 9 by [22], thus implying \(N>N-1\geq \mathsf {LCM}([1,2^{s(n)+1}-1])\geq 2^{2^{s(n)+1}-1}>2^{2^{s(n)}}\). Consider the following program which returns 1 if, and only if, all numbers in [1,2s(n)+ 1 − 1] divide N − 1.

figure a

It remains to show that the program can be implemented by a (2,1)-PTA \(\mathcal {A}_{big}\) with a suitable final control state qbig,fin.

It is straightforward to initialize our two parametric clocks x and y in such a way that one can enforce valuations v that satisfy v(x) − v(y) = N − 1 mod N: indeed, starting from the valuation \(\vec {0}\), we can wait one unit of time after which we reset x but not y.

We will use O(s(n)) suitable bit clocks for storing the variables I and J respectively.

Lines (3), (4) and (7) can easily directly be achieved by reading and writing the O(s(n)) many bits clocks reserved for storing I and J. Line (5) boils down to incrementing I when viewed as s(n) + 1 bit integer and is thus obviously a polynomial space computable function from \(\mathbb {N}\times \{0,1\}^{s(n)}\) to {0,1}s(n) and hence computable using a suitable PTA based on Lemma 7. Line (6) is a function from \(\mathbb {N}\times \{0,1\}^{s(n)+1}\) to {0,1}s(n)+ 1 that can be implemented using a suitable PTA based on Lemma 9.

As in the proofs of Lemmas 7 and 9 we reset the two parametric clocks x and y once they have reached value N but only in case we are outside any of the gadget PTA corresponding to line (5) and line (6), respectively. Similarly we realize the implementation of the bit clocks for I and J by resetting them once they have reached value 2. □

Recall that we aim at implementing the program in Fig. 2 by a (2,1)-PTA \(\mathcal {A}\). The initial part of \(\mathcal {A}\) will consist of the gadget PTA \(\mathcal {A}_{big}\) which will allow us to enforce an assignment of p to some value \(N> 2^{2^{s(n)}}\). We first explain how to encode its variables and then discuss how to implement the different lines of the program.

Encoding the Variables of the Program in Fig. 2

Our PTA \(\mathcal {A}\) will store in its control states the current state q of D and the boolean variable b. We cannot easily “explicitly” store the value of our variable B in binary as in the proof of Lemma 7 via polynomially many bit clocks in such a way that, given the current valuation \(v:{\Omega } \rightarrow \mathbb {N}\), it suffices to simply inspect their \(\widehat {v}\)-value: indeed, there are only singly-exponentially many different combinations of such \(\widehat {v}\)-values, yet B is a number in \([0,2^{2^{s(n)}}]\) and thus of doubly-exponential magnitude. We will rather store the value \(B\in \mathbb {N}\) as the difference v(x) − v(y) mod N between our only two parametric clocks x and y: this is possible since \(N> 2^{2^{s(n)}}\) by our initial gadget PTA \(\mathcal {A}_{big}\). However, when inspecting line (7) of Fig. 2 we need to access certain bits of the exponentially long bit string \(w\cdot \textsc {Bin}_{2^{s(n)}}(B)\). For this, we access B in a different representation, namely in Chinese Remainder Representation that we introduce next.

Definition 13 (Chinese Remainder Representation)

Let pi denote the i-th prime number and assume \({\prod }_{i=1}^{m}p_{i}>B\) for some \(m\in \mathbb {N}\). Then CRRm(B) denotes the bit tuple \((b_{i,r})_{i\in [1,m],r\in [0,p_{i}-1]}\), where bi,r = 1 if B mod pi = r and bi,r = 0 otherwise.

Since B will need to take values in \([0,2^{2^{s(n)}}]\) and for every \(k\in \mathbb {N}\) we have \({\prod }_{i=1}^{k}p_{i}\!>\!2^{k}\) there exists some \(m\in O(\log (2^{2^{s(n)}})) = 2^{\text {poly}(n)}\) such that \({\prod }_{i=1}^{m} p_{i}>B\). In other words, one can present B as

$$ \begin{array}{@{}rcl@{}} \mathsf{CRR}_{m}(B)=(b_{i,r})_{i\in[1,m],r\in[0,p_{i}-1]}\quad\text{for some } m\in 2^{\text{poly}(n)}\quad. \end{array} $$
(2)

Since by the Prime Number Theorem the i-th prime pi is bounded by \(O(i\log i)\) there exists some \(\ell \in O(\log (m\log m))=O(\log (2^{\text {poly}(s(n))}))=\text {poly}(n)\) such that bits are sufficient to store in binary precisely one of the primes pi. Thus, similarly O() = poly(n) bits are sufficient to store in binary precisely one of the pairs of the form (i,r), where i ∈ [1,m] and r ∈ [0,pi − 1]. Moreover we have \(|\mathsf {CRR}(B)|\in O(m^{2}\log m)=2^{\mathsf {poly}(s(n))}=2^{\text {poly}(n)}\).

Observe that in line (7) of our program in Fig. 2 we need to carry out LOGSPACE computations on our exponentially long string \(w\cdot \textsc {Bin}_{2^{s(n)}}(B)\). Yet, if at all, we only have an on-the-fly mechanism for accessing the Chinese Remainder Representation of B, notably still of exponential size in n. To have a chance to access concrete bits of B, we apply the following theorem that states that, given a number in Chinese Remainder Representation, one can compute in LOGSPACE its binary representation.

Theorem 14 (Theorem 3.3. in 11)

The following problem is computable in DLOGTIME-uniform NC1 (and thus in LOGSPACE):

INPUT: CRRm(B) and j ∈ [1,m]

OUTPUT: Bitj(B mod 2m)

Realization of line (7) in the Program in Fig. 2

Let us assume that we have \(B<2^{2^{s(n)}}\) and recall that we have stored B as the difference v(x) − v(y) mod N of our two parametric clocks x and y, assuming v to be our current clock valuation. Let us show how to compute \(\chi _{K}(w\cdot \textsc {Bin}_{2^{s(n)}}(B))\), where we recall that K is a language in LOGSPACE. Let us fix some logarithmically space bounded deterministic Turing machine \({\mathscr{M}}\) for K.

For simulating \({\mathscr{M}}\) our PTA \(\mathcal {A}\) will use \(O(\log (n+2^{s(n)}))=\text {poly}(n)\) auxiliary bit clocks \(\mathcal {J}\) to store in binary the position of the input head of \({\mathscr{M}}\) and further \(O(\log (n+2^{s(n)}))=\text {poly}(n)\) auxiliary bit clocks \(\mathcal {W}\) in order to store the working tape \({\mathscr{M}}\). Reading and writing on the working tape as well as updating the position of the input head can done analogously as in the proof of Lemma 7. It only remains to show how to access the cell content \(\textsc {Bit}_{j}(w\cdot \textsc {Bin}_{2^{s(n)}}(B))\) of the input head of \({\mathscr{M}}\), where we recall that j itself is stored inside the above-mentioned bit clocks \(\mathcal {J}\).

To compute \(\textsc {Bit}_{j}(w\cdot \textsc {Bin}_{2^{s(n)}}(B))\) we apply Theorem 14 and simulate in turn a LOGSPACE machine \({\mathscr{M}}^{\prime }\) whose input is assumed to be

$$ \mathsf{CRR}(B)=(b_{i,r})_{i\in[1,m],r\in[0,p_{i}-1]} \text{ and} j\in[1,m], $$

where we already have direct access to j via the bit clocks \(\mathcal {J}\) but need a special treatment in order to access the bi,r of CRR(B). Importantly, during the to-be discussed simulation of \({\mathscr{M}}^{\prime }\) we never modify the \(\widehat {v}\)-values associated with the bit clocks in \(\mathcal {J}\) and \(\mathcal {W}\) that are being used in the (outermost) simulation of \({\mathscr{M}}\). Before discussing the access to the bi,r let us first discuss the simulation of the working tape of \({\mathscr{M}}^{\prime }\): this can be achieved by using \(O(\log (|\mathsf {CRR}(B)|+s(n)))=O(\log (m^{2}\cdot \log m+s(n)))=\text {poly}(n)\) many auxiliary bit clocks \(\mathcal {W}^{\prime }\), say, where reading and writing the working tape is done again as in Lemma 7. It remains to discuss how to implement the input head in the simulation of \({\mathscr{M}}^{\prime }\). As mentioned repeatedly above, input j can directly be accessed by the bit clocks \(\mathcal {J}\). However, accessing \(\mathsf {CRR}(B)=(b_{i,r})_{i\in [1,m],r\in [0,p_{i}-1]}\) cannot be done explicitly but on-the-fly: for this we reserve O() = O(s(n)) = poly(n) additional auxiliary bit clocks \(\mathcal {J}^{\prime }\), say, to store in binary a pair of indices (i,r), where i ∈ [1,m] and r ∈ [0,pi − 1]. Given the binary access to (i,r) via the bit clocks \(\mathcal {J}^{\prime }\), one can compute via further suitable poly() = O(s(n)) = poly(n) bit clocks \({\mathscr{H}}\), say, the binary representation of the i-th prime number pi in space polynomial in (and thus in n) by Lemma 7: indeed, given i ∈ [1,m] in binary, i.e. using = poly(n) bits, it is straightforward to compute the i-th prime in space polynomial in . Having a binary resentation of pi via the bit clocks \({\mathscr{H}}\) one can finally compute (v(x) − v(y) mod N) mod pi via a gadget by Lemma 9. Our (2,1)-PTA \(\mathcal {A}\) can thus indeed compute B mod pi and thus decide if r equals the latter, which in turn is nothing but computing the to-be-computed input bit bi,r of CRR(B) for the simulation of \({\mathscr{M}}^{\prime }\).

Concerning the implementation details of the simulation of \({\mathscr{M}}^{\prime }\) it is important to remark (recalling Remark 8) that both during the sub-computation computing the i-th prime pi (using Lemma 7) as well as during the sub-computation computing B mod pi (using Lemma 9) one can guarantee that the \(\widehat {v}\)-values associated with the bit clocks in \(\mathcal {J},\mathcal {W},\mathcal {J}^{\prime }\) and \(\mathcal {W}^{\prime }\) are never being modified.

Realization of the Remaining Lines of the Program in Fig. 2

Lines (4), (8) and (11) can be done directly by the control states of \(\mathcal {A}\). Line (5) boils down to resetting both x and y simultaneously. Line (6) will be done by checking if for the second time ever (the first time was when v(x) = v(y) = 0) we have that \(\textsc {Bin}_{2^{s(n)}}(B)=0^{2^{s(n)}}\), which in turn can be done analogously (but in fact simpler) as our above-mentioned implementation of line (7). Line (9) is letting time elapse till the parametric clock y has value 1 (i.e. one time unit after it had value N and was reset), and then resetting it. The latter implementation indeed correctly implements incrementation modulo N.

4 From Two-Parametric Timed Automata with one Parameter to Parametric One-Counter Automata

Being introduced by Bundala and Ouaknine in [10], we define parametric one-counter automata. These are automata that can manipulate a counter that can be incremented or decremented, parametrically or not, compared against constants or parameters, and with divisibility tests modulo constants. It is worth mentioning that the notion of parametric one-counter automata from [10] is slightly more expressive than ours, as we shall discuss further below.

After introducing parametric one-counter automata we state a theorem (Theorem 16), proven essentially already in [10] — again, however for a slightly more expressive model of parametric one-counter automata — that states that (2,1)-PTA-Reachability can be reduced in exponential time to the reachability problem of parametric one-counter automata over one parameter. Since the actual proof of Theorem 16 follows the approach of Bundala and Ouaknine from [10], it can be found in the Appendix.

4.1 Parametric One-Counter Automata

Given a set of parameters P we denote by Op(P) the set of operations over the set of parameters P, being of the form \(\textsf {Op}(P)=\textsf {Op}_{\pm }\cup \textsf {Op}_{\pm P}\cup \textsf {Op}_{\!\!\mod \mathbb {N}}\cup \textsf {Op}_{\bowtie \mathbb {N}}\cup \textsf {Op}_{\bowtie P}\), where

  • Op± = {− 1,0,+ 1},

  • Op±P = {+p,−ppP},

  • \(\textsf {Op}_{\!\!\mod \mathbb {N} }=\{\!\! \mod c\mid c\in \mathbb {N}\}\),

  • \(\textsf {Op}_{\bowtie \mathbb {N}}=\{\bowtie c\mid \bowtie \in \{<,\leq ,=,\geq ,>\},c\in \mathbb {N}\}\), and

  • OpP = {⋈p∣⋈ ∈{<,≤,=,≥,>},pP}.

The size |op| of an operation op is defined as

$$ |op|=\left\{\begin{array}{ll} \log(c)&\text{if} op = \!\!\!\! \mod c \text{or} op=\bowtie c\ \text{with} \ c \in \mathbb{N}\\ 1 &\text{otherwise.} \end{array}\right. $$

We denote by updates those operations that lie in Op±∪Op±P and by tests those operations that lie in \(\textsf {Op}_{\!\!\mod \mathbb {N}}\cup \textsf {Op}_{\bowtie \mathbb {N}}\cup \textsf {Op}_{\bowtie P}\). Previously, such as in [10] or [16], slightly different sets of operations have been used, such as operations to increment the counter by a constant represented in binary. Moreover, Bundala and Ouaknine [10] include for the purpose of their construction some operations of the form + [0,p] that allow to nondeterministically add to the counter a value that lies in [0,μ(p)], where μ(p) is the parameter valuation of parameter p. As we shall show in this section, when reducing the reachability problem for parametric timed automata with two parametric clocks and one parameter to parametric one-counter automata one does not require these + [0,p]-transitions.

A parametric one-counter automaton(POCA for short) is a tuple

$$ \mathcal{C}=(Q,P,R, q_{init}, F), $$

where

  • Q is a non-empty finite set of control states,

  • P is a non-empty finite set of parameters that can take non-negative integer values,

  • \(R\subseteq Q\times \textsf {Op}(P)\times Q\) is a finite set of rules,

  • qinit is an initial control state, and

  • \(F\subseteq Q\) is a set of final control states.

The size of \(\mathcal {C}\) is defined as

$$ |\mathcal{C}| \ = \ |Q|+|P|+|R|+\sum\limits_{(q,op,q^{\prime})\in R}|op|. $$

Let \({\mathsf {Consts}}(\mathcal {C})\) denote the constants that appear in the operations \(op\in \textsf {Op}_{\!\!\mod \mathbb {N}}\cup \textsf {Op}_{\bowtie \mathbb {N}}\) for some operation \((q,op,q^{\prime })\) in R. By \(\textsf {Conf}(\mathcal {C})=Q\times \mathbb {Z}\) we denote the set of configurations of \(\mathcal {C}\). We prefer however to denote a configuration of \(\textsf {Conf}(\mathcal {C})\) by q(z) instead of (q,z).

Being slightly non-standard we define configurations to take counter values over \(\mathbb {Z}\) rather than over \(\mathbb {N}\) for notational convenience. This does not cause any loss of generality as we allow guards that enable us to test if the value of the counter is greater or equal to zero.

Definition 15 (transition)

For every op ∈Op(P), for every parameter valuation \(\mu :P\rightarrow \mathbb {N}\), for every POCA \(\mathcal {C}\), and for every two configurations q(z) and \(q^{\prime }(z^{\prime })\) in \(\textsf {Conf}(\mathcal {C})\) we define the transition \(q(z)\xrightarrow {op,\mu }q^{\prime }(z^{\prime })\) if there exists some \((q,op,q^{\prime })\in R\) such that either of the following holds

  1. 1.

    op = c ∈Op± and \(z^{\prime }=z+c\),

  2. 2.

    op ∈Op±P, and either

    • op = +p and \(z^{\prime }=z+\mu (p)\), or

    • op = −p and \(z^{\prime }=z-\mu (p)\).

  3. 3.

    \(op=\!\!\!\!\mod c\in \textsf {Op}_{\!\!\mod \mathbb {N}}\), \(z=z^{\prime }\) and \(z^{\prime }\equiv 0 \mod c\),

  4. 4.

    \(op=\bowtie c\in \textsf {Op}_{\bowtie \mathbb {N}}\), \(z=z^{\prime }\) and \(z^{\prime }\bowtie c\), and

  5. 5.

    op = ⋈p ∈OpP, \(z=z^{\prime }\) and \(z^{\prime }\bowtie \mu (p)\).

Let \(\mu :P\rightarrow \mathbb {N}\) be a parameter valuation. A μ-run in \(\mathcal {C}\) (from q0(z0) to qn(zn)) is a sequence, possibly empty (i.e. n = 0), of the form

$$ \pi \quad =\quad q_{0}(z_{0}) \ \xrightarrow{op_{0},\mu} \ q_{1}(z_{1}) \quad {\cdots} \quad \xrightarrow{op_{n-1},\mu} \ q_{n}(z_{n})\quad. $$

We sometimes use the abbreviation \(q(z) {\xrightarrow {\mu }}^{*} q^{\prime }(z^{\prime })\) to denote a μ-run of arbitrary length from q(z) to \(q^{\prime }(z^{\prime })\).

We say π is accepting if q0 = qinit, z0 = 0, and qnF. We say reachability holds for the POCA \(\mathcal {C}\) if there exists an accepting μ-run for some \(\mu \in \mathbb {N}^{P}\). We refer to Fig. 3 for an instance of a POCA for which reachability holds. For any two c,d ∈ [0,n] we define the subrun π[c,d] from qc(zc) to qd(zd) as the μ-run \(q_{c}(z_{c})\ \xrightarrow {\pi _{c},\mu } q_{c+1}(z_{c+1})\ \cdots \ \xrightarrow {\pi _{d-1},\mu } \ q_{d}(z_{d}).\) As expected, a prefix (resp. suffix) of π is a μ-run of the form π[0,c] (resp. π[d,n]).

Fig. 3
figure 3

An example of a POCA. The automaton consists of four states and the set of parameters is {p}. The edges are represented by arrows labeled with the corresponding operations. A parameter valuation \(\mu :\{p\}\rightarrow \mathbb {N}\) witnesses that reachability holds for the above POCA if, and only, if μ(p) ≡ 5 mod 6

We define the concatenation π1π2 of two μ-runs π1 and π2 when the source configuration of π2 is equal to the target configuration of π1 as expected.

We define Δ(π) = znz0 as the counter effect of the run π and for each i ∈ [0,n − 1] let Δ(π,i) = Δ(π[i,i + 1]) to denote the counter effect of the i-th transition of π. Its length is defined as |π| = n.

In the particular case where P = {p} is a singleton for some parameter p and μ(p) = N, we prefer to write \(q(z)\xrightarrow {op,N}q^{\prime }(z^{\prime })\) (resp. \(q(z){\xrightarrow {op,N}}^{*} q^{\prime }(z^{\prime })\)) to denote \(q(z)\xrightarrow {op,\mu }q^{\prime }(z^{\prime })\) (resp. HCode \(q(z){\xrightarrow {op,\mu }}^{*} q^{\prime }(z^{\prime })\)) and prefer to call a μ-run an N-run.

We define Values(π) = {zii ∈ [0,n]} to denote the set of counter values of the configurations of π. We define a run π’s maximum as \(\max \limits (\pi )=\max \limits (\textsc {Values}(\pi ))\) and the minimum as \(\min \limits (\pi )=\min \limits (\textsc {Values}(\pi ))\).

The following theorem states an exponential time reduction from (2,1)-PTA-Reachability to the reachability problem of particular parametric one-counter automata over one parameter.

Theorem 16

The following is computable in exponential time:

INPUT: A (2,1)-PTA \(\mathcal {A}\).

OUTPUT: A POCA \(\mathcal {C}\) over one parameter such that

  1. 1.

    for all \(N \in \mathbb {N}\) all accepting N-runs π in \(\mathcal {C}\) satisfy \(\textsc {Values}(\pi )\subseteq [0,4 \cdot \max \limits (N,| \mathcal {C}|)]\), and

  2. 2.

    reachability holds for \(\mathcal {A}\) if, and only if, reachability holds for \(\mathcal {C}\).

The proof of Theorem 16 can be found in Appendix A.

5 Upper Bounds

In this section we state the Small Parameter Theorem (Theorem 18) which tells us that for every POCA over one parameter and every sufficiently large parameter value N, accepting N-runs with counter values all in [0,4N] can be turned into accepting \(N^{\prime }\)-runs for some smaller \(N^{\prime }\). After having stated the theorem we will show that together with Theorem 16 it implies an EXPSPACE upper bound for (2,1)-PTA-Reachability.

We provide an overview of the proof of the Small Parameter Theorem in Section 5.1, whose actual proof will stretch over Sections 678, and 9.

For each POCA \(\mathcal {C}=(Q,P,R,q_{init}, F)\) we define the following constants:

figure b

Since for every non-empty finite set \(U \subseteq \mathbb {N}\setminus \{0\}\) we have \(\mathsf {LCM}(U) \leq \max \limits (U)^{|U|}\), the following lemma is straightforward.

Lemma 17

The above constants are asymptotically bounded by \(2^{\mathsf {poly}(|\mathcal {C}|)}\).

The main result of this section is the following theorem.

Theorem 18 (Small Parameter Theorem)

Let \(\mathcal {C}=(Q,\{p\},R, q_{init}, F)\) be a POCA with one parameter p. If there exists an accepting N-run in \(\mathcal {C}\) with values all in [0,4N] for some \(N>M_{\mathcal {C}}\), then there exists an accepting \((N-{\Gamma}_{\mathcal{C}})\)-run in \(\mathcal {C}\).

Let us first establish that this theorem is enough to prove the desired EXPSPACE upper bound.

Corollary 19

(2,1)-PTA-Reachability is in EXPSPACE.

Proof

Given a (2,1)-PTA \(\mathcal {A}\), we apply Theorem 16 and translate \(\mathcal {A}\) in exponential time into a POCA \(\mathcal {C}=(Q,P,R,q_{0},F)\) with P = {p}, such that

  1. 1.

    all accepting N-runs π in \(\mathcal {C}\) satisfy \(\textsc {Values}(\pi )\subseteq [0, 4 \cdot \max \limits (N,|\mathcal {C}|)]\), and

  2. 2.

    reachability holds for \(\mathcal {A}\) if, and only if, reachability holds for \(\mathcal {C}\).

We first claim that if there exists an accepting N-run π for \(\mathcal {C}\), then there exists one satisfying \(N\in [0,\max \limits \{M_{\mathcal {C}},|\mathcal {C}|\}]\) and \(\textsc {Val}(\pi )\subseteq [0,4\cdot \max \limits \{M_{\mathcal {C}},|\mathcal {C}|\}]\). All accepting N-runs π of \(\mathcal {C}\) satisfy \(\textsc {Val}(\pi )\subseteq [0,4\cdot \max \limits \{N,|\mathcal {C}|\}]\) by Point 1, so if \(N>\max \limits \{M_{\mathcal {C}},|\mathcal {C}|\}\), then \(4N=4\cdot \max \limits \{N,|\mathcal {C}|\}\) and hence there exists some accepting \((N-{\Gamma }_{\mathcal {C}})\)-run for \(\mathcal {C}\) by Theorem 18. Remarking that in case \(N>\max \limits \{M_{\mathcal {C}},|\mathcal {C}|\}\) we have \(N-{\Gamma }_{\mathcal {C}}>M_{\mathcal {C}}-{\Gamma }_{\mathcal {C}}>0\), one can repeat the above argument for \(N-{\Gamma }_{\mathcal {C}}\) and possibly for \(N-2{\Gamma }_{\mathcal {C}}\) and so on, thus implying the desired existence.

Thus by Point 2 it suffices to check in exponential space in \(|\mathcal {A}|\) whether there exists some accepting N-run π for \(\mathcal {C}\) satisfying \(\textsc {Values}(\pi )\subseteq [0,4N]\) for some \(N\in [0,\max \limits \{M_{\mathcal {C}},|\mathcal {C}|\}]\). Since \(M_{\mathcal {C}}\in 2^{\text {poly}(|\mathcal {C}|)}=2^{2^{\text {poly}(|\mathcal {A}|)}}\), the latter is simply a reachability question in a doubly-exponentially large finite graph all of whose vertices and edges can be represented using exponentially many bits, and thus decidable in exponential space. □

5.1 Overview of the Proof of the Small Parameter Theorem

For the proof of the Small Parameter Theorem (Theorem 18) we proceed as follows.

  • In Section 6 we introduce the notion of N-semiruns. These generalize N-runs in that only modulo tests need to hold, not however comparison tests. We define some natural operations on them, like shifting them by some value or cutting out certain infixes. In Section 6.2 we prove two important lemmas on semiruns that will serve as base tools for subsequent steps in the proof:

    • The Depumping Lemma (Lemma 22) will be our main tool to depump certains semiruns, in the following sense: in case the difference between the number of + p-transitions and − p-transitions is bounded for all infixes and equal to 0 for the whole semirun and furthermore the absolute counter effect of the semirun is sufficiently large, then one can build — by applying the above-mentioned operations — a new semirun whose absolute counter effect is slightly smaller.

    • The Bracket Lemma (Lemma 23) states that in case the counter effect is sufficiently large and the counter values are all in [0,4N], then one can find an infix where the counter effect is also large and moreover the difference between the number of + p-transitions and − p-transitions is bounded for all infixes and equal to 0 for the whole semirun.

  • In Section 7 we introduce the notion of hills and valleys. Hills are N-semiruns that start and end in configurations with low counter values but where all intermediate configurations have counter values above the source and target configuration. We introduce the dual notion of valleys. The main contribution of the section is the following.

    • The Hill and Valley Lemma (Lemma 28) allows to transform N-semiruns that are hills (resp. valleys) into \((N-{\Gamma }_{\mathcal {C}})\)-semiruns with the same source and target configuration.

  • Making use of all of the above lemmas, we introduce in Section 8 the following lemma, which is a main technical ingredient in the proof of Theorem 18.

    • The 5/6-Lemma (Lemma 39) states that N-semiruns with counter effect smaller than 5/6 ⋅ N can be turned in into \((N-{\Gamma }_{\mathcal {C}})\)-semiruns.

  • Finally, in Section 9 we prove the Small Parameter Theorem (Theorem 18) by carefully factorizing a potential N-run into subsemiruns that can be treated by the above lemmas.

In Fig. 4 we give an overview of the dependencies of the above-mentioned lemmas.

Fig. 4
figure 4

Illustration of the dependencies between the lemmas. The presence of an arrow going from a lemma to another means that the lemma in question is used inside the proof of the lemma the arrow points to

6 Semiruns, Their Bracket Projection, and Embeddings

In this section we motivate and introduce the notion of semiruns by loosening the conditions on runs, and define basic operations on them. These basic operations possibly change their counter values, length, or counter effect.

The formalism of an N-run is a little bit too restrictive to define operations on them. For instance, subtracting \(Z_{\mathcal {C}}\) from all counter values of an N-run produces an object, where conditions (1),(2), and (3) of Definition 15 indeed hold — as \(Z_{\mathcal {C}} = \mathsf {LCM}({\mathsf {Consts}}(\mathcal {C}))\) — but where conditions (4) and (5) might not hold anymore, as comparison guards may be violated. Rather than certifying each time that the application of an operation preserves the property of being an N-run we prefer to loosen the definition in order to avoid tedious case distinctions. This motivates the notion of semitransitions (resp. semiruns), which are a generalization of transitions (resp. runs), in which the comparison tests need not hold.

We introduce semiruns and operations on them in Section 6.1. Section 6.2 introduces the bracket projection of semiruns, the Depumping Lemma (Lemma 22) and the Bracket Lemma (Lemma 23). Section 6.3 introduces the notion of embeddings, which provide a formal means to express when a semirun can structurally be found as a subsequence of another.

6.1 Semiruns and Operations on Them

Definition 20 (semitransition)

Let \(\mathcal {C}=(Q,P,R,q_{init}, F)\) be a POCA. For every operation op ∈Op(P), for every parameter valuation \(\mu :P\rightarrow \mathbb {N}\), and for every two configurations q(z) and \(q^{\prime }(z^{\prime })\) in \(\textsf {Conf}(\mathcal {C})\) we define the semitransition if there exists some \((q,op,q^{\prime })\in R\) such that conditions (1),(2), and (3) of Definition 15 hold but where conditions (4) and (5) are loosened by the following conditions (4’) and (5’) respectively

  1. (1)

    op = c ∈Op±, and \(z^{\prime }=z+c\),

  2. (2)

    op ∈Op±P and either

    • op = +p and \(z^{\prime }=z+\mu (p)\), or

    • op = −p and \(z^{\prime }=z-\mu (p)\).

  3. (3)

    \(\ op=\!\!\!\!\mod c\in \textsf {Op}_{\!\!\mod \mathbb {N}}\), \(z=z^{\prime }\) and \(z^{\prime }\equiv 0 \mod c\),

  1. (4’)

    \(op=\bowtie c\in textsf{Op}_{\bowtie \mathbb {N}}\) and \(z=z^{\prime }\), and

  2. (5’)

    op = ⋈p ∈OpP, and \(z=z^{\prime }\).

Thus, in a nutshell, when writing we do not require that the comparison tests against parameters or against constants hold; however the updates and the modulo tests against constants must be respected. This naturally gives rise to the definition of μ-semiruns as expected. Note that in particular every μ-run is a μ-semirun. The abbreviation N-semirun, , the counter effect Δ, Values, \(\min \limits \), \(\max \limits \), subsemirun, prefix, suffix are defined as for runs.

Note that in particular every N-run is an N-semirun. Importantly, note also that semitransitions involving comparison tests are still syntactically present in semiruns. By a careful analysis, one can therefore possibly perform operations on N-semiruns in order to show that they are in fact N-runs.

Example 21

The 2-semirun

is not a 2-run, as, in , condition (4) of Definition 15 does not hold, however condition (4’) of Definition 20 does.

6.2 Shifting and Gluing of Semiruns

Let us fix a POCA \(\mathcal {C}\) and some N-semirun

We define the following operations, where we recall that \(Z_{\mathcal {C}}=\mathsf {LCM}({\mathsf {Consts}}(\mathcal {C}))\):

  • For \(D \in Z_{\mathcal {C}} \mathbb {Z}\), we define the shifting of π by D as

    Since there are no effective comparison tests and D is an integer that is divisible by all constants appearing in modulo tests in \(\mathcal {C}\), it is clear that π + D is again an N-semirun.

  • For two configurations qi(zi) and qj(zj) with 0 ≤ i < jn and where \(D=z_{j}-z_{i}\in Z_{\mathcal {C}} \mathbb {Z}\) is a multiple of \(Z_{\mathcal {C}} \) and qi = qj, we define the gluing of the configurations as

When gluing the leftmost and rightmost configurations of pairwise non-intersecting intervals \(I_{1}=[a_{1},b_{1}],\ldots , I_{k}=[a_{k}, b_{k}] \subseteq [0,n]\), assuming bi < ai+ 1 for all 1 ≤ i < k, and \(q_{a_{i}}=q_{b_{i}}\) and \(z_{b_{i}} - z_{a_{i}} \in Z_{\mathcal {C}} \mathbb {Z}\) for all 1 ≤ ik, we will use πI1I2⋯ − Ik to denote the result corresponding to gluing each interval successively while shifting the others accordingly, instead of writing the more tedious π(k), where

$$ \begin{array}{@{}rcl@{}} \pi^{(1)} &=& \pi - [a_{1},b_{1}],\\ \pi^{(2)} &=& \pi^{(1)} - [a_{2} - (|I_{1}|-1), b_{2} - (|I_{1}|-1)],\\ &\cdots&\\ \pi^{(k)} &=& \pi^{(k-1)} - [a_{k} - \sum\limits_{1 \leq j < k} (|I_{j}|-1), b_{k} - \sum\limits_{1 \leq j < k} (|I_{j}|-1) ]\ . \end{array} $$

6.3 The Bracket Projection of Semiruns

In this section we define a projection ϕ of semitransitions to a word over the binary alphabet {[,]}, where transitions with op = +p are mapped to [, transitions with op = −p are mapped to ], and all other transitions are mapped to the empty word ε. The projection ϕ is naturally extended to a morphism from semiruns to {[,]}. In this section we will show the following lemmas.

  • The Depumping Lemma (Lemma 22) states that for each N-semirun whose ϕ-projection has bounded bracketing properties and that has a counter effect whose absolute value is sufficiently large there exists another N-semirun with a counter effect whose absolute value is slightly smaller. This latter resulting N-semirun has a particular form in that it can be obtained from the original N-semirun by applying the above-mentioned operations of shifting and gluing: notably, the subsemiruns that are being glued themselves have a ϕ-projection that has bounded bracketing properties.

  • The Bracket Lemma (Lemma 23) states that if an N-semirun has all its counter values in [0,4N], has an absolute counter effect that is sufficiently large and has a ϕ-projection satisfies a suitable threshold condition on the number of occurrences of [ and ], that there is a subsemirun where the absolute counter effect is also large and whose ϕ-projection has bounded bracketing properties.

Formally, we define a mapping ϕ such that for every semitransition ,

$$ \phi(\tau) \ = \ \left\{\begin{array}{ll} \ \boldsymbol{[} & \text{if} op=+p\\ \ \boldsymbol{]} & \text{if} op=-p\\ \ \varepsilon & \text{otherwise}. \end{array}\right. $$

Note that an N-semirun π can contain several + p-transitions and − p transitions. We introduce the notation ϕ(π,i) = ϕ(π[i,i + 1]) to denote the ϕ-projection of the i-th transition of π for all i ∈ [0,|π|− 1]. The mapping ϕ is naturally extended to a morphism on semiruns to words over the binary alphabet {[,]} as expected: ϕ(π) = ϕ(π,0)ϕ(π,1) ⋯ ϕ(π,|π|− 1).

We are particularly interested in N-semiruns whose projection by ϕ contains as many opening as closing brackets and only a few pending ones (when read from left to right). To make this formal, for all \(k \in \mathbb {N}\) we define the regular language

$$ \begin{array}{@{}rcl@{}} {\Lambda}_{k}=\left\{w\!\in\!\{\boldsymbol{[},\boldsymbol{]}\}^{*} : |w|_{\boldsymbol{[}}= |w|_{\boldsymbol{]}}, \forall u,v \in \{\boldsymbol{[},\boldsymbol{]}\}^{*}. \ uv = w \!\implies \!|u|_{\boldsymbol{[}}-|u|_{\boldsymbol{]}} \in[-k, k]\right\}. \end{array} $$

We are interested in analyzing N-semiruns with counter values in [0,4N]. Bounding the counter values like this limits the number of + p (resp. − p) that can appear in a row. This will be the basis in the Bracket Lemma which amounts to showing the existence of subsemiruns whose ϕ-projection is in Λ8.

The now following Depumping Lemma will enable us to reduce the counter effect of N-semiruns whose ϕ-projection is in Λ8. It is worth remarking that \({\Gamma }_{\mathcal {C}} \ll {\Upsilon }_{\mathcal {C}}\), recalling the definition of our constants on page 18.

Lemma 22 (Depumping Lemma)

For all N-semiruns π satisfying ϕ(π) ∈Λ8 and \(|{\Delta }(\pi )|>{\Upsilon }_{\mathcal {C}}\) there exists an N-semirun \(\pi ^{\prime }\) such that either

  • \({\Delta }(\pi )>{\Upsilon }_{\mathcal {C}}\) and \({\Delta }(\pi ^{\prime })={\Delta }(\pi )-{\Gamma }_{\mathcal {C}}\), or

  • \({\Delta }(\pi )<-{\Upsilon }_{\mathcal {C}}\) and \({\Delta }(\pi ^{\prime })={\Delta }(\pi )+{\Gamma }_{\mathcal {C}}\).

Moreover, \(\pi ^{\prime }=\pi -I_{1}-I_{2} \ {\cdots } \ -I_{k}\) for pairwise disjoint intervals \(I_{1},\ldots ,I_{k}\subseteq [0,|\pi |]\) such that we have ϕ(π[Ii]) ∈Λ16 for all i ∈ [1,k], and either Δ(π[Ii]) > 0 for all i ∈ [1,k] or Δ(π[Ii]) < 0 for all i ∈ [1,k].

Proof

be an N-semirun such that ϕ(π) ∈Λ8. We will assume without loss of generality that \({\Delta }(\pi ) > {\Upsilon }_{\mathcal {C}}\). The dual case when \({\Delta }(\pi ) < - {\Upsilon }_{\mathcal {C}}\) can be proven analogously.

For every position i ∈ [0,n] let us define

$$ \lambda(i)=|\phi(\pi[0,i])|_{\boldsymbol{[}} - |\phi(\pi[0,i])|_{\boldsymbol{]}} \qquad\text{and }\qquad \mathsf{pot}(i)=z_{i}-z_{0}-\lambda(i)\cdot N\qquad. $$

Note that since ϕ(π) ∈Λ8 we have for all i ∈ [0,n],

$$ \lambda(i)\in[-8,8],\qquad\qquad $$
(3)

and moreover

$$ \phi(\pi[0,i])\in{\Lambda}_{8} \Longleftrightarrow\lambda(i)=0. $$
(4)

We note the following important properties of pot,

  1. 1.

    |pot(i − 1) −pot(i)|≤ 1 for all i ∈ [1,n],

  2. 2.

    pot(0) = 0,

  3. 3.

    for all 0 ≤ i < jn, if λ(i) = λ(j), then pot(j) −pot(i) = zjzi, and

  4. 4.

    pot(n) = znz0 = Δ(π) since λ(0) = λ(n) = 0.

The following claim states that if in a subsemirun the pot increases sufficiently large, then one can find a subsemirun therein that can potentially be glued.

Claim 1

For each subsemirun π[a,b] that satisfies \(\mathsf {pot}(b)-\mathsf {pot}(a)> 17\cdot |Q|\cdot Z_{\mathcal {C}}\) there exist positions as < tb, such that

  • qs = qt,

  • λ(s) = λ(t), and

  • \(z_{t}-z_{s}=d Z_{\mathcal {C}}\) for some d ∈ [1,17 ⋅|Q|].

Proof Proof of the Claim.

Since by assumption \(\mathsf {pot}(b)-\mathsf {pot}(a)> 17 \cdot |Q|\cdot Z_{\mathcal {C}}\), by the pigeonhole principle and Point 1 above, there exist two indices as < tb such that qs = qt, λ(s) ∈ [− 8,8] and λ(t) ∈ [− 8,8] are equal, and \(\mathsf {pot}(t)-\mathsf {pot}(s)=d Z_{\mathcal {C}}\) for some d ∈ [1,17 ⋅|Q|]. By Point 3 above, from λ(t) = λ(s), it follows \(z_{t}-z_{s}=\mathsf {pot}(t)-\mathsf {pot}(s)=d Z_{\mathcal {C}}\). (End of the proof of the Claim)

Since pot(i) −pot(i − 1) ≤ 1 for all i ∈ [1,n] by Point 1 above and

$$ \begin{array}{@{}rcl@{}} \mathsf{pot}(n)-\mathsf{pot}(0) &=& z_{n} - z_{0} \\ &=& {\Delta}(\pi) \\ &>& {\Upsilon}_{\mathcal{C}} \\ &\stackrel{\text{page~15}}{=}& 17 \cdot |Q| \cdot \mathsf{LCM}(17 \cdot |Q|)\cdot \left( 17 \cdot |Q|\cdot Z_{\mathcal{C}}+2\right), \end{array} $$

by the pigeonhole principle, there exist at least

$$ 17 \cdot |Q| \cdot \mathsf{LCM}(17 \cdot |Q|) $$

pairwise disjoint subsemiruns π[a,b] satisfying \(\mathsf {pot}(b)-\mathsf {pot}(a)> 17\cdot |Q|\cdot Z_{\mathcal {C}} \). Let

$$L= \mathsf{LCM}(17 \cdot |Q|),$$

and let π[a1,b1],…,π[a17⋅|Q|⋅L,b17⋅|Q|⋅L] be an enumeration of these latter subsemiruns. We apply the above Claim to all of these π[ai,bi]: there exist positions aisitibi such that λ(si) = λ(ti), \(q_{s_{i}}=q_{t_{i}}\), and \(z_{t_{i}}=z_{s_{i}}+d_{i} Z_{\mathcal {C}}\) for some di ∈ [1,17 ⋅|Q|]. From λ(si) = λ(ti) and (3) it follows ϕ(π[si,ti]) ∈Λ16. Recall that \({\Gamma }_{\mathcal {C}} = \mathsf {LCM}(17 \cdot |Q|) \cdot Z_{\mathcal {C}} = L \cdot Z_{\mathcal {C}}\), cf. page 18. By the pigeonhole principle, among these 17 ⋅|Q|⋅ L pairwise disjoint subsemiruns π[ai,bi], there exists some d ∈ [1,17 ⋅|Q|] such that there are L/d many different π[ai,bi] all satisfying di = d. Let \(\pi [a_{i_{1}},b_{i_{1}}],\ldots ,\pi [a_{i_{L/d}},b_{i_{L/d}}]\) be an enumeration of these latter π[ai,bi]. Note that for all of these π[ai,bi] we have \({\Delta }(\pi [s_{i_{j}},t_{i_{j}}])=d\cdot Z_{\mathcal {C}}\). Since moreover \(q_{s_{i_{j}}}=q_{t_{i_{j}}}\) we know that, for all j ∈ [1,L/d], the gluing \(\pi -[s_{i_{j}},t_{i_{j}}]\) is an N-semirun with \({\Delta }(\pi -[s_{i_{j}},t_{i_{j}}]) ={\Delta }(\pi )-d Z_{\mathcal {C}}\). Thus,

$$ \pi^{\prime}\quad=\quad\pi-[s_{i_{1}},t_{i_{1}}]-\ldots-[s_{i_{L/d}},t_{i_{L/d}}] $$

is an N-semirun satisfying \({\Delta }(\pi ^{\prime })={\Delta }(\pi )-d\cdot (L/d) \cdot Z_{\mathcal {C}}={\Delta }(\pi )-{\Gamma }_{\mathcal {C}}\) as required. □

Let us now introduce the Bracket Lemma, which states that in case the absolute value of the counter effect of an N-semirun is sufficiently large, the counter values are all in [0,4N] and a majority condition holds on the number of occurrences of [ and ] in its ϕ-projection, that there is a subsemirun where the counter effect is also large and that moreover has good bracketing properties (in the sense of the Depumping Lemma). Roughly speaking, it is based on the idea that if the values of a semirun are all in [0,4N], there cannot be five + p-transitions in a row. Technically speaking, the Bracket Lemma can be applied to \((N-{\Gamma }_{\mathcal {C}})\)-semiruns, where N is sufficiently large: the reason is that the Bracket Lemma will later be applied to N-semiruns in which some of the + p/ − p-transitions have already been modified (“by hand”) to have an effect \((N-{\Gamma }_{\mathcal {C}})/-(N-{\Gamma }_{\mathcal {C}})\) instead of N/ − N.

Lemma 23 (Bracket Lemma)

For all \(N > M_{\mathcal {C}}\), all \((N-{\Gamma }_{\mathcal {C}})\)-semiruns π satisfying \(\textsc {Values}(\pi )\subseteq [0,4N]\), \({\Delta }(\pi )<-{\Upsilon }_{\mathcal {C}}\) (resp. \({\Delta }(\pi )>{\Upsilon }_{\mathcal {C}}\)) and where ϕ(π) contains at least as many occurrences of [ as occurrences of ] (resp. at least as many occurrences of ] as occurrences of [) there exists a subsemirun π[c,d] satisfying ϕ(π[c,d]) ∈Λ8 and \({\Delta }(\pi [c,d])<-{\Upsilon }_{\mathcal {C}}\) (resp. \({\Delta }(\pi [c,d])>{\Upsilon }_{\mathcal {C}}\)).

Proof

We only prove the case where \({\Delta }(\pi )<-{\Upsilon }_{\mathcal {C}}\) and ϕ(π) contains at least as many occurrences of [ as of ]. The dual case when \({\Delta }(\pi )>{\Upsilon }_{\mathcal {C}}\) and ϕ(π) contains at least as many ] as of [ can be proven analogously.

As in the proof of Lemma 22, for any word u ∈{[,]} let λ(u) = |u|[ −|u|]. For the rest of the proof assume by contradiction that there is no such subsemirun π[c,d] satisfying \({\Delta }(\pi [c,d])<-{\Upsilon }_{\mathcal {C}}\) and ϕ(π[c,d]) ∈Λ8, or, equivalently, that every subsemirun π[c,d] with ϕ(π[c,d]) ∈Λ8 satisfies \({\Delta }(\pi [c,d])\geq -{\Upsilon }_{\mathcal {C}}\).

For all k ≥ 0 let

$$ {\Psi}_{k}=\{w\in\{\boldsymbol{[}, \boldsymbol{]}\}^{*}\mid\forall uv=w: \lambda(u)\in[-k,k]\} $$

denote the set of all words over the alphabet {[,]}, where for each prefix the absolute difference between the number of occurrences of [ and of ] is at most k. Note that

$$ \begin{array}{@{}rcl@{}} {\Lambda}_{k}={\Psi}_{k}\cap \lambda^{-1}(0). \end{array} $$
(5)

Under the above assumptions on π, for the sake of contradiction, we have three claims on properties on the image of ϕ applied to π and subsemiruns thereof.

Claim 1. ϕ(π) ∈Ψ4.

Proof Proof of Claim 1.

Let us write π = π[0,n]. Assume by contradiction that ϕ(π)∉Ψ4. Let u be a shortest prefix of ϕ(π) such that λ(u)∉[− 4,4]. Let us first consider the case when λ(u) > 4.

By definition of u we have λ(u) = 4 + 1 = 5 and there are indices 0 ≤ t1 < ⋯ < t5 < n such that

  • ϕ(π,t1) = … = ϕ(π,t5) = [, and

  • ϕ(π[ti + 1,ti+ 1]) ∈Λ4 for all i ∈ [1,4].

Recall that by our assumption every subsemirun π[c,d] of π with ϕ(π[c,d]) ∈Λ8 satisfies \({\Delta }(\pi [c,d])\geq -{\Upsilon }_{\mathcal {C}}\). Since \(\bigcup _{i\in [1,8]} {\Lambda }_{i}= {\Lambda }_{8}\) it follows \({\Delta }(\pi [t_{i}+1,t_{i+1}])\geq -{\Upsilon }_{\mathcal {C}}\) for all i ∈ [1,4]. Moreover, bearing in mind that π is an \((N-{\Gamma }_{\mathcal {C}})\)-semirun, we obtain \({\Delta }(\pi ,{t_{i}})=N-{\Gamma }_{\mathcal {C}}\). Altogether, as \(N > M_{\mathcal {C}}\) by assumption, we obtain

$$ \begin{array}{@{}rcl@{}} {\Delta}(\pi[t_{1},t_{5}+1]) &\geq&-4 \cdot {\Upsilon}_{\mathcal{C}}+5\cdot(N- {\Gamma}_{\mathcal{C}})\\ &>& 4N+N-5\cdot({\Upsilon}_{\mathcal{C}}+ {\Gamma}_{\mathcal{C}})\\ &>& 4N+ M_{\mathcal{C}} -5\cdot({\Upsilon}_{\mathcal{C}}+ {\Gamma}_{\mathcal{C}})\\ &>&{4N}, \end{array} $$

where the last inequality follows from \(M_{\mathcal {C}}\)’s definition on page 18, hence contradicting \(\textsc {Values}(\pi )\subseteq [0,4N]\).

Let us now consider the case when λ(u) < − 4. Again, by definition of u, we have λ(u) = − 5. There are hence indices 0 ≤ t1 < … < t5 < n such that

$$ \phi(\pi,{t_{1}})= \ldots= \phi(\pi,{t_{5}})=\boldsymbol{]}, $$

and moreover ϕ(π[0,t1]) ∈Λ4 and ϕ(π[ti + 1,ti+ 1]) ∈Λ4 for all i ∈ [1,4]. By assumption ϕ(π) contains at least as many [ as ]. Therefore there must exist 5 further positions \(t_{1}^{\prime },\ldots ,t_{5}^{\prime }\) in π satisfying \(0\leq t_{1}<\ldots <t_{5}<t_{1}^{\prime }<t_{2}^{\prime }<\ldots <t_{5}^{\prime }<n\) such that

$$ \phi(\pi,{t_{1}^{\prime}})= \ldots=\phi(\pi,{t_{5}^{\prime}})= \boldsymbol{[} $$

and \(\phi (\pi [t_{i}^{\prime }+1,t_{i+1}^{\prime }])\in {\Lambda }_{4}\) for all i ∈ [1,4]. Again taking into account our assumption that \({\Delta }(\pi [c,d])\geq -{\Upsilon }_{\mathcal {C}}\) for all subsemiruns π[c,d] with ϕ(π[c,d]) ∈Λ8, it follows as above, that \({\Delta }(\pi [t_{1}^{\prime },t_{5}^{\prime }+1])>4N\), contradicting \(\textsc {Values}(\pi )\subseteq [0,4N]\). □

Claim 2. ϕ(π[a,b]) ∈Ψ8 for all subsemiruns π[a,b] of π.

Proof Proof of Claim 2.

This is an immediate consequence of Claim 1. Indeed, any subsemirun π[a,b] of π satisfying ϕ(π[a,b])∉Ψ8 gives rise to a prefix u of ϕ(π) such that u∉Ψ4 and hence ϕ(π)∉Ψ4. □

Claim 3. For all subsemiruns π[a,b] of π, if λ(ϕ(π[a,b])) > 0, then \({\Delta }(\pi [a,b])>{\Upsilon }_{\mathcal {C}}\).

Proof Proof of Claim 3.

We prove the statement by induction on λ(ϕ(π[a,b])).

For the induction base, assume λ(ϕ([a,b])) = 1. Thus, there exists a position t ∈ [a,b] such that ϕ(π,t) = [ and λ(π[a,t]) = λ(ϕ(π[t + 1,b])) = 0. By Claim 2 and (5) we have ϕ(π[a,t]),ϕ(π[t + 1,b]) ∈Λ8. Thus, \({\Delta }(\pi [a,t]),{\Delta }(\pi [t+1,b])>-{\Upsilon }_{\mathcal {C}}\) by our assumption. Hence, we obtain

$$ \begin{array}{@{}rcl@{}} {\Delta}(\pi[a,b])&=&{\Delta}(\pi[a,t])+ {\Delta}(\pi,t)+{\Delta}(\pi[t+1,b])\\ &\geq& -{\Upsilon}_{\mathcal{C}}+(N-{\Gamma}_{\mathcal{C}})-{\Upsilon}_{\mathcal{C}}\\ &>&M_{\mathcal{C}}-2{\Upsilon}_{\mathcal{C}}-{\Gamma}_{\mathcal{C}}\\ &>&{\Upsilon}_{\mathcal{C}}, \end{array} $$

where the last strict inequality follows from definition of \(M_{\mathcal {C}}\) on page 18.

Assume λ(ϕ(π[a,b])) > 1. Consider the smallest position t ∈ [a,b] such that λ(ϕ(π[a,t])) = 0 and ϕ(π,t) = [. By Claim 2 and (5) it follows that ϕ(π[a,t]) ∈Λ8 and hence \({\Delta }(\pi [a,t])\geq -{\Upsilon }_{\mathcal {C}}\) by our assumption. Moreover, λ(ϕ(π[t + 1,b])) = λ(ϕ(π[a,b])) − 1. We can thus apply induction hypothesis to π[t + 1,b] and obtain

$$ \begin{array}{@{}rcl@{}} {\Delta}(\pi[a,b])&=& {\Delta}(\pi[a,t])+{\Delta}(\pi,t)+ {\Delta}(\pi[t+1,b])\\ &>&{\Delta}(\pi[a,t])+{\Delta}(\pi,t)+ {\Upsilon}_{\mathcal{C}}\\ &\geq& -{\Upsilon}_{\mathcal{C}}+(N-{\Gamma}_{\mathcal{C}})+{\Upsilon}_{\mathcal{C}}\\ &>& {M_{\mathcal{C}} - {\Gamma}_{\mathcal{C}}},\\ &>& {{\Upsilon}_{\mathcal{C}}}, \end{array} $$

where the first strict inequality follows from induction hypothesis on π[t + 1,b] and the last strict inequality follows from definition of \(M_{\mathcal {C}}\) on page 18 constant definitions. □

We will now contradict our initial assumption that there is no subsemirun π[c,d] satisfying ϕ(π[c,d]) ∈Λ8 and \({\Delta }(\pi [c,d])<-{\Upsilon }_{\mathcal {C}}\) by making use of the above claims.

Since π itself satisfies \({\Delta }(\pi )<-{\Upsilon }_{\mathcal {C}}\), it follows ϕ(π)∉Λ8 = Ψ8λ− 1(0) by our assumption and (5). But since ϕ(π) ∈Ψ8 by Claim 2, it follows λ(ϕ(π))≠ 0.

As ϕ(π) contains at least as many occurrences of [ as occurrences of ] by assumption, ϕ(π) must contain strictly more occurrences of [ than of ], i.e. λ(ϕ(π)) > 0. By Claim 3 it follows \({\Delta }(\pi ) > {\Upsilon }_{\mathcal {C}}\), contradicting our assumption that \({\Delta }(\pi ) < - {\Upsilon }_{\mathcal {C}}\). □

6.4 Embeddings of Semiruns

The Small Parameter Theorem (Theorem 18) turns N-runs with values in [0,4N] into \((N-{\Gamma }_{\mathcal {C}})\)-runs. In proving this, we prefer to view N-runs as N-semiruns. Indeed, we first view any N-run as an N-semirun and then apply certain of the above-mentioned operations on them to obtain some \((N-{\Gamma }_{\mathcal {C}})\)-semirun. However, we would then like to claim that the resulting \((N-{\Gamma }_{\mathcal {C}})\)-semirun is in fact an \((N-{\Gamma }_{\mathcal {C}})\)-run as desired, in particular the comparison tests need to hold. To do so, we introduce a notion when an N-semirun can be embedded into an M-semirun (possibly NM) in the sense that operations are being preserved, source and target control states are being preserved, and that with respect to some line \(\ell \in \mathbb {Z}\) the counter value of each configuration of the embedding has the same orientation with respect to as the counter value of the configuration it corresponds to.

Definition 24 (-embedding)

Let \(\ell \in \mathbb {Z}\). An N-semirun

is an -embedding of an M-semirun

if s0 = q0, sn = qm and there exists an order-preserving injective mapping \(\psi :[0,n]\rightarrow [0,m]\) such that

  • σi = πψ(i) for all i ∈ [0,n − 1], and

  • yi if, and only if, zψ(i) for all ⋈ ∈{<,=,>} and all i ∈ [0,n].

Moreover we say σ is

  • \(\max \limits \)-falling (w.r.t π) \(if \max \limits (\sigma )\leq \max \limits (\pi )\), and

  • \(\min \limits \)-rising (w.r.t. π) \(if \min \limits (\sigma )\geq \min \limits (\pi )\).

Example 25

Consider the semiruns π,σ and τ in Fig. 5, where neither concrete counter values nor the control states of σ and τ are mentioned. The semirun σ can possibly be a 7-embedding of π (if its source control control is q0 and its target control state is q6). However, τ cannot be a 7-embedding of π. Indeed, for every possible ψ such that τ2 = +p = πψ(2), the counter value of τ at position 2 is strictly larger than 7, whereas the counter value of π at position ψ(2) is strictly below 7.

Fig. 5
figure 5

Example of a semirun σ that could possibly be an embedding of the semirun π and a semirun τ that cannot

The following remark is implictly being used in subsequent sections.

Remark 26

Embeddings possess some useful properties that all follow immediately from definition.

  • Transitivity. Let π, ρ and σ be semiruns such that π is an -embedding of ρ and ρ is an -embedding of σ. Then π is an -embedding of σ. Moreover, if π was max-falling (resp. min-rising) w.r.t. ρ and ρ was max-falling (resp. min-rising) w.r.t. σ, then π is max-falling (resp. min-rising) w.r.t. σ.

  • Closure under concatenation.

    Let π be an N-semirun from q(x) to r(y) and let ρ be N-semirun from r(y) to s(z). Moreover, let \(\pi ^{\prime }\) be an \(N^{\prime }\)-semirun from \(q(x^{\prime })\) to \(r(y^{\prime })\) that is an -embedding of π and let \(\rho ^{\prime }\) be an \(N^{\prime }\)-semirun from \(r(y^{\prime })\) to \(s(z^{\prime })\) that is an -embedding of ρ. Then \(\pi ^{\prime }\rho ^{\prime }\) is an -embedding of πρ. If furthermore, \(\pi ^{\prime }\) was max-falling (resp. min-rising) w.r.t. π and \(\rho ^{\prime }\) was max-falling (resp. min-rising) w.r.t. ρ, then \(\pi ^{\prime } \rho ^{\prime }\) is max-falling (resp. min-rising) w.r.t. πρ.

  • Shifting distant embeddings. Let \(D\in Z_{\mathcal {C}} \mathbb {Z}\) be a multiple of \(Z_{\mathcal {C}}\), let π be a semirun and let ρ be an -embedding of π such that for all configurations q(z) in ρ we have |z| > |D|. Then both ρ + D and ρD are -embeddings of π.

7 On Hills and Valleys

In this section we introduce the notions of hills and valleys. Hills are semiruns that start and end in configurations with low counter values but where all intermediate configurations have counter values above these source and target configurations, and where moreover + p-transitions (resp. − p-transitions) are followed (resp. preceded) by semiruns with absolute counter effect larger than \({\Upsilon }_{\mathcal {C}}\) (we refer to Fig. 6 for an illustration of the concept). We also introduce the dual notion of valleys. We then prove that an N-semirun that is either a hill or a valley can be turned into an \((N-{\Gamma }_{\mathcal {C}})\)-semirun with the same source and target configuration that is an embedding. This lowering process serves as a building block in the proof of the 5/6-Lemma (Lemma 39).

Fig. 6
figure 6

Illustration of a B-hill

Definition 27 (Hills and Valleys)

An N-semirun

is a

  • B-hill if

    • z0,zn < B,

    • ziB for all i ∈ [1,n − 1],

    • πi = −p implies \(z_{i} > z_{0}+{\Upsilon }_{\mathcal {C}}\) for all i ∈ [0,n − 1], and

    • πi = +p implies \(z_{i+1} > z_{n}+{\Upsilon }_{\mathcal {C}}\) for all i ∈ [0,n − 1].

  • B-valley if

    • z0,zn > B,

    • ziB for all i ∈ [1,n − 1],

    • πi = −p implies \(z_{i+1} < z_{n}-{\Upsilon }_{\mathcal {C}}\) for all i ∈ [0,n − 1], and

    • πi = +p implies \(z_{i} < z_{0}-{\Upsilon }_{\mathcal {C}}\) for all i ∈ [0,n − 1].

The Hill and Valley Lemma states that an N-semirun π that is either a B-hill or a B-valley can be turned into an \((N-{\Gamma }_{\mathcal {C}}\))-semirun with the same source and target configuration that is moreover both a min-rising and max-falling \(B^{\prime }\)-embedding of π, where \(B^{\prime }\) is close to B.

Lemma 28 (Hill and Valley Lemma)

For all \(N, B \in \mathbb {N}\), all N-semiruns π from q0(z0) to qn(zn) with \(N > M_{\mathcal {C}}\) and \(\textsc {Values}(\pi )\subseteq [0,4N]\) such that moreover π is either a B-hill or a B-valley, there exists an \((N-{\Gamma }_{\mathcal {C}})\)-semirun from q0(z0) to qn(zn) that is both a min-rising and max-falling \((B-{\Upsilon }_{\mathcal {C}}-{\Gamma }_{\mathcal {C}}-1)\)-embedding of π (in case π is a B-hill), or both a min-rising and max-falling \((B+{\Upsilon }_{\mathcal {C}}+{\Gamma }_{\mathcal {C}}+1)\)-embedding of π (in case π is a B-valley).

We remark that the resulting \((N-{\Gamma }_{\mathcal {C}})\)-semirun satisfies further properties — these are being discussed in Section 7.2.

Before proving the Hill and Valley Lemma let us explain why the finding of the resulting embedding is delicate. Let us fix any N-semirun

from q0(z0) to qn(zn) with \(\textsc {Values}(\pi ) \subseteq [0, 4N]\) and \(N > M_{\mathcal {C}}\). Let us moreover assume that π is a B-hill for some \(B\in \mathbb {N}\). We need to show the existence of some \((N-{\Gamma }_{\mathcal {C}})\)-semirun from q0(z0) to qn(zn) that is moreover both a min-rising and max-falling \((B-{\Upsilon }_{\mathcal {C}}-{\Gamma }_{\mathcal {C}}-1)\)-embedding of π.

We are particularly interested in those transitions τ with absolute counter effect |Δ(τ)| = N, i.e. transitions with operation + p or − p that we will denote as unlowered + p-transitions and − p-transitions respectively. Note that if there is no such transition in π, then π is already an \((N - {\Gamma }_{\mathcal {C}})\)-semirun. Let us therefore assume there is at least one transition with absolute counter effect N in π. For obtaining only an \((N-{\Gamma }_{\mathcal {C}})\)-semirun it would simply suffice to lower the absolute counter effect of these transitions by \({\Gamma }_{\mathcal {C}}\). Indeed, if the transition is an N-semirun, then the lowered transition is an \((N-{\Gamma }_{\mathcal {C}})\)-semirun. Dually, if is an N-semirun, then is an \((N-{\Gamma }_{\mathcal {C}})\)-semirun.

Thus, applying such a lowering to all transitions of π whose absolute counter effect is N yields an \((N-{\Gamma }_{\mathcal {C}})\)-semirun with target configuration shifted by a multiple of \({\Gamma }_{\mathcal {C}}\), according to the operations seen in Section 6. However, the Hill and Valley Lemma not only requires the resulting semirun to be an \((N-{\Gamma }_{\mathcal {C}})\)-semirun but also to have same source and target configurations as the original semirun (and to be a min-rising and max-falling \((B-{\Upsilon }_{\mathcal {C}}-{\Gamma }_{\mathcal {C}}-1)\)-embedding). Hence, simply lowering all transitions with a large counter effect as described above is not enough to prove the result as the following example illustrates. Let us assume an N-semirun π containing precisely one transition τ whose absolute counter effect is N, say πj = +p for some position j. That is,

If we replace directly this j-th transition by a transition with \({\Delta }(\tau ^{\prime })=N-{\Gamma }_{\mathcal {C}}\), and, starting with the (j + 1)-th configuration, shift all following counter values by \(-{\Gamma }_{\mathcal {C}}\), we indeed obtain an \((N-{\Gamma }_{\mathcal {C}})\)-semirun

However, this \((N-{\Gamma }_{\mathcal {C}})\)-semirun does not have the same source and target configuration as the original semirun, as the target configuration’s counter value has been shifted by \(-{\Gamma }_{\mathcal {C}}\). Worse yet, if our initial N-semirun π were to possess several + p-transitions, then the accumuluated counter value shifts could potentially yield that the resulting \((N-{\Gamma }_{\mathcal {C}})\)-semirun is not a \((B-{\Upsilon }_{\mathcal {C}}-{\Gamma }_{\mathcal {C}}-1)\)-embedding of π: indeed, such a shifted semirun could contain intermediate configurations with counter values less than \(B-{\Upsilon }_{\mathcal {C}}-{\Gamma }_{\mathcal {C}}-1\).

In order to account for those transitions whose absolute counter effect is N that have already been lowered or not we will introduce the notion of hybrid semiruns, which can be seen as sequences of N-semiruns and \((N-{\Gamma }_{\mathcal {C}})\)-semiruns whose source and target configurations are suitably connected.

Definition 29

A hybrid semirun is a sequence η = α(0)β(1)α(1)β(k)α(k), where

  • each α(i) is an \((N-{\Gamma }_{\mathcal {C}})\)-semirun (possibly empty) of the form

  • each β(i) is a single transition with |Δ(β(i))| = N,

  • the target configuration of α(i− 1) is the source configuration of β(i) for all i ∈ [1,k], and

  • the source configuration of α(i) is the target configuration of β(i) for all i ∈ [1,k].

We call k the breadth of η.

Remark 30

In case our initial N-semirun π contains k transitions of absolute counter effect N, we observe that π can naturally be viewed as an initial hybrid semirun of breadth k.

Several of the notions (such as counter effect, length and maximum) that we have defined for runs and semiruns can naturally be extended to hybrid semiruns. As expected, the projection ϕ(η) is defined as ϕ(η) = ϕ(α(0))ϕ(β(1))ϕ(α(1))⋯ϕ(β(k))ϕ(α(k)). We moreover introduce the particular projection ϕ of ϕ restricted to the α(i), i.e. ϕ(η) = ϕ(α(0))ϕ(α(1))⋯ϕ(α(k)).

Moreover, we view the α(i) themselves as sequences (not as atomic objects) of length mi and the β(i) as sequences of length one. Using this convention, the notions of prefixes, infixes and suffixes are as expected. More importantly, we extend naturally the notion of (max-falling and min-rising) -embedding to hybrid semiruns as in Definition 24 when treating them as such sequences.

We prove the Hill and Valley Lemma (Lemma 28) in Section 7.1. We summarize important further consequences of the proof in Section 7.2.

7.1 Proof of the Hill and Valley Lemma

Let us fix any N-semirun

from q0(z0) to qn(zn) with \(\textsc {Values}(\pi ) \subseteq [0, 4N]\) and \(N > M_{\mathcal {C}}\). Let us moreover assume that π is a B-hill for some \(B\in \mathbb {N}\). The case when π is a B-valley can be proven analogously.

For reasons of simplicity we separate the proof into two cases, namely if there is a + p-transition or − p-transition whose source and target configurations have counter values that are both at most \(B+{\Upsilon }_{\mathcal {C}}+{\Gamma }_{\mathcal {C}}\) or not. Section 7.1.1 deals with the latter case, Section 7.1.2 with the former. It is worth mentioning that Section 7.1.2 depends on Section 7.1.1.

7.1.1 π Does not Contain any ± p-Transition Whose Source and Target Configuration Both Have Counter Value at Most \(B+{\Upsilon }_{\mathcal {C}}+{\Gamma }_{\mathcal {C}}\)

In the following let us denote by \({\mathscr{L}}\) the critical level, i.e. the constant

$$ \mathcal{L}= B+{\Gamma}_{\mathcal{C}}. $$

Moreover, for a hybrid semirun η = α(0)β(1)α(1)β(k)α(k), for every β(j) that is an unlowered + p-transition, we define the critical descending infix with respect to β(j) as the shortest prefix (when viewed as a sequence, as mentioned above) of α(j)β(j+ 1)α(j+ 1)β(k)α(k) that ends in a configuration with counter value at most \({\mathscr{L}}\). In particular, this critical descending infix could possibly end in a configuration inside some (strict prefix of) α(i), where i ∈ [j,k]. Dually, for every β(j) that is an unlowered − p-transition, we define the critical ascending infix with respect to β(j) as the shortest suffix of α(0)β(1)α(j− 1) that starts in a configuration with counter value at most \({\mathscr{L}}\). The following remark is central.

Remark 31

For a hybrid semirun η = α(0)β(1)α(1)β(k)α(k), if some unlowered − p-transition (resp. + p-transition) β(j) appears in the critical descending infix (resp. critical ascending infix) of some unlowered + p-transition (resp. − p-transition) β(i), then so does β(i) appear in the critical ascending infix (resp. critical descending infix) of β(j).

Viewing our initial semirun π as a hybrid semirun, we will now introduce two phases that successively lower unlowered + p-transitions and unlowered − p-transitions yielding hybrid semiruns that retain an approximation invariant (Definition 32).

In phase one, we are interested in unlowered + p-transitions. We want to progressively lower these, going from right to left. Moreover, we want to inspect the critical descending infix in order to obtain successive min-rising and max-falling embeddings with the same source and target configuration. In case the rightmost unlowered + p-transition has the property that its critical descending infix contains some unlowered − p-transition we lower the leftmost such directly, together with the + p-transition. Otherwise, we want to make use of the Bracket Lemma (Lemma 23) and the Depumping Lemma (Lemma 22) in order to retain some nice bracketing properties.

Having successively lowered all unlowered + p-transitions in phase one, we finally lower the remaining unlowered − p-transitions in phase two. For these we take their critical ascending infix and their φ-projection into account, again yielding some carefully chosen bracketing property.

The following definition formalizes the above-mentioned bracketing property.

Definition 32

A hybrid semirun η approximates π with respect to level \(\ell \in \mathbb {Z}\) if

  1. 1.

    η = α(0)β(1)α(1)β(k)α(k) is a hybrid semirun of some breadth k,

  2. 2.

    π can be factorized as π = χ(0)ζ(1)χ(1)ζ(k)χ(k), where the ζ(i) are transitions with operation either + p or − p,

  3. 3.

    η is a min-rising and max-falling -embedding of π,

  4. 4.

    α(i) is a max-falling -embedding of χ(i) for all i ∈ [0,k] with the same source and target configuration as χ(i),

  5. 5.

    every prefix of ϕ(γ(i)) contains at least as many occurrences of [ as of ], where γ(i) is the critical descending infix of β(i) for all i ∈ [1,k] for which β(i) has operation + p, and

  6. 6.

    every suffix of ϕ(γ(i)) contains at least as many occurrences of ] as of [, where γ(i) is the critical ascending infix of β(i) for all i ∈ [1,k] for which β(i) has operation − p.

By completing phase one and then phase two we will show the existence of a hybrid semirun that approximates π with respect to level B and does not contain any unlowered + p-transition nor any unlowered − p-transition (and is hence an \((N-{\Gamma }_{\mathcal {C}})\)-semirun). Observe first that by Point 4 any such hybrid semirun η has the same source and target configuration as π. Second, any such η is in particular a min-rising and max-falling \((N-{\Upsilon }_{\mathcal {C}}-{\Gamma }_{C}-1)\)-embedding of π since π is assumed to be a B-hill. Thus, the lemma follows. We will obtain the desired \((N-{\Gamma }_{\mathcal {C}})\)-semirun and variants thereof by first systematically lowering + p-transitions from the rightmost to the leftmost in phase one and secondly systematically lowering the possibly remaining − p-transitions from the leftmost to the rightmost in phase two. We denote such a process — whose details are given below — by the so-called (+p,−p)-lowering process. As mentioned in Remark 35 we will also define a dual variant, namely the (−p,+p)-lowering process: here phase one will consist of systematically lowering the − p-transitions from the leftmost to the rightmost, whereas phase two will systematically lower the possibly remaining + p-transitions from the rightmost to the leftmost.

Remark 35 finally discusses a variant of a (+p,−p)-lowering process (resp. (−p,+p)-process) which ends in a hybrid semirun that contains precisely one unlowered transition.

Let us discuss the (+p,−p)-lowering process in detail.

Phase one of the (+p,−p)-Lowering Process: Lowering + p-Transitions

We can view our initial N-semirun π as a hybrid semirun η(0) of breadth k0, i.e.

$$ \eta^{(0)}\quad =\quad \alpha^{(0,0)}\beta^{(0,1)}\alpha^{(0,1)}{\cdots} \beta^{(0,k_{0})}\alpha^{(0,k_{0})}\quad. $$

In phase one we will inductively show the existence of a sequence of hybrid semiruns η(0),η(1),…,η(r), where each η(i) has breadth ki and approximates π with respect to level B, η(r) does not contain any unlowered + p-transition, and ki− 1 > ki for all i ∈ [1,r]. Let us assume that we have inductively already defined the sequence η(0),…,η(i− 1) of hybrid semiruns for some i ≥ 1 and where η(i− 1) has breadth ki− 1 > 0 and approximates π with respect to level B and contains at least one unlowered + p-transition. Towards extending the sequence we need to show the existence of some hybrid semirun η(i) of breadth ki < ki− 1 that approximates π with respect to level B.

Let \(\eta ^{(i-1)}=\alpha ^{(i-1,0)}\beta ^{(i-1,1)}\alpha ^{(i-1,1)}\cdots \beta ^{(i-1,k_{i-1})} \alpha ^{(i-1,k_{i-1})}\). Let j ∈ [1,ki− 1] be maximal such that β(i− 1,j) is an unlowered + p-transition. For defining η(i) we make the following case distinction.

  1. 1.

    The critical descending infix with respect to the + p-transition β(i− 1,j) contains at least one unlowered − p-transition. That is, the critical descending infix is of the form

    $$ \alpha^{(i-1,j)}\beta^{(i-1,j+1)}\alpha^{(i-1,j+1)}\cdots\beta^{(i-1,h)}\xi, $$

    where ξ is a prefix (possibly empty) of α(i− 1,h), β(i− 1,j+ 1) is an unlowered − p-transition and where hj + 1. We refer to Fig. 7 for an illustration. Our desired hybrid semirun η(i) is obtained from η(i− 1) by simply lowering both β(i− 1,j) and β(i− 1,j+ 1), i.e. replacing β(i− 1,j) by \(\widehat {\beta ^{(i-1,j)}}\) satisfying \({\Delta }(\widehat {\beta ^{(i-1,j)}})=N-{\Gamma }_{\mathcal {C}}\) and replacing β(i− 1,j+ 1) by a suitable \(\widehat {\beta ^{(i-1,j+1)}}\) satisfying \({\Delta }(\widehat {\beta ^{(i-1,j+1)}})=-N+{\Gamma }_{\mathcal {C}}\) and moreover suitably shifting the part after \(\widehat {\beta ^{(i-1,j)}}\) and until (including) \(\widehat {\beta ^{(i-1,j+1)}}\) by \(-{\Gamma }_{\mathcal {C}}\). More precisely, the part α(i,j− 1) in η(i) is chosen to be of the form

    $$ \alpha^{(i,j-1)}=\alpha^{(i-1,j-1)}\widehat{\beta^{(i-1,j)}} \left( \alpha^{(i-1,j)}-{\Gamma}_{\mathcal{C}}\right) \left( \widehat{\beta^{(i-1,j+1)}}-{\Gamma}_{\mathcal{C}}\right)\alpha^{(i-1,j+1)}. $$

    Moreover, observe that α(i,j− 1) and the infix α(i− 1,j− 1)β(i− 1,j)α(i− 1,j)β(i− 1,j+ 1)α(i− 1,j+ 1) of η(i− 1) connect the same source and target configurations. Thus, it easily follows that η(i) also approximates π with respect to level B. Finally, observe that the breadth of η(i) equals ki− 1 − 2.

  2. 2.

    The critical descending infix with respect to the + p-transition β(i− 1,j) does not contain any unlowered − p-transition. It follows that the critical descending infix with respect to β(i− 1,j) is a non-empty prefix ξ of α(i− 1,j). We refer to Fig. 8 for an illustration. Recall that η(i− 1) approximates π with respect to level B. Firstly, since by assumption \(\textsc {Values}(\pi )\subseteq [0,4N]\), it follows from Point 3 of Definition 32 that \(\textsc {Values}(\xi )\subseteq [0,4N]\). Secondly, from Point 5 of Definition 32 every prefix of ϕ(α(i− 1,j)) contains at least as many occurrences of [ as of ]. Hence, the latter must also hold for every prefix of ϕ(ξ). Thirdly, since by the case of this subsection the target configuration of every transition with operation + p in π has counter value strictly larger than \(B+{\Upsilon }_{\mathcal {C}}+{\Gamma }_{\mathcal {C}}\), it follows from Points 2 and 4 of Definition 32 that the target configuration of β(i− 1,j) ends in a configuration with counter value strictly larger than \(B+{\Upsilon }_{\mathcal {C}}+{\Gamma }_{\mathcal {C}}\). Since ξ is the critical descending infix with respect to β(i− 1,j) (in particular ending in a configuration with counter value at most \(B+{\Gamma }_{\mathcal {C}})\), it follows \({\Delta }(\xi )<-{\Upsilon }_{\mathcal {C}}\). Hence one can apply Lemma 23 to the \((N-{\Gamma }_{\mathcal {C}})\)-semirun ξ yielding an infix ξ[c,d] satisfying ϕ(ξ[c,d]) ∈Λ8 and \({\Delta }(\xi [c,d])<-{\Upsilon }_{\mathcal {C}}\). Applying Lemma 22 to ξ[c,d] implies the existence of an \((N-{\Gamma }_{\mathcal {C}})\)-semirun \(\xi ^{\prime }=\xi [c,d]-I_{1}-I_{2}\cdots -I_{s}\) satisfying \({\Delta }(\xi ^{\prime })={\Delta }(\xi [c,d])+{\Gamma }_{\mathcal {C}}\) and where I1,…,Is are pairwise disjoint intervals of positions in ξ[c,d] such that moreover ϕ(ξ[c,d][It]) ∈Λ16 and Δ(ξ[c,d][It]) < 0 for all t ∈ [1,s]. Assume that ξ = ξ[0,m] consisted of m transitions; thus in particular c,d ∈ [0,m]. By combining the above properties it immediately follows that

    $$ \xi^{\prime\prime}=\xi[0,c]\xi^{\prime}\left( \xi[d,m]+{\Gamma}_{\mathcal{C}}\right) $$

    is an \((N-{\Gamma }_{\mathcal {C}})\)-semirun with \({\Delta }(\xi ^{\prime \prime })={\Delta }(\xi )+{\Gamma }_{\mathcal {C}}\) and that \(\xi ^{\prime \prime } - {\Gamma }_{\mathcal {C}}\) is a max-falling B-embedding of ξ. We define the desired η(i) to be obtained from η(i− 1) by lowering β(i− 1,j) to \(\widehat {\beta ^{(i-1,j)}}\) satisfying \({\Delta }(\widehat {\beta ^{(i-1,j)}})={\Delta }(\beta ^{(i-1,j)})-{\Gamma }_{\mathcal {C}}\) and moreover replacing ξ by \(\xi ^{\prime \prime }-{\Gamma }_{\mathcal {C}}\). Observe that η(i) and η(i− 1) only differ in the infix α(i,j− 1) of η(i). The latter is hence of the form

    $$ \alpha^{(i,j-1)}=\alpha^{(i-1,j-1)}\widehat{\beta^{(i-1,j)}}\left( \xi^{\prime\prime}-{\Gamma}_{\mathcal{C}}\right) \alpha^{(i-1,j)}[m,|\alpha^{(i-1,j)}|]. $$

    By construction η(i− 1)’s infix

    $$ \alpha^{(i-1,j-1)}\beta^{(i-1,j)}\alpha^{(i-1,j)} $$

    has the same source and target configuration as the part α(i,j− 1) of η(i). Since moreover

    • ϕ(ξ[c,d][It]) ∈Λ16 contains precisely as many occurrences of [ as of ] and Δ(ξ[c,d][It]) < 0 for each t ∈ [1,s] and

    • \({\Delta }(\xi ^{\prime \prime })={\Delta }(\xi )+{\Gamma }_{\mathcal {C}}\)

    it follows that indeed η(i) approximates π with respect to level B. Finally, observe that the breadth of η(i) is ki− 1 − 1.

Fig. 7
figure 7

Illustration of phase one case 1, i.e. the unlowered + p-transition β(i− 1,j) can be lowered by lowering it with the leftmost unlowered − p-transition on its critical descending infix, i.e. β(i− 1,j+ 1)

Fig. 8
figure 8

Illustration of phase one case 2, i.e. the suffix of the to be lowered + p transition β(i− 1,j) does not contain any unlowered − p-transition, i.e. any transition with counter effect − N, inside its critical descending infix

Recall that in phase one we have repeatedly lowered unlowered + p-transitions from right to left. In doing so we have hereby possibly lowered certain − p-transitions. The final hybrid semirun η(r) of phase one notably does not contain any unlowered + p-transition. However, η(r) may still contain unlowered − p-transitions. Lowering these will be subject of phase two. Yet, these unlowered − p-transitions will be lowered rather from leftmost to rightmost (instead of from rightmost to leftmost as in phase one).

Phase two of the (+p,−p)-Lowering Process: Lowering − p-Transitions That Remain After Phase one

Recall that \({\mathscr{L}}=B+{\Gamma }_{\mathcal {C}}\) denotes our critical level. Also recall that η(r) is the final hybrid semirun in the sequence η(0),…,η(r) of phase one and approximates π with respect to level B. Note that by construction η(r) does not contain any unlowered + p-transition. That is, all unlowered transitions of η(r) have operation − p and there are as many of them as the breadth of η(r). Setting \(\eta ^{(0)^{\prime }}=\eta ^{(r)}\), phase two consists in showing the existence of a sequence of hybrid semiruns \(\eta ^{(1)^{\prime }},\ldots , \eta ^{(t)^{\prime }}\) all of which do not contain any unlowered + p-transition and in which each \(\eta ^{(i)^{\prime }}\) has breadth \(k_{i}^{\prime }\) satisfying \(k_{i}^{\prime }<k_{i-1}^{\prime }\), where each \(\eta ^{(i)^{\prime }}\) approximates π with respect to level B, and finally \(\eta ^{(t)^{\prime }}\) is of breadth 0 (and is therefore already an \((N-{\Gamma }_{\mathcal {C}})\)-semirun).

Let us inductively assume that we have already defined the sequence \(\eta ^{(0)^{\prime }},\ldots ,\eta ^{(i-1)^{\prime }}\) for some i ≥ 1 and that the breadth \(k_{i-1}^{\prime }\) of \(\eta ^{(i-1)^{\prime }}\) satisfies \(k_{i-1}^{\prime }>0\).

Let \(\eta ^{(i-1)^{\prime }}=\alpha ^{(i-1,0)^{\prime }}\beta ^{(i-1,1)^{\prime }}\alpha ^{(i-1,1)^{\prime }}{\cdots } \beta ^{(i-1,k_{i-1})^{\prime }}\alpha ^{(i-1,k_{i-1})^{\prime }}\). There is only one possible case for this phase since the critical ascending infix with respect to the leftmost unlowered − p-transition \(\beta ^{(i-1,1)^{\prime }}\) does not contain any unlowered + p-transition since \(\eta ^{(i-1)^{\prime }}\) does not. The construction of \(\eta ^{(i)^{\prime }}\), as well as the proof that \(\eta ^{(i)^{\prime }}\) approximates π with respect to level B, is completely dual to the proof of the second case of phase one and therefore omitted.

Example 33

Figure 9 illustrates an example of an application of the (+p,−p)-lowering process. The topmost figure on the left is the starting hybrid semirun π. We begin the process by lowering the two unlowered + p-transitions each by compensating them with a − p-transition, then we enter phase two with one unlowered − p-transition remaining, which we lower and compensate by shifting and cutting out portions inside the critical ascending infix by applying the Depumping Lemma.

Fig. 9
figure 9

Illustration of the (+p,−p)-lowering process from Example 33 to be read from upper left to lower right

Remark 34

In case π is a B-valley instead of a B-hill there is a dual variant of the (+p,−p)-lowering process. The critical level would be adjusted to \({\mathscr{L}}=B-{\Gamma }_{\mathcal {C}}\), for unlowered + p-transitions one would define the critical descending infix to be the shortest suffix of α(0)β(1)α(j− 1) that starts in a configuration with counter value at least \({\mathscr{L}}\), whereas for unlowered − p-transitions one would define the critical ascending infix to be the shortest prefix of α(j)β(j+ 1)α(j+ 1)β(k)α(k) that ends in a configuration with counter value at least \({\mathscr{L}}\). The definition when a hybrid semirun approximates π with respect to level B would be defined analogously as in Definition 32, but where in Point 4 α(i) is rather required to be a min-rising B-embedding of χ(i) with the same source and target configuration as χ(i), Point 5 (resp. Point 6) of Definition 32def approximates would rather require that every suffix (resp. every prefix) of ϕ(γ(i)) contains at least as many occurrences of [ (resp. ]) as of ] (resp. [).

Remark 35

Consider the following variants of the (+p,−p)-lowering process for our B-hill π (dual variants can be formulated in the case when π is B-valley):

  1. 1.

    Consider the dual (−p,+p)-lowering process: In phase one we lower the − p-transitions from the leftmost to the rightmost and in phase two lower the + p-transitions from the rightmost to the leftmost. That is, such a (−p,+p)-lowering process produces a sequence of hybrid semiruns

    $$ \eta^{(0)},\eta^{(1)},\ldots,\eta^{(s)},\eta^{(0)^{\prime}},\eta^{(1)^{\prime}},\ldots,\eta^{(t)^{\prime}}, $$

    that all approximate π with respect to level B where η(0) = π, η(i) is obtained from η(i− 1) by lowering the leftmost unlowered − p-transition of η(i), \(\eta ^{(0)^{\prime }}=\eta ^{(s)}\), \(\eta ^{(i+1)^{\prime }}\) is obtained from \(\eta ^{(i)^{\prime }}\) by lowering the rightmost unlowered + p-transition, and finally \(\eta ^{(t)^{\prime }}\) has breadth 0.

  2. 2.

    Consider again the sequence of hybrid semiruns

    $$ \eta^{(0)},\eta^{(1)},\ldots,\eta^{(s)},\eta^{(0)^{\prime}},\eta^{(1)^{\prime}}, \ldots,\eta^{(t)^{\prime}}, $$

    of the (+p,−p)-process (dually (−p,+p)-process):

    1. (a)

      If t > 0, then observe that \(\eta ^{(t-1)^{\prime }}\) and breadth 1 and contains precisely one unlowered transition, namely an unlowered − p-transition (dually + p-transition).

    2. (b)

      If however t = 0, then we claim that every prefix (dually suffix) of \(\phi (\eta ^{(0)^{\prime }})=\phi (\eta ^{(s)})\) contains at least as many occurrences of [ (dually occurrences of ]) as occurrences of ] (dually occurrences of [). Indeed, it follows immediately from the fact that each η(i) is obtained from η(i− 1) by lowering a + p-transition (dually a − p-transition) either by shifting infixes and cutting out certain infixes \(\zeta ^{\prime }\) for which \(\phi (\zeta ^{\prime })\) contains as many occurrences of [ as of ], or by lowering a + p-transition (dually − p-transition) together with an unlowered − p-transition (dually + p-transition) to the right (dually to the left).

    3. (c)

      If ϕ(π) a priori contains strictly more occurrences of ] than of [ one can — by applying the (+p,−p)-lowering process — obtain a sequence of hybrid semiruns

      $$ \eta^{(0)},\eta^{(1)},\ldots,\eta^{(s)}, \eta^{(0)^{\prime}},\eta^{(1)^{\prime}},\ldots,\eta^{(t)^{\prime}}, $$

      where t > 0, all η(i) and \(\eta ^{(j)^{\prime }}\) approximate π with respect to level B (and are therefore, as remarked above by bearing in mind that π is B-hill, in particular both min-rising and max-falling \((B-{\Upsilon }_{\mathcal {C}}-{\Gamma }_{\mathcal {C}}-1)\)-embeddings of π with the same source and target configuration as π) and where the breadth of \(\eta ^{(t-1)^{\prime }}\) is 1. Dually, if ϕ(π) contains strictly more occurrences of [ than of ] one can — by applying the (−p,+p)-lowering process — obtain a sequence of hybrid semiruns

      $$ \eta^{(0)},\eta^{(1)},\ldots, \eta^{(s)},\eta^{(0)^{\prime}},\eta^{(1)^{\prime}},\ldots,\eta^{(t)^{\prime}}, $$

      where t > 0, all η(i) and \(\eta ^{(j)^{\prime }}\) approximate π with respect to level B (and are therefore both min-rising and max-falling \((B-{\Upsilon }_{\mathcal {C}}-{\Gamma }_{\mathcal {C}}-1)\)-embeddings of π with the same source and target configuration as π) and where the breadth of \(\eta ^{(t-1)^{\prime }}\) is 1.

7.1.2 π Contains a ± p-Transition Whose Source and Target Configuration Both Have Counter Value at Most \(B+{\Upsilon }_{\mathcal {C}}+{\Gamma }_{\mathcal {C}}\)

The presence of a + p-transition (resp. − p-transition) for which we have \(\max \limits \{z_{i},z_{i+1}\}\leq B+{\Upsilon }_{\mathcal {C}}+{\Gamma }_{\mathcal {C}}\) implies

\(z_{i+1} - (B+{\Gamma }_{\mathcal {C}}) \leq {\Upsilon }_{\mathcal {C}}\) (resp. \(z_{i} - (B+{\Gamma }_{\mathcal {C}}) \leq {\Upsilon }_{\mathcal {C}}\)), so the core problem is that in both cases it is not possible to apply the Bracket Lemma (Lemma 23) in the critical descending (resp. ascending) infix of such an unlowered transition. We thus have to find another way to compensate for lowering such transitions.

We next claim that firstly, any + p-transition whose configurations both have a counter value at most \(B+{\Upsilon }_{\mathcal {C}}+{\Gamma }_{\mathcal {C}}\) must be the first transition of π and secondly, any − p-transition with the same property must be the last transition of π. Indeed, every + p-transition that is not the first transition (i.e. i > 0) satisfies ziB as π is a B-hill. As a consequence, we have \(z_{i+1}\geq B+N > B+ M_{\mathcal {C}} > B + {\Gamma }_{\mathcal {C}} + {\Upsilon }_{\mathcal {C}}\), where the last inequality follows from \(M_{\mathcal {C}}\)’s definition on page 15. Dually, if there exists a − p-transition with \(z_{i}\leq B+{\Upsilon }_{\mathcal {C}}+{\Gamma }_{\mathcal {C}}\) it must be the last transition .

To finalize the proof it thus suffices to distinguish whether both the first transition of π is a + p-transition with counter values at most \((B+{\Upsilon }_{\mathcal {C}}+{\Gamma }_{\mathcal {C}})\) and the last transition of π is a − p-transition with counter values at most \((B+{\Upsilon }_{\mathcal {C}}+{\Gamma }_{\mathcal {C}})\), or this holds for precisely one of them. We thus distinguish these two cases, however in opposite order.

Case 1. The first transition is a + p-transition with counter values at most \((B+{\Upsilon }_{\mathcal {C}}+{\Gamma }_{\mathcal {C}})\) and the last transition is not a − p-transition with counter values at most \((B+{\Upsilon }_{\mathcal {C}}+{\Gamma }_{\mathcal {C}})\), or the first transition is not a + p-transition with counter values at most \((B+{\Upsilon }_{\mathcal {C}}+{\Gamma }_{\mathcal {C}})\) and the last transition is a − p-transition with counter values at most \((B+{\Upsilon }_{\mathcal {C}}+{\Gamma }_{\mathcal {C}})\).

We only treat the case when the first transition is a + p-transition with counter values at most \((B+{\Upsilon }_{\mathcal {C}}+{\Gamma }_{\mathcal {C}})\) and the last transition is not a − p-transition with counter values at most \((B+{\Upsilon }_{\mathcal {C}}+{\Gamma }_{\mathcal {C}})\), since the opposite case can be proven analogously.

Starting with η(0) = π we apply phase one of the (+p,−p)-lowering process to π yielding a sequence of hybrid semiruns that all approximate π with respect to level B (and thus in particular — bearing in mind that π is B-hill — approximates π with respect to level \(B-{\Gamma }_{\mathcal {C}}-1\))

$$ \eta^{(0)},\eta^{(1)},\ldots,\eta^{(s-1)} $$

in which (as above) η(i) is obtained from η(i− 1) by lowering the rightmost unlowered + p of η(i− 1) however only until reaching the hybrid semirun η(s− 1) that contains precisely one unlowered + p-transition, namely the first transition of π, which has counter values at most \((B+{\Upsilon }_{\mathcal {C}}+{\Gamma }_{\mathcal {C}})\) by assumption. It is important but straightforward to verify that despite the case we are in, it holds that η(i) approximates π with respect to level B (and also — bearing in mind that π is a B-hill — with respect to level \(B-{\Gamma }_{\mathcal {C}}-1)\) for all i ∈ [1,s − 1].

Next, we will define a sequence of hybrid semiruns \(\eta ^{(s)}=\eta ^{(0)^{\prime }},\eta ^{(1)^{\prime }},\ldots ,\eta ^{(t)^{\prime }}\) in which \(\eta ^{(t)^{\prime }}\) will be the desired \((N-{\Gamma }_{\mathcal {C}})\)-semirun as required by the lemma. For first defining \(\eta ^{(s)}=\eta ^{(0)^{\prime }}\) we make a case distinction for lowering the only + p-transition of η(s− 1), which happens to have counter values at most \((B+{\Upsilon }_{\mathcal {C}}+{\Gamma }_{\mathcal {C}})\) by assumption. For this assume η(s− 1) has the following form

$$ \eta^{(s-1)}=\alpha^{(s-1,0)}\beta^{(s-1,1)}\alpha^{(s-1,1)}\cdots\beta^{(s-1,k_{s-1})} \alpha^{(s-1,k_{s-1})}, $$

where we recall that β(s− 1,1) equals . Observe that the critical descending infix of β(s− 1,1) could possibly be empty, for instance if \(z_{1}\leq B+{\Gamma }_{\mathcal {C}}\). We now make the following case distinction.

  • In case the critical descending infix of β(s− 1,1) contains an unlowered − p-transition we define η(s) to be obtained from η(s− 1) by lowering β(s− 1,1) with the leftmost unlowered − p-transition inside the critical descending infix as above. Thus, η(s) no longer contains any unlowered + p-transition. It is again straightforward to verify that η(s) approximates π with respect to level B. Setting \(\eta ^{(0)^{\prime }}=\eta ^{(s)}\) we then construct the sequence \(\eta ^{(s)}=\eta ^{(0)^{\prime }},\eta ^{(1)^{\prime }},\ldots ,\eta ^{(t)^{\prime }}\) as usual, i.e. each \(\eta ^{(i)^{\prime }}\) approximates π with respect to level B and is obtained from \(\eta ^{(i-1)^{\prime }}\) by lowering the leftmost unlowered − p-transition and where eventually the breadth of \(\eta ^{(t)^{\prime }}\) is 0. Thus, as desired, the final \(\eta ^{(t)^{\prime }}\) is an \((N-{\Gamma }_{\mathcal {C}})\)-semirun that is a min-rising and max-falling B-embedding of π that has the same source and target configuration as π. Since \(\eta ^{(t)^{\prime }}\) has the same source and target configuration as π it follows that \(\eta ^{(t)^{\prime }}\) is also a min-rising and max-falling \((B-{\Upsilon }_{\mathcal {C}}-{\Gamma }_{\mathcal {C}}-1)\)-embedding of π as required by the lemma.

  • In case the critical descending infix of β(s− 1,1) does not contain any unlowered − p-transition, we consider the shortest prefix ζ of the remaining suffix

    $$ \alpha^{(s-1,1)}\cdots\beta^{(s-1,k_{s-1})}\alpha^{(s-1,k_{s-1})} $$

    that ends in a configuration with counter value at most

    $$ \mathcal{L}^{\prime}=z_{1}-{\Upsilon}_{\mathcal{C}}-1 $$

    (where we recall that as above each α(i,j) is viewed as a sequence of transitions). Indeed, we claim that ζ exists and moreover satisfies \({\Delta }(\zeta )<-{\Upsilon }_{\mathcal {C}}\). Firstly, as π is a B-hill by assumption, we have that \(z_{1}-z_{n}>{\Upsilon }_{\mathcal {C}}\). Secondly, since η(s− 1) approximates π with respect to level B we have that η(s− 1) ends in a configuration with counter value zn. Thus, \({\Delta }(\alpha ^{(s-1,1)}\cdots \beta ^{(s-1,k_{s-1})} \alpha ^{(s-1,k_{s-1})})=z_{n}-z_{1}< -{\Upsilon }_{\mathcal {C}}\) which implies that the prefix ζ exists and satisfies \({\Delta }(\zeta )<-{\Upsilon }_{\mathcal {C}}\). We make the following final case distinction.

    • In case ζ contains an unlowered − p-transition, it must contain the leftmost unlowered − p-transition, namely β(s− 1,2). Similar as for the critical descending infix, we define η(s) to be obtained from η(s− 1) by lowering β(s− 1,1) together with β(s− 1,2). Here it is important to note that η(s) is not necessarily a \((B-{\Gamma }_{\mathcal {C}})\)-embedding of π since we cannot rule out the existence of configurations appearing in α(s− 1,1) that have counter value B. Since η(s− 1) was a B-embedding of the B-hill π with the same source and target configuration it follows however that η(s) is a \((B-{\Gamma }_{\mathcal {C}}-1)\)-embedding of π. Hence, η(s) approximates π with respect to level \(B-{\Gamma }_{\mathcal {C}}-1\). Thus, η(s) no longer contains any unlowered + p-transitions, however, possibly contains unlowered − p-transitions. Recalling that \(\eta ^{(0)^{\prime }}=\eta ^{(s)}\) we define each of the remaining \(\eta ^{(i)^{\prime }}\) to be obtained from \(\eta ^{(i-1)^{\prime }}\) as usual but by retaining that each \(\eta ^{(i)^{\prime }}\) approximates π with respect to level \(B-{\Gamma }_{\mathcal {C}}-1\) (instead of level B). By construction, \(\eta ^{(0)^{\prime }}\) has breadth 0 and thus is an \((N-{\Gamma }_{\mathcal {C}})\)-semirun that is a min-rising and max-falling \((B-{\Gamma }_{\mathcal {C}}-1)\)-embedding and hence — bearing in mind that π is a B-hill — in particular a min-rising and max-falling \((B-{\Upsilon }_{\mathcal {C}}-{\Gamma }_{\mathcal {C}}-1)\)-embedding of π with the same source and target configuration as π.

    • In case ζ does not contain any unlowered − p-transition it follows that ζ is a prefix of α(s− 1,1), thus contains neither unlowered + p-transitions nor unlowered − p-transitions but possibly lowered ones. By an analogous reasoning as Point 2 of Remark 35 every occurrence of a lowered − p-transition in α(s− 1,1) is preceded by a unique corresponding lowered + p-transition again in α(s− 1,1). Thus, every prefix of ϕ(ζ) contains at least as many occurrences of [ as of ]. Recalling that \({\Delta }(\zeta )<-{\Upsilon }_{\mathcal {C}}\) we can hence apply the Bracket Lemma (Lemma 23) and the Depumping Lemma (Lemma 22) to ζ as in phase one. The final η(s) is obtained from η(s− 1) by suitably shifting subsemiruns and cutting out certain subsemiruns whose ϕ-projection contains the same number of occurrences of [ as of ]. Similar as argued in the previous point it follows that η(s) approximates π with respect to level \(B-{\Gamma }_{\mathcal {C}}-1\). Setting again \(\eta ^{(0)^{\prime }}=\eta ^{(s)}\) we define the sequence of hybrid semiruns \(\eta ^{(0)^{\prime }},\eta ^{(1)^{\prime }},\ldots , \eta ^{(t)^{\prime }}\) that all approximate π with respect to level \(B-{\Gamma }_{\mathcal {C}}-1\) analogously as done in the previous point. Again \(\eta ^{(t)^{\prime }}\) is an \((N-{\Gamma }_{\mathcal {C}})\)-semirun that is a min-rising and max-falling \((B-{\Gamma }_{\mathcal {C}}-1)\)-embedding (and hence in particular a min-rising and max-falling \((B-{\Upsilon }_{\mathcal {C}}-{\Gamma }_{\mathcal {C}}-1)\)-embedding of π with the same source and target configuration as π.

Remark 36

Our case (where the first transition of our B-hill is a + p-transition with counter values at most \(B+{\Upsilon }_{\mathcal {C}}+{\Gamma }_{\mathcal {C}}\) and the last transition is not a − p-transition with counter values at most \((B+{\Upsilon }_{\mathcal {C}}+{\Gamma }_{\mathcal {C}})\)) allows the following “penultimate” process variants for our B-hill π (dual variants can be formulated in the case when π is B-valley):

  1. 1.

    The adjusted process here in Case 1 bears similar properties to those of the (+p,−p)-lowering process seen in Remark 35. Specifically, if ϕ(π) contains strictly more occurrences of ] than of [ one can obtain a sequence of hybrid semiruns

    $$ \eta^{(0)},\eta^{(1)},\ldots,\eta^{(s)},\eta^{(0)^{\prime}},\eta^{(1)^{\prime}}, \ldots,\eta^{(t-1)^{\prime}}, $$

    where all η(i) and \(\eta ^{(j)^{\prime }}\) approximate π with respect to level \(B-{\Gamma }_{\mathcal {C}}-1\) (and are therefore — bearing in mind that π is a B-hill — in particular min-rising and max-falling \((B-{\Upsilon }_{\mathcal {C}}-{\Gamma }_{\mathcal {C}}-1)\)-embeddings of π with the same source and target configuration as π) and where \(\eta ^{(t-1)^{\prime }}\) has breadth 1 and contains precisely one unlowered − p-transition.

  2. 2.

    Dually, the (−p,+p)-lowering process mentioned in Remark 35, when applied to Case 1, is such that if ϕ(π) contains strictly more occurrences of [ than of ] one can obtain a sequence of hybrid semiruns

    $$ \eta^{(0)},\eta^{(1)},\ldots,\eta^{(s)},\eta^{(0)^{\prime}},\eta^{(1)^{\prime}},\ldots, \eta^{(t-1)^{\prime}}, $$

    where all η(i) and \(\eta ^{(j)^{\prime }}\) approximate π with respect to level \(B-{\Gamma }_{\mathcal {C}}-1\) (and are therefore — bearing in mind that π is a B-hill — in particular min-rising and max-falling \((B-{\Upsilon }_{\mathcal {C}}-{\Gamma }_{\mathcal {C}}-1)\)-embeddings of π with the same source and target configuration as π) and where \(\eta ^{(t-1)^{\prime }}\) has breadth 1 and contains precisely one unlowered + p-transition.

Case 2. The first transition is a + p-transition with counter values at most \((B+{\Upsilon }_{\mathcal {C}}+{\Gamma }_{\mathcal {C}})\) and the last transition is a − p-transition with counter values at most \((B+{\Upsilon }_{\mathcal {C}}+{\Gamma }_{\mathcal {C}})\).

By our case we have that \(z_{0},z_{n}\leq B+{\Upsilon }_{\mathcal {C}}+{\Gamma }_{\mathcal {C}}-N\leq B+{\Upsilon }_{\mathcal {C}}+{\Gamma }_{\mathcal {C}}-M_{\mathcal {C}}< B-{\Upsilon }_{\mathcal {C}}-{\Gamma }_{\mathcal {C}}-1\), where the last inequality follows the definition of our constants on page 15.

Since π is a B-hill π is also a \((B-{\Upsilon }_{\mathcal {C}}-{\Gamma }_{\mathcal {C}}-1)\)-hill. Moreover, obviously there are no + p-transitions nor − p-transitions in π whose source and target configuration both have counter value at most B − 1. Phrased differently, setting \(B^{\prime }=B-{\Upsilon }_{\mathcal {C}}-{\Gamma }_{\mathcal {C}}-1\), we view π as a \(B^{\prime }\)-hill that does not contain any + p-transitions nor − p-transitions whose source and target configuration have a counter value at most \((B^{\prime }+{\Upsilon }_{\mathcal {C}}+{\Gamma }_{\mathcal {C}})\). We can hence apply the (+p,−p)-lowering process to π as described in the case of in Section 7.1.1 for \(B^{\prime }\) instead of B, thus yielding the sequence η(0),η(1),…,η(s) and \(\eta ^{(0)^{\prime }},\eta ^{(1)^{\prime }}, {\ldots } \eta ^{(t)^{\prime }}\) of hybrid semiruns that approximate π with respect to level \(B^{\prime }\) and are therefore min-rising and max-falling \(B^{\prime }\)-embeddings of π: note that we use the fact that they are are indeed \(B^{\prime }\)-embeddings as the construction in Section 7.1.1 guarantees rather than that they are \((B^{\prime }-{\Upsilon }_{\mathcal {C}}-{\Gamma }_{\mathcal {C}}-1)\)-embeddings. The final \(\eta ^{(t)^{\prime }}\) is of breadth 0 and is hence a min-rising and max-falling \((N-{\Gamma }_{\mathcal {C}})\)-semirun that is a \((B-{\Upsilon }_{\mathcal {C}}-{\Gamma }_{\mathcal {C}}-1)\)-embedding of π with the same source and target configuration as π, as required by the lemma.

7.2 The Hill and Valley Lemma, Dependent on the Number of Occurrences + p-Transitions as of − p-Transitions

A closer look at the proof of Lemma 28 reveals that majority of occurrences of + p-transitions (resp. − p-transitions) implies the respective majority is preserved in the resulting \((N-{\Gamma }_{\mathcal {C}})\)-semirun.

Remark 37

The resulting \(\eta ^{(t)^{\prime }}\) obtained from the B-hill (resp. B-valley) π satisfies the following:

  • If ϕ(π) contains at least as many occurrences of [ as of ], then so does the resulting \((N-{\Gamma }_{\mathcal {C}})\)-semirun \(\phi (\eta ^{(t)^{\prime }})\) satisfying Lemma 28.

  • If ϕ(π) contains at least as many occurrences of ] as of [, then so does the resulting \((N-{\Gamma }_{\mathcal {C}})\)-semirun \(\phi (\eta ^{(t)^{\prime }})\) satisfying Lemma 28.

The following final remark stresses the fact that when our B-hill (resp. B-valley) π contains a number of occurrences of + p-transitions different from the number of − p-transitions, the lowering processes described in the previous section yield a penultimate hybrid semirun all but one of whose + p-transitions and − p-transitions are lowered. It is an immediate consequence of Point 2.c in Remarks 35 and 36.

Remark 38

Let π be an N-semirun that is a B-hill (dually a B-valley).

  1. 1.

    If ϕ(π) contains strictly more occurrences of ] than of [ one can obtain a sequence of hybrid semiruns

    $$ \eta^{(0)},\eta^{(1)},\ldots,\eta^{(s)},\eta^{(0)^{\prime}},\eta^{(1)^{\prime}},\ldots, \eta^{(t-1)^{\prime}}, $$

    in which \(\eta ^{(t-1)^{\prime }}\) is a min-rising and max-falling \((B-{\Upsilon }_{\mathcal {C}} -{\Gamma }_{\mathcal {C}}-1)\)-embedding (dually \((B+{\Upsilon }_{\mathcal {C}} +{\Gamma }_{\mathcal {C}}+1)\)-embedding) of π with the same source and target configuration as π and where \(\eta ^{(t-1)^{\prime }}\) has breadth 1 and contains precisely one unlowered − p-transition.

  2. 2.

    Analogously, if ϕ(π) contains strictly more occurrences of [ than of ] one can obtain a sequence of hybrid semiruns

    $$ \eta^{(0)},\eta^{(1)},\ldots,\eta^{(s)},\eta^{(0^{\prime})},\eta^{(1)^{\prime}},\ldots, \eta^{(t-1)^{\prime}}, $$

    in which \(\eta ^{(t-1)^{\prime }}\) is a min-rising and max-falling \((B-{\Upsilon }_{\mathcal {C}} -{\Gamma }_{\mathcal {C}}-1)\)-embedding (dually \((B+{\Upsilon }_{\mathcal {C}} +{\Gamma }_{\mathcal {C}}+1)\)-embedding) of π with the same source and target configuration as π and where \(\eta ^{(t-1)^{\prime }}\) has breadth 1 and contains precisely one unlowered + p-transition.

8 The 5/6-Lemma

In this section, we introduce the 5/6-Lemma (Lemma 39), stating that any N-semirun with counter effect smaller than 5/6 ⋅ N can be turned into an \((N-{\Gamma }_{\mathcal {C}})\)-semirun that is moreover an -embedding for all that are in distance at most 5/6 ⋅ N from the counter values of the source and target configuration. It will be the main technical ingredient in the proof of the Small Parameter Theorem (Theorem 18). This section is devoted to proving the lemma, hereby making extensive use of the Hill and Valley Lemma (Lemma 28), the Depumping Lemma (Lemma 22), and the Bracket Lemma (Lemma 23) introduced in previous sections.

Recall that we have fixed a POCA \(\mathcal {C}=(Q,P,R,q_{init}, F)\) with P = {p} along with the constants \(Z_{C},{\Gamma }_{\mathcal {C}},{\Upsilon }_{\mathcal {C}},M_{\mathcal {C}}\) on page 15.

Let us first introduce the 5/6-Lemma.

Lemma 39 (5/6-Lemma)

For all \(N>M_{\mathcal {C}}\) and all \(\ell \in \mathbb {Z}\) and all N-semiruns π from q0(z0) to qn(zn) with \(\textsc {Values}(\pi )\subseteq [0,4 N]\) satisfying \(\max \limits (z_{0},z_{n},\ell )-\min \limits (z_{0},z_{n},\ell )\leq 5/6 \cdot N\) there exists an \((N-{\Gamma }_{\mathcal {C}})\)-semirun \(\pi ^{\prime }\) from q0(z0) to qn(zn) that is an -embedding of π such that \(\textsc {Values}(\pi ^{\prime })\subseteq [\min \limits (\pi )-{\Gamma }_{\mathcal {C}},\max \limits (\pi )+{\Gamma }_{\mathcal {C}}]\).

Towards proving Lemma 39 let us fix

  • some \(N>M_{\mathcal {C}}\),

  • some \(\ell \in \mathbb {Z}\),

  • some N-semirun from q0(z0) to qn(zn) satisfying \(\textsc {Values}(\pi )\subseteq [0,4 N]\) and \(\max \limits (z_{0},z_{n},\ell )-\min \limits (z_{0},z_{n},\ell )\leq 5/6 \cdot N\).

In order to prove the 5/6-Lemma we need to show the existence of some \((N-{\Gamma }_{\mathcal {C}})\)-semirun \(\pi ^{\prime }\) from q0(z0) to qn(zn) that is both an -embedding of π with \(\textsc {Values}(\pi ^{\prime })\subseteq [\min \limits (\pi )-{\Gamma }_{\mathcal {C}},\max \limits (\pi )+{\Gamma }_{\mathcal {C}}]\).

For this, let us define following two constants

figure ap

and observe that

$$ \begin{array}{@{}rcl@{}} {B_{\max}}-{B_{\min}}&=&\max(z_{0},z_{n},\ell)-\min(z_{0},z_{n},\ell)+2{\Upsilon}_{\mathcal{C}}+4{\Gamma}_{\mathcal{C}}+2\\ &\leq&5/6\cdot N+2{\Upsilon}_{\mathcal{C}}+4{\Gamma}_{\mathcal{C}}+2\\ &\leq&5/6\cdot N+ M_{\mathcal{C}} / 6 \end{array} $$
(6)
$$ \begin{array}{@{}rcl@{}} &<&N, \end{array} $$
(7)

where the penultimate inequality follows from the definitions of our constants on page15.

We are particularly interested in subsemiruns of π that start and end in configurations with counter values in \([{B_{\min \limits }}+1,{B_{\max \limits }}-1]\). To categorize such subsemiruns into different types, we introduce the notion of crossing and doubly-crossing transitions.

Definition 40

A transition is called crossing if either

  • πi = +p and we have \(z_{i}<{B_{\max \limits }}\leq z_{i+1}\) or \(z_{i}\leq {B_{\min \limits }} < z_{i+1}\), or

  • πi = −p and we have \(z_{i}>{B_{\min \limits }}\geq z_{i+1}\) or \(z_{i}\geq {B_{\max \limits }}> z_{i+1}\).

If even moreover \(z_{i}\leq {B_{\min \limits }}\leq {B_{\max \limits }}\leq z_{i+1}\) or \(z_{i}\geq {B_{\max \limits }}\geq {B_{\min \limits }}\geq z_{i+1}\) we call πi doubly-crossing.

We already refer to Fig. 10, where subsemiruns of a certain type (to be defined below) are depicted, some of whose transitions crossing transitions, some of whose are even doubly-crossing transitions.

Fig. 10
figure 10

On the left, an example of a Type II subsemirun. On the right, an example of a Type III subsemirun. Bold transitions are crossing, and the first two bold transitions of the figure on the right are moreover doubly crossing

Next, we introduce three particular types of subsemiruns of π starting and ending in configurations with counter values in \([{B_{\min \limits }}+1,{B_{\max \limits }}-1]\).

Definition 41 (Type I, II and III subsemiruns of π)

A subsemirun π[a,b] of π with source and target configuration in \(Q\times [{B_{\min \limits }}+1,{B_{\max \limits }}-1]\) is

  • of Type I if \(\textsc {Values}(\pi [a,b])\subseteq [{B_{\min \limits }}+1,{B_{\max \limits }}-1]\),

  • of Type II if

    • \(\textsc {Values}(\pi [a+1,b-1])\cap [{B_{\min \limits }}+1,{B_{\max \limits }}-1]=\emptyset \), and

    • π[a,b] does not contain any doubly-crossing transitions,

  • of Type III if

    • \(\textsc {Values}(\pi [a+1,b-1])\cap [{B_{\min \limits }}+1,{B_{\max \limits }}-1]=\emptyset \), and

    • π[a,b] contains at least one doubly-crossing transition.

Remark 42

All crossing transitions in a Type III semirun, except possibly the first or the last transition, are doubly-crossing.

Figure 10 shows an example of a Type II and of a Type III subsemirun.

The following lemma factorizes π into Type I, Type II and Type III subsemiruns, bearing in mind that both the source and target configuration of π have a counter value in \([{B_{\min \limits }}+1,{B_{\max \limits }}-1]\).

Lemma 43

The N-semirun π can be factorized into Type I, Type II and Type III subsemiruns.

Proof

Let us first factorize π as

$$ \begin{array}{@{}rcl@{}} \pi &=& \pi[c_{1},d_{1}]\pi[d_{1},c_{2}]\pi[c_{2},d_{2}]\pi[d_{2},c_{3}]\quad\cdots\quad\pi[c_{t},d_{t}], \end{array} $$
(8)

where

  • π[ci,di] are Type I and maximal (possibly empty), i.e. π[ci,di] is of Type I but neither π[ci − 1,di] nor π[ci,di + 1] is of Type I for all i ∈ [1,t], and

  • \(\textsc {Values}(\pi [d_{i}+1,c_{i+1}-1])\cap [{B_{\min \limits }}+1,{B_{\max \limits }}-1]=\emptyset \) for all i ∈ [1,t − 1].

Now it suffices to show that each subsemirun π[di,ci+ 1] is either of Type II or of Type III. For this, let us make a case distincton on whether π[di,ci+ 1] contains a doubly-crossing transition or not.

For the first case, namely that π[di,ci+ 1] does contain a doubly-crossing transition, since \(\textsc {Values}(\pi [d_{i}+1,c_{i+1}-1])\cap [{B_{\min \limits }}+1,{B_{\max \limits }}-1]=\emptyset \), we have that π[di,ci+ 1] is of Type III by definition.

For the second case, namely that π[di,ci+ 1] does not contain any doubly-crossing transition, since \(\textsc {Values}(\pi [d_{i}+1,c_{i+1}-1])\cap [{B_{\min \limits }}+1,{B_{\max \limits }}-1]=\emptyset \) we have that π[di,ci+ 1] is of Type II by definition (Fig. 11). □

Fig. 11
figure 11

In this figure, we provide an example factorization of a semirun π. A semirun π is divided into five subsemiruns, separated by vertical lines. The third and fifth subsemiruns are of Type I, the first and fourth subsemiruns are of Type II, and the second one is of Type III

By Remark 26 in order to prove the existence of the desired \((N-{\Gamma }_{\mathcal {C}})\)-semirun it suffices to show it for Type I, Type II and Type III subsemiruns of π.

Since Type I subsemiruns neither contain any + p-transition nor any − p-transition by (7), they are already \((N-{\Gamma }_{\mathcal {C}})\)-semiruns.

Let us now discuss the situation for Type II subsemiruns of π. If a Type II subsemirun is already a Type I subsemirun we are done as above. In case a Type II subsemirun ρ is not of Type I we first claim that ρ is either a \({B_{\min \limits }}\)-valley or a \({B_{\max \limits }}\)-hill. Indeed, if ρ is of Type II but not of Type I one can factorize ρ as

where

  1. 1.

    m ≥ 2,

  2. 2.

    \(x_{0},x_{m}\in [{B_{\min \limits }}+1,{B_{\max \limits }}-1]\), and

  3. 3.

    either \(x_{i}\in [0,{B_{\min \limits }}]\) for all i ∈ [1,m − 1] or \(x_{i}\in [{B_{\max \limits }},4N]\) for all i ∈ [1,m − 1],

where Point 3 follows from the absence of doubly-crossing transitions.

First assume that \(x_{i}\in [{B_{\max \limits }},4N]\) for all i ∈ [1,m − 1]. In this case any + p-transition (resp. − p-transition) ends (resp. starts) in a configuration with counter value strictly larger than \({B_{\min \limits }}+N\). Due to the definition of our constants on page 15 we have

$$ \begin{array}{@{}rcl@{}} x_{0}+{\Upsilon}_{\mathcal{C}}, \ x_{n}+{\Upsilon}_{\mathcal{C}}&<&{B_{\max}}+{\Upsilon}_{\mathcal{C}}\\ &=&{B_{\min}}+({B_{\max}}-{B_{\min}})+{\Upsilon}_{\mathcal{C}} \\ &\leq&{B_{\min}} + 5/6\cdot N+3{\Upsilon}_{\mathcal{C}}+4{\Gamma}_{\mathcal{C}}+2\\ &<&{B_{\min}} + 5/6\cdot N+ M_{\mathcal{C}} / 6\\ &<&{B_{\min}}+N, \end{array} $$

hence ρ is a \({B_{\max \limits }}\)-hill.

Secondly, in case \(x_{i}\in [0,{B_{\min \limits }}]\) for all i ∈ [1,m − 1] it can analogously be shown that ρ is \({B_{\min \limits }}\)-valley.

The existence of the desired \((N-{\Gamma }_{\mathcal {C}})\)-semirun \(\rho ^{\prime }\) that is an -embedding of the Type II semirun ρ with the same source and target configuration as ρ follows immediately from the following claim, which itself (with a short justificaton below) is a consequence of the Hill and Valley Lemma (Lemma 28); thanks to the fact that the Hill and Valley Lemma guarantees the resulting \((N-{\Gamma }_{\mathcal {C}})\)-semiruns to be min-rising and max-falling, we can even guarantee \(\textsc {Values}(\rho ^{\prime })\subseteq [\min \limits (\rho ),\max \limits (\rho )]\).

Claim 2

For every N-semirun ρ that is either a B-hill with \(B \geq \ell + {\Upsilon }_{\mathcal {C}} + {\Gamma }_{\mathcal {C}} +1\) or a B-valley with \(B \leq \ell - {\Upsilon }_{\mathcal {C}} - {\Gamma }_{\mathcal {C}}-1\), there exists an \((N-{\Gamma }_{\mathcal {C}})\)-semirun that is both a min-rising and max-falling -embedding of ρ with same source and target configuration as ρ.

That the Hill and Valley Lemma produces an -embedding that has the same source and target configuration is important here. Indeed, generally speaking if ρ is any B-hill and \(\rho ^{\prime }\) is any k-embedding of ρ with the same source and target configuration as ρ and where k < B, then \(\rho ^{\prime }\) is also a \(k^{\prime }\)-embedding of ρ for all \(k^{\prime }<k\). Dually, if ρ is any B-valley and \(\rho ^{\prime }\) is a k-embedding of ρ with with the same source and target configuration as ρ and where k > B, then \(\rho ^{\prime }\) is also an \(k^{\prime }\)-embedding of ρ for all \(k^{\prime }>k\).

For the rest of this section it now suffices to prove that for every Type III subsemirun ρ of π there exists an \((N-{\Gamma }_{\mathcal {C}})\)-semirun \(\rho ^{\prime }\) that is an -embedding of ρ with the same source and target configuration as ρ and that moreover satisfies \(\textsc {Values}(\rho ^{\prime })\subseteq [\min \limits (\rho )-{\Gamma }_{\mathcal {C}}, \max \limits (\rho )+{\Gamma }_{\mathcal {C}}]\).

8.1 Lowering Type III Subsemiruns

For the rest of the section let us fix a Type III subsemirun ρ of π. Let us factorize ρ by its crossing semitransitions, i.e. as

$$ \begin{array}{@{}rcl@{}} \rho \quad=&& \alpha^{(0)} \beta^{(1)} \alpha^{(1)} \quad\cdots\quad\beta^{(n)} \alpha^{(n)}, \end{array} $$

where β(1),…,β(n) is an enumeration of the crossing semitransitions of ρ and each α(i) is a (possibly empty) N-subsemirun of ρ. It is worth mentioning that, indeed abusing notation, for the rest of this section we refer to n as the number of crossing semitransitions of ρ, rather than the number of transitions of our original N-run π.

An example factorization is shown in Fig. 10, where the crossing transitions are depicted in bold. We remark that the only crossing transitions of ρ that are not doubly-crossing can possibly only be the first or the last one (or both).

We intend to now factorize ρ, if possible, into hills and valleys. In order to do this let us first introduce the notions of B-hill candidate and B-valley candidate.

Definition 44

Let

be an N-semirun. We say χ is a B-hill candidate if x0,xm < B and xiB for all i ∈ [1,m − 1], respectively a B-valley candidate if x0,xm > B and xiB for all i ∈ [1,m − 1].

Note that every B-hill is a B-hill candidate but not vice versa, since being a B-hill moreover requires + p-transitions to end at a configuration with counter value strictly larger than \(x_{n}+{\Upsilon }_{\mathcal {C}}\) and − p-transitions to start at a configuration with counter value strictly larger than \(x_{0}+{\Upsilon }_{\mathcal {C}}\). A similar remark applies to B-valleys and B-valley candidates.

For the rest of this section we assume without loss of generality that the crossing transition β1 is a + p-transition. The case when β1 is − p-transition can be proven analogously.

It follows that if the number n of crossing transitions is even, then there is a unique factorization

$$ \rho\quad=\quad \alpha^{(0)}\sigma^{(1)} \alpha^{(2)}\sigma^{(2)}\alpha^{(4)}\sigma^{(3)}\alpha^{(6)}\quad\cdots\quad\sigma^{(n/2)}\alpha^{(n)}, $$
(9)

where σ(i) = β(2i− 1)α(2i− 1)β(2i) is a \({B_{\max \limits }}\)-hill candidate, β(2i− 1) is a + p-transition and β(2i) is a − p-transition for all i ∈ [1,n/2]. Indeed, this immediately follows from the definition of crossing transitions and the fact that α(2i− 1) does not contain any configuration with counter value strictly less than \({B_{\max \limits }}\).

Therefore our proof makes first a case distinction on the parity of the number n of crossing transitions.

Case A: The number of crossing transitions n is even.

Our proof next makes a case distinction on the number of \({B_{\max \limits }}\)-hill candidates σ(i) in the factorization (9) that are in fact \({B_{\max \limits }}\)-hills.

Case A.1: All of the \({B_{\max \limits }}\)-hill candidates σ(i) in (9) are in fact \({B_{\max \limits }}\)-hills.

Since each σ(i) = β(2i− 1)α(2i− 1)β(2i) from (9) is a \({B_{\max \limits }}\)-hill, to each σ(i) we can apply Claim 2 claim embedding and obtain an \((N-{\Gamma }_{\mathcal {C}})\)-semirun \(\widehat {\sigma ^{(i)}}\) that is both a min-rising and max-falling -embedding of σ(i) with the same source and target configuration as σ(i). Thus, it remains to show the same for α(2i) for each i ∈ [0,n/2]. We do this separately for α(0),α(n) and finally for those α(2i), where i ∈ [1,n/2 − 1].

Let us first show it for α(0). The proof for α(n) is completely analogous. If α(0) is empty (which would imply that β(1) is crossing but not doubly-crossing), there is nothing to show. Let us therefore assume that α(0) is not empty. It follows that β(1) must be a doubly-crossing + p-transition by Remark 42. Since β(1) is the first crossing transition (even doubly-crossing) and a + p-transition and moreover ρ is of Type III one can factorize α(0) as

$$ \alpha^{(0)}\quad=\quad\alpha^{(0,0)}\sigma^{(0,1)}\alpha^{(0,1)}\quad\cdots\quad\sigma^{(0,k)}, $$

where α(0,j) satisfies \(\textsc {Values}(\alpha ^{(0,j)})\subseteq [{B_{\max \limits }}-N,{B_{\min \limits }}+1]\) for all j ∈ [0,k] and σ(0,j) is a \(({B_{\max \limits }}-N-1)\)-valley candidate for all j ∈ [1,k]. It immediately follows that each α(0,j) does not contain any + p-transition nor any − p-transition, and is hence already an \((N-{\Gamma }_{\mathcal {C}})\)-semirun. Finally we claim that each σ(0,j) is in fact a \(({B_{\max \limits }}-N-1)\)-valley. Indeed, firstly the target configuration of each + p-transition in σ(0,j) has a counter value at most \({B_{\min \limits }}\) and hence a source configuration with counter value at most \({B_{\min \limits }}-N<{B_{\max \limits }}-N-1-{\Upsilon }_{\mathcal {C}}\), where the inequality follows from definition of \({B_{\min \limits }}\) and \({B_{\max \limits }}\) from page 37. Secondly and analogously, the source configuration of each − p-transition in σ(0,j) has a counter value of at most \({B_{\min \limits }}\) and hence a target configuration with counter value at most \({B_{\min \limits }}-N<{B_{\max \limits }}-N-1-{\Upsilon }_{\mathcal {C}}\). Thus, to each σ(0,j) we can apply Claim 2 to obtain an \((N-{\Gamma }_{\mathcal {C}})\)-semirun \(\widehat {\sigma ^{(0,j)}}\) that is a min-rising and max-falling -embedding of σ(0,j) with the same source and target configuration as σ(0,j). Hence, by appropriately concatenationg the α(0,j) with the \(\widehat {\sigma ^{(0,j)}}\) we obtain the desired \((N-{\Gamma }_{\mathcal {C}})\)-semirun that is an -embedding of α(0).

It now only remains and suffices to show that for each α(2i) with i ∈ [1,n/2 − 1], that there exists an \((N-{\Gamma }_{\mathcal {C}})\)-semirun that is a min-rising and max-falling -embedding of α(2i) with same source and target configuration as α(2i). Again by Remark 42 any such α(2i) succeeds σ(i) = β(2i− 1)α(2i− 1)β(2i) and thus succeeds the doubly-crossing transition β(2i) and analogously preceeds σ(i+ 1) = β(2i+ 1)α(2i+ 1)β(2i+ 2) and thus precedes the doubly-crossing β(2i+ 1). Therefore, analogously as done for α(0), one can factorize α(2i) as

$$ \alpha^{(2i)}\quad=\quad\alpha^{(2i,0)}\sigma^{(2i,1)}\alpha^{(2i,1)}\quad\cdots\quad \sigma^{(2i,k)}\alpha^{(2i,k)} $$

for some k ≥ 0, where α(2i,j) satisfies \(\textsc {Values}(\alpha ^{(2i,j)})\subseteq [{B_{\max \limits }}-N,{B_{\min \limits }}]\) (and is thus already an \((N-{\Gamma }_{\mathcal {C}})\)-semirun) for all j ∈ [0,k] and σ(2i,j) is a \(({B_{\max \limits }}-N-1)\)-valley candidate that is in fact a \(({B_{\max \limits }}-N-1)\)-valley for all j ∈ [1,k].

Case A.2: All but one of the \({B_{\max \limits }}\)-hill candidates σ(i) in (9) are in fact \({B_{\max \limits }}\)-hills.

Recall the factorization

$$ \rho\quad=\quad \alpha^{(0)}\sigma^{(1)} \alpha^{(2)}\sigma^{(2)}\alpha^{(4)}\sigma^{(3)}\alpha^{(6)}\quad\cdots\quad\sigma^{(n/2)}\alpha^{(n)} $$

from (9) where each σ(i) = β(2i− 1)α(2i− 1)β(2i) is a \({B_{\max \limits }}\)-hill candidate for all i ∈ [1,n/2].

First let us show that, in case one such \({B_{\max \limits }}\)-hill candidate is not a \({B_{\max \limits }}\)-hill, then it must be either σ(1) or σ(n/2). For every of the remaining j ∈ [2,n/2 − 1] we have that σ(j) = β(2j− 1)α(2j− 1)β(2j) is such that β(2j− 1) and β(2j) are both doubly-crossing, implying that σ(j) is a \({B_{\max \limits }}\)-hill: indeed, both the source and target configuration of σ(j) have a counter value at most \({B_{\min \limits }}<{B_{\max \limits }}-{\Upsilon }_{\mathcal {C}}\), which is sufficient since every + p-transition (resp. − p-transition) of σ(j) ends (resp. starts) in a configuration with counter value at least \({B_{\max \limits }}\).

Let us assume without loss of generality that σ(1) = β(1)α(1)β(2) is the only \({B_{\max \limits }}\)-hill candidate that is not a \({B_{\max \limits }}\)-hill, the case when σ(n/2) is not a \({B_{\max \limits }}\)-hill can be treated analogously.

Clearly, by the above reasoning, either β(1) or β(2) must not be doubly-crossing. Without loss of generality let us assume that the first crossing transition β(1) is not doubly-crossing (for β(2) not doubly-crossing implies n = 2 by definition of Type III and Remark 42; this case is thus included in the dual case when σ(n/2) is not a \({B_{\max \limits }}\)-hill and the last crossing transition β(n) is not doubly-crossing).

Remarking that α(0) must be empty by our case, one can now factorize our N-semirun ρ as

$$ \rho\quad=\quad \left( \beta^{(1)}\alpha^{(1)}\right)\beta^{(2)}\left( \alpha^{(2)}\sigma^{(2)}\alpha^{(4)}\quad\cdots\quad\sigma^{(n/2)}\alpha^{(n)}\right), $$

where β(2) is a − p-transition. For finishing this case we will proceed as follows.

  1. 1.

    Firstly we show the existence of an \((N-{\Gamma }_{\mathcal {C}})\)-semirun that is both a min-rising and max-falling -embedding of β(1)α(1) with the same source and target configuration as β(1)α(1).

  2. 2.

    Secondly, let us assume that β(2) is an N-semirun from q(x) to \(q^{\prime }(y)\), say, and moreover that α(2)σ(2)α(4)σ(n/2)α(n) is an N-semirun from \(q^{\prime }(y)\) to \(q^{\prime \prime }(z)\), say. Noting that , we explicitly lower β(2) into the \((N-{\Gamma }_{\mathcal {C}})\)-semirun , which is — since β(2) is doubly-crossing — obviously both a min-rising and max-falling -embedding of β(2) from q(x) to \(q^{\prime }(y+{\Gamma }_{\mathcal {C}})\). Finally, we show the existence of an \((N-{\Gamma }_{\mathcal {C}})\)-semirun that is an -embedding of α(2)σ(2)α(4)σ(n/2)α(n) from \(q^{\prime }(y+{\Gamma }_{\mathcal {C}})\) to \(q^{\prime \prime }(z)\) all of whose counter values lie in \([\min \limits (\rho )-{\Gamma }_{\mathcal {C}},\max \limits (\rho )+{\Gamma }_{\mathcal {C}}]\).

Let us first show Point 1. Since β(1) is not doubly-crossing and σ(1) = β(1)α(1)β(2) is a \({B_{\max \limits }}\)-hill candidate that is not a \({B_{\max \limits }}\)-hill, the only reason for the latter is the existence of a − p-transition τ such that the counter values of the source configuration of τ and σ(1) have an absolute difference at most \({\Upsilon }_{\mathcal {C}}\). Such a transition τ must have a source configuration with counter value in the interval \([{B_{\max \limits }}, {B_{\max \limits }} + {\Upsilon }_{\mathcal {C}}-1]\) and σ(1) must then necessarily have a source configuration with a counter value in the interval \([{B_{\max \limits }}-{\Upsilon }_{\mathcal {C}},{B_{\max \limits }}-1]\). Such a violation can only happen for τ = β(2). As a consequence, the target configuration q(x) of α(1) has a counter value inside \([{B_{\max \limits }},{B_{\max \limits }}+{\Upsilon }_{\mathcal {C}}-1]\). Recalling that β(1) is not doubly-crossing one can (analogously as has been done in Case A.1) factorize β(1)α(1) as

$$ \beta^{(1)} \alpha^{(1)}\quad=\quad \chi^{(1)}\xi^{(1)}\cdots\chi^{(k)}\xi^{(k)}, $$

for some k ≥ 0, where each χ(i) is a \(({B_{\min \limits }}+N+1)\)-hill and each ξ(i) satisfies \(\textsc {Values}(\xi ^{(i)})\subseteq [{B_{\max \limits }},{B_{\min \limits }}+N]\). Again, analogously as has been done in Case A.1, to each of the χ(i) we can apply Claim 2 to turn them into a suitable min-rising and max-falling \((N-{\Gamma }_{\mathcal {C}})\)-semirun that is an -embedding of χ(i) with the same source and target configuration as χ(i), whereas each of the ξ(i) are already \((N-{\Gamma }_{\mathcal {C}})\)-semiruns since they do not contain any + p-transitions nor − p-transitions.

Let us finally show Point 2. Consider the remaining factorization

$$ \gamma\quad=\quad\alpha^{(2)}\sigma^{(2)}\alpha^{(4)}\quad\cdots\quad\sigma^{(n/2)}\alpha^{(n)} $$
(10)

from \(q^{\prime }(y)\) to \(q^{\prime \prime }(z)\). We need prove the existence of an \((N-{\Gamma }_{\mathcal {C}})\)-semirun from \(q^{\prime }(y+{\Gamma }_{\mathcal {C}})\) to \(q^{\prime \prime }(z)\) that is an -embedding of γ and whose counter values lie in \([\min \limits (\gamma )-{\Gamma }_{\mathcal {C}},\max \limits (\gamma )+{\Gamma }_{\mathcal {C}}]\).

We first claim that \({\Delta }(\gamma )>{\Upsilon }_{\mathcal {C}}\). Since \(x\in [{B_{\max \limits }},{B_{\max \limits }}+{\Upsilon }_{\mathcal {C}}-1]\) it follows that the counter value y of γ’s source configuration \(q^{\prime }(y)\) satisfies \(y\in [{B_{\max \limits }}-N,{B_{\max \limits }}+{\Upsilon }_{\mathcal {C}}-1-N]\). Moreover, the target configuration \(q^{\prime \prime }(z)\) of γ is the target configuration of our Type III N-semirun ρ, thus \(z\in [{B_{\min \limits }}+1,{B_{\max \limits }}-1]\). Hence by the definition of our constants on page 15 we have

$$ \begin{array}{@{}rcl@{}} {\Delta}(\gamma)&\geq& {B_{\min}}+1-({B_{\max}}+{\Upsilon}_{\mathcal{C}}-1-N)\\ &>& N-({B_{\max}}-{B_{\min}})-{\Upsilon}_{\mathcal{C}}\\ &\stackrel{(6)}{\geq}&N-(5/6 \cdot N+2{\Upsilon}_{\mathcal{C}}+4{\Gamma}_{\mathcal{C}}+2)-{\Upsilon}_{\mathcal{C}}\\ &=&N/6-2{\Upsilon}_{\mathcal{C}}-4{\Gamma}_{\mathcal{C}}-2-{\Upsilon}_{\mathcal{C}}\\ &>&M_{\mathcal{C}}/6-2{\Upsilon}_{\mathcal{C}}-4{\Gamma}_{\mathcal{C}}-2-{\Upsilon}_{\mathcal{C}}\\ &=& M_{\mathcal{C}}/6-4{\Upsilon}_{\mathcal{C}}-4{\Gamma}_{\mathcal{C}}-2+{\Upsilon}_{\mathcal{C}}\\ &>& (M_{\mathcal{C}}/6-4({\Upsilon}_{\mathcal{C}}+{\Gamma}_{\mathcal{C}}+1))+{\Upsilon}_{\mathcal{C}}\\ &>&{\Upsilon}_{\mathcal{C}}. \end{array} $$

Recall that each σ(i) is a \({B_{\max \limits }}\)-hill for all i ∈ [2,n/2] by our case. Analogously, as has been done in Case A.1, for each i ∈ [1,n/2] one can factorize α(2i) as

$$ \alpha^{(2i)}\quad=\quad\ \alpha^{(2i,0)}\sigma^{(2i,1)}\quad\cdots\quad\sigma^{(2i,k_{i})}\alpha^{(2i,k_{i})}, $$

where α(2i,j) satisfies \(\textsc {Values}(\alpha ^{(2i,j)}) \subseteq [{B_{\max \limits }}-N,{B_{\min \limits }}+1]\) for each j ∈ [0,ki] and σ(2i,j) is a \(({B_{\max \limits }}-N-1)\)-valley for each j ∈ [1,ki]: more precisely for the final α(n) we have \(\textsc {Values}(\alpha ^{(n)})\subseteq [{B_{\max \limits }}-N,{B_{\min \limits }}+1]\), however for all i ∈ [1,n/2 − 1] we have \(\alpha ^{(2i)}\subseteq [{B_{\max \limits }}-N,{B_{\min \limits }}]\).

It is important to remark that each α(2i,j) is already an \((N-{\Gamma }_{\mathcal {C}})\)-semirun since it does not contain any + p-transition nor any − p-transition. The following remark summarizes the factorization of γ.

Remark 45

Our N-semirun γ from \(q^{\prime }(y)\) to \(q^{\prime \prime }(z)\) can be written as

$$ \gamma\quad=\quad\alpha^{(2)}\sigma^{(2)}\alpha^{(4)}\quad\cdots\quad\sigma^{(n/2)}\alpha^{(n)}\quad=\quad \alpha^{(2)} \left( \prod\limits_{i=2}^{n/2}\sigma^{(i)} \ \alpha^{(2i,0)} \left( \prod\limits_{j=1}^{k_{i}} \sigma^{(2i,j)}\alpha^{(2i,j)}\right) \right), $$
(11)

where

  1. 1.

    each σ(i) is a \({B_{\max \limits }}\)-hill,

  2. 2.

    each σ(2i,j) is a \(({B_{\max \limits }}-N-1)\)-valley,

  3. 3.

    each α(2i,j) is already an \((N-{\Gamma }_{\mathcal {C}})\)-semirun,

  4. 4.

    \({\Delta }(\gamma )>{\Upsilon }_{\mathcal {C}}\), and

  5. 5.

    every configuration in γ (except for possibly the target configuration \(q^{\prime \prime }(z)\)) has a counter value in \([0,{B_{\min \limits }}]\cup [{B_{\max \limits }},4N]\) whose absolute difference with is thus strictly larger than \({\Gamma }_{\mathcal {C}}\) (recall the definition of \({B_{\min \limits }}\) and \({B_{\max \limits }}\) of page 37).

We can now obtain suitable \((N-{\Gamma }_{\mathcal {C}})\)-semiruns with the same source and target configuration for any of the above hills and valleys by applying the Hill and Valley Lemma.

Remark 46

By applying the Hill and Valley Lemma (Lemma 28) we obtain the following.

  1. 1.

    For each of the \({B_{\max \limits }}\)-hills σ(i) there exists an \((N-{\Gamma }_{\mathcal {C}})\)-semirun \(\widehat {\sigma ^{(i)}}\) that is both a min-rising and max-falling \(({B_{\max \limits }}-{\Upsilon }_{\mathcal {C}}-{\Gamma }_{\mathcal {C}}-1)\)-embedding of σ(i) from the same source and target configuration as σ(i). In particular, since σ(i) is a \({B_{\max \limits }}\)-hill and \({B_{\max \limits }}-{\Upsilon }_{\mathcal {C}}-{\Gamma }_{\mathcal {C}}-1>\ell +{\Gamma }_{\mathcal {C}}\) it follows that \(\widehat {\sigma ^{(i)}}\) is in fact an -embedding of σ(i) all of whose configurations have a counter value whose absolute difference with is strictly larger than \({\Gamma }_{\mathcal {C}}\) (except for the exotic case when i = n/2 and γ in fact ends with σ(i), and hence the last configuration of σ(i) happens to be the last configuration \(q^{\prime \prime }(z)\) of γ; recalling that \(z\in [{B_{\min \limits }}+1,{B_{\max \limits }}-1]\)).

  2. 2.

    For each of the \(({B_{\max \limits }}-N-1)\)-valleys σ(2i,j) there exists an \((N-{\Gamma }_{\mathcal {C}})\)-semirun \(\widehat {\sigma ^{(2i,j)}}\) that is both a min-rising and max-falling \(({B_{\max \limits }}-N-1+{\Upsilon }_{\mathcal {C}}+{\Gamma }_{\mathcal {C}}+1)\)-embedding of σ(2i,j) with the same source and target configuration as σ(2i,j). In particular, since σ(2i,j) is a \(({B_{\max \limits }}-N-1)\)-valley and

    $$ {B_{\max}}-N+{\Upsilon}_{C}+{\Gamma}_{\mathcal{C}}\stackrel{(7)}{<} {B_{\min}}+ {\Upsilon}_{C}+{\Gamma}_{\mathcal{C}} \leq \ell-{\Gamma}_{\mathcal{C}} $$

    (where the last inequality follows from the definition of \({B_{\min \limits }}\) on page 37), it follows that \(\widehat {\sigma ^{(2i,j)}}\) is in fact an -embedding of σ(2i,j) all of whose configurations have a counter value whose absolute difference with is is strictly larger than \({\Gamma }_{\mathcal {C}}\) (except, similar as above, for the exotic case when i = n/2, j = ki and γ in fact ends with σ(2i,j), and hence the last configuration σ(2i,j) happens to be the last configuration \(q^{\prime \prime }(z)\) of γ).

It is worth pointing out that applying the remark immediately would only yield the existence of an \((N-{\Gamma }_{\mathcal {C}})\)-semirun \(\gamma ^{\prime }\) that is both a min-rising and max-falling -embedding of γ with the same source configuration \(q^{\prime }(y)\) and the same target configuration \(q^{\prime \prime }(z)\) as γ such that \(\textsc {Values}(\gamma ^{\prime })\subseteq [\min \limits (\gamma )-{\Gamma }_{\mathcal {C}}, \max \limits (\gamma )+{\Gamma }_{\mathcal {C}}]\). However we need to show the existence of such an -embedding rather from \(q^{\prime }(y+{\Upsilon }_{C})\) to \(q^{\prime \prime }(z)\). For this, we make a final case distinction on whether among the \({B_{\max \limits }}\)-hills σ(i) and the \(({B_{\max \limits }}-N-1)\)-valleys σ(2i,j) there exists one whose ϕ-projection contains strictly more occurrences of [ as occurrences of ].

  • Case A.2.i: Among the \({B_{\max \limits }}\)-hills σ(i) and the \(({B_{\max \limits }}-N-1)\)-valleys σ(2i,j) there exists one whose ϕ-projection contains strictly more occurrences of [ as occurrences of ].

    Without loss of generality let us assume that there exists some s ∈ [2,n/2] such that σ(s) = β(2s− 1)α(2s− 1)β(2s) is a \({B_{\max \limits }}\)-hill for which ϕ(σ(s)) contains strictly more occurrences of [ as occurrences of ] — the case when there is a \(({B_{\max \limits }}-N-1)\)-valley σ(2s,j) for which ϕ(σ(2s,j)) has the above property can be proven analogously.

    Assume σ(s) = β(2s− 1)α(2s− 1)β(2s) has source configuration r1(x1) and target configuration r2(x2), say. Since β(2s− 1) was surely neither the first nor the last crossing transition of ρ (recall that s ≥ 2), it follows that β(2s− 1) is doubly-crossing by Remark 42, and therefore \(x_{1} \leq {B_{\min \limits }}\). Recalling the notion of hybrid semirun (Definition 29) we now apply Point 2 of Remark 38 to our \({B_{\max \limits }}\)-hill σ(s) and obtain a hybrid semirun η

    • whose source configuration is r1(x1) and whose target configuration is r2(x2),

    • that is both a min-rising and max-falling \(({B_{\max \limits }}-{\Upsilon }_{\mathcal {C}}-{\Gamma }_{\mathcal {C}}-1)\)-embedding of σ(s), and

    • that has breadth 1 and contains precisely one unlowered + p-transition.

    From the above and the fact that σ(s) is a \({B_{\max \limits }}\)-hill the following remark follows.

    Remark 47

    All configurations of η (except possibly the target configuration r2(x2) in the exotic case when γ ends with σ(s)) have a counter value whose absolute difference with is strictly larger than \({\Gamma }_{\mathcal {C}}\). Moreover on can write η as \(\eta =\alpha \beta \alpha ^{\prime }\), where for some intermediate configurations \(r_{1}^{\prime }(x_{1}^{\prime })\) and \(r_{2}^{\prime }(x_{2}^{\prime })\) we have that

    • α is an \((N-{\Gamma }_{\mathcal {C}})\)-semirun from r1(x1) to \(r_{1}^{\prime }(x_{1}^{\prime })\),

    • β is an N-semirun that is a + p-transition, i.e. \(x_{2}^{\prime }=x_{1}^{\prime }+N\), and

    • \(\alpha ^{\prime }\) is an \((N-{\Gamma }_{\mathcal {C}})\)-semirun from \(r_{2}^{\prime }(x_{2}^{\prime })\) to r2(x2).

    Let \(\widehat {\beta }\) denote the lowering of β, i.e. \(\widehat {\beta }\) is the \((N-{\Gamma }_{\mathcal {C}})\)-semirun . By Remark 47 it follows that the \((N-{\Gamma }_{\mathcal {C}})\)-semirun

    $$ \theta\quad=\quad\left( \left( \alpha\widehat{\beta}\right)+{\Gamma}_{\mathcal{C}}\right) \alpha^{\prime}$$

    from \(r_{1}^{\prime }(x_{1}+{\Gamma }_{\mathcal {C}})\) to r2(x2) is an -embedding of η. Bearing in mind our factorization of γ from Remark 11 and taking into account Remark 46 we obtain that *******

    $$ \widetilde{\gamma^{(1)}}\quad=\quad \left( \left( \widehat{\alpha^{(2)}} \left( \prod\limits_{i=2}^{s-1}\widehat{\sigma^{(i)}}\ \alpha^{(2i,0)}\left( \prod\limits_{j=1}^{k_{i}} \widehat{\sigma^{(2i,j)}}\ \alpha^{(2i,j)}\right)\right) \right) +{\Gamma}_{\mathcal{C}} \right) \theta $$

    is an \((N-{\Gamma }_{\mathcal {C}})\)-semirun from \(q^{\prime }(y+{\Gamma }_{\mathcal {C}})\) to \(r_{2}^{\prime }(x_{2}^{\prime })\) that is an -embedding of γ’s prefix N-semirun

    $$ \gamma^{(1)}\quad=\quad\alpha^{(2)}\left( \prod\limits_{i=2}^{s-1}\sigma^{(i)}\ \alpha^{(2i,0)}\left( \prod\limits_{j=1}^{k_{i}} \sigma^{(2i,j)}\ \alpha^{(2i,j)}\right) \right)\sigma^{(s)} $$

    from \(q^{\prime }(y)\) to \(r_{2}^{\prime }(x_{2}^{\prime })\) satisfying \(\textsc {Values}(\widetilde {\gamma ^{(1)}}) \subseteq [\min \limits (\gamma ^{(1)}), \max \limits (\gamma ^{(1)})+{\Gamma }_{\mathcal {C}}]\). Moreover we have by Remark 46 that

    $$ \widehat{\gamma^{(2)}}\quad=\quad\alpha^{(2s,0)}\ \left( \prod\limits_{j=1}^{k_{s}}\widehat{\sigma^{(2i,j)}}\alpha^{(2i,j)}\right) \left( \prod\limits_{i=s+1}^{n/2} \widehat{\sigma^{(i)}}\ \alpha^{(2i,0)}\ \left( \prod\limits_{j=1}^{k_{i}}\widehat{\sigma^{(2i,j)}}\ \alpha^{(2i,j)}\right)\right) $$

    is an \((N-{\Gamma }_{\mathcal {C}})\)-semirun from \(r_{2}^{\prime }(x_{2}^{\prime })\) to \(q^{\prime \prime }(z)\) that is both a min-rising and max-falling -embedding of γ’s remaining suffix N-semirun

    $$ \gamma^{(2)}\quad=\quad\alpha^{(2s,0)}\ \left( \prod\limits_{j=1}^{k_{s}}\sigma^{(2i,j)}\alpha^{(2i,j)}\right) \left( \prod\limits_{i=s+1}^{n/2} \sigma^{(i)}\ \alpha^{(2i,0)}\ \left( \prod\limits_{j=1}^{k_{i}}\sigma^{(2i,j)}\ \alpha^{(2i,j)}\right)\right) $$

    from \(r_{2}^{\prime }(x_{2}^{\prime })\) to \(q^{\prime \prime }(z)\). Altogether \(\gamma ^{\prime }=\widetilde {\gamma ^{(1)}}\widehat {\gamma ^{(2)}}\) is the desired \((N-{\Gamma }_{\mathcal {C}})\)-semirun from \(q^{\prime }(y+{\Gamma }_{\mathcal {C}})\) to \(q^{\prime \prime }(z)\) that is an -embedding of γ = γ(1)γ(2) with \(\textsc {Values}(\gamma ^{\prime })\subseteq [\min \limits (\gamma )-{\Gamma }_{\mathcal {C}},\max \limits (\gamma )+{\Gamma }_{\mathcal {C}}]\).

  • Case A.2.ii: Among the \({B_{\max \limits }}\)-hills σ(i) and the \(({B_{\max \limits }}-N-1)\)-valleys σ(2i,j) all have a ϕ-projection that contains at least as many occurrences of ] as occurrences of [.

    Observe that by Remark 46 the \((N-{\Gamma }_{\mathcal {C}})\)-semirun

    $$ \widehat{\gamma}\quad=\quad \alpha^{(2)}\ \left( \prod\limits_{i=2}^{n/2}\widehat{\sigma^{(i)}}\ \alpha^{(2i,0)}\ \left( \prod\limits_{j=1}^{k_{i}}\widehat{\sigma^{(2i,j)}}\ \alpha^{(2i,j)}\right)\right) $$

    from \(q^{\prime }(y)\) to \(q^{\prime \prime }(z)\) is both a min-rising and max-falling -embedding of γ all of whose configurations (except for possibly the target configuration \(q^{\prime \prime }(z)\)) have a counter value whose absolute difference with is strictly larger than \({\Gamma }_{\mathcal {C}}\). Yet we need to show the existence of some \((N-{\Gamma }_{\mathcal {C}})\)-semirun γ that is an -embedding of γ from \(q^{\prime }(y+{\Gamma }_{\mathcal {C}})\) to \(q^{\prime \prime }(z)\) that satisfies \(\textsc {Values}(\gamma ^{\prime }) \subseteq [\min \limits (\gamma )-{\Gamma }_{\mathcal {C}},\max \limits (\gamma )+{\Gamma }_{\mathcal {C}}]\).

    By Remark 37 all of the lowered \((N-{\Gamma }_{\mathcal {C}})\)-semiruns \(\widehat {\sigma ^{(i)}}\) and \(\widehat {\sigma ^{(2i,j)}}\) mentioned in Remark 46 contain at least as many occurrences of [ as of ] or, vice versa, at least as many occurrences of ] as of [, if σ(i) does, respectively if σ(2i,j) does.

    Thus, by our case we obtain that every \(\phi (\widehat {\sigma ^{(i)}})\) and \(\phi (\widehat {\sigma ^{(2i,j)}})\) contains at least as many occurrences of ] as occurrences of [.

    Recalling that neither α(2) nor any of the α(2i,j) contain any + p-transitions nor − p-transitions (and thus have all a ϕ-projection ε) it follows that \(\phi (\widehat {\gamma })\) contains at least as many occurrences of ] as occurrences of [.

    Since \({\Delta }(\gamma )>{\Upsilon }_{\mathcal {C}}\) by Point 4 of Remark 11, and thus \({\Delta }(\widehat {\gamma })>{\Upsilon }_{\mathcal {C}}\), there exists a subsemirun \(\widehat {\gamma }[c,d]\) satisfying \({\Delta }(\widehat {\gamma }[c,d])>{\Upsilon }_{\mathcal {C}}\) and \(\phi (\widehat {\gamma }[c,d])\in {\Lambda }_{8}\) by Lemma 23. By now applying Lemma 22 there exists an \((N-{\Gamma }_{\mathcal {C}})\)-semirun χ satisfying

    • \({\Delta }(\chi )={\Delta }(\widehat {\gamma }[c,d])-{\Gamma }_{\mathcal {C}}\) and

    • \(\chi =\widehat {\gamma }[c,d]-I_{1}-I_{2}\cdots -I_{h}\) for pairwise disjoint intervals \(I_{1},\ldots ,I_{h}\subseteq [c,d]\) such that \(\phi (\widehat {\gamma }[I_{i}])\in {\Lambda }_{16}\) and \({\Delta }(\widehat {\gamma }[I_{i}])>0\) for all i ∈ [1,h].

    Note that from the definition of χ and the fact that all intermediate configurations of \(\widehat {\gamma }\) have counter values whose absolute difference with is strictly larger than \({\Gamma }_{\mathcal {C}}\) it follows that \(\chi +{\Gamma }_{\mathcal {C}}\) is an -embedding of \(\widehat {\gamma }[c,d]\) that has the same target configuration as \(\widehat {\gamma }[c,d]\) and that satisfies \(\textsc {Values}(\chi +{\Gamma }_{\mathcal {C}})\subseteq [\min \limits (\widehat {\gamma }[c,d])-{\Gamma }_{\mathcal {C}},\max \limits (\widehat {\gamma }[c,d])+{\Gamma }_{\mathcal {C}}]\). Analogously, it follows that \(\delta =(\widehat {\gamma }[0,c]+{\Gamma }_{\mathcal {C}})\ (\chi +{\Gamma }_{\mathcal {C}})\) is an \((N-{\Gamma }_{\mathcal {C}})\)-semirun from \(q^{\prime }(y+{\Gamma }_{\mathcal {C}})\) to the same target configuration as \(\widehat {\gamma }[0,d]\) that is an -embedding of \(\widehat {\gamma }[0,d]\) and that satisfies \(\textsc {Values}(\delta )\subseteq [\min \limits (\gamma [0,d])-{\Gamma }_{\mathcal {C}},\max \limits (\gamma [0,d])+{\Gamma }_{\mathcal {C}}]\).

    Finally it follows that

    $$ \gamma^{\prime}\quad=\quad(\widehat{\gamma}[0,c]+{\Gamma}_{\mathcal{C}})\ (\chi+{\Gamma}_{\mathcal{C}})\ \widehat{\gamma}[d,|\widehat{\gamma}|] $$

    is the desired \((N-{\Gamma }_{\mathcal {C}})\)-semirun from \(q^{\prime }(y+{\Gamma }_{\mathcal {C}})\) to \(q^{\prime \prime }(z)\) that is an -embedding of \(\widehat {\gamma }\) and hence of γ that satisfies \(\textsc {Values}(\gamma ^{\prime }) \subseteq [\min \limits (\gamma )-{\Gamma }_{\mathcal {C}},\max \limits (\gamma )+{\Gamma }_{\mathcal {C}}]\).

Case A.3: All but at least two of the \({B_{\max \limits }}\)-hill candidates σ(i) in (9) are in fact \({B_{\max \limits }}\)-hills.

Recall the factorization

$$ \rho\quad=\quad \alpha^{(0)}\sigma^{(1)}\alpha^{(2)}\sigma^{(2)}\alpha^{(4)}\sigma^{(3)}\alpha^{(6)}\quad\cdots\quad\sigma^{(n/2)}\alpha^{(n)} $$

from (9) where each σ(i) = β(2i− 1)α(2i− 1)β(2i) is a \({B_{\max \limits }}\)-hill candidate for all i ∈ [1,n/2]. By our case we must have n ≥ 4.

By a similar reasoning as in Case A.2 one can show that the \({B_{\max \limits }}\)-hill candidate that are not \({B_{\max \limits }}\)-hills must be precisely the two subsemiruns σ(1) and σ(n/2). In particular there cannot be strictly more than two \({B_{\max \limits }}\)-hill candidates in (9) that are not in fact \({B_{\max \limits }}\)-hills. Moreover, as already reasoned in Case A.2, neither β(1) nor β(n) is doubly-crossing. Thus α(0) and α(n) are empty. Hence, one can now factorize our N-semirun ρ as

$$ \rho\quad=\quad \left( \beta^{(1)}\alpha^{(1)}\right) \beta^{(2)} \alpha^{(2)}\beta^{(3)}\alpha^{(3)}\quad\cdots\quad \beta^{(n-1)} \left( \alpha^{(n-1)} \beta^{(n)}\right)\quad. $$

For finishing this case we will show the existence

  1. 1.

    of an \((N-{\Gamma }_{\mathcal {C}})\)-semirun that is both a min-rising and max-falling -embedding of the semirun β(1)α(1) with the same source and target configuration as β(1)α(1),

  2. 2.

    of an \((N-{\Gamma }_{\mathcal {C}})\)-semirun that is both a min-rising and max-falling -embedding of the semirun α(n− 1)β(n) with the same source and target configuration as α(n− 1)β(n), and

  3. 3.

    of an \((N-{\Gamma }_{\mathcal {C}})\)-semirun that is both a min-rising and max-falling -embedding of the semirun β(2)α(2)β(3)α(3)β(n− 1) with same source and target configuration.

Points 1 and 2 are proven analogously as Point 1 from Case A.2. For proving Point 3, we consider a different factorization

$$ \beta^{(2)} \alpha^{(2)}\beta^{(3)}\alpha^{(3)}\quad\cdots\quad \beta^{(n-1)} \quad =\quad \tau^{(1)} \alpha^{(3)} \tau^{(2)} \alpha^{(5)} \quad {\cdots} \quad \tau^{((n-2)/2)}, $$

where τ(i) = β(2i)α(2i)β(2i+ 1) is a \({B_{\min \limits }}\)-valley candidate for all i ∈ [1,(n − 2)/2]. Since β(2i) and β(2i+ 1) have to be doubly crossing for all i ∈ [1,(n − 2)/2], τ(i) is in fact a \({B_{\min \limits }}\)-valley for all i ∈ [1,(n − 2)/2] by a similar reasoning as used in Case A.2 to show that the \({B_{\max \limits }}\)-hill candidate that is not a \({B_{\max \limits }}\)-hill must be σ(1) or σ(n/2).

We can apply Claim 2 to each τ(i) and obtain an \((N-{\Gamma }_{\mathcal {C}})\)-semirun \(\widehat {\tau ^{(i)}}\) that is both a min-rising and max-falling -embedding of τ(i) with the same source and target configuration. Thus, it only remains to show the same for α(2i+ 1) for each i ∈ [1,(n − 2)/2]. This is done analogously as in Case A.1 when proving the same for each α(2i) for each i ∈ [0,n/2].

Case B: The number of crossing transitions n is odd.

Recall that we had assumed without loss of generality that β(1) is a + p-transition. Since n is odd one can consider the following first factorization

$$ \begin{array}{@{}rcl@{}} \rho\quad=\quad \alpha^{(0)}\sigma^{(1)}\alpha^{(2)}\sigma^{(2)}\alpha^{(4)}\sigma^{(3)}\alpha^{(6)}\quad\cdots\quad\sigma^{(\lfloor n/2 \rfloor)}\alpha^{(n-1)} \beta^{(n)} \alpha^{(n)}, \end{array} $$
(12)

where σ(i) = β(2i− 1)α(2i− 1)β(2i) is a \({B_{\max \limits }}\)-hill candidate, β(2i− 1) is a + p-transition, β(2i) is a − p-transition for all i ∈ [1,⌊n/2⌋], and β(n) is a + p-transition; as well as the following second factorization

$$ \begin{array}{@{}rcl@{}} \rho\quad=\quad \alpha^{(0)}\beta^{(1)} \alpha^{(1)} \tau^{(1)}\alpha^{(3)} \tau^{(2)} \alpha^{(5)} \tau^{(3)} \quad\cdots\quad\tau^{(\lfloor n/2 \rfloor)}\alpha^{(n)}, \end{array} $$
(13)

where β1 is a + p-transition, τ(i) = β(2i)α(2i)β(2i+ 1) is a \({B_{\min \limits }}\)-valley candidate, β(2i) is a − p-transition and β(2i+ 1) is a + p-transition for all i ∈ [1,⌊n/2⌋]. Indeed, this— as for the Case A factorization (9)— immediately follows from the definition of crossing transitions and the fact that neither α(2i− 1) (resp. α(2i)) contains any configuration with counter value strictly less than \({B_{\max \limits }}\) (resp. strictly larger than \({B_{\min \limits }}\)) for all i ∈ [1,⌊n/2⌋].

Our proof next will make a case distinction on the number of \({B_{\max \limits }}\)-hill candidates σ(i) in the factorization (12) that are in fact \({B_{\max \limits }}\)-hills and on the number of \({B_{\min \limits }}\)-valley candidates τ(i) in the factorization (13) that are in fact \({B_{\min \limits }}\)-valleys.

Case B.1: All of the \({B_{\max \limits }}\)-hill candidates σ(i) in (12) are in fact \({B_{\max \limits }}\)-hills or all of the \({B_{\min \limits }}\)-valley candidates τ(i) in (13) are in fact \({B_{\min \limits }}\)-valleys.

Let us assume without loss of generality that all of the \({B_{\max \limits }}\)-hill candidates in (12) are in fact \({B_{\max \limits }}\)-hills. The case when all \({B_{\min \limits }}\)-valley candidates in (13) are in fact \({B_{\min \limits }}\)-valleys can be proven analogously. Each N-semirun σ(i) can hence be turned into an \((N-{\Gamma }_{\mathcal {C}})\)-semirun \(\widehat {\sigma ^{(i)}}\) that is both a min-rising and max-falling -embedding of σ(i) with same source and target configuration as σ(i) according to Claim 2. Moreover, the same holds for α(2i) for all i ∈ [0,⌊n/2⌋− 1], as seen in Case A.1. Thus it remains to deal with the subsemiruns α(n− 1), β(n) and α(n).

We make a final case distinction on the target configuration of the dangling + p-transition β(n).

  • Case B.1.i: β(n) has a target configuration with a counter value strictly larger than \({B_{\max \limits }}+{\Upsilon }_{\mathcal {C}}\).

    Then clearly β(n)α(n) is a \({B_{\max \limits }}\)-hill as well since α(n) contains no configurations with counter value strictly less than \({B_{\max \limits }}\) besides its last one. The N-semirun β(n)α(n) can hence be turned into an \((N-{\Gamma }_{\mathcal {C}})\)-semirun that is both a min-rising and max-falling -embedding with the same source and target configuration according to Claim 2. Moreover, the same holds for α(n− 1), as analogously proven for α(2i) for all i ∈ [0,⌊n/2⌋] in Case A.1. The concatenation of these two -embeddings yields an \((N-{\Gamma }_{\mathcal {C}})\)-semirun that is a min-rising and max-falling -embedding of α(n− 1)β(n)α(n) with the same source and target configuration.

  • Case B.1.ii: β(n) has a target configuration with a counter value strictly less than \({B_{\max \limits }}\).

    It immediately follows that β(n) is crossing but not doubly-crossing, thus α(n) is empty. The remaining α(n− 1)β(n) can thus be factorized as

    $$ \alpha^{(n-1)} \beta^{(n)}\quad=\quad \xi^{(1)} \chi^{(1)}{\cdots} \xi^{(k)} \chi^{(k)}, $$

    where each χ(i) is a \(({B_{\max \limits }}-N-1)\)-valley and each ξ(i) satisfies \(\textsc {Values}(\xi ^{(i)})\subseteq [{B_{\max \limits }}-N,{B_{\min \limits }}+1]\), using a similar factorization as for proving Point 1 in Case A.2. The N-semirun α(n− 1)β(n) can hence be turned into an \((N-{\Gamma }_{\mathcal {C}})\)-semirun that is both a min-rising and max-falling -embedding with same source and target configuration. Recalling that α(n) is empty, the above embedding is an \((N-{\Gamma }_{\mathcal {C}})\)-semirun that is both a min-rising and max-falling -embedding of α(n− 1)β(n)α(n) with same source and target configuration.

  • Case B.1.iii: β(n) has a target configuration with counter value in \([{B_{\max \limits }}, {B_{\max \limits }} + {\Upsilon }_{\mathcal {C}}]\).

    Thus, the source configuration of β(n) has a counter value in \([{B_{\max \limits }}-N, {B_{\max \limits }} + {\Upsilon }_{\mathcal {C}}-N]\). One finishes this case analogously as Points 1 and 2 in Case A.2:

    1. 1.

      Firstly, one shows the existence of an \((N-{\Gamma }_{\mathcal {C}})\)-semirun that is both a min-rising and max-falling -embedding of α(n) with the same source and target configuration as α(n) as follows: one factorizes α(n) into \((N-{\Gamma }_{\mathcal {C}})\)-semiruns that have all counter values in \([{B_{\max \limits }}-1,{B_{\min \limits }}+N]\) and into \(({B_{\min \limits }}+N+1)\)-hills.

    2. 2.

      Secondly, let us assume that β(n) is an N-semirun from \(q^{\prime }(y)\) to \(q^{\prime \prime }(z)\) and that moreover α(0)σ(1)α(2)σ(⌊n/2⌋)α(n− 1) is an N-semirun from q(x) to \(q^{\prime }(y)\). Stipulating that , we explicitly lower β(n) into the \((N-{\Gamma }_{\mathcal {C}})\)-semirun , which is — since β(n) is doubly-crossing — obviously both a min-rising and max-falling -embedding of β(n) from \(q^{\prime }(y+{\Gamma }_{\mathcal {C}})\) to \(q^{\prime \prime }(z)\). Then one shows the existence of an \((N-{\Gamma }_{\mathcal {C}})\)-semirun that is an -embedding of α(0)σ(1)α(2)σ(⌊n/2⌋)α(n) from q(x) to \(q^{\prime }(y+{\Gamma }_{\mathcal {C}})\) with configurations all of whose counter values lie in the interval \([\min \limits (\rho )-{\Gamma }_{\mathcal {C}},\max \limits (\rho )+{\Gamma }_{\mathcal {C}}]\) as follows: one subfactorizes each of the α(2i) into \((N-{\Gamma }_{\mathcal {C}})\)-semiruns that have a counter values in \([{B_{\max \limits }}-N,{B_{\min \limits }}]\) and into \(({B_{\max \limits }}-N-1)\)-valleys and by recalling that σ(i) is a \({B_{\max \limits }}\)-hill for all i ∈ [1,⌊n/2⌋].

Case B.2: Not all of the \({B_{\max \limits }}\)-hill candidates σ(i) in (12) are in fact \({B_{\max \limits }}\)-hills and not all of the \({B_{\min \limits }}\)-valley candidates τ(i) in (13) are in fact \({B_{\min \limits }}\)-valleys.

Since they all start and end with a doubly-crossing transition we remark that σ(i) is in fact a \({B_{\max \limits }}\)-hill for all i ∈ [2,⌊n/2⌋] and τ(i) is in fact a \({B_{\min \limits }}\)-valley for all i ∈ [1,⌊n/2⌋− 1]. Hence our case implies that σ(1) is in fact not a \({B_{\max \limits }}\)-hill and that τ(⌊n/2⌋) is in fact not a \({B_{\min \limits }}\)-valley. As in Case A.2, β(1) and β(n) are hence not doubly-crossing, and hence α(0) and α(n) are empty.

By definition of a Type III semirun, ρ contains at least one doubly-crossing transition and thus n ≥ 3. Since the + p-transition β(1) is not doubly-crossing (and therefore ends at a counter value strictly larger than \({B_{\min \limits }}+N\)) but β(2) is, it follows that the only reason for σ(1) = β(1)α(1)β(2) not to be a \({B_{\max \limits }}\)-hill is that the − p-transition β(2) has a source configuration with a counter value in \([{B_{\max \limits }}, {B_{\max \limits }}+{\Upsilon }_{\mathcal {C}}]\) and hence a target configuration with counter value in \([{B_{\max \limits }}-N, {B_{\max \limits }}+{\Upsilon }_{\mathcal {C}}-N]\), similarly as seen in Case A.2. Analogously, the only reason for τ(⌊n/2⌋) = β(n− 1)α(n− 1)β(n) not to be a \({B_{\min \limits }}\)-valley is that the doubly-crossing − p-transition β(n− 1) has a target configuration with counter value in \([{B_{\min \limits }}-{\Upsilon }_{\mathcal {C}},{B_{\min \limits }}]\).

Recalling that σ(⌊n/2⌋) = β(n− 2)α(n− 2)β(n− 1), for finishing this case we will apply an analogous reasoning as in Case A.2:

  1. 1.

    Firstly, one shows the existence of an \((N-{\Gamma }_{\mathcal {C}})\)-semirun that is both a min-rising and max-falling -embedding of β(1)α(1) with the same source and target configuration as β(1)α(1).

  2. 2.

    Secondly, let us assume that β(2) is an N-semirun from q(x) to \(q^{\prime }(y)\) and that moreover α(2)σ(2)α(4)σ(⌊n/2⌋) is an N-semirun from \(q^{\prime }(y)\) to \(q^{\prime \prime }(z)\), with \(y \in [{B_{\max \limits }}-N, {B_{\max \limits }}+{\Upsilon }_{\mathcal {C}}- N]\) and \(z \in [{B_{\min \limits }}-{\Upsilon }_{\mathcal {C}},{B_{\min \limits }}]\). Noting that , we explicitly lower β(2) into the \((N-{\Gamma }_{\mathcal {C}})\)-semirun , which is — since β(2) is doubly-crossing — obviously both a min-rising and max-falling -embedding of β(2) from q(x) to \(q^{\prime }(y+{\Gamma }_{\mathcal {C}})\). Then one shows, as done in Case 2.A, the existence of an \((N-{\Gamma }_{\mathcal {C}})\)-semirun that is an -embedding of α(2)σ(2)α(4)σ(⌊n/2⌋) all of whose counter values lie in \([\min \limits (\rho )-{\Gamma }_{\mathcal {C}},\max \limits (\rho )+{\Gamma }_{\mathcal {C}}]\) from \(q^{\prime }(y+{\Gamma }_{\mathcal {C}})\) to \(q^{\prime \prime }(z)\) by subfactorizing each of the α(2i) into \((N-{\Gamma }_{\mathcal {C}})\)-semiruns that have counter values in \([{B_{\max \limits }}-N,{B_{\min \limits }}]\) and into \(({B_{\max \limits }}-N-1)\)-valleys, by recalling that σ(i) is a \({B_{\max \limits }}\)-hill for all i ∈ [2,⌊n/2⌋], and that

    $$ \begin{array}{@{}rcl@{}} z-y &\geq& N-({B_{\max}}-{B_{\min}})-2 {\Upsilon}_{\mathcal{C}}\\ &\stackrel{(6)}{>}& N-(5/6\cdot N+2{\Upsilon}_{\mathcal{C}}+4{\Gamma}_{\mathcal{C}}+2)-2{\Upsilon}_{\mathcal{C}}\\ &=& N/6-(5{\Upsilon}_{\mathcal{C}}-4{\Gamma}_{\mathcal{C}}-2) + {\Upsilon}_{\mathcal{C}}\\ &>&M_{\mathcal{C}}/6-(5{\Upsilon}_{\mathcal{C}}-4{\Gamma}_{\mathcal{C}}-2) + {\Upsilon}_{\mathcal{C}}\\ &>& {\Upsilon}_{\mathcal{C}}. \end{array} $$
  3. 3.

    Finally (analogously as Point 1) one shows the existence of an \((N-{\Gamma }_{\mathcal {C}})\)-semirun that is both a min-rising and max-falling -embedding of α(n− 1)β(n) with the same source and target configuration as α(n− 1)β(n).

9 Proof of the Small Parameter Theorem

This section is devoted to proving the Small Parameter Theorem (Theorem 18).

For proving this let us fix some \(N> M_{\mathcal {C}}\) and some accepting N-run π in \(\mathcal {C}\) with \(\textsc {Values}(\pi )\subseteq [0,4N]\) of the form

$$ \pi \quad= \quad r_{0}(x_{0}) \quad\xrightarrow{\pi_{0},N} \quad r_{1}(x_{1}) \quad{\cdots} \quad\xrightarrow{\pi_{n-1},N} \quad r_{n}(x_{n}) $$

with rnF. We will assume that accepting runs in \(\mathcal {C}\) end with counter value 0 and hence, that xn = x0 = 0. We do not lose generality by making this assumption. Indeed, from every POCA \(\mathcal {C}\), one can build a POCA \(\mathcal {C}^{\prime }\) with all its accepting runs ending in configuration with counter value 0 such that, for all \(N \in \mathbb {N}\), there exists an accepting N-run in \(\mathcal {C}\) with values in [0,4N] if, and only if, there exists an accepting N-run in \(\mathcal {C}^{\prime }\) with values in [0,4N]. This is clear when one considers the construction \(\mathcal {C}^{\prime }\) obtained from \(\mathcal {C}\) by adding two control states r and rf such that every final control state of \(\mathcal {C}\) has a ≥ 0 rule leading to r, r has a − 1 rule that is a loop, and finally a = 0 rule to rf, the only final state of \(\mathcal {C}^{\prime }\).

Starting from the accepting N-run π, we need to prove the existence of an accepting \((N-{\Gamma }_{\mathcal {C}})\)-run in \(\mathcal {C}\). For every \(a,b\in \mathbb {Q}\) with a < b we define \({[a,b)}=\{c\in \mathbb {Q}\mid a\leq c<b\}\) and \({(a,b]}=\{c\in \mathbb {Q}\mid a<c\leq b\}\).

Since \(\frac {N}{3}<N-{\Gamma }_{\mathcal {C}}\), as \({\Gamma }_{\mathcal {C}} < \frac {2 M_{\mathcal {C}}}{3} < \frac {2 N}{3}\) by definition of the constants on page 15, the following claim is clear.

Claim 3

Every subrun ρ of π with \(\textsc {Values}(\rho )\subseteq {[0, \frac {N}{3})}\) is already an \((N-{\Gamma }_{\mathcal {C}})\)-run.

We can therefore uniquely factorize π as

$$ \pi \quad= \quad\rho^{(0)}\sigma^{(1)}\rho^{(1)} \quad{\cdots} \quad \sigma^{(m)}\rho^{(m)}, $$
(14)

where each ρ(j) satisfies \(\textsc {Values}(\rho ^{(j)})\subseteq {[0, \frac {N}{3})}\) and each σ(j) is some subrun π[c,d] with \(x_{c}<\frac {N}{3}\), \(x_{d}<\frac {N}{3}\) and \(x_{k} \geq \frac {N}{3}\) for all k ∈ [c + 1,d − 1], where [c + 1,d − 1]≠.

To finish the proof of the Small Parameter Theorem (Theorem 18), by Claim 3 it thus suffices to prove the following statement for the rest of this section.

figure bb

Let σ be such an N-run. Let us first assume that ziN for some i ∈ [1,m − 1]; the case zi < N for all i ∈ [1,m − 1] will be treated later. By this asumption, one can uniquely factorize σ — as seen in Fig. 12 — as

$$ \sigma \quad = \quad \alpha \ \sigma[a,a+1] \ \beta \ \sigma[b,b+1] \ \gamma, $$
(15)

where, for some a,b ∈ [0,m − 1],

  • α = σ[0,a] is the maximal prefix of σ satisfying \(\textsc {Values}(\alpha )\subseteq {[0,N)}\), in particular the transition \(q_{a}(z_{a})\xrightarrow { \sigma _{a} ,N}q_{a+1}(z_{a+1})\) satisfies za ∈ [0,N) and za+ 1 ∈ [N,4N],

  • γ = σ[b + 1,m] is the maximal suffix of σ satisfying \(\textsc {Values}(\gamma )\subseteq {[0,N)}\), i.e. the transition \(q_{b}(z_{b})\xrightarrow { \sigma _{b} ,N}q_{b+1}(z_{b+1})\) satisfies zb ∈ [N,4N] and zb+ 1 ∈ [0,N), and

  • β = σ[a + 1,b] is the remaining infix of σ (note that a + 1 = b is possible).

Fig. 12
figure 12

Illustration of the factorization (15)

We will apply the 5/6-Lemma (Lemma 39) to one of the subruns

$$ \begin{array}{@{}rcl@{}} \beta, \quad \sigma[a,a+1] \ \beta, \quad \beta \ \sigma[b,b+1], \text{ or } \quad \sigma[a,a+1] \ \beta \ \sigma[b,b+1], \end{array} $$

hereby showing the existence of a suitable \((N-{\Gamma }_{\mathcal {C}})\)-semirun with same source and target configuration, respectively. We then shift this \((N-{\Gamma }_{\mathcal {C}})\)-semirun by \(-{\Gamma }_{\mathcal {C}}\) to obtain a suitable \((N-{\Gamma }_{\mathcal {C}})\)-run. To which of the subruns we will choose to apply the 5/6-Lemma will depend on the counter values za,za+ 1,zb and zb+ 1. For deciding this, we make a case distinction on which of the five intervals \(\left \{ {\left [\frac {iN}{3},\frac {(i+1)N}{3}\right )}\ : i\in [1,5]\right \}\) they lie in, respectively.

Before the above-mentioned distinction on za, za+ 1, zb and zb+ 1 we first claim that one can turn the possible resulting prefixes α and ασ[a,a + 1] and possible suffixes σ[b,b + 1]γ and γ into \((N-{\Gamma }_{\mathcal {C}})\)-runs separately. The following claim tells us when these latter prefixes (resp. suffixes) can be turned into \((N-{\Gamma }_{\mathcal {C}})\)-runs whose target (resp. source) configuration has been shifted down by \({\Gamma }_{\mathcal {C}}\).

Claim 4 (Possible lowering of the prefixes and suffixes)

  1. 1.

    If \(z_{a+1}\in {[N,\frac {5N}{3})}\), then there exists an \((N-{\Gamma }_{\mathcal {C}})\)-run from q0(z0) to \(q_{a+1}(z_{a+1}-{\Gamma }_{\mathcal {C}})\).

  2. 2.

    If \(z_{a}\in {[\frac {N}{3}+{\Upsilon }_{\mathcal {C}},N)}\), then there exists an \((N-{\Gamma }_{\mathcal {C}})\)-run from q0(z0) to \(q_{a}(z_{a}-{\Gamma }_{\mathcal {C}})\).

  3. 3.

    If \(z_{b}\in {[N,\frac {5N}{3})}\), then there exists an \((N-{\Gamma }_{\mathcal {C}})\)-run from \(q_{b}(z_{b}-{\Gamma }_{\mathcal {C}})\) to qm(zm).

  4. 4.

    If \(z_{b+1}\in {[\frac {N}{3}+{\Upsilon }_{\mathcal {C}},N)}\), then there exists an \((N-{\Gamma }_{\mathcal {C}})\)-run from \(q_{b+1}(z_{b+1}-{\Gamma }_{\mathcal {C}})\) to qm(zm).

We postpone the proof of Claim 4 to the end of this section but refer to Fig. 16 for an illustration of Points 1 and 2.

We can use Point (1) or Point (2) of the claim to turn the possible resulting prefixes ασ[a,a + 1] or α respectively into \((N-{\Gamma }_{\mathcal {C}})\)-runs with target configuration shifted down by \({\Gamma }_{\mathcal {C}}\). Symmetrically, we can use Point (3) or Point (4) of the claim to turn the possible resulting suffixes σ[b,b + 1]γ or γ respectively into \((N-{\Gamma }_{\mathcal {C}})\)-runs with source configuration shifted down by \({\Gamma }_{\mathcal {C}}\). The claim will rely on the Depumping Lemma (Lemma 22) and on the fact that a transition with operation + p or − p has an absolute counter effect of N in an N-run but \(N-{\Gamma }_{\mathcal {C}}\) in an \((N-{\Gamma }_{\mathcal {C}})\)-run.

Let us for the moment assume ziN for some i ∈ [1,m − 1] along with the factorization (15) of σ and Claim 4.

Assuming Claim 4 we conclude the proof by treating the following exhaustive cases on the positions of za+ 1 and zb separately.

Fig. 13
figure 13

Illustration of Case 1, i.e. \(z_{a+1},z_{b}\in {[N,\frac {5N}{3} )}\), on the left, and Case 2, i.e. \(z_{a+1},z_{b}\in {[\frac {5N}{3},2N)}\), on the right

Case 1. \(z_{a+1},z_{b}\in {[N,\frac {5N}{3} )}\), cf. Figure 13.

Recall that β = σ[a + 1,b] as defined in (15) is an N-run from qa+ 1(za+ 1) to qb(zb) satisfying \(\textsc {Values}(\beta )\subseteq [\frac {N}{3},4N]\). We view β as an N-semirun. We consider = N and observe that

$$ \max(z_{a+1},z_{b},\ell)-\min(z_{a+1},z_{b},\ell)< \frac{5N}{3}-N=\frac{2N}{3}\leq\frac{5 N}{6}. $$

Hence we can apply the 5/6-Lemma (Lemma 39) to β: there exists an \((N-{\Gamma }_{\mathcal {C}})\)-semirun \(\widehat {\beta }\) from qa+ 1(za+ 1) to qb(zb) that is an N-embedding of β with \(\textsc {Values}(\widehat {\beta }) \subseteq [\min \limits (\beta )-{\Gamma }_{\mathcal {C}},\max \limits (\beta )+{\Gamma }_{\mathcal {C}}]\). Since moreover \(\frac {N}{3} - 2 {\Gamma }_{\mathcal {C}} > \max \limits ({\mathsf {Consts}}(\mathcal {C}))\), from \(M_{\mathcal {C}}\)’s definition on page 15, and because \(\min \limits (\beta ) \geq N/3 \), it follows that \(\widehat {\beta }-{\Gamma }_{\mathcal {C}}\), the shifting of \(\widehat {\beta }\) by \(-{\Gamma }_{\mathcal {C}}\), is in fact an \((N-{\Gamma }_{\mathcal {C}})\)-run from \(p(z_{a+1}-{\Gamma }_{\mathcal {C}})\) to \(q_{b}(z_{b}-{\Gamma }_{\mathcal {C}})\). It thus remains to show the existence of an \((N-{\Gamma }_{\mathcal {C}})\)-run from q0(z0) to \(q_{a+1}(z_{a+1}-{\Gamma }_{\mathcal {C}})\) and one from \(q_{b}(z_{b}-{\Gamma }_{\mathcal {C}})\) to qm(zm): the former follows from Point (1) of Claim 4, and the latter follows from Point (3) of Claim 4.

Case 2. \(z_{a+1},z_{b}\in {[\frac {5N}{3},2N)}\), cf. Figure 13.

It follows that \(z_{a},z_{b+1}\in {[\frac {2N}{3},N)}\), and that σa and σb must be a + p and − p respectively. We apply the 5/6-Lemma (Lemma 39) to

$$ \sigma[a,a+1] \ \beta \ \sigma[b,b+1] $$

with = N, then shift the output by \(-{\Gamma }_{\mathcal {C}}\). Then we apply Point (2) of Claim 4claim fix and Point (4) of Claim 4.

Fig. 14
figure 14

Illustration of Case 3, i.e. \(z_{a+1}\in {[N,\frac {4N}{3})}\) and \(z_{b}\in {[\frac {5N}{3},2N)}\), on the left, and Case 4, i.e. \(z_{a+1}\in {[\frac {5N}{3},2N)}\) and \(z_{b}\in {[N,\frac {4N}{3})}\), on the right

Case 3. \(z_{a+1}\in {[N,\frac {4N}{3})}\) and \(z_{b}\in {[\frac {5N}{3},2N)}\), cf. Figure 14.

It follows that \(z_{b+1}\in {[\frac {2N}{3},N)}\). We apply the 5/6-Lemma (Lemma 39) to

$$ \beta \ \sigma[b,b+1] $$

with = N, then shift the output by \(-{\Gamma }_{\mathcal {C}}\). Then we apply Point (1) of Claim 4 and Point (4) of Claim 4.

Case 4. \(z_{a+1}\in {[\frac {5N}{3},2N)}\) and \(z_{b}\in {[N,\frac {4N}{3})}\), cf. Figure 14.

It follows that \(z_{a}\in {[\frac {2N}{3},N)}\). We apply the 5/6-Lemma (Lemma 39) to

$$ \sigma[a,a+1] \ \beta $$

with = N, then shift the output by \(-{\Gamma }_{\mathcal {C}}\). Then we apply Point (2) of Claim 4 and Point (3) of Claim 4.

Fig. 15
figure 15

Illustration of Case 5, i.e. \(z_{a+1}\in {[\frac {4N}{3},\frac {5N}{3})}\) and \(z_{b}\in {[\frac {5N}{3},2N)}\), on the left (with moreover \(z_{a} \notin {[\frac {N}{3},\frac {N}{2})}\)), and Case 6, i.e. \(z_{a+1}\in {[\frac {5N}{3},2N)}\) and \(z_{b}\in {[\frac {4N}{3},\frac {5N}{3})}\), on the right (with moreover \( z_{b+1} \in {[\frac {N}{3},\frac {N}{2})}\) )

Case 5. \(z_{a+1}\in {[\frac {4N}{3},\frac {5N}{3})}\) and \(z_{b}\in {[\frac {5N}{3},2N)}\), cf. Figure 15.

It follows \(z_{b+1}\in {[\frac {2N}{3},N)}\), and that σa and σb must be a + p and − p respectively. We distinguish whether \(z_{a}\in {[\frac {N}{3},\frac {N}{2})}\) or not.

Case 5.A. \(z_{a}\not \in {[\frac {N}{3},\frac {N}{2})}\).

It follows \(z_{a}\in {[\frac {N}{2},N)}\). We apply the 5/6-Lemma (Lemma 39) to

$$ \sigma[a,a+1] \ \beta \ \sigma[b,b+1] $$

with = N, then shift the output by \(-{\Gamma }_{\mathcal {C}}\). Then we apply Point (2) of Claim 4 and Point (4) of Claim 4.

Case 5.B. \(z_{a}\in {[\frac {N}{3},\frac {N}{2})}\).

It follows \(z_{a+1}\in {[\frac {4N}{3},\frac {3N}{2})}\). We apply the 5/6-Lemma (Lemma 39) to

$$ \beta \ \sigma[b,b+1] $$

with = N, then shift the output by \(-{\Gamma }_{\mathcal {C}}\). Then we apply Point (1) of Claim 4 and Point (4) of Claim 4.

Case 6. \(z_{a+1}\in {[\frac {5N}{3},2N)}\) and \(z_{b}\in {[\frac {4N}{3},\frac {5N}{3})}\), cf. Figure 15.

It follows \(z_{a}\in {[\frac {2N}{3},N)}\), and that σa and σb must be a + p and − p respectively. We distinguish whether \(z_{b+1}\in {[\frac {N}{3},\frac {N}{2})}\) or not.

Case 6.A. \(z_{b+1}\not \in {[\frac {N}{3},\frac {N}{2})}\).

It follows \(z_{b+1}\in {[\frac {N}{2},\frac {2N}{3})}\). We apply the 5/6-Lemma (Lemma 39) to

$$ \sigma[a,a+1] \ \beta \ \sigma[b,b+1] $$

with = N, then shift the output by \(-{\Gamma }_{\mathcal {C}}\). Then we apply Point (2) of Claim 4 and Point (4) of Claim 4.

Case 6.B. \(z_{b+1}\in {[\frac {N}{3},\frac {N}{2})}\).

It follows \(z_{b}\in {[\frac {4N}{3},\frac {3N}{2})}\). We apply the 5/6-Lemma (Lemma 39) to

$$ \sigma[a,a+1] \ \beta $$

with = N, then shift the output by \(-{\Gamma }_{\mathcal {C}}\). Then we apply Point (2) of Claim 4 and Point (3) of Claim 4.

It remains to provide the proof of the Claim 4 before discussing the remaining case when zi < N for all i ∈ [1,m − 1]

Proof Proof of Claim 4

Let us only prove Points (1) and (2). Points (3) and (4) can be proven in a symmetrical manner as Points (1) and (2). Let us first prove Point (1), so let us assume that \(z_{a+1}\in {[N,\frac {5N}{3})}\). We refer to Fig. 16 for an example of such a situation. Recall that α = σ[0,a], \(z_{0}<\frac {N}{3}\) and \(z_{i}\in {[\frac {N}{3},N)}\) for all i ∈ [1,a].

Fig. 16
figure 16

Claim 4: Examples for Point 1 (above) and Point 2 (below)

We first factorize α, as seen in Fig. 17, as

$$ \alpha=\left( \prod\limits_{i=1}^{t} \chi_{i}\right)\zeta, $$

where

  • each χi is a subrun of α that either

    1. a)

      starts in a configuration with counter value strictly less than \(N-{\Gamma }_{\mathcal {C}}-{\Upsilon }_{\mathcal {C}}\) and ends in the first next configuration with counter value at least \(N-{\Gamma }_{\mathcal {C}}\), or conversely

    2. b)

      starts in a configuration with counter value at least \(N-{\Gamma }_{\mathcal {C}}\) and ends in the first next configuration with counter value strictly less than \(N-{\Gamma }_{\mathcal {C}}-{\Upsilon }_{\mathcal {C}}\), and

  • the (possibly empty) suffix ζ’s prefixes are neither of form a) nor b), i.e. \(\textsc {Values}(\zeta )\subseteq {[0,N-{\Gamma }_{\mathcal {C}})}\) or \(\textsc {Values}(\zeta )\subseteq {[N-{\Gamma }_{\mathcal {C}}-{\Upsilon }_{\mathcal {C}},N)}\).

Fig. 17
figure 17

Illustration of the factors χ1, χ2, χ3, χ4 and ζ of α

First observe that α and hence in particular χ1,…,χt,ζ all do not contain any + p-transition nor any − p-transition, and that |Δ(χi)| > Υh for all i ∈ [1,t] by definition.

Next observe that t = 0 is possible; in this case we have α = ζ and \(\textsc {Values}(\alpha )\subseteq {[0,N-{\Gamma }_{\mathcal {C}})}\).

We will however first treat the case t > 0, the case t = 0 will be treated later. It follows from \(z_{0}<\frac {N}{3}\) that χ1 must be of type a); more generally, χi is of type a) for all odd i ∈ [1,t] and of type b) for all even i ∈ [1,t]. Since \(z_{0}<\frac {N}{3}\), observe that if for α’s last counter value za we have \(z_{a}\in {[N-{\Gamma }_{\mathcal {C}},N)}\), then t must be odd, and, similarly (but not entirely dually), if for α’s last counter value za we have \(z_{a}\in {[\frac {N}{3}, N-{\Gamma }_{\mathcal {C}}-{\Upsilon }_{\mathcal {C}})}\), then t must be even.

In the following we prefer to write α as α = α[0,a] rather than σ[0,a]. It is important to recall that \(z_{0}<\frac {N}{3}\) and \(z_{s}\in {[\frac {N}{3},N)}\) for all s ∈ [1,a].

Let

$$ q_{0}(z_{0})=q_{j_{1}}(z_{j_{1}})\xrightarrow{\chi_{1}}q_{j_{2}}(z_{j_{2}}) \xrightarrow{\chi_{2}}q_{j_{3}}(z_{j_{3}}) \quad\cdots\quad \xrightarrow{\chi_{t-1}}q_{j_{t}}(z_{j_{t}})\xrightarrow{\chi_{t}} q_{j_{t+1}}(z_{j_{t+1}}) \xrightarrow{\zeta}q_{j_{t+2}}(z_{j_{t+2}}). $$

Note that jt+ 1 = jt+ 2 is possible if ζ is empty. In the following, we will first show how to turn any χi of type a) (resp. b)) into an \((N-{\Gamma }_{\mathcal {C}})\)-run with target (resp. source) configuration shifted down by \({\Gamma }_{\mathcal {C}}\), and then we make a case distinction on how to end the proof based on the parity of t.

Subclaim 1

Let i ∈ [1,t] be odd. Then there exists an \((N-{\Gamma }_{\mathcal {C}})\)-run \(\widehat {\chi _{i}}\) from \(q_{j_{i}}(z_{j_{i}})\) to \(q_{j_{i+1}}(z_{j_{i+1}}-{\Gamma }_{\mathcal {C}})\).

Proof Proof of Subclaim 1

Indeed, ϕ(χi) = ε ∈Λ8, as α contains neither + p-transitions nor − p-transitions. Since moreover \({\Delta }(\chi _{i})> {\Upsilon }_{\mathcal {C}}\) we can now apply Lemma 22 to χi (viewed as an N-semirun) and obtain an N-semirun \(\widehat {\chi _{i}}\) with \({\Delta }(\widehat {\chi _{i}})={\Delta }(\chi _{i})-{\Gamma }_{\mathcal {C}}\) that is such that \(\widehat {\chi _{i}}=\alpha [j_{i},j_{i+1}]-I_{1}-I_{2}{\cdots } -I_{k}\) for pairwise disjoint intervals \(I_{1},\ldots ,I_{k}\subseteq [j_{i},j_{i+1}]\) such that

  • ϕ(α[Ih]) ∈Λ16,

  • \({\Delta }(\alpha [I_{h}]) \in Z_{\mathcal {C}} \mathbb {Z}\) and Δ(α[Ih]) > 0 for all h ∈ [1,k].

Recall \(\textsc {Values}(\alpha [1,a])\subseteq {[\frac {N}{3},N)}\) and \(\frac {N}{3}-{\Gamma }_{\mathcal {C}}>\frac {M_{\mathcal {C}}}{3}-{\Gamma }_{\mathcal {C}}> {\Gamma }_{\mathcal {C}} > \max \limits ({\mathsf {Consts}}(\mathcal {C}))\), where the inequalities follows from \(M_{\mathcal {C}}\)’s and \({\Gamma }_{\mathcal {C}}\)’s definition on page 15. It follows that \(\widehat {\chi _{i}}\) has all its counter values (except for the first one) in \( {[\frac {N}{3}-{\Gamma }_{\mathcal {C}} , N - {\Gamma }_{\mathcal {C}} )}\). Moreover, the first transition’s operation must be a + 1 update and therefore cannot be a test, and hence \(\widehat {\chi _{i}}\) is an \((N-{\Gamma }_{\mathcal {C}})\)-run from \(q_{j_{i}}(z_{j_{i}})\) to \(q_{j_{i+1}}(z_{j_{i+1}}-{\Gamma }_{\mathcal {C}})\). □

Subclaim 2

Let i ∈ [1,t] be even. Then there exists an \((N-{\Gamma }_{\mathcal {C}})\)-run \(\widehat {\chi _{i}}\) from \(q_{j_{i}}(z_{j_{i}}-{\Gamma }_{\mathcal {C}})\) to \(q_{j_{i+1}}(z_{j_{i+1}})\).

Proof Proof of Subclaim 2.

Analogously, by use of Lemma 22, for i ∈ [1,t] even, there exists an \((N-{\Gamma }_{\mathcal {C}})\)-semirun \(\chi ^{\prime }\) from \(q_{j_{i}}(z_{j_{i}})\) to \(q_{j_{i+1}}(z_{j_{i+1}}+{\Gamma }_{\mathcal {C}})\), from which we obtain an \((N-{\Gamma }_{\mathcal {C}})\)-semirun \(\widehat {\chi _{i}}=\chi ^{\prime }-{\Gamma }_{\mathcal {C}}\) from \(q_{j_{i}}(z_{j_{i}}-{\Gamma }_{\mathcal {C}})\) to \(q_{j_{i+1}}(z_{j_{i+1}})\) by shifting \(\chi ^{\prime }\) by \(-{\Gamma }_{\mathcal {C}}\). Moreover, as \(\textsc {Values}(\alpha [1,a])\subseteq {[\frac {N}{3},N)}\) and \(\frac {N}{3}-{\Gamma }_{\mathcal {C}}> {\Gamma }_{\mathcal {C}} > \max \limits ({\mathsf {Consts}}(\mathcal {C}))\) as seen in the proof of Subclaim 1, \(\widehat {\chi _{i}}\) is an \((N-{\Gamma }_{\mathcal {C}})\)-run as required.

To finish the proof of the existence of an \((N-{\Gamma }_{\mathcal {C}})\)-run from q0(z0) to \(q_{a+1}(z_{a+1}-{\Gamma }_{\mathcal {C}})\) we make a case distinction on the parity of t.

Assume first that the parity of t is odd. By applying Subclaims 1 and 2 to the runs χ1,…,χt appropriately we obtain the \((N-{\Gamma }_{\mathcal {C}})\)-run

$$ \widehat{\chi_{1}}\cdots\widehat{\chi_{t}} $$

from \(q_{j_{1}}(z_{j_{1}})\) to \(q_{j_{t+1}}(z_{j_{t+1}}-{\Gamma }_{\mathcal {C}})\). Since t is odd we have that χt is of type a), \(z_{j_{t+1}} \in {[N-{\Gamma }_{\mathcal {C}},N)}\) and \(\textsc {Values}(\zeta )\subseteq {[N-{\Gamma }_{\mathcal {C}}-{\Upsilon }_{\mathcal {C}},N)}\). As \((N-{\Gamma }_{\mathcal {C}}-{\Upsilon }_{\mathcal {C}})-{\Gamma }_{\mathcal {C}} > (M_{\mathcal {C}}-{\Gamma }_{\mathcal {C}}-{\Upsilon }_{\mathcal {C}})-{\Gamma }_{\mathcal {C}}> \max \limits ({\mathsf {Consts}}(\mathcal {C}))\), following from \(M_{\mathcal {C}}\)’s, \({\Gamma }_{\mathcal {C}}\)’s and \({\Upsilon }_{\mathcal {C}}\)’s definition on page 15, and ϕ(α) = ε, it follows that

$$ \widehat{\chi_{1}}\cdots\widehat{\chi_{t}}\left( \zeta-{\Gamma}_{\mathcal{C}}\right) $$

is an \((N-{\Gamma }_{\mathcal {C}})\)-run from \(q_{j_{1}}(z_{j_{1}})\) to \(q_{j_{t+2}}(z_{j_{t+2}}-{\Gamma }_{\mathcal {C}})\). Recall that \(z_{a+1} < \frac {5N}{3}\) by case assumption and also recall that \(N > M_{\mathcal {C}}\). Since \(\textsc {Values}(\zeta )\subseteq {[N-{\Gamma }_{\mathcal {C}}-{\Upsilon }_{\mathcal {C}},N)}\) we have \(z_{a}=z_{j_{t+2}} \geq N-{\Gamma }_{\mathcal {C}}-{\Upsilon }_{\mathcal {C}}\) and hence \(0<{\Delta }(\sigma ,{a}) < \frac {5N}{3}-(N-{\Gamma }_{\mathcal {C}}-{\Upsilon }_{\mathcal {C}}) \leq \frac {2N}{3} + {\Gamma }_{\mathcal {C}} + {\Upsilon }_{\mathcal {C}} < \frac {2N}{3} + \frac {M_{\mathcal {C}}}{3} < N\), where the penultimate inequality follows from the definition of \(M_{\mathcal {C}}\) on page 15. Hence, as σa is not a test nor a + p-transition we have that

$$ \widehat{\chi_{1}}\cdots\widehat{\chi_{t}} \left( \zeta-{\Gamma}_{\mathcal{C}}\right)(\sigma[a,a+1] -{\Gamma}_{\mathcal{C}}) $$

is an \((N-{\Gamma }_{\mathcal {C}})\)-run from \(q_{j_{1}}(z_{j_{1}})=q_{0}(z_{0})\) to \(q_{j_{t+2}}(z_{j_{t+2}}-{\Gamma }_{\mathcal {C}})= q_{a+1}(z_{a+1}-{\Gamma }_{\mathcal {C}})\) as required.

Let us now treat the case when t is even. It follows \(\textsc {Values}(\zeta )\subseteq {[0,N-{\Gamma }_{\mathcal {C}})}\), in particular \(z_{a}\in {[0,N-{\Gamma }_{\mathcal {C}})}\). Again,

$$ \widehat{\chi_{1}}\cdots \widehat{\chi_{t}} $$

is an \((N-{\Gamma }_{\mathcal {C}})\)-run from \(q_{j_{1}}(z_{j_{1}})=q_{0}(z_{0})\) to \(q_{j_{t+1}}(z_{j_{t+1}})\). Since za+ 1N and \(z_{a}<N-{\Gamma }_{\mathcal {C}}\) it follows that σa is a + p-transition, in particular \({\Delta }(\sigma , a)>{\Gamma }_{\mathcal {C}}\). Thus,

$$ \widehat{\chi_{1}}\cdots\widehat{\chi_{t}}\zeta \tau, $$

where \(\tau = q_{a}(z_{a}) \xrightarrow { \sigma _{a} , N-{\Gamma }_{\mathcal {C}}} q_{a+1}(z_{a+1}-{\Gamma }_{\mathcal {C}})\) with \({\Delta }(\tau )={\Delta }(\sigma , a)-{\Gamma }_{\mathcal {C}}= N-{\Gamma }_{\mathcal {C}}\), is an \((N-{\Gamma }_{\mathcal {C}})\)-run from \(q_{j_{1}}(z_{j_{1}})=q_{0}(z_{0})\) to \(q_{j_{t+2}}(z_{j_{t+2}}-{\Gamma }_{\mathcal {C}})= q_{a+1}(z_{a+1}-{\Gamma }_{\mathcal {C}})\), as required.

It remains to discuss the case when t = 0. This case can be proven analogously. Indeed, from t = 0 it follows immediately that α = ζ and \(\textsc {Values}(\zeta )\subseteq {[0,N-{\Gamma }_{\mathcal {C}})}\) and the proof is analogous as the case when t > 0 and when t is even.

Let us now sketch the proof of Point (2) of Claim 4. Let us assume \(z_{a}\in {[\frac {N}{3}+{\Upsilon }_{\mathcal {C}},N)}\). Similarly as in Point (1) we can factorize α as \(\alpha =\left ({\prod }_{i=1}^{t}\chi _{i}\right )\zeta \) and Subclaims 1 and 2 hold again.

If t is odd, then by Subclaims 1 and 2 we have that the run \(\left ({\prod }_{i=1}^{t}\widehat {\chi _{i}}\right )(\zeta -{\Gamma }_{\mathcal {C}})\), stipulating that \(\widehat {\chi _{i}}\) is the of Subclaims 1 and 2 respectively (depending on the parity of i), is the desired \((N-{\Gamma }_{\mathcal {C}})\)-run from q0(z0) to \(q_{a}(z_{a}-{\Gamma }_{\mathcal {C}})\).

If t is even, then again by Subclaims 1 and 2 we have that \(\xi =\left ({\prod }_{i=1}^{t}\widehat {\chi _{i}}\right )\zeta \) is an \((N-{\Gamma }_{\mathcal {C}})\)-run from q0(z0) to qa(za), where again \(\widehat {\chi _{i}}\) is defined as above. By definition the run ξ does not contain any + p-transitions nor − p-transitions, thus ϕ(ξ) = ε ∈Λ8. By construction also the run ξ has all counter values, besides the first, above \(\frac {N}{3} -{\Gamma }_{\mathcal {C}} > {\Gamma }_{\mathcal {C}} + \max \limits ({\mathsf {Consts}}(\mathcal {C}))\). Moreover, as \(z_{a} \geq \frac {N}{3}+{\Upsilon }_{\mathcal {C}}\) and \(z_{0} < \frac {N}{3}\), we have \({\Delta }(\xi )>{\Upsilon }_{\mathcal {C}}\). We can thus apply Lemma 22 to ξ, obtaining an \((N-{\Gamma }_{\mathcal {C}})\)-run \(\xi ^{\prime }\) from q0(z0) to \(q_{a}(z_{a}-{\Gamma }_{\mathcal {C}})\), as required. □

We now conclude the proof of our statement by treating the only remaining case, the case when σ is such that zi < N for all i ∈ [1,m − 1]. In this case we can factorize σ as \( \sigma ={\prod }_{i=1}^{t}\chi _{i} \zeta \) similarly as done in the proof of Point (1) of Claim 4, where t is even, and analogously prove that \({\prod }_{i=1}^{t}\widehat {\chi _{i}}\zeta \) is an \((N-{\Gamma }_{\mathcal {C}})\)-run from q0(z0) to qm(zm), where \(\widehat {\chi _{i}}\) is the output of Subclaim 1 and 2 respectively (depending on the parity of i).

10 Conclusion

In this paper we have shown that the reachability problem for parameteric timed automata with two parametric clocks and one parameter is complete for exponential space.

For the lower bound proof, inspired by [13, 14], we made use of two results from complexity theory. First, we made use of a serializability characterization of EXPSPACE from [13] which is a padded version of the serializability characterization of PSPACE from [20], which in turn has its roots in Barrington’s Theorem [7]. Second, we made use of a result of Chiu, Davida, Litow that states that numbers in Chinese remainder representation can be translated into binary representation in NC1 (and thus in logarithmic space). We are convinced that it is worthwhile to develop a suitable programming language that serves as a unifying framework in that it provides an interface for proving lower bounds for various problems involving automata. In a sense, we have developed the corresponding interface “by hand” when defining how parametric timed automata can compute functions (Definition 6).

For the EXPSPACE upper bound we first followed the approach of Bundala and Ouaknine [10] by providing an exponential time translation from reachability in parametric timed automata with two parametric clocks and one parameter (i.e. (2,1)-PTA) to reachability in parametric one-counter automata (POCA) over one parameter, yet on a slightly less expressive POCA model as introduced in [10]. We then studied the reachability in POCA with one parameter p. Our main result, the Small Parameter Theorem (Theorem 18), states that such a parametric one-counter automaton (POCA) has an accepting run all of whose counter values lie in [0,4 ⋅ p] if, and only if, there exists such an accepting run for some p that is at most exponential in the size of the POCA. Since the translation from (2,1)-PTA to POCA is computable in exponential time, this gives a doubly exponential upper bound on the parameter value of the original (2,1)-PTA and hence an EXPSPACE upper bound for reachability in (2,1)-PTA (Corollary 19).

In proving the Small Parameter Theorem we introduced the notion of semiruns and gave several techniques for manipulating them. The Depumping Lemma 22 allowed us to construct from semiruns with large absolute counter effect new semiruns with a smaller absolute counter effect. The Bracket Lemma 23 allowed us to find in semiruns having a sufficiently large absolute counter effect and satisfying some majority condition on the number of occurrences of + p-transitions and − p-transitions some subsemirun that has again a large absolute counter effect and moreover some equal bracketing properties. Our Hill and Valley Lemma (Lemma 28) allowed to turn for sufficiently large N any N-semirun that is either a hill or a valley into an \(N^{\prime }\)-semirun for some \(N^{\prime }<N\). Our 5/6-Lemma (Lemma 39) allowed to turn for sufficiently large N any N-semirun with an absolute counter effect of at most 5/6N into an \(N^{\prime }\)-semirun for some \(N^{\prime }<N\).

We hope that extensions of our techniques provide a line of attack for finally showing decidability (and the precise complexity) of reachability in parametric timed automata with two parametric clocks over an arbitrary number of parameters (i.e. (2,∗)-PTA). For these however, it seems that the reduction to POCA indeed requires the presence of the above-mentioned + [0,p]-transitions. When analyzing runs in the corresponding more general POCA model that in turn also involves an arbitrary number of parameters, it will become necessary to “de-scale” semiruns in the following sense. Already in the presence of two parameters one can see that it becomes necessary to decrease the value of both parameters simultaneously proportionally: for instance one can build a (2,2)-PTA for which reachability holds only if the first parameter is a multiple of the second parameter.