Manuscript Offprint
arXiv:2609.00678Two-State Max-Plus Comparison Is Decidable
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
Daviaud, Guillon, and Merlet proved that comparison of max-plus automata is undecidable under a fixed state bound of 553 and explicitly left the range from 2 to 552 states open. We resolve the two-state endpoint. More strongly, given an arbitrary finite max-plus automaton and a max-plus automaton with at most two states, it is decidable whether for every word . The structural reason is a one-dimensional projective normal form for two-state dynamics. Outside an effective bounded region, a transition has one of three tail behaviors: it propagates the unbounded projective gap with gap-independent height increment, forgets the gap with gap-independent height increment, or reads the gap magnitude into the height increment and then forgets it. In particular, any transition whose output depends on the unbounded gap necessarily destroys that gap. This yields an exact one-counter realization of . Effective semilinearity of context-free Parikh images then reduces comparison to Presburger arithmetic. As a consequence, two-state max-plus comparison, equivalence, and positivity are decidable.
1 Introduction
Let
be the max-plus semiring. A finite max-plus automaton over an alphabet computes a series
by taking the maximum weight of an accepting run.
The exact comparison problem asks, for two automata , whether
It is undecidable in general. Daviaud, Guillon, and Merlet [1] proved undecidability already with a bounded number of states: their published bound is 553 states. They explicitly asked what happens between 2 and 552 states, noting that even the two-state case appeared difficult.
We prove the following.
Theorem 1.1 (Two-state right-hand comparison). Let be an arbitrary finite max-plus automaton over , and let be a max-plus automaton with at most two states. It is decidable whether
This is stronger than merely resolving the two-state bounded-state endpoint, because only the right-hand automaton is required to have at most two states.
*Google. Work done in a personal capacity; no Google internal resources were used. Email: ogiekako@gmail.com. ORCID: 0009-0007-8119-9267.
Corollary 1.2. The following problems are decidable:
(i) comparison of two max-plus automata with at most two states;
(ii) equivalence of two max-plus automata with at most two states;
(iii) for every finite alphabet size k.
The proof is elementary apart from one standard formal-language theorem. A two-state forward vector has only one unbounded projective coordinate, namely the difference of its two entries. For sufficiently large absolute difference, each letter has a fixed tail form. The essential property is one-way: if the current height increment depends on the magnitude of the unbounded projective gap, then the successor projective state no longer depends on that magnitude. A step that propagates the gap has a gap-independent height increment. This no-read-while-propagating property permits exact simulation by one nonnegative counter. The accepting transition language of the synchronized simulation is context-free, so effective Parikh semilinearity [5] reduces the existence of a comparison violation to Presburger arithmetic.
We use slightly more general conventions than [1]: arbitrary max-plus initial and final weights and words in are allowed here. The MFCS 2017 formulation uses Boolean-valued initial/final vectors and nonempty words. Restricting to that convention only simplifies the construction; excluding the empty word can also be enforced by one bit of finite control.
No complexity bound is claimed here.
When , define its height
If both coordinates are finite, define the signed projective gap
If exactly one coordinate is finite, use or for the corresponding infinite gap. After subtracting the common height, every finite projective state is therefore represented by
The unbounded projective information is one-dimensional.
Let a letter act by
For a finite signed gap, use the representative . Direct max-plus multiplication gives
Hence the successor signed gap is
(3) whenever both displayed maxima are finite, with the evident infinite-gap conventions otherwise.
Write
Subtracting the input height gives the height cocycle
whenever the successor is nondead.
3 The tail trichotomy
Let be the set of all finite transition, initial, and final weights of . Choose
with if has fewer than two elements. Thus strictly dominates every finite transition breakpoint, every fixed tail shift below, and the final readout breakpoint.
Consider first the positive tail . Every maximum in (3) then has a forced branch. The four active-row cases are summarized in Table 1. The negative tail follows by exchanging the two current-state coordinates.
| active row | successor projective behavior | height increment | class |
|---|---|---|---|
| finite | fixed gap | constant | forget |
| exactly one finite | translation, or infinite gap | constant | propagate or forget |
| fixed by , independent of | read-and-forget |
Table 1: Tail behavior for . A translation has gap magnitude for a fixed integer (with the symmetric negative-tail form obtained by exchanging the current states).
For completeness, if is finite then forces ; if , the first successor coordinate is . The same statement holds for . If both are finite, both successor coordinates come from the active row, so the gap is the fixed value and . If exactly one of is finite, the active successor coordinate is plus a fixed weight. The other coordinate is either absent, giving an infinite gap, or comes from the inactive row and differs by for a fixed integer ; in either case the height increment is constant. Finally, if , both successor coordinates come from the inactive row, so their projective class is independent of while (4) gives .
Thus there is a genuine third possibility that should not be conflated with reading: a step may forget the gap without using its magnitude in the height increment.
Lemma 3.1 (Tail trichotomy). For every projective state with finite gap magnitude , every nondead letter transition has exactly one of the following forms, with constants determined by the letter and the tail side:
(i) propagate: the successor retains an unbounded gap with magnitude for a fixed integer (and a fixed successor side), while the height increment is a fixed constant ;
(ii) forget: the successor projective state is independent of , while the height increment is a fixed constant ;
(iii) read-and-forget: the successor projective state is independent of , while the height increment is .
In particular, whenever the height increment depends on the unbounded gap magnitude, that magnitude is not propagated to the successor.
Proof. The positive-tail case is the case split above, and the negative-tail case is obtained by exchanging the current-state coordinates. The choice of makes every relevant comparison strict and also gives for every propagate shift .
Remark 3.2. For example, the all-zero matrix has a silent forget tail: for every sufficiently large gap, the successor gap is 0 and the height increment is 0. This is why the useful structural statement is not a literal retain/read dichotomy, but the prohibition on simultaneously reading an unbounded magnitude into the output and propagating that magnitude to the future.
Remark 3.3. The statement is specific to the one-dimensional projective geometry of two states. With three states, two independent projective differences can coexist, and an update can read one combination while retaining another.
4 Exact compilation to one counter
Lemma 4.1 (Functional one-counter realization). From one can effectively construct a one-counter transducer such that, for every word :
(i) if , then has no successful computation on ;
(ii) if , then has a successful computation on , and every successful computation on emits exactly .
The construction may be chosen deterministic on each input word (apart from a fixed internal macro-expansion). It uses finite control, one nonnegative counter, increment, blocking decrement, zero test, and fixed integer emissions.
Proof. Finite control stores which coordinate is maximal, whether the projective gap is finite or infinite, and every finite gap value at most . The counter invariant is:
In a bounded-gap or infinite-gap control state the counter is zero. In a tail state the counter equals the exact magnitude .
The initial forward vector contributes its height as a fixed emission and initializes this invariant.
If the current gap is bounded, the exact successor and height increment are obtained from a finite lookup table. If it is infinite, the only surviving current coordinate determines the successor by another finite lookup. Suppose now that the counter stores a tail magnitude . Apply Lemma 3.1.
In a propagate case, emit the fixed constant and change the counter by the fixed shift . Since , a tail value cannot cross zero. To determine whether the shifted value has entered the bounded region, perform a deterministic destructive probe of at most decrements: if zero is reached within the first decrements, record the exact bounded value in finite control and leave the counter at zero; otherwise perform the st decrement, then restore those units and remain in a tail control state. The probe emits zero, so it does not change the represented height.
In a forget case, the old magnitude will never be needed again. Drain the counter to zero with zero emission, emit the fixed constant , and move to the bounded- or infinite-gap successor stored in finite control.
In a read-and-forget case, drain the counter to zero while emitting -1 per decrement, then emit the fixed constant and move to the successor projective control state. This contributes exactly and restores the invariant. Dead transitions reject.
The final vector has the same one-dimensional form. On a bounded or infinite projective state its value is a finite-control lookup. On a tail, either the currently maximal coordinate has a finite final weight, in which case the final contribution is constant and the counter can be silently drained, or only the other coordinate contributes, in which case the counter is drained with emission -1 per decrement and a fixed final weight is added. If neither coordinate can accept, the computation rejects.
All choices above are forced by the current finite control, counter tests, and input letter. Thus the macro-expanded transducer can be chosen deterministic, so successful computations cannot introduce spurious output values. By induction on the input prefix, the maintained height and projective state equal the exact max-plus forward vector; the terminal emission is therefore exactly .
5 Deciding comparison
Proof of Theorem 1.1. First separate support. For a max-plus automaton, the set of words on which the value is finite is regular: ignore weights and retain exactly the finite-weight transitions, initial states, and final states. Hence it is decidable whether there exists a word with finite and . Any such word is an immediate violation.
Assume now that we work on the common finite support. Construct the functional one-counter transducer from Lemma 4.1. Synchronize with the finite run graph of . A transition of that consumes an input letter is synchronized with a transition of carrying the same letter; internal counter operations of leave the -state unchanged. The resulting machine nondeterministically chooses an accepting run of , while the component has only the exact output on the synchronized word.
Give every transition of this product machine a fresh symbol. The set of successful transition sequences is an effectively given one-counter language and therefore a context-free language. By the effective form of Parikh's theorem [5], the set of transition-count vectors
is effectively semilinear.
Both
are integer-linear functions of the transition-count vector: each product transition carries a fixed contribution to the chosen -run weight and a fixed transducer emission, and fixed initial/final contributions can be represented by dedicated start/end transitions. Therefore the existence of a successful computation satisfying
is an existential Presburger question over an effectively semilinear set, and is decidable.
Finally,
holds if and only if some accepting run of has weight greater than . Thus we can decide whether any comparison violation exists.
Proof of Corollary 1.2. Comparison follows immediately when both automata have at most two states. Equivalence is the conjunction of the two comparison directions. For positivity, let be the one-state automaton with constant value zero. Then
if and only if for every word .
6 Position relative to prior work
Daviaud, Guillon, and Merlet [1] established the bounded-state undecidability frontier at 553 states and explicitly identified the interval as open. Theorem 1.1 closes its two-state endpoint. Daviaud and Johnson [2] studied the same two-state max-plus model but addressed semigroup identities rather than positivity or comparison. Daviaud's survey [3] reviews containment and equivalence for weighted automata and records no two-state solution. More recently, Daviaud, Purser, and Tcheng [4] proved the Big-O (affine-domination) problem decidable and PSPACE-complete; their problem is explicitly a relaxation of exact containment, which remains undecidable in general.
The proof mechanism here is different from nearby decidable restrictions such as finitely ambiguous classes, unary-alphabet tropical automata, or determinisability problems: the alphabet and left-hand automaton are unrestricted, while the right-hand automaton has only two states. The decisive structure is the exact one-counter reduction furnished by Lemmas 3.1 and 4.1.
A targeted literature audit conducted through September 1, 2026 located no earlier resolution of the two-state comparison case and no equivalent arbitrary-left/two-state-right containment theorem. Bibliographic search cannot certify absolute historical absence, so this note makes no stronger priority claim than that dated statement.
7 Reproducibility and provenance
A maintained version of this manuscript, the public regression code, and the dated literature audit are available in the Exact Interaction Geometry research repository:
https://github.com/ogiekako/exact-interaction-geometry.
The result arose within the EIG research programme: its residual/interface viewpoint led to isolating the one-dimensional projective gap and asking whether one transition can both expose an unbounded residual magnitude and preserve it for future computation. The theorem itself is ordinary weighted-automata mathematics and does not depend on EIG.
The companion regression script checks the projective formulas, exhaustively classifies a finite family of letter tails into propagate / forget / read-and-forget (including the all-zero silent-forget case), and compares direct max-plus evaluation with a separately coded projective/counter evaluator on hundreds of thousands of finite words. The infinite theorem rests on the proof above, not on finite enumeration.
AI-assisted research disclosure
This work was developed through AI-assisted mathematical research. OpenAI reasoning models, including GPT-5.6 Sol, materially contributed to theorem discovery, proof drafting, verifier generation, and literature-audit support. The author directed the research programme, curated the final mathematical claims after adversarial checking, and takes responsibility for the manuscript.
Model output is not treated as mathematical evidence; the result is intended to stand on the written proof above, with the public regression code serving as an independent finite check of its algebraic mechanism.
References
[1] Laure Daviaud, Pierre Guillon, and Glenn Merlet. Comparison of Max-Plus Automata and Joint Spectral Radius of Tropical Matrices. In MFCS 2017, LIPIcs 83, Article 19, 2017. DOI: 10.4230/LIPIcs.MFCS.2017.19.
[2] Laure Daviaud and Marianne Johnson. The Shortest Identities for Max-Plus Automata with Two States. In MFCS 2017, LIPIcs 83, Article 48, 2017. DOI: 10.4230/LIPIcs.MFCS.2017.48.
[3] Laure Daviaud. Containment and Equivalence of Weighted Automata: Probabilistic and Max-Plus Cases. In LATA 2020, LNCS 12038, pp. 17–32, 2020. DOI: 10.1007/978-3-030-40608-0_2.
[4] Laure Daviaud, David Purser, and Marie Tcheng. The Big-O Problem for Max-Plus Automata is Decidable (PSPACE-Complete). Logical Methods in Computer Science, 21(3), 3:1–3:35, 2025. DOI: 10.46298/lmcs-21(3:3)2025.
[5] Rohit J. Parikh. On Context-Free Languages. Journal of the ACM, 13(4):570–581, 1966.