Closure Properties and the Co-Turing-Recognizable Class

Imagine a verifier that checks whether a Turing machine ever halts on blank input. Given a machine that halts, the verifier can simulate it. It can confirm "yes" in finite time. But if the machine runs forever, the verifier waits forever. It never announces "no." This asymmetry — being able to confirm membership but not always confirm non-membership — is the central phenomenon of this article. It explains why some of the most important undecidable languages in computability theory, like the acceptance problem ATMA_{TM}, are only "half-decidable." The idea matters far beyond a single puzzle about Turing machines. Every real verification or search procedure that terminates on success but may loop on failure inherits this same one-sided structure. This includes type checkers hunting for a proof, model checkers searching for a counterexample, theorem provers, and even certain security scanners. Understanding exactly when one-sided verification can be upgraded to full decidability matters greatly. So does knowing when it provably cannot. This tells engineers and theorists where automation has hard limits. It also gives us a clean algebraic toolkit: closure properties of language classes under union, intersection, and complement. These let us reason about combinations of problems without re-deriving everything from scratch. This article develops the precise relationship between the classes of decidable languages and Turing-recognizable languages. It culminates in the theorem that ties them together: a language is decidable exactly when both it and its complement are recognizable. We then use this theorem as a lens to examine ATMA_{TM}. This is the canonical undecidable-but-recognizable language established via Undecidability by Diagonalization. We show why its complement, ATM‾\overline{A_{TM}}, cannot be recognizable. The argument is short but subtle. Mastering it is a rite of passage in Decidable and Turing-Recognizable Languages. By the end, you will be able to state and prove the decidability–closure theorem. You will apply it to classify new languages as decidable, recognizable-only, or co-recognizable-only. You will also see how this single result seeds later machinery. This includes mapping reductions and the arithmetic hierarchy, used to organize the entire undecidable universe.

Key takeaways
  • A language is decidable iff both it and its complement are Turing-recognizable.
  • Decidable languages are closed under complement; recognizable languages, in general, are not.
  • ATMA_{TM} (the halting/acceptance problem) is recognizable but not decidable, by diagonalization.
  • Therefore ATM‾\overline{A_{TM}} must not be recognizable — otherwise ATMA_{TM} would be decidable.
  • This gives the first natural example of a language that is not even Turing-recognizable.
  • The result sets up mapping reducibility, the standard tool for proving new languages undecidable.
The core insight

A language is decidable precisely when we can recognize both it and its complement — one-sided verification becomes two-sided proof only when both directions terminate.

The idea

A language LL over an alphabet Σ\Sigma is Turing-recognizable (also called recursively enumerable) if some Turing machine MM halts and accepts on every string in LL, and either rejects or runs forever on every string not in LL. A language is decidable (recursive) if some Turing machine halts on every input, accepting strings in LL and rejecting strings not in LL. Decidability is strictly stronger: it demands a guaranteed, halting verdict in both directions, while recognizability only guarantees a halting verdict on the "yes" side. The complement of LL, written L‾\overline{L}, is the set of all strings over Σ∗\Sigma^* not in LL. Closure properties describe how these classes behave under set operations. The decidable languages are closed under complement, union, intersection, and concatenation — if you can decide L1L_1 and L2L_2, you can decide combinations of them by running both deciders and combining the verdicts, since both always halt. The recognizable languages are closed under union and intersection, but not closed under complement in general. This failure of closure is not a minor technicality; it is the structural reason undecidable-but-recognizable languages exist at all, and it is precisely quantified by the central theorem below.

Theorem (Decidability via recognizability of both sides). A language LL is decidable if and only if both LL and L‾\overline{L} are Turing-recognizable. This theorem is the bridge between the two classes. The forward direction is easy: a decider for LL is trivially a recognizer for LL, and swapping accept/reject states gives a decider — hence a recognizer — for L‾\overline{L}. The reverse direction is the substantive half, and it is a dovetailing argument: run two recognizers side by side, alternating steps, until one of them halts. Because every string is in exactly one of LL or L‾\overline{L}, and because both languages have a recognizer, one of the two machines is guaranteed to halt eventually on any input, giving a correct, always-halting decision procedure.

How it works

