Metamath Proof Explorer


Theorem tmachfullfin

Description: Folk theorem. For any algorithm deterministically processing a stream of data (essentially, an infinite tape with cell indices I and finite alphabet U ), if it terminates on every possible input, then it never looks beyond a finite portion U. ran S of the input.

Termination is expressed here with a weaker condition: that an execution may only look at a finite number of cells. Obviously, a program which finishes in a finite number of steps can only scan finite set of cells.

This theorem has many corollaries, such as: any encoding scheme able to represent all integers has at least one non-decodable tape (in other terms, encoding of the infinity).

I no longer have the source for this theorem but I believe I first read about it on LessWrong. My gratitude to Grok for suggesting that this theorem will require Axiom of Choice, and to DeepSeek for suggesting the topology-based proof route. (Contributed by Ender Ting, 28-Jul-2026)

Ref Expression
Hypotheses tmach.finalph ⊢ φ → U ∈ Fin
tmach.exindex ⊢ φ → I ∈ V
tmach.tapelist ⊢ φ → T = U I
tmach.scanmap ⊢ φ → S : T ⟶ 𝒫 I ∩ Fin
tmach.agreemap ⊢ φ → A = z ∈ T ⟼ y ∈ T | y ↾ S ⁡ z = z ↾ S ⁡ z
tmach.agreement ⊢ φ → ∀ z ∈ T ∀ y ∈ A ⁡ z S ⁡ y = S ⁡ z
Assertion tmachfullfin ⊢ φ → ⋃ ran ⁡ S ∈ Fin

Proof

Step Hyp Ref Expression
1 tmach.finalph ⊢ φ → U ∈ Fin
2 tmach.exindex ⊢ φ → I ∈ V
3 tmach.tapelist ⊢ φ → T = U I
4 tmach.scanmap ⊢ φ → S : T ⟶ 𝒫 I ∩ Fin
5 tmach.agreemap ⊢ φ → A = z ∈ T ⟼ y ∈ T | y ↾ S ⁡ z = z ↾ S ⁡ z
6 tmach.agreement ⊢ φ → ∀ z ∈ T ∀ y ∈ A ⁡ z S ⁡ y = S ⁡ z
7 1 2 3 4 5 6 tmachlem-franscan ⊢ φ → ran ⁡ S ∈ Fin
8 1 2 3 4 5 6 tmachlem-fssscan ⊢ φ → ran ⁡ S ⊆ Fin
9 unifi ⊢ ran ⁡ S ∈ Fin ∧ ran ⁡ S ⊆ Fin → ⋃ ran ⁡ S ∈ Fin
10 7 8 9 syl2anc ⊢ φ → ⋃ ran ⁡ S ∈ Fin