Interactive edition · 12 September 2026
One Unit Separates Polynomial Time
from Undecidability in Term Coding
Read the paper. Open any paragraph to follow the argument.
Continue into the exact Lean statement, proof steps and foundations.
Contents · all eight sections
Abstract
Term coding provides a common algebraic framework for network coding, index coding and problems in extremal combinatorics. We exhibit a decision problem in which lowering an output threshold by just one changes the complexity from polynomial time to undecidability: no algorithm then halts with the correct answer on every input. The problem concerns dispersion, the maximum number of distinct output tuples obtainable by interpreting the function symbols in a tuple of terms on a finite alphabet. We restrict inputs by inequalities between terms and ask whether a given instance meets a prescribed output threshold for some alphabet size at least two. Both thresholds are considered on the same class of instances. A machine-checked Lean development and an interactive presentation of the paper accompany this work (GitHub: https://github.com/SR123/term-coding-disequality-lean; DOI: 10.5281/zenodo.22727895); Section 8 specifies its external input and verification limits.
1. Two decision problems with adjacent thresholds
An expression such as becomes a function of once a set and functions and are chosen. We call such expressions terms, and the choice of functions an interpretation. Every occurrence of a symbol uses the same function: for example, means that this function is applied twice. A tuple of terms in variables defines a map from to , where is the number of terms in the tuple. We restrict its domain by requiring finitely many inequalities between terms. Such inequalities are also called disequalities or tests.
An instance specifies the variables, function symbols and their arities, output terms, and tests. For each , let be the maximum number of distinct output tuples obtained from inputs satisfying all tests, as the interpreting functions on vary. This maximum is called the dispersion. It counts output tuples, not satisfying input tuples: different inputs can give the same output. The finite set on which the functions act is also called the alphabet. The instance specifies neither its size nor any of the interpreting functions. Section 2 gives the formal definitions.
Let consist of all instances with a finite set of variables containing distinct variables , output tuple and a finite list of tests that includes . The remaining output terms may use any variables in and may repeat. All variables, symbols, terms and tests are explicitly listed in the input. The class does not depend on the integer used below; in particular, the numbers of variables and outputs need not equal .
For , put This is the number of -tuples in whose first two coordinates differ. We compare two questions about an input : does hold for some , and does hold for some ? Both quantify over the same possible sizes of the finite set. The second question asks for just one more output tuple, but admits a polynomial-time algorithm, whereas the first is undecidable.
The algorithm uses a graph determined by the terms. Its vertices are the distinct subterms, together with all declared variables; an edge runs from an immediate argument to the term containing it. This is a directed acyclic graph. A term cut is a set of vertices meeting every directed path from a variable to an output term. Paths of length zero are included, and a cut may contain variables or output terms. Let be the minimum size of such a cut. Every cut for an instance in contains , since each is both a variable and an output. Thus .
Theorem 1.1. The one-unit difference in complexity. For every fixed integer , the following decision problems on have the indicated complexities: The second answer is yes if and only if no test has syntactically identical sides and . This criterion can also be decided in polynomial time when is part of the input, written in binary. If it holds, and is the number of distinct subterms in the outputs and tests together with all declared variables, then In particular, whenever the criterion holds, the strict threshold is attained at the alphabet size . For every fixed , the first problem remains undecidable on the subclass with , where for all . There is no total computable function such that every positive instance in this subclass, of input length , has a size with and .
We call the two inequalities in the theorem the non-strict and strict thresholds, respectively: since is an integer, the second is equivalent to . For fixed , the sufficient size is polynomial in . When varies, its value need not be polynomial, but its binary representation is still short. On a positive strict instance, , so it has at most bits. This bounds the length of the integer specifying a sufficient alphabet size; it does not assert that all entries of functions of arbitrary arity can be listed in polynomial time.
Why all output pairs force identities. For outputs , the test allows at most outputs. Achieving this number means that every pair with satisfies every test. In particular, if a further test is , then for every : otherwise the pair would fail. We refer to equality with this upper bound as saturation. Applying this observation to terms expressing inverse and relator laws forces them to hold on the whole finite set. Section 5 uses it to encode the following undecidable problem for one fixed finitely presented group: given a word, does it have nonidentity image in some finite quotient? The external group-theoretic result is [1, Theorem 2.1]. Only the term representing the input word varies; the unary symbols and the number of tests are fixed. Adding new variables as further outputs, with no tests involving them, multiplies the image size by and proves the other degrees.
The cut bound and earlier routing work. Riis and Gadouleau [6] proved that ordinary dispersion, without tests, has growth exponent equal to the minimum term cut. Their lower bound transmits independent values along disjoint paths in the term graph. Each transmitted value is accompanied by a label identifying its subterm, so that different uses of a symbol can be handled by one function. This construction is called routing. Section 3 shows that the same labels satisfy every test whose sides are syntactically different. It also proves the sharper upper bound because every cut contains the output variables , whose values must differ. These two bounds give the strict decision criterion. The reduction uses the new identity-forcing argument above; it does not follow from the earlier asymptotic theorem.
Approaching the upper bound by explicit functions. For the two-variable instance associated to a fixed presentation and a word , write for the dispersion. For every nonempty word , Section 7 constructs functions satisfying where counts the letters as written and depends only on the presentation. Given and a positive rational , the construction computes an integer and unary functions for which the allowed output image contains at least pairs. It works even for words for which equality with is impossible at every size. Thus arbitrarily accurate proportions of this upper bound, with computable witnesses, do not decide whether the bound can be reached. The reason is concrete: each failed identity at a point excludes at most one further second coordinate. At most pairs are lost, a vanishing proportion of , whereas losing no pair forces every identity to hold everywhere. The approximate constructions need not satisfy the group laws.
Example 1.2. Both answers occur at every degree. Fix , variables , and only the test . The output tuple has distinct outputs and exceeds already at . With the same variables, test and number of output coordinates, the tuple instead has exactly outputs. It gives a no answer to the strict question and a yes answer to the non-strict question. Adding the deliberately impossible test excludes every assignment and gives , so both questions have answer “no”. For , the first two examples are with and with .
The strict positive instances form a subset of the non-strict positive instances; there is no contradiction in the subset being easier to recognise. Also for every . As increases, the undecidable thresholds therefore alternate with the polynomial-time thresholds. The input class remains throughout.
Correction to the earlier omnibus. This paper is intended to replace Term Coding for Extremal Combinatorics: Dispersion and Complexity Dichotomies, arXiv:2504.16265 [3]. That work has been divided into focused papers. The entropic framework and guessing-number sandwich theorem are developed in [4]; ordinary dispersion and its exact and asymptotic decision problems are studied in [5]. Versions 1–3 of the earlier omnibus asserted undecidability of finite square term bijectivity, the existence of an interpretation making a tuple of terms in variables a bijection on for some finite with . The proposed Horn-clause reduction in Appendix A of v1 did not establish the required forcing properties, and the machine-simulation sketches in Section 7.1 of v2 and v3 did not establish the required reduction. The undecidability assertion and the unconditional pure-equation complexity conclusions depending on it are therefore withdrawn. Finite square term bijectivity remains open. The present reduction applies to the stated class with disequality tests and does not establish that earlier assertion.
2. Terms, interpretations, and the output image
Fix a finite nonempty set of variables, also called source variables, and a finite signature : a set of function symbols with a specified nonnegative integer arity for each symbol. Terms are finite rooted expressions over and , with ordered arguments. A symbol of arity zero is a constant symbol. Syntactic equality means literal equality of expressions using the same symbol and variable names; no algebraic identities or cancellation rules are imposed. An interpretation on a nonempty set assigns one function to each . Every such function is defined on its entire domain, with no prescribed values. For an assignment , the value of a term is defined recursively. All occurrences of use the same .
Definition 2.1. An instance consists of variables , a finite signature , an output tuple , and a finite list of tests between terms over and . For an interpretation on a finite nonempty set , define The output map is . Its image on the allowed inputs is . For , the dispersion is The notation leaves and implicit.
A bijection between two finite sets transports interpretations and assignments, preserving the number of outputs. Thus only matters. There are finitely many functions of each specified arity on , so the maximum exists. In particular, means that some interpretation on has at least distinct outputs.
For outputs and only the test , the output map is the identity on pairs and has outputs. Input and output counts can differ when other variables are present. For example, with variables , outputs and only the test , there are allowed inputs, but only different outputs: changing does not change the output.
Writing nested terms as acyclic equations. One may introduce a new variable for each distinct nonvariable subterm and an equation recording its computation. For example, the output can be written using and , with output . Every assignment to the original variables has a unique extension to the new ones. Replacing terms in outputs and tests by their names therefore preserves the output image. Equal subterms receive the same name, and every use of a symbol still has the same interpretation. These equations merely record evaluation; they add no further equality condition on the original variables. This rewriting is often called flattening.
Finite input descriptions. For the complexity statements, names, arities, variables, output and test lists, and ordered argument lists are explicitly encoded in binary. Integers have canonical self-delimiting encodings, and every list includes its length and all entries. Let be the bit length of this description. Terms may be represented by syntax trees or by an acyclic graph listed in topological order, with arguments referring to earlier nodes. In the latter representation, different nodes can still represent the same expression. We identify them by syntax, processing child terms first, without expanding the graph into a potentially exponential tree. Validation and this identification take polynomial time in either representation.
The algorithm rejects invalid references, wrong argument counts, noncanonical integer encodings and trailing data. A declared list length or arity does not justify a long search for absent entries: a parser stops and rejects when the supplied data end. Thus validation is polynomial in the actual input length even for malformed descriptions. For the uniform problem, is a separate binary integer and inputs with are rejected.
3. Image bounds from cuts in the term graph
Let contain all distinct subterms of the outputs and tests, together with every declared variable, and put . On , draw an edge from each immediate argument to its parent term. Vertices represent expressions, not separate occurrences of those expressions. Let be the minimum size of a set meeting all directed paths from variables to outputs, including paths of length zero. Repeated output terms designate the same vertex.
Terms occurring only in tests do not change : all ancestors of an output already occur among its subterms. Constant symbols have no incoming edges and start no path from a variable. Unused variables and terms occurring only in tests can enlarge without increasing . For example, the outputs have , since the last two terms share . The cut has size three; the paths consisting of alone, alone, and the edge from to show that no smaller cut is possible.
Theorem 3.1. The term-cut bounds with disequalities. If a test in has syntactically identical sides, then for every . Otherwise, for every , For each fixed instance without such a test, One can check for identical sides and compute in polynomial time in the explicit input length.
Proof. A test cannot be satisfied. For the upper bound, fix an interpretation and a cut . The values of its terms determine every output value. Indeed, evaluate an output recursively, stopping whenever a vertex of is reached and using its given value. Any other leaf must be a constant: reaching a variable without meeting would give a path missed by the cut. Consequently two assignments with the same values at have the same output tuple. There are at most possible tuples of values at , and restricting the allowed inputs cannot increase this bound. Take a minimum cut.
For the lower bound, Menger's theorem gives vertex-disjoint paths from variables to outputs. Choose a set of size and use the finite set . An element has a label and a value . We construct the functions so that every subterm evaluates with its own label and the values at the chosen path starts are copied along their paths.
For a symbol of arity , consider arguments . If belongs to , let the result have label . If a chosen path enters through , set its value to ; otherwise use a fixed element of . Vertex-disjointness makes the chosen predecessor unique. If the predecessor term occurs in several argument positions, select any one of those positions. On the assignments used below they have equal values. For a constant symbol belonging to , use the same default value and its own label. All remaining function values may be chosen arbitrarily. These instructions define one function for each symbol: the symbol and the ordered input labels determine the term , so different subterms cannot impose conflicting instructions.
Give each source variable its own label. Allow the values at the path starts to vary independently in , and fix all other source values. Induction on terms shows that each subterm has its own label. Every test with different sides is therefore satisfied. Along each selected path its starting value is copied to the output, giving distinct output tuples. Hence . For a larger set, extend each function arbitrarily while preserving its values on . Taking proves the lower bound for every .
For , , giving the growth and logarithmic limits, also when . To compute the cut, split each vertex into an entrance and exit joined by an edge of capacity one. Replace each original edge by an edge from the corresponding exit to entrance, of capacity . Attach a new source to all variable entrances and all output exits to a new sink, again with capacity . Cutting all unit edges costs , so a minimum cut uses only unit edges. Integral max-flow/min-cut gives both and the vertex-disjoint paths in polynomial time. This is the directed vertex form of Menger's theorem [2].□
Proposition 3.2. The sharper bound when are outputs. For every and , For every the bound is sharp: the tuple of distinct variables, with only the test on its first two coordinates, has and .
Proof. Every cut contains because of their paths of length zero. For a fixed interpretation, the values at determine the output tuple, as in Theorem 3.1. On allowed inputs the values at differ, so there are at most possible tuples of values at the cut. Choose a minimum cut and maximise over interpretations. In the stated example, every allowed input is a different output, and every one of the variables is an output. Thus the cut has size and the image has size .□
Corollary 3.3. Thresholds for all sufficiently large sets. Fix an integer and a function such that for all sufficiently large , and . Given an instance, one can decide in polynomial time whether for all sufficiently large . The answer is yes exactly when no test has syntactically identical sides and .
Proof. An identical-side test makes every image empty. Otherwise the lower bound is at least a positive constant, depending on the instance, times for all sufficiently large . If , this eventually exceeds . If , the upper bound gives the converse.□
How the labels handle repeated symbols. For terms and using the same binary symbol, the ordered input labels are and . They are different, so one function can give each result its required label. Two occurrences of the same term instead use the same rule. For , either argument position can be used to copy the value of . The rules depend on terms, never on occurrences independently.
This is the routing method of Riis and Gadouleau [6], with the additional observation that the labels satisfy all disequalities at once. For example, , , and hold simultaneously when are distinct terms and each receives its own label. Small finite sets can still be too small for the tests. The theorem controls growth as increases; it does not decide whether the sharp upper bound is ever reached at a finite size.
4. Forcing identities from all distinct pairs
Lemma 4.1. An inequality characterises the identity function. For any set and function ,
Proof. If , take to contradict the stated condition. Conversely, if , the condition is just .□
For functions , define the set of allowed pairs When are the only variables and are also the outputs, this set is itself the output image. Its size is at most for . The next proposition characterises equality, called saturation above.
Proposition 4.2. Equality with the pair bound. If , then
Proof. The set is contained in the set of all pairs with different coordinates. Equality of their sizes means that every such pair is allowed. Lemma 4.1 then gives for each . For any , choose ; the test on gives . Conversely, these identities and the absence of fixed points make every pair with different coordinates satisfy every test.□
We can also count exactly how many pairs are excluded. For each , put , and put . If , no pair with first coordinate is allowed. Otherwise the allowed second coordinates are precisely . Hence If has no fixed point, then is empty and , so The lower bound is an ordinary integer inequality and remains valid when is negative.
Example 4.3. A failed identity can exclude just one pair. Take , outputs , and tests , . If , , and , exactly five of the six pairs with different coordinates are allowed: only is excluded. Admitting all six pairs requires as well. If we also require , all six can never be admitted. More generally, on any -element set with , these three tests have maximum output image size . A point moved by allows second coordinates, while a fixed point allows none. A cyclic permutation of all elements attains . Thus the proportion tends to one, although the image always falls short of by at least .
5. Reduction from a fixed finitely presented group
The external undecidability theorem. A finite quotient of a group means a finite group together with a surjective homomorphism . A word is separated in such a quotient if its image is not the identity. Bridson and Wilton [1, Theorem 2.1], deriving a consequence of Slobodskoi's construction [7], prove that there is a fixed finitely presented group for which the set is recursively enumerable and undecidable. Thus an algorithm can eventually find a separating finite quotient whenever one exists, but no algorithm decides for every input word whether one exists. The presentation is fixed; the input consists only of the word. We first describe our reduction for an arbitrary finite presentation.
Fix For each generator introduce two unary symbols . The notation suggests a generator and its inverse, but their interpretations are initially independent functions. For a signed word , whose letters belong to , define where , , and is the empty word. Let be the list of terms We call these the law terms, since requiring each to equal would impose inverse and relator identities. Repetitions are retained; an empty relator contributes the term . Our convention for multiplying permutations is composition with the rightmost function applied first, agreeing with the displayed nesting.
Given the input word , construct an instance with just the variables , output tuple , and tests Here denotes the law term , with its indicated variable . Write for this instance's dispersion. For each interpretation its output image is above, where interpret the law terms and interprets .
Theorem 5.1. The reduction. For every finite presentation and signed word , The construction has linear output length in the explicit presentation and word lengths, and is computable in polynomial time.
Proof. Suppose , and choose an interpretation attaining this maximum on a set of size . Write also for its unary functions. Proposition 4.2 gives , so the are permutations and . It also gives for every relator. The universal property of the presentation therefore gives a homomorphism . The interpreted has no fixed point, hence is not the identity. The finite group , with the surjection , is the required quotient. The identities hold at every point of , as required to define this homomorphism.
Conversely, suppose is a finite quotient with . On , interpret as left multiplication by and as left multiplication by its inverse. Each law term is the identity function. The term acts by left multiplication by , which has no fixed point: would imply . Proposition 4.2 gives , and . The construction of the instance only lists the inverse-law terms, copies the relators, and writes the nested term for , giving the stated size and time bounds.□
Theorem 5.2. Undecidability with fixed unary symbols and tests. There is a fixed finite presentation such that, given a signed word , deciding whether for some is undecidable. The associated instances use a fixed finite unary signature, a fixed number of tests, and just two variables and two outputs. Their positive instances are recursively enumerable but not decidable, and their complement is not recursively enumerable.
Proof. Fix the presentation provided by the external theorem above and apply Theorem 5.1. Only varies with the input. For enumerability, try in order, and for each enumerate all interpretations on . There are finitely many at each size, and each output image is computable by finite enumeration. This procedure finds an image of size whenever one exists. If the negative instances also had such a semidecision procedure, running both procedures in parallel would decide every instance, contradicting the reduction.□
Bridson–Wilton state their theorem for freely reduced words, meaning words with no adjacent inverse pair or . Such a word is already a valid signed input word here. Conversely, removing adjacent inverse pairs is computable and preserves evaluation in every group, hence preserves separation in finite quotients. The reduction theorem therefore gives the same exact decision problem for arbitrary signed words. This does not license cancellation in the terms under arbitrary interpretations: and need not be inverse functions. Cancellation preserves their evaluation only after the required inverse laws hold, as they do when the pair bound is attained.
The empty word yields the impossible test and is a decidable negative case. Restricting to nonempty freely reduced words consequently leaves the problem undecidable. Recursively enumerable completeness is not asserted; it does not follow from enumerability and undecidability alone.
6. Proof of the one-unit theorem
Proof of Theorem 1.1. Fix . Start with the instance associated to in Theorem 5.1. Add new variables as further output coordinates, with no tests involving them. This operation is called padding. For each interpretation the new image is exactly the Cartesian product of the old pair image with : the new variables can be chosen independently of every test and of the old outputs. Maximising over the same interpretations therefore gives where the superscript denotes the padded instance. All variables are outputs, so every cut contains them and they also form a cut. Thus . Since , for the inequality holds exactly when . For fixed , adding the variables and outputs takes constant extra space; the signature and tests are unchanged. Theorem 5.2 proves the claimed undecidability.
For the strict problem, a test with identical sides makes the answer no. Otherwise compute . If , then Proposition 3.2 gives, for every , so again the answer is no. If , Theorem 3.1 gives For the last expression is Here because are distinct, so . This proves the criterion and the explicit sufficient size. Checking syntax and computing a minimum vertex cut are polynomial-time operations, as detailed below. Comparing with the binary integer is polynomial too. The decision algorithm need not construct or any interpreting functions.
Finally, suppose a total computable bound as in the theorem existed for some fixed . On an input from the padded family, compute its bit length and enumerate . For each size enumerate all interpretations and all assignments, form the set of distinct outputs satisfying the tests, and compare its size with . The search is finite and, by the assumed bound, would answer yes exactly on the positive instances. This would decide the undecidable problem. The contradiction needs no time bound on this exhaustive search.□
The polynomial-time algorithm. First validate the input as described in Section 2. Process terms in topological order. Assign an identifier to each source and identify compound terms by the record of their symbol and ordered child identifiers. Equal records receive the same identifier. Thus syntactically equal expressions are identified even when the input supplied different node names for them. Reject any test whose two resulting identifiers agree. Build the term graph on these identifiers, compute its minimum cut by the network in Theorem 3.1, and answer yes exactly when .
For a term description of bits, at most nodes and argument entries are supplied. Pairwise comparison of the records can be done in bit operations. The split network has vertices and edges and integer capacities at most . An augmenting-path flow algorithm needs at most augmentations, since each increases the integer flow by at least one, while the cut of all unit edges bounds it by . Path searches and updates involve only polynomially many entries. Indices, capacities and flow values have bits, so even sequential scans for lookups give polynomial bit cost. Together with validation and the binary comparison with , this proves the uniform polynomial-time bound. No loop of length is needed when is large.
Which degree can give an undecidable question. For an instance in without an identical-side test, . If , the strict threshold is exceeded for all sufficiently large . If , the sharp upper bound is smaller than for every , so even the non-strict answer is no. When , the non-strict question asks whether the upper bound is attained for some ; this is the subclass on which the reduction proves undecidability. It also follows that the existential strict question is equivalent to requiring for all sufficiently large , and to requiring for all sufficiently large . These are consequences; both questions in Theorem 1.1 itself use the existential quantifier.
Three outputs. For outputs in , first reject a test with identical sides. Then if contains no variable other than , including when it contains no variables at all. If another variable occurs in , a path from it to cannot pass through or , since variable vertices have no incoming edges. Together with the paths of length zero at , this gives three disjoint paths. The three outputs form a cut, so . For , the strict algorithm thus only has to check whether contains another variable. In the positive case is a sufficient size and . The lower bound is for , hence at least for .
Requiring to be outputs is essential to this criterion. For example, with four distinct variables , outputs , and only the test , every pair is an output for . Thus although the cut size is two. This instance lies outside : the two variables constrained to differ are not output coordinates.
7. Functions approaching the pair bound
Theorem 7.1. An explicit approximation to the pair bound. Fix a finite presentation and its law terms. For every nonempty signed word of length and every integer , An interpretation giving the lower bound is explicitly computable and uses only cyclic shifts. In particular, for each such word, The constant in the error bound depends only on the presentation, while the condition also depends on the word.
Proof. On , interpret every and every as . A word of length as written then acts by , regardless of the signs of its letters. Because , the function interpreting has no fixed point. For each first coordinate , the tests exclude at most second coordinates: itself and the law values. The lower bound follows from (3). Dividing by gives a proportion between and , proving the limit and the error estimate. The inequality is valid even if its lower bound is nonpositive.
The formal inverse symbols receive the same shift as the positive symbols. This is permitted because an interpretation consists of arbitrary functions. Inverse laws are forced only when every pair with different coordinates is admitted.□
For this interpretation the exact count is Each inverse-law term is here regarded as its two-letter word, and always counts the letters without cancellation. Distinct nonzero residues give distinct additional forbidden second coordinates for each first coordinate; the zero residue forbids nothing beyond .
Given a nonempty word and a positive rational , choose, for example, This integer satisfies and . Return and the unary functions . Under this interpretation the instance has at least distinct output pairs. The functions have finite explicit tables; writing those tables takes time polynomial in and the input length, with measured by its value rather than its binary length. Here density refers exactly to the ratio of the image size to .
This gives more information than the quadratic growth exponent: for any prescribed rational error an algorithm produces functions with the required proportion of outputs. Nonetheless it cannot decide whether some interpretation admits all pairs. A nonzero loss of at most pairs becomes arbitrarily small after division by , while zero loss imposes every group identity on all of . The approximate interpretations are not required to be group actions.
The distinction between an empty word and a word representing the identity matters. The empty word gives and zero dispersion. A nonempty word can represent the identity in , or even cancel freely to the empty word, while retaining positive length as an input expression. Its shift interpretation still gives the bound above. There is no conflict with the reduction theorem: cancellation preserves group evaluation, but need not preserve evaluation by these arbitrary unary functions. For such an identity word, the exact answer is no even though the proportions tend to one.
For the padded instances of degree , the exact product identity gives, for , The lower bound again uses ordinary integer subtraction. For every the ratio equals the original pair ratio. Thus the same algorithm gives a proportion at least of by adding the independent output variables, although deciding whether is attained at any size remains undecidable.
8. Scope and the problem without tests
The decision problems use one finite set for all variables and function values. For each fixed , undecidability already holds with variables, all retained as outputs, a fixed finite unary signature and a fixed number of tests. Only the nested expression for the input word varies. The tests compare computed expressions as well as variables. Writing a computed term as a new variable with a defining equation does not make it an independent source variable: its value is determined by the original inputs. The reduction therefore proves no undecidability result for the narrower language in which tests may compare only source variables.
The open bijectivity problem. Without disequality tests, finite square term bijectivity asks the following: given terms in variables, does some interpretation on a finite set , with , make the resulting map bijective? This problem remains open in general. The analysis of ordinary dispersion in [5] identifies an image of size for such a map with bijectivity, and gives padding reductions from the case to the problem of attaining the full output set at every fixed output dimension at least three. Those reductions do not prove undecidability and are not used here. An unconditional polynomial-time/undecidable separation for dispersion without disequality tests remains open. The present bounds also concern a different quantity from the number of solutions of an arbitrary equation system or the entropy and guessing number of a graph; they do not imply that those quantities are integer-valued or efficiently computable.
Machine verification. The development, archived release and interactive paper are available at:
GitHub:
https://github.com/SR123/term-coding-disequality-lean
DOI: 10.5281/zenodo.22727895
Interactive paper:
https://sr123.github.io/term-coding-disequality-lean/
The accompanying Lean 4.26 development has 71 mathematical and
algorithmic modules. It checks the output-image definition, the sharp
cut bound when are outputs, finite directed Menger and max-flow
results, the routing construction, and the strict criterion for every
degree with its explicit sufficient size. It also checks the argument
forcing identities, the equivalence with finite-quotient separation,
the exact product under padding, finite search, enumerability, and the
absence of a computable bound on alphabet size, as well as the
approximation, asymptotic and flattening results.
The undecidability theorems assume explicitly the fixed-presentation
finite-group noncomputability result. The classical theorem of
Slobodskoi in the form used by Bridson–Wilton is an external input,
not a theorem formalised in this project. The axiom audits use only
the standard axioms of Lean's classical foundations, with no admissions.
The build and audit records accompany the source.
https://github.com/SR123/term-coding-disequality-lean
DOI: 10.5281/zenodo.22727895
Interactive paper:
https://sr123.github.io/term-coding-disequality-lean/
For the strict decision algorithm, the development proves correctness
of parsing, rejection of malformed bit strings, and the decision by
max-flow. It also certifies one fixed deterministic random-access
machine program under a logarithmic cost criterion. For every input
bit string , including malformed inputs, this program halts with
the specified decision result. Fixed constants and bound
both its number of instructions executed and its total logarithmic
cost by . The binary degree is part of the input; the
program does not loop to its value. The main formal statements are
program_polynomial and program_accepts_iff
in MMain.lean. The standard polynomial simulation from
this RAM model to a multitape Turing machine is not formalised here.
The ordinary bit-complexity argument appears in
Section 6.
The interactive edition links the text of this paper to explanations, exact formal statements and proofs, including the hypotheses used at each stage. The reader can inspect Lean's recorded proof states and follow formal dependencies into library proofs and the underlying logical rules. External mathematical input and the limits of machine verification are identified explicitly. This correspondence helps a reader check that the formal statements express the claims made in the paper; kernel checking of a Lean proof alone does not establish that correspondence.
References
- Martin R. Bridson and Henry Wilton. The triviality problem for profinite completions. Inventiones Mathematicae, 202:839–874, 2015. arXiv:1401.2273; Theorem 2.1.
- Karl Menger. Zur allgemeinen kurventheorie. Fundamenta Mathematicae, 10:96–115, 1927.
- Søren Riis. Term coding for extremal combinatorics: Dispersion and complexity dichotomies. arXiv:2504.16265v3, 2025. Earlier omnibus; its square-bijectivity undecidability claim is withdrawn in the present replacement.
- Søren Riis. Term coding: An entropic framework for extremal combinatorics and the guessing–number sandwich theorem. arXiv:2601.16614v2, 2026. Revised 30 August 2026.
- Søren Riis. Term coding and dispersion: Exact and asymptotic decision problems. arXiv:2602.08110v2, 2026. Revised 1 September 2026.
- Søren Riis and Maximilien Gadouleau. Max-flow min-cut theorems on dispersion and entropy measures for communication networks. Information and Computation, 267:49–73, 2019. Preprint: arXiv:1012.5224.
- A. M. Slobodskoi. Undecidability of the universal theory of finite groups. Algebra i Logika, 20(2):207–230, 1981. In Russian; English translation in Algebra and Logic 20 (1981), 139–156.