Can a safe cyclic value at a fixed ground type lack a polyhedral proof?

It is undecidable whether a cyclic constructor value admits a rational polyhedral recursive typing at one prescribed ground type, even when every finite walk from that type satisfies the constructor guard. Eight numeric indices, homogeneous linear field maps, one constructor, one heap node and one linear guard suffice. Every positive instance has one conjunctive rational polyhedral scheme. On a negative instance even a finite union of polyhedra fails. The ground tuple is the same in every instance. The undecidability concerns the existence of a finite proof in the index language. The proof below also gives a decidable three-index example in which provable ground calls exhaust an infinite increasing sequence of schemes. Runnable positive instance · Exact arithmetic and compiler replay

Monniaux also proves undecidability of polyhedral invariant existence for linear programmes over the rationals or integers, using counter machines with control locations and guarded piecewise-affine transitions. The constructor instance below has unconditional homogeneous field maps. Fijalkow et al.’s tile construction supplies the convergence to zero needed to distinguish its ground typings. Monniaux, September 2026 preprint · Fijalkow et al., JACM 2025

The fixed caller

Start with the three-dimensional rational tile matrices \(A_i\) from the infinite Post correspondence reduction of Fijalkow et al. Let \(x=(0,1,1)^T\), let \(Q\) range over symmetric three-by-three matrices, and put \(B_i Q=A_i Q A_i^T\). Writing the six independent entries of \(Q\) as indices makes each \(B_i\) a linear map on those indices. Write \(T(Q)\) for the trace and \(e=(1,0)\). Add two indices \(p\) for a point of the plane. Use the rational rotation \[ R=\tfrac15\begin{pmatrix}3&-4\\4&3\end{pmatrix}. \] There is one recursive field per tile, and one extra field for a spin. The declared guard is \(p_x\le1+T(Q)\). Tile construction, Lemmas 4.1–4.3 · Six-index construction · Aperiodicity of this rotation

Field Child indices
Tile \(i\) \((B_iQ,p)\)
Spin \((2Q,Rp)\)

Use let rec knot = Fork (knot,…,knot) and demand \(\mathrm{Fixed}(xx^T,e)\). In scalar coordinates the caller always asks for \((0,0,0,1,1,1,1,0)\). A walk with \(k\) spins and tile subsequence \(w\) reaches \((2^k zz^T,R^k e)\), where \(z=A_w x\). This follows by induction. A tile acts on \(z\), while a spin doubles the matrix and rotates the point. Hence \(T(Q)=2^k\lVert z\rVert^2\ge0\) and \(p_x\le1\). Every finite walk is safe for every tile instance, including every instance without a polyhedral typing. The replay compares the two formulas for all 1,458 words of length six in two concrete programmes. Word replay

Why an infinite match excludes every polyhedral typing

An infinite word match has prefixes \(w\) with \(A_w x\to0\). Follow tiles only. The start belongs to the scheme and recursive closure puts \((zz^T,e)\) in it for each prefix. Its real closure therefore contains \((0,e)\). Continuous field maps preserve the closure, and the guard is closed. The same argument applies to schemes on rational indices by taking the real closures of their nonempty rational polyhedral cells.

Intersect the closure with \(Q=0\). On this section the spin is an ordinary rotation and the guard is \(p_x\le1\). The positive powers of \(R\) are dense. Consequently the section is contained in the closed unit disk. Since it contains \(e\), it contains the whole unit circle. The convex hull of the section is exactly the disk. But for a finite union of polyhedra the bounded section is a finite union of compact polytopes. Its convex hull is a polytope. This contradiction excludes every such scheme at the fixed caller. The limit point itself has a safe infinite unfolding. Disk obstruction and Lean aperiodicity proof

A single polyhedron when no infinite match exists

