Reading the bag off System 4

Wolfram Institute • 2026
Each time the head is back at the left end in state B, the sets before the first star together hold the System 5 bag: an integer x in an odd number of them, below the band, stands for the bag element x/2 + 1. With the proof's parameters these readings are the System 5 run, in order, followed by a few steps of a terminal phase.
The functions come from the paclet WolframInstitute/TuringMachine.

The parameters

A System 5 program with two rules:
In[1]:=
program=System5[{2},{{1,2},{}}]
Out[1]=
System5

The parameters the proof takes for it:
f
(the tape's time budget) and the band
b
below which the decoder reads, among others:
In[2]:=
params=EmulationParameters[program]
Out[2]=
B2,T55,M7,H13,f43,Band74,System4Length775,T419114,Fuel19188,w15

The run

The run of its System 4 tape, sampled to 400 rows; the head zigzags from the left end into the tape:
In[3]:=
System4EvolutionPlot[System5ToSystem4[program,params["f"]],20000,ImageSize->420]
Out[3]=

Reading the bag

At every return of the head to the left end in state B, the decoder takes the sets before the first star, keeps the integers below the band that lie in an odd number of them, and reads each even integer
x
as the bag element
x/2+1
; a reading with an odd integer is not a bag and is skipped. The readings along the run, consecutive repeats removed:
In[4]:=
First/@Split[Sort/@DeleteMissing[System4ToSystem5[#,params["Band"]]&/@​​Values[System4Evolution[System5ToSystem4[program,params["f"]],10^6,#["Active"]==0&&#["State"]==="B"&]]]]
Out[4]=
{{2},{1},{3,4},{2,3},{1,2},{1}}
The bags of the System 5 run:
In[5]:=
Sort/@System5Evolution[program,100][[All,"Bag"]]
Out[5]=
{{2},{1},{3,4},{2,3},{1,2},{1}}
The readings are the System 5 bags in order; the tape is run a little further than System 5 (the terminal phase of the proof), which only continues to decrement.