Wolfram Language Paclet Repository

Community-contributed installable additions to the Wolfram Language

Primary Navigation

    • Cloud & Deployment
    • Core Language & Structure
    • Data Manipulation & Analysis
    • Engineering Data & Computation
    • External Interfaces & Connections
    • Financial Data & Computation
    • Geographic Data & Computation
    • Geometry
    • Graphs & Networks
    • Higher Mathematical Computation
    • Images
    • Knowledge Representation & Natural Language
    • Machine Learning
    • Notebook Documents & Presentation
    • Scientific and Medical Data & Computation
    • Social, Cultural & Linguistic Data
    • Strings & Text
    • Symbolic & Numeric Computation
    • System Operation & Setup
    • Time-Related Computation
    • User Interface Construction
    • Visualization & Graphics
    • Random Paclet
    • Alphabetical List
  • Using Paclets
    • Get Started
    • Download Definition Notebook
  • Learn More about Wolfram Language

TuringMachine

Tutorials

  • Exploring One-Sided Turing Machines
  • The Chain of Smith's Universality Proof

Guides

  • Turing Machine

Symbols

  • boundaryAxiomsFor
  • cachedProofFor
  • CompressToRunLength
  • CyclicTagSystemEvolution
  • CyclicTagSystemEvolutionPlot
  • CyclicTagSystem
  • CyclicTagSystemToSystem5
  • CyclicTagSystemToTagSystem
  • DecodeTuringMachineRules
  • EmulationParameters
  • EmulationSizes
  • FindInductiveProof
  • forAllBody
  • goalFor
  • inductionProofGraph
  • IslandsPanel
  • mergedProofFor
  • MultiwayBothPanel
  • multiwayCloudOverlap
  • multiwayDistance
  • MultiwayEquationalGraph
  • MultiwayGeodesicGraph
  • MultiwayInductiveProofPanel
  • MultiwayNonHaltedStatesLeft
  • MultiwayRuleGraph
  • multiwaySubProofCones
  • multiwaySystemFor
  • MultiwayTokenEventGraph
  • MultiwayTuringMachineFunction
  • MultiwayTuringMachinePlot
  • MultiwayTuringMachineRules
  • NonTerminatingTuringMachineQ
  • OneSidedTuringMachineEvolution
  • OneSidedTuringMachineFind
  • OneSidedTuringMachineFunction
  • OneSidedTuringMachineFunctionPlot
  • OneSidedTuringMachinePlot
  • OneSidedTuringMachineRuntimePlot
  • onesRunDefinitions
  • ParityBlock
  • proofGraph
  • RenderAxiomGrid
  • RenderConfiguration
  • RenderEquation
  • RenderUniversalGoal
  • RuleSpacePanel
  • RunMachine
  • SettingsPanel
  • ShowTapeConfiguration
  • StatementPanel
  • System3Evolution
  • System3EvolutionPlot
  • System3
  • System3ToWolfram23
  • System4Evolution
  • System4EvolutionPlot
  • System4
  • System4ToSystem3
  • System4ToSystem5
  • System5Evolution
  • System5EvolutionPlot
  • System5
  • System5ToCyclicTagSystem
  • System5ToSystem4
  • TagSystemEvolution
  • TagSystemEvolutionPlot
  • TagSystem
  • TagSystemToCyclicTagSystem
  • TagSystemToTuringMachine
  • TokenEventPanel
  • transitionAxiomsFor
  • TuringMachineEvolutionPlot
  • TuringMachineOutput
  • TuringMachineOutputWithStepsFloat
  • TuringMachineOutputWithSteps
  • TuringMachineOutputWithStepsWidthsFloat
  • TuringMachineOutputWithStepsWidths
  • TuringMachineRuleCases
  • TuringMachineRuleCount
  • TuringMachineSteps
  • TuringMachineStepsWidths
  • TuringMachineToTagSystem
  • TuringMachineWidths
  • TuringMachineWorstCasePlot
  • unboundAxiom
  • Wolfram23Evolution
  • Wolfram23EvolutionPlot
  • Wolfram23ToSystem5
  • zerosRunDefinitions
  • $InductiveProofColors
  • $PvsNPStyles

Overviews

  • TuringMachine

The Chain of Smith's Universality Proof

Definition
System 5 as System 4
A Turing machine as a 2-tag system
System 4 as System 3 and wolfram23
A 2-tag system as a cyclic tag system
How large the emulation is
A cyclic tag system as System 5
The formal proof
In 2007 Alex Smith proved that Wolfram's 2-state 3-color Turing machine, rule 596440 and here called wolfram23, is universal. The proof is a chain of emulations: every binary Turing machine is emulated by a 2-tag system (Cocke and Minsky), every 2-tag system by a cyclic tag system (Cook), and every cyclic tag system by wolfram23 through four intermediate systems of Smith's design, System 5 to System 3. The whole chain is formalized in Lean in the
Proofs/
directory of this paclet's repository, one module per arrow, and its web blueprint is at
wolframinstitute.github.io/TuringMachine
.
This paclet has one function for each arrow of the chain, one for each way back, and an evolution function for each system. Each transcribes the Lean definition named on its reference page, and the paclet tests compare the two on shared examples. This tutorial walks along the chain on small examples and checks at every stage that the emulating system reproduces the emulated one.
arrow
encoder
decoder
Lean module
Turing machine → 2-tag system
TuringMachineToTagSystem
TagSystemToTuringMachine
Wolfram23.TMToTag
2-tag system → cyclic tag system
TagSystemToCyclicTagSystem
CyclicTagSystemToTagSystem
Wolfram23.TagToCTS
cyclic tag system → System 5
CyclicTagSystemToSystem5
System5ToCyclicTagSystem
Wolfram23.CTSToSystem5
System 5 → System 4
System5ToSystem4
System4ToSystem5
Wolfram23.System5ToSystem4
System 4 → System 3
System4ToSystem3
​
Wolfram23.System4ToSystem3
System 3 → wolfram23
System3ToWolfram23
Wolfram23ToSystem5
Wolfram23.System3ToWolfram23

