JCA Round 23: Two rigid equations fit in two ordinary branches
Theorem. Simultaneous rigid \(E\)-unification with two rigid equations polynomial-time many-one reduces to ordinary equational JCA with exactly two branches. Both rigid hypotheses may contain variables. The JCA target can use a fixed signature with one binary constructor, one unary constructor and one constant. It needs two conclusion equalities per branch and no quantifier-prefix condition.
A rigid constraint here is \(E_i\vdash s_i=t_i\). Its solution is a ground substitution \(d\) such that \(s_i(d)\) and \(t_i(d)\) are equal in the least congruence generated by \(E_i(d)\). The same \(d\) must solve both constraints. All terms are finite, with a nonempty single-sorted ground domain. Round 24 uses this construction to prove the ordinary two-branch lower bound by checking two chains of constraints. Two-chain reduction Veanes proves undecidability for four rigid constraints with ground hypotheses and reports a three-constraint refinement. Levy and Veanes identify the two-constraint case as a separate question. Their undecidability result for two directed reachability constraints does not establish it for congruences. Veanes, §3.4 · Levy and Veanes, On the Undecidability of Second-Order Unification
Two proofs in opposite rows
Call the two JCA branches rows 1 and 2. For each source constraint \(i\) introduce public proof coordinates \(Y_i,Z_i\). Both rows evaluate both proofs. Row \(i\) checks the endpoints of proof \(i\). The other row checks equality of its two lists. The public source-data coordinates \(X\) are shared. The only other coordinates are pairs of slots used to write the proof lists.
First use distinct fresh ranked symbols. Let \(W\) be unary, \(N\) a constant, and \(C\) binary. Wrap every source node by setting \(e(x)=W(x)\) for a variable and \(e(g(\vec u))=W(g(e(\vec u)))\) for a constructor. For each hypothesis \(l_j=r_j\) in \(E_i\), introduce a private midpoint \(K_{ij}(X)\). Make two edges, followed by one additional edge per proof for the end of its list.
| Edge | First endpoint | Second endpoint |
|---|---|---|
| First half of hypothesis \(j\) | \(e(l_j)\) | \(K_{ij}(X)\) |
| Second half of hypothesis \(j\) | \(K_{ij}(X)\) | \(e(r_j)\) |
| List end | \(C(e(t_i),N)\) | \(N\) |
Give each edge \(b\) its own marker symbol \(M_{ib}\) of arity \(|X|+2\). For each of its two endpoints allocate a public slot. In row \(i\) the premise equates that slot to its endpoint. In the other row it equates both slots of this edge to the same term
\[M_{ib}(X,Y_{3-i},Z_{3-i}).\]
In particular it contains the complete data and the two proof coordinates being checked in that other row. The row-\(i\) conclusion is
\[Y_i=C(e(s_i),Z_i)\qquad\land\qquad Y_{3-i}=Z_{3-i}.\]
These are all the premises and conclusions. The construction uses \(|X|+4+4(|E_1|+|E_2|)+4\) public coordinates. Repeating the data tuple in the markers and midpoints has polynomial size.
Building an answer from two conversions
Fix a common source solution \(d\). Assign each data coordinate the tree just inside the outer \(W\) of \(e(d_x)\). Substitution in \(e(u)\) now yields \(e(u(d))\). Use distinct bare parameters for every slot.
For proof \(i\), write a source conversion from \(s_i(d)\) to \(t_i(d)\) as successive applications of ground equations in either direction in a constructor context. Encode each application and split it at its midpoint. At every resulting half-step the old and new encoded trees have a common context. Plug the slot for the old endpoint into that context to obtain a head \(H\), and the slot for the new endpoint to obtain a head \(J\). In the checking row they evaluate to consecutive path values. In the other row they evaluate to identical trees, since the two slots receive the same marker. This works for reverse steps by exchanging the two slots.
Use the heads \(H\) in order for \(Y_i\) and the heads \(J\) for \(Z_i\), using \(C\) as list constructor. End \(Y_i\) with the first list-end slot and \(Z_i\) with the second. In the checking row the first list begins one place earlier and its end supplies the final value. In the other row the two lists agree throughout. An empty conversion uses the two list-end slots alone.
Each proof uses only its own slots. To construct a row witness, supply the checking proof’s endpoints first. Evaluate its two lists, then supply the other slots with markers containing those two values. This order also proves relevance for every premise witness. The answer passes both rows.
Reading the two congruences
The common tuple \(d'\) can contain markers, list constructors or midpoints. Define a single projection \(\pi\) of all target trees to source trees. It preserves source constructors, removes \(W\), maps \(N\) to a fixed source constant and maps \(C(u,v)\) to \(\pi(v)\). At a midpoint or either half-edge marker of hypothesis \(l_j=r_j\), return \(l_j\) evaluated on the projected data children of that node. At a list-end marker return the chosen constant. This is structural recursion on arbitrary trees, even if a marker occurs inside a data value. Use \(d=\pi(d')\) componentwise. The projection gives \(\pi(e(u)[d'])=u(d)\).
For each \(i\) let \(Q_i\) be the source ground algebra modulo \(E_i(d)\), and \(q\) the class of \(t_i(d)\). Interpret target trees in \(Q_i\times\mathbb N\). Their first coordinate is the class of \(\pi\). Give every source constructor, \(W\), \(N\), midpoint and marker second coordinate zero. Interpret the list constructor by
\[C((u,m),(v,n))=(v,n+\mathbf 1_{u\ne q}).\]
Both values of every slot of proof \(i\) now have the same interpretation in its two rows. For a hypothesis, its two projected endpoints and their common marker represent the class of \(l_j(d)=r_j(d)\) with count zero. For a list-end slot, prepending the target contributes zero. The \(W\) reset ensures count zero even when a variable rule side was supplied with a target tree containing a list.
The two evaluations of each body \(Y_i,Z_i\) therefore agree in this algebra. Marker-row equality and checking-row equality imply that the interpretation of \(Z_i\) equals that of \(C(e(s_i),Z_i)\). The second coordinates force the class of \(s_i(d)\) to equal \(q\). Apply the argument separately in both quotients with the same \(d\). This recovers both original rigid constraints. Earlier single-congruence counting argument
One binary and one unary constructor suffice
Use \(F/2,U/1,a/0\). Encode all the ranked symbols above by distinct tags \(t_0=F(a,a)\) and \(t_{j+1}=F(t_j,a)\). Put \(n=U(a)\) and \(b=F(a,n)\). Pack arguments and encode applications by
\[P()=n,\qquad P(u,\vec v)=F(F(b,u),P(\vec v)),\qquad A_j(\vec u)=F(t_j,P(\vec u)).\]
An ordinary application uses \(A_j\). A marker uses \(U(A_j)\). Variables stay raw. Both endpoints of a single checking edge now have outer root \(F\), but have different literal tags, so their values still differ for every data assignment. Checking and marker values have distinct roots \(F,U\), which forces bare slots. The proper-subtree argument still holds for every data and proof child of a marker. Distinct markers have different literal tags. The forward proof uses the encoded bodies and data.
To verify the converse for arbitrary binary/unary bodies, the following interpretation implements each algebra used above. Given any algebra \(B\) for the ranked symbols, use a tagged carrier with objects \(\mathrm{obj}(v)\), a unit, tag indices, lists of \(B\)-values, a boxing flag, boxes of \(B\)-values and pending marker values. Read an object by taking its value and any administrative state as a fixed default of \(B\). Interpret \(a\) as unit. The definitions of \(F,U\) are as follows.
- \(F(\mathrm{unit},\mathrm{unit})\) returns tag zero. \(F(\mathrm{tag}_j,\mathrm{unit})\) returns its successor.
- \(U(\mathrm{unit})\) returns the empty list and \(F(\mathrm{unit},[])\) the boxing flag.
- \(F(\mathrm{flag},v)\) boxes the reading of \(v\). \(F(\mathrm{box}(v),L)\) prepends \(v\) to list \(L\).
- \(F(\mathrm{tag}_j,L)\) applies the declared operation when its arity matches. It returns an object for ordinary symbols and a pending value for marker symbols. \(U\) converts a pending value to an object. Every other case returns the default object.
Thus a complete code returns exactly the object for applying its operation to the readings of its arguments, whatever raw trees occupied the slots. A homomorphism between two ranked algebras preserving the default extends to these carriers by acting on object, box, list and pending contents and retaining their state tags. Apply this first to the common projection algebra of source trees and then to each quotient. Independently use the counting algebra, whose first-coordinate map to its quotient preserves all operations and the default. The readings of arbitrary raw data give a common source substitution, and slot values that must compare equal are equal as full objects. Evaluation of arbitrary binary/unary proof bodies therefore preserves the counting argument.
The tags and lists are polynomial in the input size. Padding unused argument places with \(a\) gives the same bound for any fixed signature having a branching constructor and a second constructor of positive arity. The proof uses the second positive-arity root to separate the two rows.
Verification and what remains open
The executable compiler builds the two raw branches and explicit term-pattern certificates from conversions. An independent finite-tree unifier checks relevance and consistency. Tests cover variable hypotheses, a bare variable as a rule side, a rewrite below the root, reverse steps, empty paths, exchanged row roles, arbitrary-data projection and the fixed target signature.
The scope payload has an observable effect. Give the first constraint the hypothesis \(a=b\) and the tautological goal \(a=a\), and give the second no hypotheses and goal \(a=b\). The source has no solution. With constant markers an explicit second proof can borrow the first proof’s slots and pass both rows. The compiler verifies that same false positive, then verifies its rejection with the payload restored.
Lean checks the strict-subtree scope lemma, the shifted-list counting inference and compatibility of a common term evaluation with two algebra homomorphisms. The complete compiler equivalence and the tag representation are the proofs above. The reduction is in one direction. The two-chain extension in Round 24 settles the JCA question independently of the status of two-constraint SREU. Smallest branching signature
python3 projects/jca/agent-collab/round-23-two-rigid.py
lean projects/jca/agent-collab/round-23-model.lean