Chapter 13: The Boundaries of Reasoning — and Why We Must Accept Them
Turing asked: can machines think? The harder question is: can we know that they think?
1. The Boundaries Exist
This book started with entropy and prediction in Chapter 1, and has passed through symbolic systems, word vectors, neural networks, Transformers, search algorithms, and complexity theory. We have seen the great progress of AI reasoning, and we have seen its fundamental limits.
Now it is time to face a deeper question: does reasoning itself have boundaries?
The answer is: yes. And that boundary is not a technical limit — it is a logical necessity.
Chapter 7's halting problem told us: some questions simply cannot be decided. Given a program and its input, no algorithm can decide whether it will halt.
Chapter 12's Yonglin's formula told us: reasoning chains eventually converge back to the prior anchor — the object layer closes and the meta layer breaks.
These two results point at the same fact: any sufficiently powerful reasoning system contains problems it cannot solve.
This is not failure. It is mathematical truth.
2. The Echo of Gödel
In 1931, Gödel proved a theorem that shook the mathematical world: any sufficiently strong formal system contains true propositions it cannot prove.
Let me restate this theorem in the simplest way.
Suppose you have a formal system
- a set of axioms — the starting points the system acknowledges
- a set of inference rules — how to derive new propositions from the axioms
As long as this system is strong enough — strong enough to express basic arithmetic, strong enough to talk about "proof" itself — Gödel can construct a special proposition
Now ask: is
Case 1: if
Case 2: if
Conclusion: there is a true proposition
Stop, and let that sentence turn around in your head.
"The proposition
This is not a failure of logic; it is the structural cost of self-reference. Any sufficiently strong system contains such a pit, because "sufficiently strong" itself means: it can not only talk about objects, but also talk about how it talks about objects.
Why Does "Sufficiently Strong" Bring Self-Reference?
Gödel's trick is not simply writing down a paradox; it is encoding "proof" as arithmetic relations. Propositions, proof sequences, inference rules can all be numbered and turned into relations between natural numbers. So a system that seems to only talk about addition and multiplication suddenly gains the ability to talk about "whether this proposition is provable".
That is where the danger lies: once a system can encode its own syntax, it can construct propositions that point at itself. Self-reference is not an added feature; it is a side effect of being expressive enough.
This also explains why incompleteness is not about "the system not being strong enough". Quite the opposite: the stronger a system is, the more inevitably it meets its own shadow.
3. Gödel's Boundary: The Shape of Incompleteness
The lesson of Gödel's incompleteness theorem for reasoning is not the conclusion "there exist unprovable propositions" itself, but a deeper structure it reveals: a system can generate infinitely many legal steps in internally consistent fashion, yet cannot guarantee from the inside that those steps reach the truth outside the system.
A formal system can be written as a triple:
where
This brings three direct consequences:
Consequence one: self-verification has a structural ceiling. A system can prove many theorems with
Consequence two: internal consistency is not external truth. A system can generate infinitely many seemingly correct proofs within its own boundaries, and mistake that internal consistency for external truth. The real danger is not that the system makes mistakes, but that it cannot use itself to prove itself right.
Consequence three: there is still a lot to do inside the boundaries. Precisely because a system cannot vouch for itself, we need external checkpoints — machine proof checkers, independent verifiers, human review. Completeness was never a property of the system; it is a division of labor between people and systems.
Technical Detail: The Abstraction of a Formal System Is Roomy Enough to Hold a Reasoning System
Put
: the starting points the system acknowledges (axioms / the training distribution and the prior) : the legal derivation rules (inference rules / hidden-state transition rules) : the provability relation (whether a derivation step is accepted)
The benefit of this abstraction: it moves the discussion of "system boundaries" from mathematics into reasoning research, without assuming a reasoning system and a mathematical system are the same kind of thing. Gödel spoke of formal systems, not neural networks. His lesson is structural: any system that "generates legal steps with its own rules" cannot use itself to prove its own completeness.
An Easy Point of Confusion:
Gödel's proposition
A reasoning model's prior anchor
The two propositions are similar in language but different in mechanism:
The judgment really worth taking away: any sufficiently powerful reasoning system encodes its own limits into its own structure. Gödel is the example that takes this judgment furthest, and most precisely.
4. Try It Yourself: Constructing an Undecidable Problem
Let us experience the undecidability of the halting problem with our own hands.
Step 1: assume a halting decider exists
Step 2: construct the diagonalization program
The Python below makes this thought experiment concrete. We first define a "hypothetical" halting decider (which in reality cannot be implemented exactly), then construct the diagonalization program that drives it into contradiction, and finally verify with a brute-force simulation that the contradiction must happen.
import sys
import threading
# ------------------------------------------------------------------
# Step 1: simulate an "approximate halting checker" with a timeout
# A true HALT cannot exist; here we approximate it with a finite timeout:
# if the program returns within `timeout` seconds, we judge it "halts",
# otherwise we judge it "does not halt".
# ------------------------------------------------------------------
def approximate_halt(func, timeout=0.05):
"""
Approximate whether func() halts within `timeout` seconds.
Returns True for "judged halting", False for "judged non-halting".
"""
result = [None]
def runner():
try:
func()
result[0] = True # function returned normally -> halts
except Exception:
result[0] = True # raising an exception also counts as halting
t = threading.Thread(target=runner, daemon=True)
t.start()
t.join(timeout)
# still running after the timeout -> judged as "does not halt"
return result[0] is True
# ------------------------------------------------------------------
# Step 2: construct the diagonalization program DIAG
# The logic of DIAG:
# If HALT(DIAG) returns True (judges that DIAG will halt)
# -> DIAG enters an infinite loop (actually does not halt)
# Otherwise (judged not to halt)
# -> DIAG returns immediately (actually halts)
# ------------------------------------------------------------------
def make_diag(halt_checker):
"""Factory function: build a diagonalization program from the given halt_checker"""
def diag():
# First ask the "checker": will I (diag) halt?
will_halt = halt_checker(diag)
if will_halt:
# The checker says I will halt -> I stubbornly loop forever
while True:
pass
else:
# The checker says I will not halt -> I stubbornly return at once
return
return diag
# ------------------------------------------------------------------
# Step 3: ask whether DIAG(DIAG) will halt, revealing the contradiction
# ------------------------------------------------------------------
print("=" * 55)
print("Undecidability of the halting problem: the diagonalization argument")
print("=" * 55)
diag = make_diag(approximate_halt)
# First predict with the checker
prediction = approximate_halt(diag)
print(f"\nChecker prediction: DIAG will {'halt' if prediction else 'not halt'}")
# Then actually observe DIAG's behavior using a timeout
actual_halted = approximate_halt(diag, timeout=0.1)
print(f"Actual observation: DIAG {'halted' if actual_halted else 'did not halt (timeout)'}")
# Check whether a contradiction arises
if prediction != actual_halted:
print("\n-> Contradiction! The checker's prediction is the opposite of DIAG's actual behavior.")
else:
# Note: the timeout approximation may make the two observations
# "coincidentally" agree; this is only the error of an approximate
# checker and does not affect the rigorous mathematical proof.
print("\n-> Note: the timeout approximation may mask the contradiction, but the rigorous proof")
print(" guarantees the exact HALT inevitably leads to a contradiction (see the analysis below).")
print("\n--- Rigorous logical analysis ---")
print("Case A: HALT(DIAG, DIAG) = True -> DIAG loops forever -> actually does not halt -> contradiction!")
print("Case B: HALT(DIAG, DIAG) = False -> DIAG returns at once -> actually halts -> contradiction!")
print("\nConclusion: an exact halting checker HALT is logically impossible.")
print(" This is not a matter of algorithmic cleverness, but a logical necessity.")Step 3: ask DIAG(DIAG)
Now ask: does DIAG(DIAG) halt?
- If HALT(DIAG, DIAG) returns True:
- that means DIAG(DIAG) halts
- but by DIAG's definition, it enters an infinite loop
- contradiction!
- If HALT(DIAG, DIAG) returns False:
- that means DIAG(DIAG) does not halt
- but by DIAG's definition, it returns immediately (halts)
- contradiction!
Conclusion: HALT cannot exist.
What does this contradiction tell us?
Not that we have not yet found an algorithm clever enough, but that no algorithm can solve the halting problem. It is a logical necessity, not a technical limit.
5. The Map of the Reasoning Kingdom
Now let us step back.
Lay out the thirteen earlier chapters: Chapter 1's entropy told us why the world needs prediction; Chapter 2's symbols told us how humans write predictions into workable rules; Chapters 3 through 6 told us how neural networks compress symbols into vectors, push vectors into states, and organize states into the attention flow of a Transformer; Chapter 7's complexity told us: not every search can be finished beautifully; Chapter 8's heuristics told us: when exactness is unavailable, we must learn to compromise at a price; Chapters 9 through 11 told us: attention, search, and randomization can each push the boundary a little — but not the boundary away; Chapter 12's Yonglin's formula told us, finally: even "continuing to reason" has its own convergence limit.
All of it ends up on this map.
The center: decidable problems.
This is the brightest district of the Reasoning Kingdom. Sorting, shortest paths, dynamic programming, linear algebra, and many engineering optimization problems live here. They are not necessarily easy, but they have clear roads: given an input, the algorithm will stop; the answer can be verified; the complexity can be estimated.
P-class problems are the main arteries of the downtown area: solvable in polynomial time. NP-class problems are the trickier neighborhoods: an answer can be verified quickly, but finding the answer can be extremely expensive. Chapter 7's
The fog belt: the phase-transition region — a phase transition is a sharp change in behavior as a parameter crosses a threshold.
Walk further out and you meet fog.
OpenXOR's
The most important feature of a fog belt: it is not a wall. You cannot simply say "solvable here, unsolvable there". In the fog, tiny parameter changes cause huge consequences. One extra constraint, a bit more compression, a few steps too many of reasoning — any of these can slide a system from lucidity into hallucination.
The outer ring: undecidability and incompleteness.
Further still, the dark frontier of the kingdom.
The halting problem tells us: some problems have no general decision algorithm. Gödel's proposition tells us: some true propositions cannot be proven inside a system. Yonglin's formula tells us: some reasoning chains cannot complete meta-level self-verification inside the model — each is its own boundary, not three statements of the same thing.
These three are not the same theorem, but they point in the same direction: when a system is strong enough to express, simulate, and reflect on itself, it inevitably generates its own blind spot.
The Difference Between the Three Boundaries
- Complexity boundary: the problem is solvable, but possibly far too slow. Typical example: NP-hard search.
- Phase-transition boundary: the problem does not suddenly become unsolvable — it sharply hardens in some parameter region. Typical example: 3-SAT's
. - Logical boundary: the problem is not slow — no general algorithm exists at all. Typical examples: the halting problem and Gödel's incompleteness.
Conflating the three causes two kinds of mistakes: mistaking a logical impossibility for insufficient engineering effort, or prematurely declaring an engineering difficulty a philosophical fate.
This map tells us: the boundary of reasoning is not a line, but a fog with a gradient; at the end of the fog, there is no bigger model — only the horizon of logic itself.
That is what Volume 1 really wants to say: reasoning is not an infinitely rising staircase; it is finding a path among three kinds of terrain — the decidable, the phase-transition, and the incomplete. Knowing where you stand matters more than charging ahead blindly.
6. Pseudocode: Formalizing the Boundaries
Algorithm 1: The Diagonalization Proof of the Halting Problem
Halting-problem undecidability proof:
Assumption: a decider HALT(P, x) exists
Construct the diagonal program:
def DIAG(P):
if HALT(P, P):
loop_forever() # infinite loop
else:
return # halt
Ask: HALT(DIAG, DIAG) = ?
Case 1: HALT(DIAG, DIAG) = True
-> DIAG(DIAG) halts
-> but DIAG definition: if HALT returns True, loop forever
-> contradiction!
Case 2: HALT(DIAG, DIAG) = False
-> DIAG(DIAG) does not halt
-> but DIAG definition: if HALT returns False, halt
-> contradiction!
Conclusion: HALT does not exist
Figure 1: the matrix view of the diagonalization argument. Rows are programs P, columns are inputs x, and each cell records the result of HALT(P, x) (H = halts, L = loops). The diagonal cells HALT(P, P) define DIAG: where the diagonal says H, DIAG loops; where it says L, DIAG halts. DIAG must appear in some row — but that row's diagonal value contradicts DIAG's definition. The contradiction is a logical necessity, not a technical limit.
Algorithm 2: The Meta-Level Break of Yonglin's Formula
Meta-layer break detection (AI system S, reasoning task T):
Input: AI system, reasoning task
Output: object-level conclusion, meta-layer limit
1. Object-level reasoning:
C = S.reason(T)
2. Meta-layer verification:
ask: "can S prove C is correct?"
3. Incompleteness detection:
if S cannot verify C at the meta layer:
# there exists a true proposition C* that is true at
# the object layer but unprovable at the meta layer
return (C, "meta-layer break")
4. Return (C, "object layer closed, meta layer broken")Note: the "existence" in Step 3 is not Gödel's proof; it is a direct consequence of Yonglin's formula — the model verifies reasoning with the same set of parameters that produced the reasoning, so once the anchor
7. The Future of Reasoning: How Far Can We Go Inside the Boundaries
Acknowledging that boundaries exist does not mean giving up. The boundaries give direction: how far can we go inside them?
7.1 From Impossible to "Probabilistically Possible"
Yonglin's formula revealed the meta-level break: when a model verifies its own reasoning, it uses the same set of parameters that produced the reasoning, so it cannot truly jump out.
But this is not binary. Not "fully possible" or "fully impossible" — it is a probabilistic spectrum:
- Short chains (3–5 steps): the meta-level break barely matters; the model can effectively self-correct
- Medium chains (10–20 steps): error accumulation starts to show; external calibration points are needed
- Long chains (50+ steps): the prior anchor dominates; self-correction nearly fails
This has a direct implication for system design: do not let a model complete a reasoning chain beyond its effective reasoning window by itself. Interrupting, calibrating, restarting — these are necessary engineering compensations.
7.2 External Verifiers: Breaking the Meta-Level Closure
The fundamental problem in Yonglin's formula is self-reference — verifying reasoning with reasoning itself.
The idea to break the loop is introducing an independent external verifier:
- Formal verification: machine proof of mathematical theorems (Lean, Coq). The model generates a draft proof, and a formal system independently verifies every step. The verifier shares no parameters with the model; the meta-level break is repaired by an external force.
- Symbolic execution: in code reasoning, let an interpreter actually run the code the model generated, and use the execution result as the verification signal.
- Multi-model debate: two independently trained models challenge each other's reasoning, reducing the influence of systematic bias.
The common logic of these approaches: move the meta layer from inside the model to outside it. There is no parameter sharing between the external verifier and the internal reasoner; the self-reference is physically severed.
Feel this gap with your own hands: on real models, the only force that ever moves a belief is an outside one — an independent detector report drives the model's belief (Section 14.7: with a 0.90-reliability detector the model tracks the Bayesian posterior to a median KL of 0.02), while 128 steps of the model re-reading its own belief leave
7.3 Extended Context: A Longer Effective Reasoning Window
The effective reasoning window
Research directions in recent years:
- Long-horizon CoT training: DeepSeek-R1's GRPO found that intra-group competitive pressure spontaneously produces longer, more structured reasoning chains — which effectively stretches the effective reasoning window during training.
- Memory augmentation: externalize intermediate reasoning steps to external storage (tool calls, vector stores), so the model does not have to hold all intermediate states in its activations.
- Recursive refinement: reason about the same problem multiple times, each time using the previous output as a new starting point — similar to iterative convergence of numerical methods.
7.4 Accepting the Boundary Is Where Design Begins
The halting problem tells us: there is no general decidable algorithm. P≠NP (if it holds) tells us: there is no general efficient search. Yonglin's formula tells us: there is no complete self-verification.
But these three boundaries happen to outline a design space:
| Boundary | Engineering compensation |
|---|---|
| Undecidable halting problem | Bounded computation, timeout termination |
| NP-hard search | Heuristics, approximation algorithms, randomization |
| Meta-level break | External verifiers, tool calls, multi-model debate |
Every tool in this book — A*, MCTS, ADS, Collins, Transformer — is an engineering compensation inside some boundary. They do not break the boundaries; they find the optimal way to survive within them.
Perhaps this is the most honest definition of reasoning: finding the optimal path within constraints.
8. Accept the Boundaries, Rather Than Deny Them
The core thesis of this book is: reasoning has boundaries, and these boundaries are fundamental.
But this is not a pessimistic conclusion; it is the starting point of liberation.
When we accept the existence of boundaries, we stop chasing impossible perfection:
- no longer expecting AI to solve every problem
- no longer believing a larger model removes all limits
- no longer treating incompleteness as a defect
Instead, we start asking more meaningful questions:
- Within the boundaries, how good can we do?
- How do we recognize whether a problem is inside or outside the boundaries?
- How do we make the best decisions under uncertainty?
Chapter 7's
Chapter 8's heuristics told us: when the optimal solution is unavailable, we need "good enough" solutions — while being able to quantify exactly how good "good enough" is.
Chapter 10's MCTS told us: reasoning does not need "understanding"; it needs effective search.
Chapter 11's Collins told us: randomization can break a deterministic lower bound, trading probabilistic guarantees for efficiency gain.
Chapter 12's Yonglin's formula told us: CoT's value is in the effective reasoning window before convergence, not in the total number of steps.
All of this is wisdom within the boundaries.
But there is a trap here.
Optimizing within the boundaries with heuristics, approximation algorithms, and external verifiers — this itself can become another kind of "arrogance of things": treating the boundary as an engineering problem to conquer, rather than a logical fact to respect. Technical systems are best at recasting every problem as "can this be optimized a little more?" Yet in some places, the problem is not that you have not optimized enough; it is that you forgot to ask: optimized for what?
The real boundary of reasoning is not technical; it is about purpose. What is reasoning for? If it is only for accuracy, then optimizing within the boundary is enough. If it is for understanding — for people to understand the world, themselves, and each other — then the boundary is not a wall; it is a signpost. It tells you: this far, and beyond this is not reasoning's territory.
What remains is a sense of humor, aesthetic judgment, moral courage, the capacity to love — the human qualities that algorithms cannot imitate and should not be absorbed.
9. The Boundary Is Possibility
The boundary is not the end; it is the beginning.
When we know certain problems are undecidable, we will not waste time searching for a perfect algorithm, but turn to approximation, heuristics, probabilistic guarantees.
When we know reasoning converges to the prior anchor, we will not blindly increase the number of reasoning steps, but optimize the effective reasoning window.
When we know a global receptive field and linear complexity cannot be had together, we will not pursue an architecture that does not exist, but find the optimum in the tradeoff.
The boundary defines the space of possibilities.
Within the boundaries, we have unlimited creative room:
- better heuristic functions
- more efficient search algorithms
- more precise approximation guarantees
- cleverer resource allocation
Beyond the boundaries, we have deeper theoretical questions:
- Can the boundary be pushed?
- Do different problems' boundaries share a unified mathematical structure?
- Is human reasoning subject to the same boundaries?
Open Questions
This book began with open questions, and it ends with open questions.
- Are the boundaries of reasoning fixed, or can they be pushed? Can P vs NP be proven? Or is it itself an undecidable statement?
- Can we construct a system "weak enough" to avoid incompleteness? If a system is not strong enough, it will not run into Gödel's proposition. But would such a system still be useful?
- After accepting the limits, what should we do? Optimize within the boundaries, or try to break through them?
- Where are the boundaries of human reasoning? Are we also bound by Yonglin's formula? If so, how do we overcome it?
- Is uncertainty a defect or a feature? Perhaps the essence of reasoning is making the best guess under incomplete information, rather than seeking absolute truth.
These questions have no answers. But asking them — that itself is the meaning of reasoning.
Further Reading
- Chapter 12 of this book, Yonglin's formula — the theoretical proof of reasoning incompleteness (derivation and script included)
- Gödel, K. (1931). Über formal unentscheidbare Sätze der Principia Mathematica und verwandter Systeme I — the original paper of the incompleteness theorem
- Turing, A. (1936). On Computable Numbers, with an Application to the Entscheidungsproblem — the halting problem and computability
- Turing, A. (1950). Computing Machinery and Intelligence — the Turing test: can machines think?
- Penrose, R. (1989). The Emperor's New Mind — the philosophical discussion of Gödel's theorem and AI
- [Hamkins & Nenu, 2024] — historical clarification of the halting problem
-> [arXiv:2310.07927] - Hofstadter, D. (1979). Gödel, Escher, Bach: An Eternal Golden Braid — the classic on self-reference, recursion, and consciousness
Epilogue
The boundary of the Reasoning Kingdom is not a wall; it is a horizon.
When you stand on the boundary, what you see is not an ending, but a broader expanse of the unknown.
This book has tried to draw the outline of this horizon — from entropy and prediction to symbolic systems, from word vectors to neural networks, from Transformers to complexity theory, from search to reasoning, from effectiveness to boundaries.
But the horizon is always ahead.
Every answer leads to new questions. Every boundary hints at a deeper structure.
The journey of reasoning has no end, only deeper understanding.
And that is precisely the charm of reasoning.
Good luck.