The constructive half of the theorem — building a decider out of two recognizers — is the mechanism worth internalizing, since it recurs throughout computability theory. The technique is called dovetailing: instead of running one machine to completion (which might never happen) and then the other, we interleave their execution step by step so that neither one can "starve" the other of CPU time. ``` // Given: recognizer M1 for language L // recognizer M2 for language ~L (the complement of L) // Goal: a decider D for L function D(w): // simulate M1 and M2 in lock-step, one step at a time initialize configuration c1 = start configuration of M1 on w initialize configuration c2 = start configuration of M2 on w loop forever: c1 <- advance M1 by exactly one computation step from c1 if M1 has halted in c1: if M1 accepts: return ACCEPT // (M1 rejecting w is impossible for a recognizer's // intended use here, but if it happens, fall through) c2 <- advance M2 by exactly one computation step from c2 if M2 has halted in c2: if M2 accepts: return REJECT // w is in ~L, so w not in L // unreachable: guaranteed to halt, see correctness argument below ``` Two engineering details make this work in practice. First, "advance by one step" must be well-defined for an arbitrary Turing machine simulation — this is exactly the same simulation primitive used to build the universal Turing machine underlying ATMA_{TM}. Second, the loop must genuinely alternate a bounded amount of work per round (one step each), not run M1M_1 to some heuristic cutoff before trying M2M_2; otherwise, on inputs where M1M_1 loops forever, DD would never reach M2M_2 and would fail to halt. The other direction of the theorem — decidable ⇒\Rightarrow both sides recognizable — is the trivial "flip the decider" construction: ``` // Given: decider D for language L (always halts) // Build: recognizer for L, and recognizer for ~L function Recognizer_for_L(w): return D(w) // D already halts and gives correct verdict function Recognizer_for_complement(w): if D(w) == ACCEPT: return REJECT else: return ACCEPT // still always halts, since D always halts ``` Since a decider is, by definition, a machine that always halts with the correct verdict, simply swapping its accept and reject outputs yields a decider for the complement — and a decider is in particular a recognizer.

Figure
Dovetailing two recognizers into one decider
input w M1 recognizes L halts + accepts if w∈L may loop if w∉L M2 recognizes ¬L halts + accepts if w∉L may loop if w∈L Dovetail scheduler: 1 step M1, 1 step M2, repeat ACCEPT (w∈L) REJECT (w∉L)

Complexity & correctness

Correctness of the dovetailing decider. Fix any input ww. Because LL and L‾\overline{L} partition Σ∗\Sigma^*, exactly one of the statements "w∈Lw \in L" or "w∈L‾w \in \overline{L}" is true. If w∈Lw \in L, then since M1M_1 recognizes LL, M1M_1 halts and accepts after some finite number of steps s1s_1. If w∈L‾w \in \overline{L}, then since M2M_2 recognizes L‾\overline{L}, M2M_2 halts and accepts after some finite number of steps s2s_2. In either case, one of the two machines halts within a finite, input-dependent number of steps. Because the scheduler advances both machines by exactly one step per round, after at most 2max⁡(s1,s2)2\max(s_1,s_2) total simulated steps the halting machine's halt is observed, and DD returns the corresponding verdict. Crucially DD never needs to wait for the non-halting machine: it only needs to notice, at each round, whether either machine has halted yet. So DD always halts, and it halts with the correct answer — hence DD decides LL.

Complexity. This construction is about computability, not efficiency, so there is no polynomial bound to state — but it is worth being honest about the resource cost. If w∈Lw \in L and M1M_1's accepting computation takes s1s_1 steps, the dovetailed decider may take O(s1)O(s_1) rounds only if M2M_2 also happens to halt around then; more precisely it takes O(min⁡(s1,s2))O(\min(s_1, s_2)) rounds in the case both machines eventually halt (which is guaranteed here since one always does for any given ww), each round costing the constant-factor overhead of simulating one step of each machine. The simulation overhead itself is bounded by a polynomial in the machine's description size for standard simulation techniques, but the number of rounds is fundamentally unbounded as a function of ∣w∣|w| alone — deciding some decidable languages this way can be astronomically slow, since decidability makes no promise about running time. Space usage is similarly unbounded in principle but always finite for a given halting computation, since each of M1M_1, M2M_2 only uses finitely much tape before halting.

