Undecidable
Which questions about programs, tiles and equations can no algorithm ever settle?
The part opens with three questions: whether eleven Wang tiles cover the plane, whether x^2 - 61 y^2 = 1 has a solution, and whether a program can print its own source. It separates deciding from recognizing, and uses mapping reductions to carry Part 1's halting problem to acceptance, emptiness and equivalence. Rice's theorem then makes every nontrivial extensional property of programs undecidable, and Kleene's recursion theorem builds programs that hold their own description: a Pebble quine of 13,380 bytes runs on the emulator. The same impossibility is found in Post's dominoes, where one four-domino set has a shortest match of 206, in Wang tilings and the hat, and in Hilbert's tenth problem, where every recognizable set is Diophantine. The part turns from computation to proof and information: Godel's theorem follows from halting, plain complexity C is uncomputable by Berry's paradox, and Chaitin's Omega packs halting into one real number. It ends at the busy beaver, which outgrows every computable function, and at the map of where decidability stops: Presburger arithmetic on one side, PRIMEGAME and matrix mortality on the other.
What you need. Comfort with proofs by contradiction and with reading a program; nothing beyond the earlier parts.
- Mathematics, ideas and history
- Rice, the recursion theorem and quines, Post's correspondence, Wang tiles, Hilbert's tenth, Gödel via halting, Kolmogorov complexity, Ω, busy beavers
- What we build or compute
- quines; PRIMEGAME; tilings
What you will be able to do
Degree
- Tell a decider from a recognizer, and place K, its complement and TOT in the picture of recognizable and co-recognizable sets.
- Prove a problem undecidable by a mapping reduction from halting or acceptance.
- State Rice's theorem and say which questions about a program it covers and which it does not.
Graduate
- Prove Rice's theorem, and write a quine by the head, data and tail construction.
- Build the modified PCP dominoes of a Turing machine and read an accepting history off a match.
- Prove that fewer than a 2^-c fraction of n-bit strings have C below n - c, and that C is uncomputable.
Research
- Classify FIN and TOT in the arithmetic hierarchy and state what the Friedberg-Muchnik theorem settles.
- Explain why the first n bits of Omega decide halting for programs of at most n bits, and why no sound effective theory proves more than finitely many values of S.
- State Hilbert's tenth problem over rings of integers and over the rationals, and which is open.
Industry
- Explain why a static analyzer or a virus scanner must miss cases or raise false alarms, and how restricting the language buys decidability.
- Report a bounded search honestly: matched, exhausted, or cut off with no verdict.
Contents
Each chapter has a home level. Choose a track to see what to read and watch: Degree 10 min · Graduate 32 min · Research 40 min · Industry 12 min.
- 0Three questions, three connectionsDegree1 min
- 1Decidable and recognizableDegree1 min
- 2Mapping reductionsDegree1 min
- 3Rice's theoremDegree2 min
- 4Programs that know their own codeGraduate2 min
- 5Post's correspondence problemGraduate3 min
- 6Tiling the planeDegree2 min
- 7Hilbert's tenth problemGraduate2 min
- 8Gödel, through haltingGraduate3 min
- 9Oracles and the arithmetic hierarchyResearch2 min
- 10Kolmogorov complexityGraduate3 min
- 11Chaitin's OmegaResearch3 min
- 12Busy beavers, againGraduate3 min
- 13Where decidability endsGraduate4 min
- 14Undecidability in the wildIndustry1 min
- 15Frontier: Hilbert's tenth over other ringsResearch3 min
- Recap, problems, and where this comes backAll tracks3 min
Also on this page: Lecture · Key results · Try it · Lab · Problems · Notes and sources · 中文 · Build the film.
Lecture
The text of each chapter is the film's narration, as it is spoken, so you can read along or revise without the film. The pictures are in the film.
Three questions, three connectionsDegree1 min
Here are three questions linking geometry, arithmetic and programs. Can these eleven fixed-orientation Wang tiles cover the whole plane? Our search constructs finite patches. The separate Jeandel and Rao theorem proves full-plane tilings exist and none is periodic. Does x squared minus sixty-one y squared equal one have a solution with positive y? A million attempted positive values find none. Continued fractions give the least solution, with x equal to one billion, seven hundred and sixty-six million, three hundred and nineteen thousand and forty-nine. Can a program print its own source without reading a file? Yes. Both our Python and Pebble quines do exactly that. Tiling and general integer equations lead to undecidability. The quine question has a constructive answer: self-reference supplies a technique used in the impossibility proofs.
1Decidable and recognizableDegree1 min
Part 1 proved that halting is undecidable. A decider always halts and answers membership correctly. A recognizer accepts every member and never accepts a nonmember. On a nonmember it may reject or run forever. Co-recognizable means that the complement has a recognizer. K contains machine descriptions whose machines halt on their own descriptions, whether accepting or rejecting. Simulate the machine; any halt confirms membership in K. But the diagonal argument proves no decider for K exists.
Draw the classes. Recognizable sets on the left, co-recognizable on the right. Their intersection is exactly the decidable sets. Dovetail recognizers for a language and its complement. Wait for one to ACCEPT, not merely halt. Exactly one accepts eventually, and neither gives a false acceptance. K is recognizable and undecidable, so its complement cannot be recognizable. TOT, the machines halting on every input, is neither recognizable nor co-recognizable. This forbids uniform recognizers for the two sides; it does not rule out finite proofs for particular machines.
2Mapping reductionsDegree1 min
Almost every impossibility proof after the first one is a reduction. A maps to B if a computable function f turns every question about A into a question about B with the same answer: members land inside B, and non-members land outside. Then a decider for B gives a decider for A: compute f, and ask. Read backwards, if A is undecidable, B must be too. To prove a new problem impossible, you show that the halting problem reduces to it.
Here is the catalogue. Acceptance is recognizable and undecidable. To reduce K to acceptance, wrap M so that it simulates M on its own description and ACCEPTS after any halt, including rejection. Emptiness is co-recognizable; equivalence and totality are neither. A standard construction ignores the new machine's input and simulates a chosen computation. Make M prime accept everything if M accepts w, and nothing otherwise. Then M prime has an empty language exactly when M does NOT accept w. A decider for emptiness would decide acceptance by reversing its answer. The exercises give both reductions needed for equivalence. Rice's theorem handles many nontrivial semantic questions together.
3Rice's theoremDegree2 min
Rice's theorem concerns partial computable input-output functions in an effective universal programming system. A property is extensional if equal partial functions always agree on it. Faults and divergence both count as undefined under this convention. Nontrivial means that some computed functions have the property and some lack it. Defined on zero, total, computes sorting, or equals a fixed partial computable function are examples. Never dividing by zero is not an extensional example under these observations. Suppose the nowhere-defined function lacks P and some program Y has it. Construct M prime to simulate M on w, then run Y on its own input if the simulation halts. If M halts, M prime computes Y's function; otherwise it computes the nowhere-defined function. A decider for P would decide halting. If the nowhere-defined function has P, apply the argument to its complement.
These limits guide software design under unbounded semantics. Exact detection of a specified nontrivial extensional malicious behaviour is undecidable. The behaviour and observation model must be stated. Detecting all dead code is impossible in general; optimization impossibility claims likewise require a particular objective and model. No terminating analyzer decides every instance of such an undecidable property both without missed cases and without false alarms. Practical tools use conservative approximations or incomplete searches. Restrictions can make particular questions decidable. Totality alone does not make all semantic questions decidable: even equality of total primitive recursive programs is problematic. Syntactic questions about a finite program description remain decidable by inspection.
4Programs that know their own codeGraduate2 min
Can a program print its own source? The obvious attempt fails: a print statement must contain its own text, which contains the print statement, forever. The trick is to split the program in two. Here in Python, the string s is a template of the whole program, with a hole. The print statement fills the hole with the string itself, quoted. Our Pebble language has no string formatting, so its quine is longer: seven hundred and fifty-nine lines. Most of them store the rest of the program as numbers, one character each. The tail then prints the head from that data, then prints each assignment statement, then prints the tail. Part A describes part B; part B prints A twice, once as code and once as the text it encodes. We ran it on the emulator: ninety-nine thousand instructions, and the output is the source, byte for byte.
Kleene's recursion theorem makes self-reference precise. In an acceptable effective numbering of programs, every TOTAL computable transformation of program indices has an index whose program computes the same partial function as its transform. This constructs programs with an embedded description of themselves. It does not provide arbitrary source introspection to every existing program. Printing a supplied description gives the quine construction. If H decided halting, construct R with its own description embedded, ask H whether R halts, and do the opposite. H must be wrong. The construction packages the diagonal argument as a programming technique. Related self-reference appears in Gödel sentences and Thompson's compiler construction in Part 55.
5Post's correspondence problemGraduate3 min
Post's correspondence problem uses a NONEMPTY sequence of dominoes. Each has a top and bottom string; repetitions are allowed. For these four, the sequence two, one, three, two, four is a match. Concatenating each row gives the same string. The general question asks whether any nonempty match exists. Post proved it undecidable. Matches are finite certificates. Some no-match instances also have finite proofs, including exhausted finite residual graphs. What fails is a total general decider; the full no-match set is not recognizable.
Computation histories explain the reduction. Our example moves right twice and accepts input one zero. The didactic tape model rejects a left move off its first cell; it never clamps the head. Start, transition, copying, cleanup and closing dominoes encode successive configurations. The start domino is REQUIRED first: this is modified PCP. The bottom row leads the top by one configuration, until accepting cleanup lets the rows close. We check the full concatenated top and bottom for equality, and retain the complete accepting trace. The standard construction reduces acceptance to modified PCP. A separate transformation converts modified PCP to ordinary PCP. The displayed witness illustrates the construction under its stated alphabet and boundary conventions.
Our search uses fixed budgets and retains every sampled instance. We draw twenty thousand three-domino sets with one-to-three-bit words. Every result says matched, exhausted, depth limit or node limit; an unfinished search is not a no-match proof. The longest shortest match among the solved sample instances has fifteen dominoes. The displayed four-domino instance really has shortest match length two hundred and six. We execute the search, check the full strings and retain a residual-graph distance certificate excluding shorter matches. No computable shortest-match bound exists for UNRESTRICTED PCP. This does not settle the fixed four-domino case. Two dominoes are decidable. Neary's published 2015 theorem proves undecidability for five. That published theorem leaves three and four open; its five-pair result supersedes a conflicting earlier preprint.
Here is the promised ambiguity reduction. For each domino, the T rules generate its top string, and the B rules its bottom, followed by distinct index markers in reverse sequence order. Markers use a disjoint terminal alphabet. Each half is unambiguous because the markers determine every rule choice. A string has parses through both halves precisely when the same nonempty index sequence makes equal top and bottom strings. Thus grammar ambiguity, and nonempty intersection of two context-free languages, are undecidable. Context-free grammar universality is also undecidable, but needs another reduction. Parser conflicts concern particular parsing methods and are not a general ambiguity decider.
6Tiling the planeDegree2 min
Wang tiles are oriented squares with colored edges. Copies cannot rotate, and adjacent edges must match. The plane problem asks for an infinite tiling. Our backtracker constructs all five displayed finite patches, retaining every grid and checking every edge independently. On the sixty-four tori up to eight by eight, sixty-two bounded searches finish with refutations and two hit the cap. Separately, complete closed-row graphs are acyclic at every width one through eight. Their checked topological certificates exclude tori of ANY height at these widths. These are finite-width results. Full-plane aperiodicity and minimality among Wang square sets come from Jeandel and Rao's theorem, including their five-color set T shown here.
A local computation tableau is the first idea, not the whole plane reduction. Rows encode tape configurations with a marked head and state. Local edge constraints enforce valid neighboring transitions. To obtain a full-plane equivalence with nonhalting, the reduction also needs hierarchical forcing of initialized computations on arbitrarily large scales. Without that mechanism, arbitrary rows could evade the intended start. Berger supplied this difficult aperiodic forcing in 1966; his construction used twenty thousand, four hundred and twenty-six tiles. Later constructions reduced the counts, under different square-tile or geometric-shape conventions. Jeandel and Rao's eleven-tile minimum concerns oriented Wang squares, not every possible tile shape.
The sequence ended in 2023, with an amateur. David Smith, a retired print technician who played with shapes, found a single tile that covers the plane, but only aperiodically. With Joseph Myers, Craig Kaplan and Chaim Goodman-Strauss he proved it. It is called the hat: thirteen vertices, eight kites cut from a hexagonal grid. The hat needs reflected copies as well; two months later the same team found the spectre, which does not. It answered the einstein problem, German for one stone, which had been open since Berger's aperiodic sets. And it is still true that no algorithm can tell, for an arbitrary finite set of tiles, whether it covers the plane.
7Hilbert's tenth problemGraduate2 min
Hilbert asked for an algorithm deciding integer polynomial solvability. Pell's equation illustrates distant witnesses: take positive nonsquare D and require y positive. Continued fractions give least solutions, including the thirty-digit x for D equal to nine hundred and ninety-one. Our deterministic brute search finds D thirteen in one hundred and eighty attempts and D twenty-nine in one thousand, eight hundred and twenty. A million attempts for sixty-one find none. For positive nonsquare D, Lagrange's theorem ensures a positive solution. We retain every convergent through the least one, check its exact identity, and record nine timing repetitions. A cutoff only excludes the searched range. General no-solution claims require a proof, not merely a search that has not yet found a witness.
The answer took seventy years and four people. Call a set of numbers Diophantine if, over natural-number parameters and auxiliary variables, an integer-coefficient polynomial vanishes exactly for its members. Integer-variable solvability is equivalent by standard encodings, such as sums of four squares for nonnegativity. In 1961 Martin Davis, Hilary Putnam and Julia Robinson proved that every recognizable set is Diophantine, provided that exponentiation is. In 1970 Yuri Matiyasevich, aged twenty-two, closed the gap: the relation y equals two to the x is Diophantine, with a construction built on the Fibonacci numbers. So the recognizable sets and the Diophantine sets are the same. In particular there is a polynomial that has a solution exactly when machine number n halts on itself. A process for Hilbert's problem would decide halting. There is none.
Recognizable sets are Diophantine, including the primes. Jones, Sato, Wada and Wiens wrote a twenty-six-variable polynomial of degree twenty-five. Over nonnegative integer inputs, its positive values are exactly the primes. It is k plus two times one minus a sum of fourteen squares. Positivity forces every square to vanish. For each prime k plus two, THERE EXISTS an auxiliary tuple satisfying those equations. An arbitrary auxiliary tuple need not satisfy them. This is a representation theorem, not an efficient prime generator or a measured assertion about random inputs. The existential auxiliary variables carry the computation.
8Gödel, through haltingGraduate3 min
In 1931 Kurt Gödel needed arithmetic to talk about itself. Give every symbol a code number. Then encode a formula as a product of prime powers: two to the code of the first symbol, times three to the code of the second, and so on. Zero equals zero is two times twenty-seven times five: two hundred and seventy. A short statement that adding zero changes nothing has forty-seven digits. Factoring recovers the formula, so nothing is lost. A proof is a list of formulas, so it has a number too, and whether one number is a proof of another is a mechanical check. Part 1 did the same for machines, with description strings. Gödel did it first, for logic.
An effective sound arithmetic theory cannot prove every true nonhalting statement. Effective means its theorems can be enumerated by a program. Assume soundness and enough arithmetic to express the machine computations and verify finite halting witnesses. Suppose every true nonhalting assertion had a proof. Dovetail the actual run of M on w with theorem enumeration seeking the assertion that it never halts. If it halts, the simulation finishes; otherwise the assumed proof appears. Soundness prevents a false answer. This would decide halting, so the theory is incomplete. Effective axiomatization is essential: the set of all true arithmetic statements is not a counterexample to this scoped theorem.
Self-reference identifies a particular missing statement. Construct R with its own description embedded, and enumerate T's proofs searching for a proof that R never halts. Finding one makes R halt. If T proved nonhalting, R would halt, contradicting soundness. Thus R actually runs forever and its nonhalting is true but unprovable in this effective sound T. This is a program version of the Gödel self-reference idea. The exact historical assumptions differ: Gödel used consistency for unprovability and a stronger omega-consistency assumption for the opposite direction. Rosser's modified sentence obtains incompleteness from consistency alone, with the usual effective arithmetic hypotheses.
The second theorem needs a formal internal proof argument. Use an effective arithmetic theory with its standard provability predicate and the Hilbert-Bernays-Loeb derivability conditions. The suitable Gödel argument can then be formalized inside T. Internalized consistency implies the relevant Gödel sentence; proving consistency would therefore contradict the first theorem. A consistent sufficiently strong such T cannot prove its own standard consistency assertion. This does not follow just by repeating our informal soundness argument. It obstructs Hilbert's desired consistency proof when the proposed finitistic reasoning is formalizable within T; it does not prohibit every external consistency proof. For ZFC, standard consistency says that no encoded proof of contradiction exists. The corresponding proof-search machine connects the theorem to busy beavers, subject to the same effective arithmetic assumptions.
9Oracles and the arithmetic hierarchyResearch2 min
An oracle answers a chosen membership query in one abstract step. Turing reducibility permits an algorithm to query the oracle during its computation. A K oracle decides a sigma-one question after a computable reduction to K and one query. The diagonal argument relativizes: machines with a K oracle cannot decide their own halting problem, K prime. Repeating the jump produces an infinite strictly increasing tower of Turing degrees.
Count alternating quantifier BLOCKS over computable predicate matrices. Delta one means decidable sets. Bounded-formula delta zero is a different syntactic class. A leading existential block gives sigma one: for example there exists a time when M halts. A universal block gives pi one, including the displayed nonhalting formulations. These are upper-level formulations of conjectures, not completeness classifications of individual closed sentences. Finitely many halting inputs, FIN, is sigma-two-complete. Totality, TOT, is pi-two-complete. The other displayed conjectures admit pi-two formulations; that does not make them complete. Cofinitely many halting inputs, COF, is sigma-three-complete. Post's theorem says sigma n plus one is recognizable relative to the n-th jump; pi n plus one is co-recognizable relative to that oracle.
Post asked about the computably enumerable degrees below K. Must a recognizable set be decidable or complete? Friedberg and Muchnik constructed incomparable computably enumerable sets A and B. Both degrees are strictly between the decidable degree and K. Their priority constructions meet infinitely many requirements, each injured only finitely often by higher priorities. Sacks's density theorem inserts a degree between any two DISTINCT COMPARABLE computably enumerable degrees. It does not insert one between the incomparable A and B in this drawing. Finding convincing natural intermediate examples is a research theme, with naturalness an informal criterion. It is not the theorem that every conceivable natural problem is decidable or complete.
10Kolmogorov complexityGraduate3 min
Fix an optimal plain description machine U. Plain complexity C of x is the minimum number of program BITS needed to output x. Later we will distinguish optimal prefix-free complexity K. Each retained input here has one hundred thousand bytes. Random bytes grow slightly under these three compressors. English and decimal pi compress, partly because their byte encodings contain redundancy. Every compressed output is retained and decompressed to its full original input. Our finite pi printer also needs its requested length, caller, libraries and interpreter. An independent integer-interval Chudnovsky computation certifies all one hundred thousand digits, including the leading three. Eight times a compressed byte length, PLUS fixed decoding and framing costs, supplies a plain-complexity upper bound. It does not compute the shortest description.
The invariance theorem requires an OPTIMAL description system. An optimal U simulates every description machine V with a fixed additive program-length cost. The interpreter or compiler description is fixed for V. Combining it with a V description of x produces a U description only that constant longer, under the stipulated effective encoding. If both machines are optimal, the two inequalities bound their difference by a constant. The constant can matter for short strings; machine independence means only this additive equivalence. Arbitrary computational universality alone does not guarantee an additive length overhead, and an interpreter's raw source size omits its own runtime and encoding costs.
Count descriptions. Fewer than two to the n programs have length strictly below n, so at least one n-bit string has plain complexity at least n. More generally, fewer than a two-to-the-minus-k fraction have C strictly below n minus k, for zero through n as the deficit range. Thus fewer than one in a thousand and twenty-four have C below n minus ten. Saying shortened BY ten would instead include equality and change the threshold. Incompressibility is relative to a fixed machine and deficit. At least one minus two to the minus c of n-bit strings have C at least n minus c. The exact threshold C at least n guarantees some strings, not an overwhelming fraction. An injective lossless compressor cannot shorten every input.
Turn Berry's paradox into a program. The phrase names an object allegedly too complex for that phrase. If plain C were computable, search strings in shortlex order and output the first with C above L. Counting ensures one exists. Encoding L in this fixed plain program costs about log L plus a constant, less than L for large L. That contradicts the selected string's complexity, proving C uncomputable. For an EFFECTIVELY AXIOMATIZED SOUND theory T, enumerate proofs instead, seeking any assertion C of x exceeds L. Beyond a T-dependent constant none can appear. The effective hypothesis is essential. Incompressibility of most strings means a stated fixed deficit; it is not a claim that every sound theory lacks all proofs of randomness.
11Chaitin's OmegaResearch3 min
Fix an optimal prefix-free machine U. Feed it an infinite fair coin stream. A finite halting program prefix may eventually appear; some streams never yield one. Its halting domain is prefix-free, so Kraft's inequality bounds the total cylinder measure by one. Omega is that halting measure, strictly between zero and one for this optimal machine. Dovetail all finite programs and add each halting program's weight once. This gives computable increasing lower approximations. There is no uniform computable convergence modulus providing every requested precision. This does not rule out certifying particular finite prefixes for specially analyzed machines.
Our finite experiment is a sample fraction, distinct from universal Omega. Draw five thousand independent uniform six-rule, three-state two-symbol machines with replacement, and retain every machine and halt time. Two thousand, two hundred and fifty-one halt: the exact SAMPLE fraction is zero point four five zero two. The population has sixteen to the sixth machines; this sample is not a census. The longest observed halting run takes eleven steps. Independent tape replay through the known bound S of three equals twenty-one classifies every sampled machine, matching the two-thousand-step runs. The displayed Wilson interval describes sampling uncertainty under the iid model. For universal Omega there is no computable all-length halting-time bound. Finite model certainty does not transfer to universal halting measure.
Omega depends on the chosen optimal prefix-free machine. Calude, Dinneen and Shu analyzed one particular machine and certified a finite prefix. This is not a uniform algorithm for arbitrary precision or arbitrary machines. Given the first n bits, let a be their dyadic truncation. Dovetail programs until the partial sum is AT LEAST a. Equality is sufficient if reached; insisting on equality alone could miss an overshoot. The remaining mass is then less than two to the minus n. Any still-running program of at most n bits can never halt. With enough bits this settles any particular effectively encoded finite program's halting, including the displayed conjecture-search examples. No machine-independent few-thousand-bit budget is claimed. Its prefixes satisfy optimal PREFIX-FREE complexity K at least n minus a constant, distinct from the preceding chapter's plain C. An effective sound arithmetic theory determines only finitely many bits. Solovay's special-machine result also has soundness conditions on ZFC; it is not an unconditional claim about an arbitrary formal theory.
12Busy beavers, againGraduate3 min
Compare primitive recursive, total computable and busy-beaver growth. Primitive recursion computes exponentials, variable-height towers, and fixed iterations of such constructions. Ackermann's diagonal growth eventually dominates every primitive recursive function, while remaining total computable. For an effectively enumerable total language of functions from unbounded natural numbers to natural numbers, assume a computable total interpreter on valid codes, extended by a default on invalid codes. If the language also represented that interpreter and the diagonal function interpreter of x on x plus one, applying the diagonal to its own code would contradict equality. The coding and closure assumptions matter, including for typed languages. The LAST column, S, eventually dominates every total computable function, including Ackermann.
The proof is a machine built in three pieces. Take any TOTAL computable natural-valued function f, computed by a machine with c states. For each n, build a machine that first writes n on its tape, which takes n states; then computes the larger of f of two n and f of two n plus one, using a fixed number c of states; then counts that number down to zero, a few states more. It has n plus a constant states, and it halts after more than f of two n steps. So the busy beaver of n plus that constant is bigger than f of two n. Once n is larger than the constant, the busy beaver of two n is bigger still. The same maximum also covers the next odd size, by monotonicity of S. Thus S passes f at every sufficiently large size and stays ahead. No computable function can even bound it.
Busy-beaver tables combine established values and conditional encoding claims. S of five is established. Other rows describe particular conjecture-search machines: the reported twenty-seven-state Goldbach encoding still needs verification, while larger published constructions have different evidence. Knowing S of n settles a conjecture only after a CORRECT at-most-n-state encoding is established. We therefore make no unconditional Goldbach conclusion from the unverified twenty-seven-state claim. An effectively axiomatized sound sufficiently strong arithmetic theory can prove only finitely many exact S values: otherwise theorem enumeration would give a computable bound contradicting domination. A checked seven-thousand-nine-hundred-and-ten-state construction gives a published ZFC upper bound under the usual consistency assumptions. The smaller four-hundred-and-thirty-two-state 2025 claim is conditional on its construction checking out. The first unprovable value is unknown.
13Where decidability endsGraduate4 min
Decidability depends on the theory's exact language. Presburger arithmetic, with addition on natural numbers, is decidable; the doubly exponential lower bound is WORST CASE as formula length grows. Tarski decides first-order polynomial formulas over real closed fields, covering the corresponding algebraic geometry. Arbitrary real functions are outside that statement. Adding multiplication on natural numbers makes the full first-order theory undecidable. The full first-order theory of the rationals is also undecidable, via definitions of the integers. Its purely existential polynomial-equation problem is the separate open Hilbert-tenth question. In the ordered real field, integers are not first-order definable; this prevents that particular arithmetic encoding.
Undecidability also hides in pure algebra. Max Dehn asked in 1911: given a group by finitely many generators and relations, can you decide whether a word in the generators equals the identity? Pyotr Novikov in 1955 and William Boone in 1958 found groups where no algorithm can. Or take a handful of three-by-three integer matrices. Does some product of them, in some order, with repetition, give the zero matrix? Michael Paterson proved in 1970 that this is undecidable, by turning Post's dominoes into matrices. The cited Neary 2015 paper records unrestricted two-by-two integer mortality as open. This is a dated literature status, not a claimed new 2026 survey.
John Conway invented the strangest programming language of all. A program is a list of fractions. Start with a POSITIVE INTEGER; repeatedly multiply it by the first fraction in the list that gives a whole number; stop when none does. This list, PRIMEGAME, starts from two. Record powers of two reached AFTER positive steps, excluding the initial two to the first power. After nineteen steps, four, which is two squared. After sixty-nine, eight. Then thirty-two, a hundred and twenty-eight, two to the eleven. The exponents are exactly the primes, in order. Our run reached every prime up to a hundred and twenty-seven in under three million steps. Why does this work? The exponents of the primes in n act as registers, and each fraction is an instruction that decrements some registers and increments others. That is Part 1's counter machine, and it is universal. So whether a list of fractions ever stops is undecidable.
The ordinary Collatz question remains distinct from its universal generalizations. For positive integers, halve an even value and triple an odd value then add one. Twenty-seven takes one hundred and eleven steps to reach one. We retain stopping lengths and full trajectory peaks for EVERY positive start below a million, independently checked by an overflow-guarded native implementation. The longest takes five hundred and twenty-four steps from eight hundred and thirty-seven thousand, seven hundred and ninety-nine. These finite checks prove only this finite prefix; larger published verification ranges are dated claims, not executions of this run. Conway's generalized residue-dependent iterations can encode universal computation and have an undecidable halting problem. It could be true with a proof, true but independent of a specified theory, or false. No independence result is established here.
14Undecidability in the wildIndustry1 min
Universality can appear in unexpected rule systems under IDEAL UNBOUNDED resources. C++ template metaprograms encode computation; real compilers impose depth and memory limits. Grigore's Java-generics result concerns the formal unbounded subtyping problem. Recursive type-level systems likewise differ from finite implementations with cutoffs. The Magic construction uses a precise idealized game model; finite hardware limits are not part of its universality theorem. Dolan's move-instruction construction requires a repeating control-flow convention as well as unbounded storage. A finite straight-line list of moves alone is not universal. Life uses an unbounded grid; the displayed finite glider merely illustrates local dynamics. Choose restrictions for a particular decision problem.
The spectral-gap theorem has a precise thermodynamic scope. Consider a computably specified family of two-dimensional translation-invariant nearest-neighbor Hamiltonians with fixed local dimension. Ask about the spectral gap in the growing-lattice limit. The promise separates robust gapped and gapless cases; gap structure influences phases, but is not a universal finite-material conductor test. Cubitt, Perez-Garcia and Wolf proved this promised family problem undecidable. It is not a claim that a particular finite Hamiltonian's eigenvalues cannot be approximated. Their construction combines aperiodic forcing and computation so that halting controls the limiting gap. Finite experimental evidence and the ideal limit are different questions.
15Frontier: Hilbert's tenth over other ringsResearch3 min
Hilbert's tenth problem over other rings. Hilbert's tenth extends to effectively presented rings of integers. For a number field K, ask for solutions in its ring of integers, with coefficients in that ring. A Diophantine definition of the ordinary integers transfers undecidability. Earlier all-field conditional results used conjectural finiteness of Shafarevich groups, not merely an unspecified elliptic-curve claim. Koymans and Pagano's December 2024 work gives an unconditional result for every number field. Their tools include elliptic rank stability and additive combinatorics. Independently, Alpoge, Bhargava, Ho and Shnidman's 2025 work uses positive-rank abelian varieties stable in quadratic extensions. The two routes should not be conflated. Combined with earlier reductions, Hilbert's tenth is undecidable over every infinite commutative unital ring finitely generated as a Z algebra, with an effective presentation.
Hilbert's tenth over the rationals remains a separate question. The displayed rational points satisfy y squared equals x cubed minus two; their exact fraction identities can be checked directly. A Diophantine definition of integers in rationals would transfer integer undecidability. Mazur's topological conjecture would obstruct such a definition; it does not itself give a decision algorithm. Integers ARE first-order definable in rationals. Koenigsmann gives a universal definition, and a DIFFERENT forall-exists definition with only one universally quantified variable. These are distinct quantifier claims. Thus the full first-order theory is undecidable, while the purely existential polynomial-equation fragment remains open. General integer equations restricted to two unknowns present another unresolved decision question in the cited literature.
Small universality claims require model labels. The cited constructions give undecidability bounds of nine natural-number unknowns and eleven integer unknowns. These are sufficient bounds, not proved minimal counts. Neary's published theorem uses five dominoes. Smith's two-state three-symbol 2007 machine uses a nonstandard infinite-background convention; it is not ordinary blank-background universality. The smaller ZFC busy-beaver encoding is explicitly conditional on verification, and the matrix row records the cited mortality literature's scope. Gaps between sufficient constructions and decision results motivate research, but the models and evidence must remain visible.
Five open problems from this part. Hilbert's tenth over the rationals. Post's problem for three or four dominoes. Convincing natural intermediate computably enumerable degrees, with naturalness understood informally. The exact point where set theory loses track of the busy beaver. And whether the Collatz conjecture, if true, can be proved from the ordinary axioms of arithmetic. This part's research problem takes the second, for three dominoes.
Recap, problems, and where this comes backAll tracks3 min
What we built in this part. Decidable, recognizable and co-recognizable, and reductions that carry impossibility from one problem to the next. Rice's theorem for nontrivial extensional properties of unbounded programs. Programs that print their own source, in Python and in Pebble. Dominoes, tiles and Diophantine equations, each hiding a Turing machine, and the hat. Gödel's theorems, proved from halting; oracles and the arithmetic hierarchy; Kolmogorov complexity and Chaitin's Omega; and the busy beaver, where proof runs out.
Where this comes back. Part 26 proves the time hierarchy theorem with the same diagonal, and asks the question this part cannot answer: not whether, but how fast. Part 54 checks proofs and specifications, using restrictions or incomplete proof search where general decision is impossible. Part 55 shows that safety in access control is undecidable, and builds Ken Thompson's trojan compiler on a quine. Part 57 turns Kolmogorov's idea into Occam's razor for learning, and Part 58 makes recursion a fixed point, the semantic cousin of Kleene's theorem.
In practice, specify the model and the exact question. Terminating exact analysis of a nontrivial extensional property over universal unbounded programs is impossible; practical tools use approximations or restrictions. Finite compiler limits are different from ideal universality. Testing an unbounded input domain cannot exhaust it. Exhaustive testing of a fully specified FINITE model, however, can establish absence of bugs within that model. Keep those scopes distinct.
Six problems. The notes give worked solutions to the first five, including an executed Pebble program that prints its own source backwards. The starred task explores finite three-domino PCP instances with explicit certificates and cutoff statuses, then asks about a computable general bound. Finiteness alone guarantees that some bound exists for a fixed finite family; finding a useful explicit bound is a different task. The unrestricted three-domino decision problem remains the research lead.
Next time: this part asked what can be computed at all. Part 26 asks what can be computed quickly. In 1956 Gödel wrote to John von Neumann about the cost of finding proofs compared with checking them. Cook and Levin later proved SAT complete for NP, and Karp linked twenty-one further problems by reductions. The P versus NP question remains open after more than fifty years. Part 26, P versus NP.
The books and papers this part follows are on screen and in the notes. Thank you for watching.
Where it goes next. The diagonal returns as the time hierarchy theorem in Part 26, which asks how fast instead of whether. Part 54 checks proofs and specifications by restriction and incomplete search, Part 55 proves safety in access control undecidable and builds Thompson's trojan compiler on a quine, Part 57 turns Kolmogorov's idea into Occam's razor for learning, and Part 58 makes recursion a fixed point.
Key results
The part's results in one place, for revision.
Try it
Lab 25 · Dominoes that compute: bounded search, a reduction, and PRIMEGAME
Find the shortest match of the film's four-domino set (206 dominoes) by breadth-first search over overhangs, check that a match of the dominoes built from a Turing machine spells its accepting history, and check that Conway's PRIMEGAME reaches the powers 2^p for exactly the primes p, in order.
python -m videos.cs.labs 25
needs numpy, scipy, matplotlib · download lab25.py ·
source on GitHubSipser's set, shortest match 2 1 3 2 4 (the film: 2 1 3 2 4)
300 random three-domino sets matched 66 exhausted 206 depth-limit 20 node-limit 8
four-domino set, shortest match 206 dominoes, 412 symbols (the film: 206)
overhang states dequeued 73,135 (the film: 73,135)
machine on '10' accepted in 2 steps, history #q10#1p0#10a#
its MPCP match 19 dominoes in the set, 13 used, spelling #q10#1p0#10a#1a#a##
PRIMEGAME, 60,000 steps 2^2, 2^3, 2^5, 2^7, 2^11, 2^13, 2^17, 2^19, 2^23, 2^29, 2^31
first outputs at steps 19, 69, 281, 710, 2375 (the film: 19, 69, ...)
A match is a finite certificate and so is an exhausted overhang graph, but a search that hits its budget has proved nothing: the budget that would suffice is not computable in general.
The code (98 lines; it asserts its own result)
"""Lab 25: search Post's dominoes with a budget, turn a Turing machine into dominoes, and run PRIMEGAME."""
from videos.coursekit import labs
import numpy as np
from explainer.cs.algo import computability as C
TITLE = "Dominoes that compute: bounded search, a reduction, and PRIMEGAME"
GOAL = ("Find the shortest match of the film's four-domino set (206 dominoes) by breadth-first search over overhangs, "
"check that a match of the dominoes built from a Turing machine spells its accepting history, and check that "
"Conway's PRIMEGAME reaches the powers 2^p for exactly the primes p, in order.")
TASKS = [
"Lower max_len for the 206 instance to 150. Which status comes back, and why is it not a proof that no match exists?",
"Change the machine's input from '10' to '11'. It rejects: what does pcp_search(D, 60, first=0) report now, and what does that say about no-match instances?",
"Raise STEPS to 400,000 and predict the next primes before you run it. Then fit the step at which 2^p appears against p on log-log axes.",
]
FOUR = [("1000", "0"), ("01", "0"), ("1", "101"), ("00", "001")] # chapter 5: shortest match 206
SIPSER = [("b", "ca"), ("a", "ab"), ("ca", "a"), ("abc", "c")] # chapter 5: 2, 1, 3, 2, 4
RULES = {("q", "1"): ("p", "1", "R"), ("p", "0"): ("a", "0", "R"), ("q", "0"): ("r", "0", "R"),
("p", "1"): ("r", "1", "R"), ("q", "_"): ("r", "_", "R"), ("p", "_"): ("r", "_", "R")}
STEPS = 60_000
def rows(dominoes, match):
return "".join(dominoes[i][0] for i in match), "".join(dominoes[i][1] for i in match)
def primes_below(n):
return [p for p in range(2, n) if all(p % d for d in range(2, int(p ** 0.5) + 1))]
def run(seed=0):
rng = np.random.default_rng(seed)
lab = labs.Lab()
# 1. Sipser's four dominoes, and random small sets: every reported match is checked on the full strings
s = C.pcp_search(SIPSER, 10)
assert [i + 1 for i in s["match"]] == [2, 1, 3, 2, 4]
words = ["0", "1", "00", "01", "10", "11", "001", "010", "011", "100", "101", "110"]
tally = {"matched": 0, "exhausted": 0, "depth-limit": 0, "node-limit": 0}
for _ in range(300):
inst = [(words[rng.integers(12)], words[rng.integers(12)]) for _ in range(3)]
r = C.pcp_search(inst, 40, max_nodes=5000)
tally[r["status"]] += 1
if r["match"]:
top, bottom = rows(inst, r["match"])
assert top == bottom and len(r["match"]) <= 40
lab.row("Sipser's set, shortest match", " ".join(str(i + 1) for i in s["match"]) + " (the film: 2 1 3 2 4)")
lab.row("300 random three-domino sets", " ".join(f"{k} {v}" for k, v in tally.items()))
assert tally["matched"] > 20 and tally["exhausted"] > 20, "both kinds of finite certificate occur"
# 2. the four-domino set: nothing shorter than 206, by exhausting every shorter overhang
f = C.pcp_search(FOUR, 300)
top, bottom = rows(FOUR, f["match"])
lab.row("four-domino set, shortest match", f"{len(f['match'])} dominoes, {len(top)} symbols (the film: 206)")
lab.row("overhang states dequeued", f"{f['nodes']:,} (the film: 73,135)")
assert top == bottom and len(f["match"]) == 206 and f["nodes"] == 73_135
assert C.pcp_search(FOUR, 205)["status"] == "depth-limit", "a budget of 205 gives no verdict"
over, t, b = [], 0, 0
for i in f["match"]:
t, b = t + len(FOUR[i][0]), b + len(FOUR[i][1])
over.append(t - b)
# 3. a machine becomes dominoes: the forced-first match is the accepting computation history
D = C.tm_to_mpcp(RULES, "q", "a", "10", "01")
m = C.pcp_search(D, 60, first=0)
trace = C.run_tm_trace(RULES, "q", "a", "10")
top, bottom = rows(D, m["match"])
lab.row("machine on '10'", f"{trace['status']} in {trace['steps']} steps, history {trace['history']}")
lab.row("its MPCP match", f"{len(D)} dominoes in the set, {len(m['match'])} used, spelling {top}")
assert trace["status"] == "accepted" and top == bottom and top.startswith(trace["history"])
# 4. PRIMEGAME: the exponents of the powers of two it reaches are the primes, in order
out = C.fractran_run(C.PRIMEGAME, 2, STEPS)["outputs"]
exps = [e for _, e in out]
lab.row(f"PRIMEGAME, {STEPS:,} steps", "2^" + ", 2^".join(map(str, exps)))
lab.row("first outputs at steps", ", ".join(str(step) for step, _ in out[:5]) + " (the film: 19, 69, ...)")
assert exps == primes_below(exps[-1] + 1) and len(exps) >= 10 and out[0] == (19, 2) and out[1] == (69, 3)
lab.note = ("A match is a finite certificate and so is an exhausted overhang graph, but a search that hits its "
"budget has proved nothing: the budget that would suffice is not computable in general.")
fig, ax = labs.figure(2, size=(11, 4.4))
k = np.arange(1, len(over) + 1)
over = np.array(over)
ax[0].fill_between(k, over, 0, color=labs.GOLD, alpha=0.6)
ax[0].plot(k, over, color=labs.GOLD, lw=1.2)
ax[0].axhline(0, color=labs.MUTED, lw=0.8)
ax[0].set(title="The shortest match of the four-domino set: 206 dominoes", xlabel="dominoes placed",
ylabel="top length minus bottom length (symbols)")
steps = np.array([st for st, _ in out])
ax[1].loglog(exps, steps, "o-", color=labs.GREEN, label="step at which 2^p first appears")
ax[1].set_xticks(exps, [str(e) if e not in (17, 23, 29) else "" for e in exps])
ax[1].set_xticks([], minor=True)
ax[1].set(title="PRIMEGAME: fourteen fractions that list the primes", xlabel="prime p", ylabel="steps")
ax[1].legend(loc="upper left")
lab.fig = fig
return lab
Now change it
- Lower max_len for the 206 instance to 150. Which status comes back, and why is it not a proof that no match exists?
- Change the machine's input from '10' to '11'. It rejects: what does pcp_search(D, 60, first=0) report now, and what does that say about no-match instances?
- Raise STEPS to 400,000 and predict the next primes before you run it. Then fit the step at which 2^p appears against p on log-log axes.
Problems, with solutions
Try each problem before opening its solution.
-
Equivalence. Prove that EQ_TM is neither recognizable nor co-recognizable.
Solution
Reduce A_TM to the complement of EQ_TM. Map ⟨M, w⟩ to ⟨M₁, M₂⟩, where M₁ rejects everything and M₂ ignores its input and runs M on w, accepting if M does. If M accepts w, L(M₂) = Σ* ≠ ∅ = L(M₁); otherwise both are empty. So A_TM ≤ₘ co-EQ_TM, hence co-A_TM ≤ₘ EQ_TM. Since co-A_TM is not recognizable, neither is EQ_TM. Next, reduce A_TM to EQ_TM itself. Map ⟨M, w⟩ to ⟨M₁, M₂⟩ where M₁ accepts everything and M₂ is as before. Then M accepts w iff L(M₁) = L(M₂). So co-A_TM ≤ₘ co-EQ_TM, and co-EQ_TM is not recognizable either. That is, EQ_TM is not co-recognizable.
-
Rice, and what it does not cover. Show that "M accepts some palindrome" is undecidable, and explain why "M's description is a palindrome" is not.
Solution
Whether L(M) contains a palindrome depends only on L(M), so the property is semantic. It is non-trivial: a machine accepting {a} has it, and a machine accepting nothing does not. By Rice's theorem it is undecidable. The second property is about the text ⟨M⟩, not about L(M). Two machines with the same language can differ on it, so it is not semantic, and a program decides it by reading the string from both ends.
-
Enumerating in order. Prove that a language is decidable if and only if some enumerator prints it in increasing (shortlex) order.
Solution
(⇒) Given a decider D, run D on every string in shortlex order and print those it accepts. (⇐) If L is finite it is decidable, by a table. If L is infinite and E prints it in increasing order, decide w as follows. Run E until it prints w (accept) or prints a string that comes after w (reject). Since L is infinite, E prints strings beyond w eventually, so the procedure always halts, and since the order is increasing, w cannot appear later.
-
Plain complexity bounds. Fix an optimal plain description machine; sizes are bits. Show that C(x) ≤ |x| + c and C(xx) ≤ C(x) + c, and conclude that at most half of the strings of each length have C(x) < |x| − 1.
Solution
The program "print the following literal: x" has length |x| plus the fixed length of the printing code. If p prints x, the program "run p, and print its output twice" has length |p| + c′. For the count: the programs of length less than n − 1 number 1 + 2 + … + 2ⁿ⁻² = 2ⁿ⁻¹ − 1. Each prints at most one string, so fewer than 2ⁿ⁻¹, half of the 2ⁿ strings of length n, can have C(x) < n − 1.
-
Build: a backwards quine. Write a Pebble-language program that prints its own source backwards, and run it on the emulator.
Executed solution.
computability.pebble_backward_quine()constructs the program below. The retained O2 compiler image runs for 472,027 emulator instructions and outputs exactly the 15,705 source bytes in reverse order. The source fits the explicitly checked 32,768-entry output buffer.Keep the structure of chapter 4's quine: a head that declares an array
d; a data section of assignmentsd[k] = c;holding the character codes of the head and the tail; and a tail. Instead of printing directly, the tail writes the whole source into a buffer in three passes. First it copies the head fromd, then it writes the text of each assignment (the decimal digits of k and c with the fixed punctuation), and then it copies the tail fromd. Finally it prints the buffer from its last byte to its first. Generate the program with a short Python script, ascomputability.pebble_quinedoes. Check it the same way: compile it, run it on the emulator, and compare the output with the source reversed. The recursion theorem guarantees such a program exists for any computable transformation of the text, reversal included. -
★ Research: three dominoes. Is Post's correspondence problem decidable for three dominoes? Start with words of length at most 3: retain match certificates, finite-graph refutations and unresolved cutoffs. A fixed finite family automatically has some finite maximum among its shortest matches; seek explicit values/certificates, then a computable bound as a function of general input size.
Where to start. The two-domino case was decided by Ehrenfeucht, Karhumäki and Rozenberg (1982) and simplified by Halava, Harju and Hirvensalo (2002). Their method, analysing how the overhang can evolve, is the natural thing to push to three. Neary (2015) gives undecidability for five, so the methods must break somewhere between three and five, and finding where is itself informative. Our retained fixed-budget run covers 20,000 random instances: 4,679 matches, 11,819 finite-graph exhaustions, 2,217 depth cutoffs and 1,285 node cutoffs. All inputs, statuses and matches are saved. Cutoffs are unresolved. The finite word-length-three experiment does not resolve unrestricted three-domino PCP. Enumerate all three-domino instances over {0, 1} with words of length at most 3, removing symmetries (swapping 0 and 1, reversing every word, permuting the dominoes). Solve them by breadth-first search over the overhang. Then try to certify the unsolved ones as unsolvable with simple invariants: a length imbalance that can never be repaired, an overhang that can never be extended, or a finite-automaton certificate in the style of the busy-beaver deciders of Part 1. The instances that resist every certificate are where the question lives.
Notes and sources
Glossary
可判定 decidable · 可识别(递归可枚举) recognizable (recursively enumerable) · 补可识别 co-recognizable · 映射归约 mapping reduction · 语义性质 semantic property · Rice 定理 Rice's theorem · 自打印程序 quine · 递归定理 recursion theorem · Post 对应问题 Post's correspondence problem · 计算历史 computation history · 歧义文法 ambiguous grammar · Wang 砖 Wang tile · 非周期铺砌 aperiodic tiling · 单瓦(帽子) monotile (the hat) · 丢番图集 Diophantine set · Pell 方程 Pell's equation · 连分数 continued fraction · Gödel 编码 Gödel numbering · 不完备性 incompleteness · 一致性 consistency · 可靠 sound · 谕示机 oracle machine · 图灵跳跃 Turing jump · 算术层级 arithmetic hierarchy · 优先方法 priority method · Kolmogorov 复杂度 Kolmogorov complexity · 不变性定理 invariance theorem · 不可压缩 incompressible · Berry 悖论 Berry's paradox · 停机概率 halting probability · Chaitin 常数 Chaitin's constant · 原始递归 primitive recursion · Ackermann 函数 Ackermann function · 忙碌的海狸 busy beaver · Presburger 算术 Presburger arithmetic · 字问题 word problem · 矩阵致死性 matrix mortality · FRACTRAN · Collatz 猜想 Collatz conjecture · 谱隙 spectral gap · 整数环 ring of integers · 数域 number field
Sources
Canon. Books:
- Sipser, Introduction to the Theory of Computation (3rd ed., 2012), ch. 4–6;
- Rogers, Theory of Recursive Functions and Effective Computability (1967);
- Soare, Turing Computability (2016);
- Boolos, Burgess & Jeffrey, Computability and Logic (5th ed., 2007);
- Li & Vitányi, An Introduction to Kolmogorov Complexity and Its Applications (4th ed., 2019);
- Matiyasevich, Hilbert's Tenth Problem (1993);
- Grünbaum & Shephard, Tilings and Patterns (1987).
Papers:
- Foundations: Turing (1936, 1939); Kleene (1938); Post (1944, 1946, 1948); Rice (1953); Friedberg (1957); Muchnik (1956); Sacks (1964); Cohen, "Computer viruses" (1987).
- PCP and grammars: Ehrenfeucht, Karhumäki & Rozenberg (1982); Halava, Harju & Hirvensalo (2002); Neary, "Undecidability in binary tag systems and the Post correspondence problem for five pairs of words" (2015); Cantor (1962); Floyd (1962); Chomsky & Schützenberger (1963).
- Tiles: Wang (1961); Berger (1966); Robinson (1971); Kari (1996); Culik (1996); Jeandel & Rao, "An aperiodic set of 11 Wang tiles" (2015, published 2021); Smith, Myers, Kaplan & Goodman-Strauss, "An aperiodic monotile" (2023) and "A chiral aperiodic monotile" (2023).
- Hilbert's tenth: Davis, Putnam & Robinson (1961); Matiyasevich (1970); Davis, "Hilbert's tenth problem is unsolvable" (1973); Jones, Sato, Wada & Wiens, "Diophantine representation of the set of prime numbers" (1976); Jones (1982); Sun (2021).
- Logic: Gödel (1931); Rosser (1936); Presburger (1929); Fischer & Rabin (1974); Tarski (1948); Robinson (1949); Novikov (1955); Boone (1958); Paterson (1970).
- Information: Kolmogorov (1965); Chaitin (1966, 1974, 1975); Solomonoff (1964); Calude, Dinneen & Shu, "Computing a glimpse of randomness" (2002); Solovay, "A version of Ω for which ZFC can not predict a single bit" (2000).
- Busy beavers and iterations: Radó (1962); Conway, "Unpredictable iterations" (1972) and "FRACTRAN" (1987); Yedidia & Aaronson (2016); Aaronson, "The busy beaver frontier" (2020); Stérin & Woods (2021); the bbchallenge collaboration (2024); Barina (2020).
- In the wild: Veldhuizen, "C++ templates are Turing complete" (2003); Grigore, "Java generics are Turing complete" (2017); Churchill, Biderman & Herrick, "Magic: the Gathering is Turing complete" (2019); Dolan, "mov is Turing-complete" (2013); Cubitt, Pérez-García & Wolf, "Undecidability of the spectral gap" (2015).
- Frontier: Denef & Lipshitz (1978); Mazur (1992); Poonen (2009); Mazur & Rubin (2010); Koenigsmann, "Defining ℤ in ℚ" (2016); Koymans & Pagano, "Hilbert's tenth problem via additive combinatorics" (2024); Alpöge, Bhargava, Ho & Shnidman (2025).
Primary version reconciliation:
- Neary, STACS 2015, Section 4, Theorem 11: five nonempty binary pairs; use this published version.
- Jeandel–Rao, Figure 3 and Theorem 3: five-color T and its separately colored variants.
- Koymans–Pagano, Theorems 1.1–1.2; Alpöge et al., published DOI.
- Koenigsmann: distinguish universal from the alternative one-universal-variable ∀∃ definition.
- Cubitt–Pérez-García–Wolf: exact thermodynamic promise and locality assumptions.
About this partfrom its README
Part 25 of the 61-part series, opening Act V, Limits and Secrets. The episode connects recognition, reductions, self-reference, arithmetic and information. Every impossibility result has an explicit model and hypotheses; finite unsuccessful searches retain their cutoff status.
The instrument is explainer/cs/algo/computability.py; numerical producers are
compute.py, with separate certificate checkers and native references in
computational_references.py. Tests exercise domains, budgets, full witnesses,
independent short PCP enumeration, tape boundaries and both executed quines.
The bilingual source registry contains 68 exact narration pairs. Plain complexity is written C; optimal prefix-free complexity is written K. Chinese source and cue agreement is distinct from synthesized speech and listening approval.
- Hook: finite Wang patches, positive Pell solutions, and constructive quines illustrate three connections. Quine existence itself has a constructive answer.
- Classes and reductions: a recognizer never falsely accepts; dovetailing waits for acceptance. Reducing self-halting to acceptance uses a halt-then-accept wrapper, including simulated rejection. Emptiness reverses the acceptance answer; exercise 1 supplies both equivalence reductions.
- Rice: nontrivial extensional properties of partial computable functions in an effective universal system. Under the stated observations, faults and divergence are both undefined; “never divides by zero” is not an extensional example. Analyzer, malware and optimization consequences need a specified property, objective and unbounded model. Totality alone does not decide every semantic question.
- Self-reference: Kleene's theorem assumes an acceptable effective numbering and a total computable index transformer. It constructs embedded descriptions; it is not an introspection facility for arbitrary existing source files. The forward Pebble quine prints 13,380 bytes in 98,687 instructions; the executed reverse-printing exercise prints 15,705 bytes in reverse in 472,027 instructions.
- PCP: matches are nonempty. The displayed TM construction is forced-first MPCP, under disjoint one-character alphabets, a reserved separator, nonempty input and rejection of a left move off cell zero. A separate standard reduction yields ordinary PCP. Full concatenated rows, not only history prefixes, are checked. The four-domino example's shortest length 206 is actually searched: 73,135 dequeued states including the root (73,134 with the legacy root-excluding convention). A retained independent residual-distance closure certificate and full string witness exclude shorter matches. Five-pair undecidability follows Neary's published 2015 theorem; the conflicting four-pair 2013 preprint is superseded. CFG intersection/ambiguity follow the marker construction; CFG universality needs another reduction.
- Tiles: every 4, 8, 12, 16 and 20 square grid is retained and independently edge-checked. The bounded torus search finishes 62 refutations and leaves two cutoffs among the 64 sizes up to 8 by 8. A separate complete closed-row graph and topological certificate for each width 1–8 excludes every positive height at those widths. This finite-width result does not prove full-plane aperiodicity. Jeandel–Rao Figure 3's five-color set T is covered by their Theorem 3; their four-color variant is a different set. The eleven-tile minimum concerns oriented Wang squares. The plane reduction also needs hierarchical forcing of initialized computations at arbitrary scales. The hat needs reflected copies; the spectre does not. Integer lattice cross products certify hat area exactly as 8√3 and verify every displayed vertex.
- Hilbert: Pell assumes positive nonsquare D and y>0. A deterministic million-attempt brute cap finds D=13 in 180 attempts and D=29 in 1,820; D=61 remains unresolved by that brute prefix. Continued fractions give its least positive solution (1,766,319,049, 226,153,980). All ten convergent certificates and nine monotonic timing repetitions per D are retained. Leastness uses the standard Pell-convergent theorem. DPRM uses natural-number parameters and auxiliaries; standard encodings transfer to integer-variable solvability. The prime polynomial asserts existence of auxiliary tuples, not that arbitrary tuples work at a prime k+2.
- Gödel: effective axiomatization, arithmetic strength and soundness scope the nonhalting proof. Rosser's consistency-only refinement is distinct from Gödel's original omega-consistency hypothesis for the opposite direction. The second theorem uses the standard provability predicate and derivability conditions; it does not follow merely from the informal soundness argument. Hilbert's objective is obstructed when its proposed finitistic reasoning is formalizable inside the theory, not by banning all external consistency proofs.
- Degrees: decidable sets are Δ1, distinct from bounded-formula Δ0. Quantifier blocks have computable matrices. Σ(n+1) is recognizable relative to the nth jump; Π(n+1) is co-recognizable. One oracle query follows a computable reduction. Sacks density requires distinct comparable c.e. degrees, not the incomparable displayed A and B. “Natural intermediate” is an informal research theme.
- Complexity: compression container bytes times eight plus fixed decoding, interpreter and framing costs bound plain C. The finite pi printer also needs its length argument, caller and dependencies. Every full compressed output round-trips; the independent interval-certified Chudnovsky computation agrees with all 100,000 digits, including the leading 3, from integer Machin. Invariance requires optimal description machines with additive simulation cost. Fewer than 2^-c of n-bit strings have C<n-c; the exact C≥n threshold guarantees some strings, not an overwhelming fraction. Chaitin's theorem requires an effectively axiomatized sound theory.
- Omega: an optimal prefix-free halting domain defines the measure of infinite coin streams having a halting program prefix. No uniform computable convergence modulus supplies arbitrary precision; special finite prefixes may be certified. Given dyadic truncation a, stop enumeration when q≥a: equality is sufficient if attained, while waiting only for equality can miss an overshoot. Prefix randomness uses prefix-free K, distinct from plain C. Effective sound-theory hypotheses apply, including Solovay's special-machine ZFC claim. The separate finite sample has 2,251/5,000 = 0.4502 halting machines, with an iid Wilson 95% interval approximately [0.4365, 0.4640]. All machine strings and halt times are retained. Independent native replay through S(3)=21 matches every 2,000-step result. This exactly classifies the sample, not the 16^6-machine population probability; observed empirical fractions are not deterministic lower bounds on that population measure.
- Busy beavers: S counts steps; Σ counts ones. The dominance sketch covers both parities and nonmonotone total computable f by computing max(f(2n), f(2n+1)). Total-language diagonalization states its effective syntax, Nat-to-Nat and closure assumptions. Exact-value unprovability requires an effective sound sufficiently strong arithmetic theory. Goldbach's reported 27-state encoding is unverified, so no unconditional S(27) consequence follows. The checked published 7,910-state ZFC construction is distinguished from the 432-state 2025 claim conditional on verification.
- Boundary and applications: Presburger's lower bound is worst case as formula length grows; real-closed-field decision concerns first-order polynomial formulas. Matrix mortality's 2×2 status is explicitly the cited 2015 literature status, not a new current survey. PRIMEGAME outputs are powers of two reached after positive steps, excluding initial 2^1. The actual three-million-step instruction trace is independently replayed using prime-exponent registers; every first-applicable instruction and all prime outputs through 127 agree. Full stopping lengths and tail-aware trajectory peaks for every positive Collatz start below a million agree with a guarded independent native replay. Ordinary Collatz may be false or true; no independence theorem is established. Universality examples assume ideal unbounded resources. Move-only computation needs repeating control flow. The spectral-gap theorem concerns promised robust thermodynamic families of 2D translation-invariant nearest-neighbor Hamiltonians with fixed local dimension. Finite exhaustive testing can establish absence of bugs within a completely specified finite model.
- Frontier: Koymans–Pagano and independent Alpöge–Bhargava–Ho–Shnidman results give H10 undecidability over all number-field integer rings; distinguish elliptic rank stability/additive combinatorics from the abelian-variety route. The broader ring statement concerns effectively presented infinite commutative unital finitely generated Z-algebras. Koenigsmann's universal definition and his different ∀∃ definition with one universal variable are separate results. Smith's 2007 two-state three-symbol claim uses a nonstandard infinite background.
Companion material in this repository
The syllabus's plan for this partfrom SYLLABUS.md, the plan of record
- Formally: decidable, recognizable, co-recognizable; the halting set K.
- Mapping reductions; A_TM, E_TM, EQ_TM; recognizable but undecidable; neither.
- Rice's theorem (proved): every non-trivial semantic property is undecidable. What that means for compilers, antivirus and static analysis, and how Part 54 escapes it by approximation.
- The recursion theorem (Kleene): programs that know their own code; quines in the Pebble language and in Python; a shorter proof of halting's undecidability.
- Post's correspondence problem (1946), via computation histories (dominoes animated); ambiguity of CFGs (callback to Part 12).
- Tiling: Wang tiles (1961); Berger's aperiodic set and undecidability (1966); Penrose tilings; the 2023 aperiodic monotile, "the hat".
- Hilbert's tenth (Matiyasevich 1970, on Davis, Putnam and Robinson): every r.e. set is Diophantine; the prime-producing polynomial (Jones et al. 1976), shown.
- Gödel via halting: a sound r.e. theory that proved every true halting statement would decide halting (proved); the second theorem; Gödel numbering.
- Oracles and degrees; the arithmetic hierarchy (Σ₁, Π₁, Σ₂; FIN and TOT); Post's problem (Friedberg–Muchnik).
- Kolmogorov complexity: the invariance theorem (proved); incompressible strings exist (counting); K is uncomputable (Berry); Chaitin's incompleteness.
- Chaitin's Ω: random, uncomputable, its bits answering famous questions.
- Busy beavers again: how BB(5) was proved (deciders, cryptids, Coq); BB(6) bounds and the Collatz-like Antihydra (2025) (verify); BB(n) is uncomputable and eventually independent of ZFC (Yedidia & Aaronson 2016, and later smaller machines (verify)).
- The boundary:
- decidable: Presburger arithmetic, at double-exponential cost (Fischer & Rabin 1974), and real closed fields (Tarski);
- undecidable: the word problem for groups (Novikov, Boone), matrix mortality, generalized Collatz (Conway's FRACTRAN).
- In the wild: Magic: The Gathering is Turing-complete (2019); Java generics and C++ templates; type checking that never ends. Outro.
Computed: a bounded PCP solver and the reduction; Wang tilings; compressors as a Kolmogorov proxy on random against structured strings; BB champions; Conway's PRIMEGAME producing primes; Collatz trajectories. Visuals: the PCP domino stack; a Wang tiling growing; the hat; the arithmetic hierarchy as a ladder; Ω's bits. In practice: why static analyzers report false positives and no virus scanner can be perfect; self-reproducing code. Reading: Sipser ch. 4–6; Rogers, Theory of Recursive Functions and Effective Computability; Soare, Turing Computability; Boolos, Burgess & Jeffrey, Computability and Logic; Li & Vitányi, An Introduction to Kolmogorov Complexity; Davis 1973; Matiyasevich, Hilbert's Tenth Problem; Chaitin 1975; Aaronson 2020; Smith et al. 2023.
中文讲义
本讲的中文部分(与英文版对应)。
习题与解答
-
等价性。 证明 EQ_TM 既不可识别,也不是补可识别的。
解答
把 A_TM 归约到 EQ_TM 的补:把 ⟨M, w⟩ 映到 ⟨M₁, M₂⟩,其中 M₁ 拒绝一切,M₂ 忽略输入、在 w 上运行 M,M 接受则接受。若 M 接受 w, 则 L(M₂) = Σ* ≠ ∅ = L(M₁);否则两者都为空。所以 A_TM ≤ₘ co-EQ_TM,从而 co-A_TM ≤ₘ EQ_TM;co-A_TM 不可识别,所以 EQ_TM 也不可识别。 再把 A_TM 归约到 EQ_TM 本身:映到 ⟨M₁, M₂⟩,M₁ 接受一切,M₂ 同上;M 接受 w 当且仅当 L(M₁) = L(M₂)。于是 co-A_TM ≤ₘ co-EQ_TM,co-EQ_TM 也不可识别,即 EQ_TM 不是补可识别的。
-
Rice 定理,以及它管不到的。 证明“M 接受某个回文”不可判定,并解释为什么“M 的描述是回文”可判定。
解答
L(M) 是否含有回文只取决于 L(M),所以这是语义性质;它非平凡:接受 {a} 的机器有,什么都不接受的机器没有。由 Rice 定理,它不可判定。 第二个性质关乎文本 ⟨M⟩ 而不是 L(M):两台语言相同的机器可以在这一点上不同,所以它不是语义性质,程序从两端读这个字符串就能判定。
-
按序枚举。 证明一个语言可判定,当且仅当某个枚举器按递增(先短后字典)顺序打印它。
解答
(⇒) 给定判定器 D,按先短后字典的顺序在每个字符串上运行 D,打印它接受的。(⇐) 若 L 有限,查表即可判定。若 L 无限且 E 按递增顺序 打印它,判定 w 时就运行 E,直到它打印出 w(接受)或一个排在 w 之后的字符串(拒绝)。L 无限,所以 E 终究会打印出 w 之后的字符串,过程总会停机; 而顺序递增,w 不可能再晚出现。
-
普通复杂度的界。 固定最优普通描述机,长度单位为比特。 证明 C(x) ≤ |x| + c 且 C(xx) ≤ C(x) + c,并推出每种长度的字符串中至多一半满足 C(x) < |x| − 1。
解答
程序“打印下面这段字面量:x”的长度是 |x| 加上打印代码的固定长度。若 p 打印 x,则“运行 p,把输出打印两遍”的长度为 |p| + c′。计数: 长度小于 n − 1 的程序共有 1 + 2 + … + 2ⁿ⁻² = 2ⁿ⁻¹ − 1 个,每个至多打印一个字符串,所以少于 2ⁿ⁻¹ 个,即长度为 n 的 2ⁿ 个字符串中不到一半, 能有 C(x) < n − 1。
-
动手:倒着打印自己的程序。 用 Pebble 语言写一个把自己的源代码倒着打印出来的程序,并在模拟器上运行。
已执行的解答。
computability.pebble_backward_quine()构造该程序。保留的 O2 编译镜像运行 472,027 条模拟器指令,把 15,705 个源码字节精确反向输出;构造时检查源码能装入 32,768 个条目的输出缓冲区。沿用第 4 章自打印程序的结构:头部声明数组
d;数据段由赋值d[k] = c;组成,存放头部和尾部的字符编码;然后是尾部。尾部不直接打印, 而是分三趟把整个源代码写进一个缓冲区:先从d复制头部,再写出每条赋值的文本(k 和 c 的十进制数字加上固定的标点),最后从d复制尾部。 然后从最后一个字节到第一个字节打印缓冲区。像computability.pebble_quine那样用一小段 Python 脚本生成这个程序,再用同样方式检查:编译, 在模拟器上运行,把输出与反转后的源代码比较。递归定理保证,对文本的任何可计算变换(包括反转),这样的程序都存在。 -
★ 研究:三张多米诺。 三张多米诺的 Post 对应问题可判定吗?从长度至多为 3 的词入手:保留匹配证书、有限图排除证明,以及尚未解决的截断。固定有限集合的最短匹配长度必有某个有限最大值;任务是找出显式数值与证书,再探索依赖一般输入规模的可计算界。
从哪里入手。 两张多米诺的情形由 Ehrenfeucht、Karhumäki 与 Rozenberg(1982)解决,Halava、Harju 与 Hirvensalo(2002)作了简化;他们分析 悬垂部分如何演变的方法,是推向三张时最自然的工具。Neary(2015)给出五张时的不可判定性,所以这些方法必然在三到五之间的某处失效,而找出在哪里 失效本身就很有价值。保留的固定预算运行覆盖 20,000 个随机实例:4,679 个匹配、11,819 个有限图穷尽、2,217 个深度截断、1,285 个节点截断。全部输入、状态与匹配均已保存;截断仍未解决。词长至多三的有限实验并未解决一般三张 PCP。枚举 {0, 1} 上词长至多为 3 的全部三张多米诺实例,去掉对称性(交换 0 和 1、反转每个词、置换多米诺);用悬垂部分上的广度优先搜索求解;再用简单的不变量证明未解出的实例无解:无法修复的长度失衡、无法延伸的悬垂, 或者像第 1 部分忙碌海狸判定器那样的有限自动机证书。抵抗住所有证书的那些实例,就是问题真正所在。
Build the film
python -m videos.cs.cs25.compute # the part's numbers, into .cache/cs25
python tools/build.py cs25 # render and assemble the film
EXPLAINER_TTS=silent python tools/qa_scene.py cs25 Hook # one chapter, silent, with a contact sheet
Scenes: videos/cs/cs25. Setup: see the course page. Source of these notes: the README and the scenes' narration.
Build it
python -m unittest tests.test_cs25_computability
python -m videos.cs.cs25.compute --force
python tools/build.py cs25 -q l
python tools/build.py cs25
Schema-2 caches validate source signatures and their retained artifacts. Complete native sources, compiler flags/version, images, inputs, outputs and sanitizer receipts are retained. Durations describe this workload on the shared host; deterministic budgets and verified witnesses are the central results.
The episode checkpoint evidence is documented in the QA packet. Continuous narrated playback/listening, Chinese speech/listening, whole-video native production and runtime at the selected narration pace remain separate production gates.