In this case the symmetric-product construction gives a rational polyhedral cone \(K\) in coordinates \((Q,h)\) and a rational \(\delta>0\) such that \((xx^T,1)\in K\), \((Q,h)\mapsto(B_iQ,h)\) preserves \(K\), and \(T(Q)\ge\delta h\) on \(K\). The construction uses the finitely many short word prefixes and the two separately invariant sign regions of the tile system. Since \(K\) is a cone, \((2Q,2h)\) belongs to it whenever \((Q,h)\) does. The auxiliary coordinate \(h\) is a witness in this proof. The programme’s caller has eight fixed indices. Construction of \(K\)

Take \(N\) with \(2^N\delta\ge1\). Form the following finite collection of rational polyhedra, projecting away \(h\) in each case.

  • For \(0\le k<N\), take the states with \(p=R^k e\) and \((Q,h)\in K\) for some \(h\ge2^k\).
  • For the remaining spins, take the states with \((Q,h)\in K\), \(h\ge1\), and \(\lVert p\rVert_\infty\le\delta h\).

The start is in the first region or, if \(N=0\), in the last. Each tile preserves its region with the same \(h\). A spin doubles \(h\) and advances the prefix. At spin \(N\) the last region admits the point because \(\lVert R^N e\rVert_\infty\le1\). That region is itself stable since \(\lVert Rp\rVert_\infty\le(7/5)\lVert p\rVert_\infty\le2\delta h\). Each region satisfies the guard. The closed convex hull of finitely many rational polyhedra is a rational polyhedron. Every field maps the union into itself. Linearity and continuity preserve its closed convex hull, and the closed half-space defining the guard contains that hull. It gives the required single recursive scheme.

As in the preceding reduction, a computable bound on the number of public facets would decide the problem by real quantifier elimination. With a proposed bound, quantify the half-space coefficients, require the fixed tuple to lie in the polyhedron, and check the guard and all field maps universally. Positive instances have rational witnesses. Negative instances exclude real polyhedral witnesses as well. Arbitrarily many private rational coordinates cannot give a computable bound on the number of inequalities either. If an extended description has \(m\) rows \(Aq+Bz\le c\), its private variables affect the rows only through the column space of \(B\). A rational basis needs at most \(m\) columns. Quantifying at most \(m\) private coordinates therefore suffices to test a putative bound over the reals, with one fresh opening at each field. This argument now holds under the promise that every walk is safe and with no choice of scale by the caller. Facet-bound argument

Quadratic observations and their witnesses

There is a fixed-size nonlinear certificate for every instance. Require \(Q\) to be positive semidefinite and \(p_x^2+p_y^2\le1\). Congruence by \(A_i\) and doubling preserve positive semidefiniteness. Rotation preserves squared length. The trace of a positive semidefinite matrix is nonnegative, so these conditions prove the linear guard immediately. Seven principal-minor inequalities describe positive semidefiniteness in dimension three. These two properties give the refined-datatype programme a vocabulary that can type the entire family. Other synthesized observations

The reachable matrices even have rank at most one. Requiring all two-by-two minors to vanish, the trace to be nonnegative, and the disk inequality gives a certificate of degree at most two entirely in public coordinates. A real symmetric matrix of rank at most one has at most one nonzero eigenvalue, equal to its trace. The matrix is therefore positive semidefinite. Congruence preserves both properties. Thus degree two is sharp for a polynomial observation language on this family. A finite Boolean combination of linear rational constraints, even with private rational linear witnesses, still projects to a finite union of polyhedral cells. Closing those cells gives exactly the obstruction in the negative case.