Why recognizability alone does not give closure under complement. The dovetailing trick above requires a recognizer for L‾\overline{L} to exist. If only LL is known to be recognizable, dovetailing M1M_1 against nothing achieves nothing on the "no" side: if w∉Lw \notin L, M1M_1 simply loops forever, and there is no witness process to detect this in finite time in general. This is not a failure of cleverness — for ATMA_{TM} it is a theorem.

Theorem. ATM‾\overline{A_{TM}} is not Turing-recognizable. Proof. Recall ATM={⟨M,w⟩:M is a TM that accepts w}A_{TM} = \{\langle M, w\rangle : M \text{ is a TM that accepts } w\}, which is recognizable via the universal simulator (established by Undecidability by Diagonalization alongside its undecidability). Suppose, for contradiction, that ATM‾\overline{A_{TM}} were also recognizable. Then both ATMA_{TM} and its complement would be recognizable, so by the theorem above, ATMA_{TM} would be decidable. But ATMA_{TM} is proven undecidable by the diagonalization argument: assuming a decider HH for ATMA_{TM} lets us build a machine DD that runs H(⟨D,D⟩)H(\langle D, D \rangle) and does the opposite, producing a contradiction on input ⟨D,D⟩\langle D, D\rangle exactly as in Cantor's diagonal argument. This contradiction refutes the assumption that ATM‾\overline{A_{TM}} is recognizable. ■\blacksquare This is the contrapositive engine of the whole article: instead of directly building a diagonalizing machine against ATM‾\overline{A_{TM}}, we route the argument through the decidability–closure theorem, reusing the already-established undecidability of ATMA_{TM}. This is a template you will reuse constantly: to show some language BB is not recognizable, it often suffices to show BB's complement is recognizable and that if BB were also recognizable, some known-undecidable language would become decidable.

Worked example

Let's trace both directions of the theorem on a small but genuine example, then apply the contrapositive machinery to a second language.

Example 1 — a decidable language, forward direction. Let L={⟨M⟩:M is a TM whose transition table has an even number of entries}L = \{\langle M \rangle : M \text{ is a TM whose transition table has an even number of entries}\}. This is decidable: count the table entries and check parity — always halts. We exhibit both recognizers explicitly per the theorem.

