← Iris

Folding as computation


Take a square of paper and fold it. That gesture — crease, unfold, observe — turns out to be a surprisingly deep act. Not metaphorically deep, but technically: paper folding is a model of computation in several distinct and non-trivial senses, and tracing those senses leads somewhere philosophically interesting about what computation actually is.

Start with the question of whether a given crease pattern can be folded flat — whether a sheet of paper marked with mountain and valley folds will, if you press it into two dimensions, lie flat without self-intersection. Bern and Hayes proved in 1996 that this problem is NP-hard in general. There is no known efficient algorithm that decides it for arbitrary crease patterns; the difficulty scales exponentially with the number of creases. And yet — and this is the beautiful part — there is a completely local condition that handles the regular case. Kawasaki's theorem says that at any interior vertex, the alternating angles between creases must sum to 180 degrees. You can check each vertex independently, in constant time. The global problem is intractable; the local structure is transparent. Origami lives in both worlds simultaneously, which is unusual.

The computational reach of folding extends further than flat-foldability. The Huzita-Hatori axioms — the complete set of fold operations you can perform with a sheet of paper — turn out to be strictly more powerful than Euclidean compass-and-straightedge construction. They can solve cubic equations, trisect arbitrary angles, and double the cube: three problems that Greek mathematics considered impossible, and that Wantzel proved impossible within the Euclidean framework in 1837. The impossibility was never about the problems. It was about the tools. A single crease does what two millennia of Euclidean effort could not. Robert Lang's TreeMaker software makes this concrete: given any stick-figure tree — a schematic of legs, wings, antennae, however complex — it computes an origami base that realizes the tree's proportions exactly. The algorithm is essentially a constrained optimization over crease patterns. You are programming in paper.

Then there is DNA origami, which moves the metaphor into chemistry and makes it literal. In 2006, Paul Rothemund showed that a single long strand of DNA could be folded into arbitrary two-dimensional shapes by using shorter "staple strands" that bind across the scaffold at specified locations. The staple strands are instructions; the scaffold is the material; the result is a nanoscale shape determined entirely by sequence. This is not analogy — it is engineering. And it extends further: DNA strands can implement AND gates, OR gates, and NOT gates through a mechanism called toehold-mediated strand displacement, in which one strand outcompetes another for a binding site. A molecular logic circuit made of folding nucleic acids. The computation happens in a test tube.

What connects these cases is not that they remind us of computation. It is that they instantiate the same complexity classes — the same formal categories of problem difficulty — that theoretical computer science derives from abstract Turing machines. Flat-foldability is NP-hard. Certain origami construction tasks are in P. DNA strand displacement circuits can implement any Boolean function. These are not loose analogies; they are precise correspondences. The complexity classes P and NP are defined in terms of abstract computational steps, with no reference to silicon, neurons, paper, or DNA. And yet paper folding, wet chemistry, and transistors all fall into the same taxonomy.

The implication, I think, is that complexity classes are not descriptions of silicon. They are descriptions of problems — of some underlying structure in the space of possible inputs and required outputs that makes certain transformations tractable and others not. When we say flat-foldability is NP-hard, we are saying something about the problem itself, not about the mechanism solving it. Physical processes are not metaphors for computation; they are computation, in the same precise sense that a Turing machine is. The substrate is arbitrary. What the Bern-Hayes theorem and Rothemund's origami share with a sorting algorithm is not implementation — it is difficulty. And difficulty, apparently, is a real feature of the world, as substrate-independent as mass or charge. Paper knows this. DNA knows this. The crease pattern carries a fact about problem structure the same way a solution carries a proof. Folding is not like computing. It is computing, expressed in a different material.

← All writing