Definition

The examples: a three-state binary machine that moves both ways, started on the tape
011
; a small 2-tag system; Smith's cyclic tag system with the appendants
1
and
10
on the working string
01
(p. 29 of his paper); Smith's System 5 program of p. 33; and two small System 5 programs. Every system is an object that displays as the drawing of its rules and its starting state, which
RulePlot
gives as well.
The machine, as rules
{q,a}->{q',w,d}
, and its rule icons as a
TuringMachine
:
In[1]:=
Needs["WolframInstitute`TuringMachine`"]
In[1]:=
machine={{1,0}{2,1,1},{1,1}{1,0,-1},{2,0}{1,1,-1},{2,1}{2,1,1}}
Out[1]=
{{1,0}{2,1,1},{1,1}{1,0,-1},{2,0}{1,1,-1},{2,1}{2,1,1}}
In[2]:=
RulePlot[TuringMachine[machine]]
Out[2]=
Its starting configuration: state 1, nothing on the left, the head on a 0,
11
on the right:
In[3]:=
config={1,{},0,{1,1}}
Out[3]=
{1,{},0,{1,1}}
A 2-tag system over three symbols; each production is drawn below the symbol it belongs to, the word underneath:
In[4]:=
tag3=
TagSystem
[{{1,2},{0},{0,0,0}},{1,0,0}]
Out[4]=
TagSystem

Smith's cyclic tag system; each appendant is appended when a 1 is read at its phase, the current phase framed red:
In[5]:=
cts=
CyclicTagSystem
[{{1},{1,0}},{0,1}]
Out[5]=
CyclicTagSystem

Smith's System 5 program and two small ones, the bag and every rule on the number line:
In[6]:=
program=
System5
[{2},{{1,4},{1,6},{},{}}]
Out[6]=
System5

In[7]:=
twoRules=
System5
[{2},{{1,2},{}}]
Out[7]=
System5

In[8]:=
small=
System5
[{1,3},{{1},{}}]
Out[8]=
System5


A Turing machine as a 2-tag system

A 2-tag system deletes the first two symbols of its word and appends the production of the first one. Cocke and Minsky's construction writes the two halves of the machine's tape as numbers, in unary, and moves the head by rounds that halve and double them.
TuringMachineToTagSystem
builds the tag system; with a number of steps it also gives the tag times, at which the tag word is the word of the next configuration.
The tag system of the machine, with the tag times of its first four steps:
In[9]:=
tag=
TuringMachineToTagSystem
[machine,config,4]
Out[9]=
TagSystem

The alphabet has
1+84s
symbols for states below s:
In[10]:=
Length[tag["Productions"]]
Out[10]=
253
The run of the tag system during those four steps, drawn by
TagSystemEvolutionPlot
: each row is a tag word at its place in the queue, each color a kind of symbol:
In[11]:=
TagSystemEvolutionPlot
[tag,85]
Out[11]=
At the tag times the words decode, by
TagSystemToTuringMachine
, to the machine's configurations:
In[12]:=
TagSystemToTuringMachine
[#,3]&/@
TagSystemEvolution
[tag,85]tag["TagTimes"]+1
Out[12]=
{{1,{},0,{1,1}},{2,{1},1,{1}},{2,{1,1},1,{}},{2,{1,1,1},0,{}},{1,{1,1},1,{1}}}

A 2-tag system as a cyclic tag system

The cyclic tag system:
Its configurations at the start of every cycle:
The run of the tag system, for comparison:

A cyclic tag system as System 5

Smith's System 5 keeps a bag of integers and a list of rules. Every step decrements the bag and increments the rules; when a bag element reaches 0 it is removed and the next rule is merged into the bag, an integer already present cancelling. It emulates the doubled cyclic tag system, which has every bit of the working string twice and an empty appendant after each doubled one. A bit becomes two pairs of bag integers, with gaps 1 for a 0 and 2 for a 1.
The run of the doubled cyclic tag system, for comparison:

System 5 as System 4

The parameters for Smith's program of p. 33:
A smaller program with two rules is shown in full. Its parameters:
The System 5 run, for comparison:

System 4 as System 3 and wolfram23

The System 4 tape:
Its run:
Its decodes at its left-end turns:
The tape has this many cells:

How large the emulation is

The sizes for one step of a two-state machine that writes 1, moves right and halts:
The headline theorems of the formal proof take these parameters from the run lengths, as above, so their initial condition exists but is not written out. An optional corollary writes it out as a definition that runs no system, with closed-form bounds in place of the run lengths; the bounds are far larger than the runs:

The formal proof

© 2026 Wolfram. All rights reserved.

  • Legal & Privacy Policy
  • Contact Us
  • WolframAlpha.com
  • WolframCloud.com