Here is a mathematical escape-room challenge. Build a continuous function from polynomial pieces, assigning a polynomial rule to each region of space. Can you always reconstruct the whole function using a finite recipe that repeatedly chooses the larger or smaller of two polynomials?

For decades, the answer seemed to be yes. The Pierce-Birkhoff conjecture says that any such function can be assembled from finitely many polynomial comparisons. It sounds plausible: if the pieces are polynomial and the seams fit together, perhaps some sufficiently clever sequence of “take the maximum” and “take the minimum” operations can recover them.

But a recent counterexample sets a trap. It is continuous. Its pieces are quadratic, among the simplest polynomial shapes. And yet no finite recipe of the proposed kind can build it. The obstruction is not a jagged edge or a sudden jump. It is a sign hidden in a determinant—one that stays out of reach even when every relevant quadratic measurement agrees.

First, the rules of the puzzle. A familiar spline might divide a flat surface into polygonal regions, with a different formula on each. The conjecture reaches further: regions can be carved out by polynomial inequalities, so their boundaries may curve or twist. The function must remain continuous across them, but the partitions need not look like a tidy grid. The conjecture was known to hold in dimensions one and two, and for the special case of flat, linear cuts. The question was whether the broader claim survived.

The counterexample lives in a space with thirty coordinates. Each point in that space is a pair of symmetric five-by-five matrices. A symmetric matrix is determined by fifteen independent entries, so two of them make thirty. Multiply the matrices in order. Their product need not itself be symmetric, but its entries provide the readings for a bank of forty quadratic tests.

Each test looks at one diagonal entry of the product and compares it with one off-diagonal entry. The function starts by taking the smallest of all forty readings. Call that the gauge: if even the smallest reading is positive, the matrix product has a useful structural guarantee. It is strictly diagonally dominant, meaning each diagonal entry outweighs the combined off-diagonal entries in its row. That forces the product to be invertible, and therefore forces both original matrices to be invertible too.

Now comes the switch. If the gauge is positive and the first matrix has positive determinant, the function reports the gauge. In every other case, it reports zero. The determinant distinguishes two orientations of the matrix: it can be positive or negative. At first, that sign test might seem like a crude discontinuity waiting to happen. But wherever the gauge is positive, the first matrix cannot become singular. Its determinant therefore cannot change sign there without crossing a forbidden state. The switch is safe; the resulting function is continuous and piecewise quadratic.

So why can’t a nest of polynomial maximums and minimums reproduce it? The paper’s proof searches near a special boundary where the two matrices lose rank in complementary directions. At the boundary, their product is zero. Think of it as a place where the two matrices nearly cancel each other’s reach: each acts on directions the other has largely let go.

From that boundary, the authors construct two nearby versions of the matrix pair. One has positive determinant; the other has negative determinant. Yet in both versions, the product is exactly the same small multiple of the identity matrix. The forty gauges therefore all give the same positive reading. The function reports that reading for the positive-determinant pair, but zero for the negative-determinant pair.

That is the key mismatch: the function sees a distinction that the shared product cannot reveal. But to rule out every possible finite recipe, the authors must show that no clever choice of polynomial tests can recover the hidden sign either. Their argument handles any finite collection of tests of degree at most two. Tests that vary along the boundary can be made to keep the same sign at both nearby points. Tests that vanish throughout the boundary turn out to depend only on the matrix product—so they agree exactly for the two pairs.

What about a proposed recipe using higher-degree polynomials? Here the function’s scaling behavior closes the loophole. Shrink the inputs toward the origin. Constant and linear parts of a polynomial may dominate; quadratic parts can remain; higher-degree parts fade faster. Because the target function scales quadratically, the sign of any finite maximum-minimum recipe for it would ultimately be controlled by finitely many constant, linear, and quadratic pieces. The matched pair defeats that reduced set of probes too. The output differs, but the recipe has no way to tell the inputs apart.

The result does not say that every piecewise-polynomial function is impossible to assemble from maximums and minimums. It refutes the universal claim. The authors give an explicit example in thirty dimensions because its construction can be checked relatively directly, and report related counterexamples in dimensions five, six, and seven, among others. They also report Lean formalizations of several examples, including the thirty-dimensional one. The work was developed with assistance from a multi-model AI system, but the mathematical claim rests on the stated construction and proof.

One mystery remains: this counterexample does not settle the smallest dimension in which the conjecture fails. Nor does it erase the cases already known to work. What it changes is the map of the problem. A continuous, neatly quadratic function can hide a global sign from every finite collection of local polynomial comparisons. The puzzle was whether the pieces could always be reassembled. Now mathematicians know that, sometimes, the seam carries information the pieces cannot recover.