The same public matrix relation has an exact rational description with one hidden vector \(u\) and one scalar \(s\). Require \(s\ge1\) and \(sQ=uu^T\). For a nonzero rational matrix in the relation, choose a positive diagonal entry \(d=Q_{ii}\) and let \(u\) be column \(i\). Vanishing minors give \(dQ=uu^T\). If \(d<1\), multiplying \(u\) by \(1/d\) and \(d\) by \((1/d)^2\) puts the scale above one. Zero has witnesses \((0,1)\). The caller starts with \((x,1)\). A tile carries \((A_i u,s)\), and a spin carries \((2u,2s)\). These are affine rational witness terms. More generally a field \(Q'=\lambda A Q A^T\) with \(\lambda>0\) can choose \((aAu,(a^2/\lambda)s)\) for any fixed rational \(a\) with \(a^2\ge\lambda\). A zero multiplier chooses \((0,1)\). This describes which hidden data a refined datatype could expose and how each occurrence could instantiate it. Exact field replay

A second quadratic description permits matrices of rank two. At each opening expose two private three-vectors \(u,v\) with \(Q=uu^T+vv^T\), and require \(p_x^2+p_y^2\le1\). The caller chooses \((u,v)=(x,0)\). A tile chooses \((A_i u,A_i v)\). A spin chooses \((u+v,u-v)\) since the two cross terms cancel in each matrix entry. Thus six quadratic equations and one disk inequality cover the whole family. The trace is a sum of rational squares. Even the doubling step uses rational witnesses at every opening. Both descriptions expose a fixed number of private coordinates independently of the tile instance. Witness identities · Exact field replay

When recursive schemes can be joined

There is a general reason why one convex scheme suffices on the positive instances. Take a fixed finite constructor graph and a finite family of sound rational polyhedral typings. At each node take the closed convex hull of the corresponding polyhedra. With affine field maps and a closed convex polyhedral local relation, the resulting family is again a sound typing. This gives a common generalization for any finite list of answers in this setting.

The argument also handles a private numeric witness shared by several fields. Write the local obligation as \[ \forall x\in P_v\;\exists z.\; C_v(x,z)\ \land\ \bigwedge_{e:v\to w} f_e(x,z)\in P_w . \] Let \(H_w\) be the proposed hull at each child. The set of parents that can satisfy this obligation with the new children is the projection onto \(x\) of a single closed rational polyhedron in \((x,z)\). The projection is itself closed and convex and contains each original parent polyhedron. It therefore contains their closed convex hull \(H_v\). At a rational parent there is a rational witness, and it satisfies the tests at all siblings. This proof covers unbounded regions, including limiting points where an argument based on converging witness sequences would need a separate justification. A designated parameter visible before selecting \(z\) can be included in \(x\) and copied unchanged through each relevant field. Witness scope in Theorem 4.5R

A projected witness need only exist at each opening in this semantic rule. There is a stronger construction when the two original answers carry affine witness terms and the new scheme keeps its decomposition. Use the Balas formulation of the closed hull. Write \(x=y_0+y_1\), with \(y_0\) in the first polyhedron scaled by \(\theta\) and \(y_1\) in the second scaled by \(1-\theta\), for \(0\le\theta\le1\). Homogenize each affine constraint and interpret a zero weight by its recession cone. If the two witness terms are \(L_i x+b_i\), choose \(z=L_0y_0+\theta b_0+L_1y_1+(1-\theta)b_1\). This is one affine term in the extended opening. Each sibling receives the same \(z\). For a child map \(Ax+Dz+c\), carry the two pieces \(Ay_i+D(L_i y_i+\theta_i b_i)+\theta_i c\) with their original weights \(\theta_i\). The local inequalities and the child decompositions follow by adding the two homogenized derivations, also at weight zero for nonempty cells. Thus the extended scheme can retain a uniform affine policy even when projection onto public coordinates would lose its syntax. Balas formulation · Witness-order conventions · Formal closure argument

Here is a case where the decomposition matters. On the unit square require \(0\le z\), \(x+y-1\le z\), \(z\le x\) and \(z\le y\). At \(y=0\) take \(z=0\), and at \(y=1\) take \(z=x\). The joined square forces \(z=0\) at three corners and \(z=1\) at \((1,1)\), so there is no affine witness in the public coordinates. In the extended opening write \(y=\theta\), \(x=u+v\), with \(0\le u\le1-\theta\) and \(0\le v\le\theta\). All four inequalities hold with the single affine witness \(z=v\). Lean proofs for both descriptions

The order of choices matters. If one witness must be chosen before the parent index, the obligation \(\exists z\;\forall x\in P.\ z=x\) admits either singleton \(\{0\}\) or \(\{1\}\). It fails on their hull. The Horn clause \(P(x)\land P(y)\Rightarrow x=y\) gives the same obstruction with two independently admitted parents.

For independent premises there is an exact compatibility test. Suppose the clause reads several parent indices \(x_j\) independently. At position \(j\) answer \(a\) admits \(P_j^a\), and the proposed join admits \(H_j=\overline{\mathrm{conv}}\bigcup_a P_j^a\). Let \(K\) be the closed convex set of parent tuples that can discharge the clause with one common witness and the joined children. The join works if and only if \(\prod_j P_j^{a_j}\subseteq K\) for every choice of answers \((a_1,\ldots,a_m)\). Each containment is a rational polyhedral check. The original derivations cover the choices where all the answers agree. The other choices state exactly what remains to check.

Indeed the product of the \(H_j\) is the closed convex hull of all the displayed products. Before taking closures, express each coordinate as a convex combination and multiply their weights. This gives a convex combination of tuples with the specified coordinate marginals. Taking coordinatewise limits proves the identity for unbounded sets as well. For the equality example, the mixed tuple \((0,1)\) immediately refutes the join.

A guard coupling the parent choices can create new premises after taking the hull. For instance, \(P(x)\land x=0\Rightarrow\bot\) holds separately at the singletons \(-1\) and \(1\) and fails on their hull. With a rational polyhedral coupling \(G\), test \((\prod_j H_j)\cap G\subseteq K\) directly. The same test handles equality of designated parameters across openings. The predecessor projects the shared witness only after imposing all the sibling constraints. These tests settle compatibility for a proposed join with these affine, closed polyhedral obligations. The unrestricted clauses in Theorem 4.5R may have other witness scopes. Theorem 4.5R

The three-index value inside the proof

Consider the independent binding let rec probe = Spin probe with indices \((p,t)\), child \((Rp,2t)\) and guard \(p_x\le1+t\). On this value alone, the ground question has an exact decision procedure.

For a scheme at depth \(N\), require \(t\ge0\), the first \(N\) guards, and \(\lVert R^N p\rVert_\infty\le2^N t\). These are closed rational linear inequalities. Each such scheme is inductive, and the schemes increase with depth because the final cone is stable.

Every sound finite polyhedral typing for this value is contained in one of these schemes. Take the closure and examine the finitely many generators of its nonempty convex cells. No point has negative \(t\). The only point at zero is the origin. A recession direction with zero \(t\) has zero planar component, since the guards from finitely many rotations already bound the planar section at any fixed \(t\). Every remaining vertex or ray has a finite ratio \(\lVert p\rVert_2/t\). The maximum of these generator ratios bounds that ratio on the cells by the triangle inequality. Choose \(2^N\) above the maximum. Then every admitted point reaches the last cone by depth \(N\). This proves cofinality. Yet every \((e,t)\) with \(t>0\) has some typing, while no finite polyhedral typing can admit them all. A caller-directed iteration along this chain succeeds whenever a solution exists for the specified ground point. Decision procedure · Lean chain and guard proofs

One scheme for a family of callers

Let the caller demand any finite union \(D\) of closed rational polyhedra in \((p,t)\). If every rational point of \(D\) has a polyhedral typing individually, one finite scheme covers the whole demand. The least sufficient depth in the chain is computable, even when \(D\) is unbounded. This statement concerns calls to the three-index probe.

For each nonempty cell write a finite set of base points and recession generators, including both signs of a lineality basis. At every base point we need \(t\ge0\), and \(t=0\) forces \(p=0\). Every ray also has nonnegative \(t\) direction. A ray with zero \(t\) direction and nonzero planar direction would make the section at its base point’s \(t\) unbounded. The guards at finitely many spin depths already bound this entire section because their planar normals positively span the plane. The rational points on that ray therefore include a caller that fails a guard. These tests can reject a demand before any unrolling.

On the remaining generators with \(t>0\) take the maximum of \((|p_x|+|p_y|)/t\), or zero for an empty list. This rational number bounds \(\lVert p\rVert_2/t\) on the whole demand. Once \(2^N\) reaches the bound, every point of \(D\) satisfies the final square test. Test the earlier guards on the base points and their homogeneous versions on the rays. A failure exhibits a rejected caller, and passing them gives a single depth-\(N\) scheme. Testing the square at each earlier step returns the least sufficient depth. For the closed demand \(\{(e,t):t\ge2^{-25}\}\) this is 25. If one allows the open demand \(\{(e,t):t>0\}\), every point is typable but no finite scheme covers it. Exact caller-family procedure

In particular, a polynomial solution-size promise holds for this probe with an explicitly supplied caller. If each rational generator uses at most \(L\) bits per coordinate, the ratio bound above is at most \(2^{O(L)}\). Depth \(O(L)\) suffices. The scheme has \(O(L)\) inequalities, and its depth-\(j\) coefficients have \(O(j+1)\) bits because they come from \(R^j\) and \(2^j\). Its whole description takes \(O(L^2)\) bits. This bound is for the displayed induction scheme. Table 4.4 may choose different updates.

One can also split the eight-index reduction into two source bindings. Give probe the type above. Give the search constructor six indices \(Q\), its original tile fields at \(B_iQ\), and a field of type \(\mathrm{Probe}(e,T(Q))\). Define let rec search = Fork (search,…,search,probe) and require \(\mathrm{Search}(xx^T)\). A positive instance has a search scheme with \(T(Q)\ge\delta\) by taking the slice \(h=1\) of \(K\). One sufficiently deep probe scheme admits all its calls. For an infinite match, tile prefixes force calls \(\mathrm{Probe}(e,T(Q))\) with \(T(Q)\to0\). No one finite probe scheme admits them. This variant keeps the largest datatype at six indices and uses two heap nodes. The positive programme supplies written schemes for both. InvarGenT checks them and OCaml verifies that each tile points back to the search node and the probe points back to itself. Two-binding programme

How many inequalities does the probe need?

Even for this fixed three-index definition, the number of public facets required for \((e,\varepsilon)\) grows without bound as positive rational \(\varepsilon\) tends to zero. Here is an exact finite check. Choose \(n\ge3\), \(t_0=2^{-2n}\) and \(\varepsilon=2^{-3n}\). Intersect any candidate polyhedron with \(0\le t\le t_0\) and project it onto the plane. The projected polygon contains \(R^j e\) for \(0\le j\le n\). It lies inside the half-planes \((R^j p)_x\le1+2^{-n}\) for the same \(j\), by recursive closure.

Let \(g\) be the largest angular gap between the outer normals. Once \(g<\pi\), the outer polygon is inside the disk of squared radius \(M=2(1+2^{-n})^2/(1+\cos g)\). Each inner orbit point \(u\) requires a vertex \(v\) with \(u\cdot v\ge1\). Two inner points \(u,w\) cannot use the same vertex if \(M(1+u\cdot w)<2\), by Cauchy–Schwarz applied to \(u+w\). Density gives arbitrarily many pairwise separated inner directions as \(M\) tends to one. For each fixed number of directions the same conclusion holds for all sufficiently small positive \(\varepsilon\) by using a fixed \(n\) and the same slab.

If the original scheme has \(F\) public facets, the bounded three-dimensional slab has at most \(F+2\) facets and hence at most \(2F\) vertices by Euler’s formula. The first four spin iterates are affinely independent. Their three difference vectors have determinant \(208\varepsilon/125\), so the slab is full dimensional. Projection cannot create more vertices. The check orders rational unit vectors by cross products, computes \(M\) exactly, and greedily selects incompatible directions. At \(n=64\) it finds 30 directions, requiring at least 15 facets. At \(n=256\) it finds 68, requiring at least 34 public facets for the ground slack \(2^{-768}\). These counts concern a conjunction in the public three-dimensional space. Varying the rotation and the slack multiplier gives an exponential separation, with a matching trade-off between the private dimension and the number of inequalities. Witness-dimension theorem · Rational facet certificates

Two unfoldings recover the sharp caller

InvarGenT now checks numerical schemes for a direct recursive constructor against all its fields. With private witnesses it first tries carrying the same witnesses to each child. It can also project them away and check that each convex cell maps into a licensed child cell. If this proof succeeds, a large written invariant can be checked without searching for it again. The eight-index positive programme uses an octagonal norm with rows \(\pm p_x\), \(\pm p_y\), and \(\tfrac23(\pm p_x\pm p_y)\). Its induced norm for \(R\) is exactly \(11/10\). The compiler checks the certificate and the generated OCaml has three fields pointing back to the same root. Programme · Independent octagon and field checks

For unannotated cycles the compiler can decompose an affine guard row into verified simultaneous eigenforms of the field maps. It takes candidate rational eigenvalues from their diagonal entries, including one for the constant coordinate. The projection identities and multipliers are checked exactly. A fixed component stays public. A changing component gets a private upper bound. A negative multiplier may also need a bound on the opposite component. The inequalities on these bounds ensure that each child can keep them. The compiler checks the guard at the root and after one field exactly, then bounds each two-field observation by the products of its multipliers. A separate replay checks the resulting scheme. A caller chooses the private bounds afresh when it instantiates the binding.

The original arithmetic search can find a different sound scheme. The compiler checks containment after projecting private bounds. When neither scheme contains the other it constructs their closed convex hull by splitting the public tuple, homogenizing the two sets of inequalities, and eliminating the private coordinates. It checks both inputs against the proposed hull and replays the hull against every field. If elimination would make an intermediate step exceed the quadratic row budget, the compiler can keep the two alternatives with a minimum of private upper bounds on their violations. Tests for unsupported input still go through ordinary inference. This combination is specific to an independently checked recursive constructor value.

Take the six-index positive instance with tiles \((2,0)\) and \((22,0)\). On the caller’s ray the exact minimum scale is \(8/3\). After the first short tile the unsquared word coordinates are \((1/2,1/4,1/4)\), with squared norm \(3/8\). The long tile has squared norm \(117/256\). After two or more tiles the second coordinate \(b\le1/16\) and the first equals \(\frac23(1-b)\), so its square alone is at least \(25/64>3/8\). The initial squared norm is two. For sufficiency at the sharp scale, the fixed component of the trace is \(4/9\) per unit of scale. Its only potentially negative component at the root is \(-8/9\), and each tile contracts it by at least a factor of four. At depth two the common lower bound is therefore \(4/9-(8/9)/16=7/18>3/8\). The exact first-step check supplies the sharp inequality. The native compiler now accepts the unannotated binding at \(8/3\) and rejects \(5/2\). The one-step prototype had needed \(9/2\). Unannotated programme · One-step construction

The hull can also recover a caller admitted by neither input scheme. For field \((i/2,j/3,k/5)\) under root guard \(i+j+k\le0\), ordinary inference admits \((-1,0,1)\) and the spectral scheme admits \((0,-1,0)\). Their midpoint \((-1/2,-1/2,1/2)\) falls outside both. InvarGenT now infers four inequalities for the hull, \(i+j+k\le0\), \(i+k\le0\), \(9i+4j\le0\), and \(i\le0\), and accepts the midpoint. Native example · Independent hull checks

Replay

Run the Python companion with z3-solver installed and OCaml on the path. It checks 1,458 mixed field selections, compares 90 ground calls with independent linear descriptions, and executes both fixed-caller heaps. It also emits six probe schemes, from depth zero through twelve, and checks each at a symbolic family of admissible slacks and at an excluded ground slack. The replay passed with OCaml 5.3.0 and 5.5.1 compatibility builds of InvarGenT 1a11502. The full OCaml 5.3 suite passed all 396 active tests, with ten existing TODOs. All 204 previously generated signatures matched byte for byte. The native search on the unannotated eight-index shrinking instance reached our 150-second wall limit without an answer. Its exclusion follows from the disk proof.

python3 thesis-review-58.py --compiler /path/to/InvarGenT.native

Lean checks the rational factor updates, the rotation identities, the positive-slack equivalence between finite certification and orbit safety, the abstract common-witness argument, the square witness example, and the sharp first-tile bound. The reduction from infinite Post correspondence and the polyhedral generator arguments are proved above. Lean file