StepMachineBehavior on input ⟨M⟩\langle M\rangle
1Decider DDParses ⟨M⟩\langle M\rangle, counts transition entries nn, checks n  2n \bmod 2
2Recognizer for LLRuns DD; if DD says even, ACCEPT; if odd, REJECT (still halts, so it's a valid recognizer)
3Recognizer for L‾\overline{L}Runs DD; if DD says odd, ACCEPT; if even, REJECT

Both halt on every input, confirming decidable ⇒\Rightarrow both sides recognizable, with room to spare (both are in fact decidable too).

Example 2 — the reverse (dovetailing) direction on a toy pair. Suppose (hypothetically, for illustration only — this is a toy, not ATMA_{TM}) L′={n:n is prime}L' = \{n : n \text{ is prime}\} encoded in unary/binary, with:

  • M1M_1: on input nn, trial-divides up to n\sqrt n; halts and accepts iff nn is prime, halts and rejects iff composite. (In reality M1M_1 already halts on both sides — primality is decidable — but suppose we only trust the "accept primes" behavior for this drill.)
  • M2M_2: on input nn, searches divisors 2,…,n−12,\dots,n-1; halts and accepts as soon as it finds one (so accepts composites), and would in principle "run forever" if we naively didn't bound the search — we impose the bound n−1n-1 so it always halts.

Dovetailing: on n=17n = 17, round-robin single steps of M1M_1 and M2M_2. M1M_1 tests divisibility by 2,32,3 (17≈4.1\sqrt{17}\approx 4.1) and halts accepting after checking up to 44; M2M_2 would need to check up to 1616 divisors before concluding "no divisor found," but since M2M_2 here is defined to loop or reject only after exhausting all candidates, M1M_1's halt is detected first, in about 3–4 rounds, and DD correctly outputs ACCEPT ("17 is prime") well before M2M_2 finishes its longer search. This mirrors the general theorem: the decider does not need both machines to be efficient or even comparably fast — it only needs the one that will eventually halt on this particular input to halt in finite time, and it detects whichever happens first.

Example 3 — applying the contrapositive to a new language. Define B={⟨M⟩:M does not halt on any input}B = \{\langle M \rangle : M \text{ does not halt on any input}\} (the "totally non-halting" machines). One can show, using a very similar reduction-flavored argument foreshadowing Mapping Reducibility, that BB is not recognizable. Sketch: recognizability of BB would let you build a recognizer for ATM‾\overline{A_{TM}} by a reduction that transforms ⟨M,w⟩\langle M, w\rangle into a machine MwM_w that ignores its input and simulates MM on ww, looping forever if MM accepts ww (never halting) and halting immediately otherwise. Then Mw∈BM_w \in B (never halts) exactly when MM does not accept ww, i.e., exactly when ⟨M,w⟩∈ATM‾\langle M,w\rangle \in \overline{A_{TM}}. A recognizer for BB would thus recognize ATM‾\overline{A_{TM}} — which we just proved impossible. This is precisely the reduction technique the theorem sets up.

Common pitfalls & traps

PitfallWhy it's wrong
Thinking "recognizable" means "decidable but maybe slow"Recognizability permits never halting on non-members; there is no time bound, however large, that fixes this
Running M1M_1 to completion, then starting M2M_2If w∉Lw \notin L, M1M_1 never finishes, so M2M_2 never starts; true dovetailing needs simultaneous, interleaved steps
Assuming recognizable languages are closed under complementOnly decidable languages enjoy that closure; ATMA_{TM} is the standard counterexample showing recognizable languages are not
Concluding ATM‾\overline{A_{TM}} is undecidable by direct diagonalizationIt's cleaner (and standard) to derive non-recognizability of ATM‾\overline{A_{TM}} via the closure theorem plus undecidability of ATMA_{TM}, rather than re-diagonalizing from scratch
Forgetting that a decider IS a recognizerThe forward direction of the theorem needs this trivial-but-easy-to-skip fact; failing to state it leaves the "only if" direction unjustified
Confusing "not recognizable" with "recognizable-complement"ATM‾\overline{A_{TM}} is not recognizable at all — it is not simply "recognizable from the other side"; it truly cannot be recognized by any single machine

Pioneers & history

The theorem connecting decidability to two-sided recognizability, and the resulting classification of ATMA_{TM} and its complement, emerged directly from the foundational work on computability in the 1930s and its systematization in the following decades.

Origins · 1 minAlan Mathison Turing and how this was discovered
AM
Alan Mathison Turing
1912–1954 · Formalized mechanical computation and proved the undecidability of the Halting Problem

Turing introduced the Turing machine as a precise model of mechanical computation and used a diagonalization argument to show that no machine can decide, for every machine–input pair, whether the machine halts. This single result is the ancestor of both ATMA_{TM}'s undecidability and the non-recognizability of its complement.

History
1936
— Turing publishes "On Computable Numbers," proving the Halting Problem undecidable via diagonalization.
1936
— Alonzo Church independently establishes unsolvability results via the lambda calculus, corroborating Turing's model.
1943–1946
— Post and Kleene develop recursive enumerability, formalizing what later becomes "Turing-recognizable."
1958–1967
— Textbook systematizations (Davis, Rogers) crystallize the decidable-iff-both-sides-recognizable theorem as standard curriculum.
1979
— Hopcroft and Ullman's textbook cements the modern presentation used in undergraduate theory-of-computation courses.

Where this matters

The recognizable-but-not-decidable phenomenon is not an academic curiosity confined to Turing machines; it shows up wherever a search or verification process can confirm success but has no guaranteed way to confirm failure. Program verifiers and type checkers for sufficiently expressive languages exhibit exactly this asymmetry: they can certify "this program type-checks" by exhibiting a derivation, but detecting "this program will never type-check under any elaboration strategy" is, in the worst case, exactly as hard as the halting problem — which is why real-world tools impose termination bounds, restricted type systems, or accept the risk of non-termination on pathological inputs. Automated theorem provers and SAT/SMT solvers used in hardware and software verification (as in compilers, security analyzers, and formal-methods tooling) are recognizers for "provable" or "satisfiable," and their looping-on-failure behavior is a direct, practical instance of one-sided recognizability. Model checkers used to verify hardware circuits and communication protocols similarly can confirm the existence of a bug (a reachable bad state) but proving the absence of bugs in unbounded-state systems runs into the same theoretical wall, motivating techniques like abstraction and bounded model checking that trade completeness for termination. More broadly, the decidability–closure theorem is the ancestor of the entire hierarchy of unsolvability degrees. It directly motivates Mapping Reducibility as the tool for transferring undecidability and non-recognizability from known hard languages like ATMA_{TM} to new ones, and it is the base case of the Oracles and the Arithmetic Hierarchy, where languages are classified by how many alternations of "recognizable" and "co-recognizable" quantifiers are needed to define them.

Ask the tutor: Can you walk through why interleaving must be exactly one step per machine per round, rather than some other fixed schedule?

Is every recognizable language automatically decidable?

No. Recognizability only guarantees a halting, correct "accept" behavior on members of the language; on non-members, the recognizer may reject or may run forever without ever announcing rejection. Decidability additionally requires halting with a correct verdict on every input, member or not. ATMA_{TM} is the standard example of a language that is recognizable — a universal machine can simulate MM on ww and accept if it halts and accepts — but not decidable, since no machine can also guarantee halting and correctly rejecting every non-member, by the diagonalization argument.

Why is the dovetailing construction necessary instead of just running the two recognizers sequentially?

Sequential execution assumes you can finish running the first recognizer before starting the second, but a recognizer for LL may run forever on an input not in LL. If you wait for M1M_1 to finish before trying M2M_2, and w∉Lw \notin L, you wait forever and never get to consult M2M_2, which would have told you the answer. Interleaving single steps of both machines guarantees that whichever one is destined to halt (exactly one is, for any input, given both languages partition all strings) will be detected in finite time, regardless of how long the other machine might loop.

Why can't we just diagonalize directly to prove the complement of A_TM is not recognizable?

You can construct a direct diagonalization proof, but routing through the closure theorem is more economical and more illuminating. Since ATMA_{TM}'s undecidability is already established by diagonalization, showing that recognizability of ATM‾\overline{A_{TM}} would make ATMA_{TM} decidable (via the dovetailing theorem) immediately yields a contradiction. This reuses previously proven machinery rather than re-deriving a fresh diagonal argument, and it is the standard proof pattern extended later to many other non-recognizable languages via reductions.

Are recognizable languages closed under union and intersection, even though not under complement?

Yes. Given recognizers M1M_1 for L1L_1 and M2M_2 for L2L_2, you can recognize L1∪L2L_1 \cup L_2 by dovetailing both machines on the same input and accepting as soon as either accepts — no need to wait for rejection since recognizers may never reject. You can recognize L1∩L2L_1 \cap L_2 by running both machines to completion in parallel (dovetailed) and accepting only if both eventually accept; if either loops forever, the intersection-recognizer correctly loops too, since we're never claiming to detect non-membership.

What is the practical significance of a language being recognizable but not decidable?

It means there is a program that will always correctly say "yes" in finite time when the answer is yes, but there is no program guaranteed to always say "no" in finite time when the answer is no — you might simply have to keep waiting, never knowing if the machine will eventually halt or is stuck forever. This models real verification tools: a compiler's type checker, a proof assistant, or a program analyzer can often confirm success but cannot, in general, definitively certify failure without risking non-termination or resorting to conservative approximations.

Does this theorem generalize beyond Turing machines, e.g., to other computational models?

Yes — the theorem is really a statement about any class of "yes-detecting" procedures closed under simultaneous simulation, so it applies to any Turing-equivalent model (register machines, lambda calculus, cellular automata) under the Church–Turing thesis. It also generalizes upward: in the arithmetic hierarchy, the pattern "decidable iff both directions are recognizable at level nn" recurs with oracle machines, giving rise to classes Σn\Sigma_n, Πn\Pi_n, and Δn\Delta_n that measure how many alternating layers of recognizability are needed to pin down harder and harder languages.

How does this connect to mapping reducibility, which comes next?

Mapping reducibility formalizes the "convert one language's membership question into another's" technique used implicitly in the BB example above. Once you know ATM‾\overline{A_{TM}} is not recognizable, you can prove a new language CC is not recognizable by exhibiting a computable function that transforms instances of ATM‾\overline{A_{TM}} into instances of CC in a membership-preserving way. The closure theorem supplies the "target" hardness result; mapping reducibility supplies the transportation mechanism that spreads that hardness to new languages without redoing diagonalization each time.

Before this

Where this leads