BB(6) hunt

1RB0LA_0RC1RD_0LD1RE_1LA0RB_0RD1RF_1RC---

#4local proof 2Kill claimedSync bouncer counterbbchallenge ↗Explorer

How we proved it never halts

Both cycle formulas keep the block counts in a safe region

The tape is a binary counter at the left end, four cells per digit, followed by a row of five-cell blocks: "A" blocks 00111 and "B" blocks 10111. The head bounces between the counter and the right end, adding 1 to the counter on every visit and, along the way, new B blocks at the right end.

When the counter rolls over, it gains a digit, and a three-cell marker 111 appears just to its right. The marker walks right through the A blocks, two blocks for every three counts, and on reaching the B blocks turns them all into A blocks. Then the cycle repeats, one digit longer.

The key idea: at each cycle start, count the A blocks ahead of the new marker and the B blocks beyond them (a rollover in mid-conversion needs a small correction). One cycle changes this pair of counts by one of two exact formulas, chosen by whether the A count is even or odd, a choice that looks random.

Why that settles it: the machine stays on these rails only if the timing works out, for example the marker finishing its walk before the next rollover. Scale both counts by the counter's size and each cycle start becomes a point in the plane. The proof finds a six-sided region where every timing condition holds and which both formulas map into itself, so the even/odd choices never matter. The run is inside it at step 17,215, so it never leaves the rails and never uses the missing transition.

The Rocq proof (checked against busycoq) checks the 21 basic tape moves by running them, the longer moves by induction, the region by linear arithmetic, and the first 17,215 steps by exact replay.

#2local proof number
504lines of Rocq
6 sto compile
6/6automatic checks
space-time diagram, first 10,000 steps from blank
The first 10,000 steps from a blank tape. Time runs down; white is 1.
About this picture

The standard picture (bbchallenge.org's Default view): each row is the whole tape at one step, time runs downward, and the head's path draws the pattern.

bbchallenge-defaultStart blankRows steps 0 → 10,000, top to bottomWindow cells −200..199, left to rightColors 1 0 or unvisited

Overview

In one sentence

TM4's binary counter + 00111/10111 block bouncer; 7 phase rules validated; parity branch, both branches safe

Submitted mechanism On the left is a binary counter C_k(n): k digits, MSB first, 1 = 1010, 0 = 0010 (TM4's d1/d0). The head bounces between the counter and the right edge, adding 1 to the counter on each visit. Between them is a row of 5-cell blocks, A = 00111 and B = 10111. (submission/README.md, Mechanism)

Upstream
Kill claimed · PR #24merged 2026-10-16 07:07 UTC by ccz181078 · SBCv13.v · TM1 · on Submissions →
Rocq proof
check_kill PASS · first Oct 10 05:13
504 lines · 20 KB .v · compile 6.4 s · coqchk pass · 0 axioms · PASS Oct 10 05:13 (re-run Oct 10 11:50)
· the .v file
Automatic review
6 of 6 checks passtemplate: verify/SBCv7.v Module TM4 (adapted from) · details in Proof →
Class
Sync bouncer counterours: Sync bouncer counter (sheet) · ours adds: TM4 binary counter + 3-block bouncer with moving front · high confidence
On the list
not on BB6_holdouts_663.txt (line 645 of the previous list) · historical 740 line 645
#4eqv ×1sim 1e15UBRRBAlongit.

Mechanism

What to check here: the pictures show the mechanism that the rule table describes.

How it works: 3 notes
  • Left: TM4's binary counter, k bits MSB first (1=1010, 0=0010), +1 per bounce.
  • Right: A blocks 00111, one 111 marker (the front), B blocks 10111. P phase: each bounce adds a B block.
  • Overflow: counter gains a bit; the front moves right 2 A blocks per visit; on reaching B, all B blocks become A blocks.

Figures for Checkpoint A

Fig 1 · Left/right records to 2.7M stepsQ1Q2viewer ↗

Edge records to 2.7M steps. Look at each horizontal reset and the diagonal that follows it.

Left/right records to 2.7M steps
bbchallenge-defaultStart blankRows left/right recordsWindow cells -21..1151, 1 px = 0.5 cellsColors 1 0 or never visited head just moved right/left
Rows: the start, then one row each time the head reaches a new leftmost or rightmost cell (1,173 rows, steps 0..2,700,000; rows are not equal time) · Window: each cell is 2x2 px
Fig 2 · One cycle up close, every 60 stepsQ1

One cycle of the same run, up close: every 60 steps from step 74,114, the tape Q(8,129,1,24,29).

One cycle up close, every 60 steps
bbchallenge-defaultStart mid-run: step 74,114Rows every 60 stepsWindow cells -17..377, 1 px = 0.5 cellsColors 1 0 or never visited head just moved right/left
Start: the real tape there is exactly Q(8,129,1,24,29); rebuilt from that formula and checked identical · Rows: (1,834 rows: steps 74,114..184,114), so one zigzag (bounce) spans many rows · Window: each cell is 2x2 px
More figures (2)Fig 3–4: Blaze, 10 million steps · bbchallenge default view, first 10,000 steps
Fig 3 · Blaze, 10 million stepsviewer ↗

The span grows like sqrt(t); the periodic conversion sweeps show as bands.

Blaze, 10 million steps
bbchallenge-blazeStart blankRows Blaze time blocks of 16,384 stepsWindow cells -24..2653, 1 px = 3.35 cellsColors 0 1 mixed
Rows: (averaged), 611 blocks stretched to 500 px, so 1 px row ~ 20,000 steps (steps 0..10,000,000) · Colors: paler orange: each pixel averages its cells over its time block; no head drawn
Fig 4 · bbchallenge default view, first 10,000 stepsviewer ↗

The site's view: a bouncer growing to the right from an almost fixed left end.

bbchallenge default view, first 10,000 steps
bbchallenge-defaultStart blankRows every step 0..10,000Window cells -200..199, 1 px = 1 cellColors 1 0 or never visited head just moved right/left
Rows: squeezed 20:1 into 500 px as on bbchallenge.org (px row y blends steps 20y+9 and 20y+10)
Rules (7/7 validated)exact tape rewrites the proof will formalize, each re-checked by simulation
rulefrom ⟶ tocasesstepschecked
R1 P-bounce
0∞ C_k(n) (00111)X (10111)z 00 C> 0∞
⟶ 0∞ C_k(n+1) (00111)X (10111)z+1 00 C> 0∞
n+1 <= 2^k-1, X >= 132X+32z+16t(n)+47, t(n) = trailing 1-bits of n✓65/65
R2 overflow
0∞ C_k(2k-1) (00111)X (10111)z 00 C> 0∞
⟶ 0∞ C_(k+1)(2k+1) 00111 111 (00111)X-2 (10111)z+1 00 C> 0∞
X >= 2—✓25/25
R3 Q-bounce (front +2)
0∞ C_k(n) (00111)x 111 (00111)y+2 (10111)z 00 C> 0∞
⟶ 0∞ C_k(n+3) (00111)x+2 111 (00111)y (10111)z+1 00 C> 0∞
n+3 <= 2^k-196x+32y+32z+16(t(n)+t(n+1)+t(n+2))+197✓65/65
R4 even end (y=0)
0∞ C_k(n) (00111)x 111 (10111)z 00 C> 0∞
⟶ 0∞ C_k(n+z+2) (00111)x+z+1 00 C> 0∞
n+z+2 <= 2^k-1—✓25/25
R5 odd end (y=1)
0∞ C_k(n) (00111)x 111 00111 (10111)z 00 C> 0∞
⟶ 0∞ C_k(n+2z+7) (00111)x+z+4 00 C> 0∞
n+2z+7 <= 2^k-1—✓25/25
R4o even end + overflow
0∞ C_k(n) (00111)x 111 (10111)z 00 C> 0∞
⟶ 0∞ C_(k+1)(2k+1+3m) (00111)1+2m 111 (00111)x+z-1-2m 00 C> 0∞
m = n+z+2-2^k >= 0, x+z <= 2^(k-1); outside that regime 2/25 fail—✓25/25
R5o odd end + overflow
0∞ C_k(n) (00111)x 111 00111 (10111)z 00 C> 0∞
⟶ 0∞ C_(k+1)(2k+1+3m) (00111)1+2m 111 (00111)x+z+2-2m 00 C> 0∞
m = n+2z+7-2^k >= 0, x+z <= 2^(k-1); outside that regime 4/25 fail—✓50/50
Compressed historythe tape as 0∞ C_k(n) (00111)x [111 (00111)y] (10111)z 00 C> 0∞ at 38 moments: where the rules are read off
0∞ C_k(n) (00111)x [111 (00111)y] (10111)z 00 C> 0∞
stepphaseknxyz
1,047P4144-0
1,222P4154-1
1,507Q517122
1,912Q520303
2,826P5257-0
4,996P5317-6
5,553Q633157
7,003Q639519
17,215Q7651160
27,975Q7891708
35,105P79926-0
72,213P712726-28
74,114Q812912429
108,318Q816525041
172,672P820867-0
310,913P825567-47
314,750Q925716548
518,654Q935365180
1,101,764Q10537171310
1,824,857Q10732147165
2,625,871P10869216-0
4,076,949P101,023216-154
4,089,010Q111,0251214155
6,289,433Q111,3462150262
9,222,995P111,610478-0
18,983,294P112,047478-437
19,012,811Q122,0491476438
30,552,161Q122,7634770676
48,261,531P123,4411,154-0
79,286,557P124,0951,154-654
79,344,666Q134,09711,152655
139,306,778Q135,8251,15301,231
209,134,028P137,0582,385-0
316,196,767P138,1912,385-1,133
316,309,612Q148,19312,3831,134
564,062,495Q1411,7662,38312,325
1,093,007,525Q1516,502794,6320
2,318,632,923P1525,7687,028-0
phaselast P
not plottable
klast 15
1541,0472.3e9log xstep 1047: k = 4step 1222: k = 4step 1507: k = 5step 1912: k = 5step 2826: k = 5step 4996: k = 5step 5553: k = 6step 7003: k = 6step 17215: k = 7step 27975: k = 7step 35105: k = 7step 72213: k = 7step 74114: k = 8step 108318: k = 8step 172672: k = 8step 310913: k = 8step 314750: k = 9step 518654: k = 9step 1101764: k = 10step 1824857: k = 10step 2625871: k = 10step 4076949: k = 10step 4089010: k = 11step 6289433: k = 11step 9222995: k = 11step 18983294: k = 11step 19012811: k = 12step 30552161: k = 12step 48261531: k = 12step 79286557: k = 12step 79344666: k = 13step 139306778: k = 13step 209134028: k = 13step 316196767: k = 13step 316309612: k = 14step 564062495: k = 14step 1093007525: k = 15step 2318632923: k = 15
nlast 25,768
25,768141,0472.3e9log xstep 1047: n = 14step 1222: n = 15step 1507: n = 17step 1912: n = 20step 2826: n = 25step 4996: n = 31step 5553: n = 33step 7003: n = 39step 17215: n = 65step 27975: n = 89step 35105: n = 99step 72213: n = 127step 74114: n = 129step 108318: n = 165step 172672: n = 208step 310913: n = 255step 314750: n = 257step 518654: n = 353step 1101764: n = 537step 1824857: n = 732step 2625871: n = 869step 4076949: n = 1023step 4089010: n = 1025step 6289433: n = 1346step 9222995: n = 1610step 18983294: n = 2047step 19012811: n = 2049step 30552161: n = 2763step 48261531: n = 3441step 79286557: n = 4095step 79344666: n = 4097step 139306778: n = 5825step 209134028: n = 7058step 316196767: n = 8191step 316309612: n = 8193step 564062495: n = 11766step 1093007525: n = 16502step 2318632923: n = 25768
xlast 7,028
7,02811,0472.3e9log xstep 1047: x = 4step 1222: x = 4step 1507: x = 1step 1912: x = 3step 2826: x = 7step 4996: x = 7step 5553: x = 1step 7003: x = 5step 17215: x = 1step 27975: x = 17step 35105: x = 26step 72213: x = 26step 74114: x = 1step 108318: x = 25step 172672: x = 67step 310913: x = 67step 314750: x = 1step 518654: x = 65step 1101764: x = 17step 1824857: x = 147step 2625871: x = 216step 4076949: x = 216step 4089010: x = 1step 6289433: x = 215step 9222995: x = 478step 18983294: x = 478step 19012811: x = 1step 30552161: x = 477step 48261531: x = 1154step 79286557: x = 1154step 79344666: x = 1step 139306778: x = 1153step 209134028: x = 2385step 316196767: x = 2385step 316309612: x = 1step 564062495: x = 2383step 1093007525: x = 79step 2318632923: x = 7028
ylast -
4,63201,5071.1e9log xstep 1507: y = 2step 1912: y = 0step 5553: y = 5step 7003: y = 1step 17215: y = 16step 27975: y = 0step 74114: y = 24step 108318: y = 0step 314750: y = 65step 518654: y = 1step 1101764: y = 131step 1824857: y = 1step 4089010: y = 214step 6289433: y = 0step 19012811: y = 476step 30552161: y = 0step 79344666: y = 1152step 139306778: y = 0step 316309612: y = 2383step 564062495: y = 1step 1093007525: y = 4632
zlast 0
2,32501,0472.3e9log xstep 1047: z = 0step 1222: z = 1step 1507: z = 2step 1912: z = 3step 2826: z = 0step 4996: z = 6step 5553: z = 7step 7003: z = 9step 17215: z = 0step 27975: z = 8step 35105: z = 0step 72213: z = 28step 74114: z = 29step 108318: z = 41step 172672: z = 0step 310913: z = 47step 314750: z = 48step 518654: z = 80step 1101764: z = 0step 1824857: z = 65step 2625871: z = 0step 4076949: z = 154step 4089010: z = 155step 6289433: z = 262step 9222995: z = 0step 18983294: z = 437step 19012811: z = 438step 30552161: z = 676step 48261531: z = 0step 79286557: z = 654step 79344666: z = 655step 139306778: z = 1231step 209134028: z = 0step 316196767: z = 1133step 316309612: z = 1134step 564062495: z = 2325step 1093007525: z = 0step 2318632923: z = 0
Template comparisonSBCv7.v TM4: partly applies · the nearest solved proof, what carries over, and the transitions that differ
01
A1RB0LA
B0RC1RD
C0LD1RE
D1LA0RB
E0RD1RF
F1RCtpl 0RA---

differs from the template

file
SBCv7.v:610
module
TM4 (line 610); also TM37 (line 7021)
machine
1RB0LA_0RC1RD_0LD1RE_1LA0RB_0RD1RF_0RA--- (1 transition apart)
diff
F0 only: 0RA (TM4) / 1RB (TM37) -> 1RC; A-E identical
note
Left counter carries over (same d1/d0 digits; TM37's overflow form reached 5/5). Right side doesn't: TM4's BigStep holds 2/8, only when F0 is never read.
Proof strategy & riskshow the formal proof will go · 3 risks to watch

Longitudinal proof in TM4 style: reuse the counter lemma (BC.Mul2/BC.Incs on d0/d1), add new segRLs lemmas for 00111/10111/111 words, prove R1-R5o with es/ind/follow. Then progress_nonhalt_cond with a linear invariant on (n, X, z)/2^k that holds for both parity branches. init: c0 -->* Q(5,17,1,2,2) at step 1507 by esx.

  • ▲Branch = parity of X (X grows ~3X/2: Collatz-like); proof needs an invariant valid for both branches (holds numerically under adversarial branching to k=600).
  • ▲R5o (odd end + overflow) has front and conversion running at once: hardest low-level lemma.
  • ▲Outside the regime (x+z >> 2^k) the head breaks through the counter and can halt; the invariant must exclude this.
Stats & provenance3·109 steps simulated · 48,013 cells · the status in full · files
simulated
3·109 steps
tape
48,013 cells · 22,929 nonzeros
growth
span ~ t^0.5 (cycle k: ~2^k blocks in ~4^k steps); left edge -2 cells per cycle
status now
check_kill PASS, independently re-verified (status.json, 2026-10-10)
observer's note
Mechanism found; 7 rules validated by simulation; the phase map built from them reproduces all 36 phase boundaries in history from step 1507 (its start) to 2.3e9 steps. Parity branch present but halting does not depend on it.
files
observe.json · notes.md · proof.md · how_proved.md · status.json · 1RB0LA_0RC1RD_0LD1RE_1LA0RB_0RD1RF_1RC---.v

Proof & checks

6/6 automatic checks pass

Kill 2 · Sync bouncer counter · the kill file 1RB0LA_0RC1RD_0LD1RE_1LA0RB_0RD1RF_1RC---.v: 504 lines, 73 items · the package submission/

✓ 6/6 automatic checks pass · Checkpoint B: no note from Dennis yet · template (adapted from): verify/SBCv7.v Module TM4 · 7% of our lines identical
1What is provedCheck: the string, the theorem and every check_kill line are green, and the .v on disk is the one that was checked (same sha256).
Machine
1RB0LA_0RC1RD_0LD1RE_1LA0RB_0RD1RF_1RC---
vs holdout list
✓ byte-exact: the .v literal (L18) == 2026-10-07_778.txt line 681 (41 bytes, via tools/holdouts.py)
Theorem
✓ Lemma nonhalt: ~halts tm c0. L466
check_kill
✓ PASS · 17/17 checks pass · compile 6.42 s · coqchk pass (2.04 s) · assumptions: 0 (closed) · 2026-10-10 18:50:58 UTC · submission/check_kill.txt
Checked .v
sha256 51e3dea1f666153c…
✓1RB0LA_0RC1RD_0LD1RE_1LA0RB_0RD1RF_1RC---.v51e3dea1f666153c… = checked
✓submission/1RB0LA_0RC1RD_0LD1RE_1LA0RB_0RD1RF_1RC---.v51e3dea1f666153c… = checked
Status
✓Killed: never halts updated 2026-10-10
✓ args✓ input✓ framework✓ framework_build✓ forbidden✓ structure✓ tm_text✓ theorem_text✓ coq✓ names✓ compile✓ tm_rocq✓ theorem_rocq✓ isolation✓ assumptions✓ coqchk✓ integrity
All 17 check_kill checks with their one-line results
✓args6x2 machine, framework module Individual62, mode nonhalt
✓input20787 bytes, 504 lines, 532 sentences
✓frameworkHEAD 0940bb9cf434ba68f0c025dabfde45a219999973 == pin; no tracked changes under verify/
✓framework_build13 needed framework .vo files present and fresh, with native code no older than the .vo
✓forbiddennone of 30 forbidden patterns occur (ground rule 1's words: anywhere; command words: outside comments and strings; comments never split a token)
✓structure4 Require name(s) allowed; no top-level Variable/Context; no shadowing; Module/Section balanced
✓tm_textline 18: TM_from_str "1RB0LA_0RC1RD_0LD1RE_1LA0RB_0RD1RF_1RC---" == <tm> (41 bytes)
✓theorem_textline 466: nonhalt : ~halts tm c0
✓coqcoqc 8.20.1 ([local working file]
✓nameshalts, c0, TM_from_str resolved inside Individual62
✓compilecompiled in 6.4s with all appended checks
✓tm_rocqBB6Kill.Candidate.tm = BusyCoq.Individual62.TM_from_str "1RB0LA_0RC1RD_0LD1RE_1LA0RB_0RD1RF_1RC---" by eq_refl (in-file and isolated)
✓theorem_rocqnonhalt : ~ halts (TM_from_str "1RB0LA_0RC1RD_0LD1RE_1LA0RB_0RD1RF_1RC---") c0 with absolute names (in-file and isolated)
✓isolationonly stock proof plugins loaded; guard/positivity/universe checking on, definitional UIP off
✓assumptions0 assumption(s), all in the baseline
✓coqchkcoqchk -norec BB6Kill.Candidate ok (2.0s); its context summary lists nothing of the file's own
✓integrityinput sha256 and framework HEAD/cleanliness identical before and after
2Where it came fromCheck: the template is the one you expect, and the measured reuse (tiles, the reuse figure, diff) agrees with what the README says was kept and changed (quoted).
7%of our lines identical to the template
4changed lines
394added lines (ours only)
154template lines dropped
1 / 1 / 71items identical / adapted / new
What the package README says it reused and changed (submission/README.md line 18, Template and what changed), quoted:

This extends SBCv7.v Module TM4 (1RB0LA_0RC1RD_0LD1RE_1LA0RB_0RD1RF_0RA---), which differs only in F0 (0RA there, 1RC here). TM1, TM2, TM3, TM18 and TM37 in that file also differ only in F0.

  • Kept: TM4's moving head <A 001 / 001 E> (hL/hR), its digits d0/d1, and the overall shape: init, a big step per cycle, and progress_nonhalt_cond with a linear invariant.
  • Changed:
  • F0 = 1RC changes every right-side word. TM4's unary right counter is replaced by the A/B blocks, the front gadget (FL, FR1–FR3) and the conversion gadget.
  • TM4's Longitudinal counter lemma is replaced by a direct Fixpoint ctr, so the file imports only Individual62, Arith, Lia and String.
  • TM4's one-inequality invariant is replaced by a 6-facet hexagon that holds on both branches.
  • New lemmas ConvOV/PostOV cover the overflow during an odd conversion.

The file is 504 lines, about 3 times TM4's 170. The informal proof is proof.md.

Fig P1 · Reuse of the template, line by line and by name

Top two bars: non-blank lines after the TM string is replaced by <TM> and whitespace is collapsed. Bottom bar: our Definitions/Lemmas/… by name.

ours 428 lines
7% identical · 4 changed · 394 added
template 188 lines
16% kept verbatim · 154 not in ours
our items 73
1 identical · 1 adapted · 71 new · 18 template-only
identicalchanged / adaptedours only (new)template only
Template part: lines 1–57 (shared header, before the first Module) + 611–778 (body of Module TM4; the Module/End lines left out). Ours: lines 13–504 (header comment 1–12 left out). Line diff: Python difflib SequenceMatcher; inside a replaced block, line pairs at least 75% alike count as changed, the rest as removed + added.

Template-only names: lrcons_lpow1', sideRLs_wall, tm', LIncs, Incs, RC0, Incs0, Incs', RCa, RCb, cons, RCb_shift, Rn, Rn_cons, RIncs, S, Rst, BigStep

Other references found:

Side-by-side diff: template (188 lines) vs ours (428 lines), 552 lines differ; runs of identical lines and long template-only runs folded
identicalequal once each TM string is <TM>changedours onlytemplate only
templateours
1From BusyCoq Require Import Individual62.14From BusyCoq Require Import Individual62.
2Require Import ZifyNat Lia.15Require Import Arith Lia.
3Require Import ZArith.
4Require Import String.16Require Import String.
5Require Import List.
6From BusyCoq Require Import Longitudinal.
⋯ 35 template-only lines (template 7–51), not in ours
53Ltac am a a' k b b' :=
54 applys_eq (segRLs_addmul_v2 a a' k b b'); unfold DH0; flia; esc.
612Definition tm := Eval compute in (TM_from_str "1RB0LA_0RC1RD_0LD1RE_1LA0RB_0RD1RF_0RA---").18Definition tm := Eval compute in (TM_from_str "1RB0LA_0RC1RD_0LD1RE_1LA0RB_0RD1RF_1RC---").
613Definition tm' := flip tm.
615Notation "c -->* c'" := (c -[ tm ]->* c') (at level 40).20Notation "c -->* c'" := (c -[ tm ]->* c') (at level 40).
616Notation "c -->+ c'" := (c -[ tm ]->+ c') (at level 40).21Notation "c -->+ c'" := (c -[ tm ]->+ c') (at level 40).
618Notation hR := (E,<[0;0;1]).
23Open Scope list.
619Notation hL := (A,[0;0;1]).
620Notation hRL := [(hR,hL)].
621Notation hLR := [(hL,hR)].
623Notation d0 := <[0;0;1;0].25Notation d0 := <[0;0;1;0].
624Notation d1 := <[1;0;1;0].26Notation d1 := <[1;0;1;0].
625Notation dh := (0inf <* d1).
27Notation bA := <[0;0;1;1;1].
627Notation w0 := [0;0;1;0;0].28Notation bB := <[1;0;1;1;1].
628Notation w1 := [0;0;1;0;1].29Notation bAr := [0;0;1;0;1].
629Notation w0' := [0;0;0;0;1].30Notation bBr := [0;0;0;0;1].
630Notation w1' := [1;0;1;0;0].
32Ltac fw H := eapply evstep_trans; [solve [apply H; lia] | ].
632Lemma LIncs n:
33Ltac fp H := eapply progress_evstep_trans; [solve [apply H; lia] | ].
633 sideRLs tm' (hLR^^((2^n-1)*2)) (dh <* d0^^n <* d1) (dh <* d1^^(1+n)).
35Lemma ev_eq {c1 c2 c2'} : c1 -->* c2 -> c2 = c2' -> c1 -->* c2'.
36Proof. intros H E. subst. exact H. Qed.
38Lemma prog_eq {c1 c2 c2'} : c1 -->+ c2 -> c2 = c2' -> c1 -->+ c2'.
39Proof. intros H E. subst. exact H. Qed.
41(** * Shift rules (proof.md 3.1) *)
43Lemma ENDL l : l <* <[0;0] {{C}}> 0inf -->+ l <{{A}} [0;0;1] *> 0inf. Proof. es. Qed.
44Lemma AL l r : l <* bA <{{A}} [0;0;1] *> r -->* l <{{A}} [0;0;1] *> bAr *> r. Proof. es. Qed.
45Lemma BL l r : l <* bB <{{A}} [0;0;1] *> r -->* l <{{A}} [0;0;1] *> bBr *> r. Proof. es. Qed.
46Lemma AR l r : l <* <[0;0;1] {{E}}> bAr *> r -->* l <* bA <* <[0;0;1] {{E}}> r. Proof. es. Qed.
47Lemma BR l r : l <* <[0;0;1] {{E}}> bBr *> r -->* l <* bB <* <[0;0;1] {{E}}> r. Proof. es. Qed.
48Lemma ENDR l : l <* <[0;0;1] {{E}}> 0inf -->* l <* bB <* <[0;0] {{C}}> 0inf. Proof. es. Qed.
49Lemma D1L l r : l <* d1 <{{A}} [0;0;1] *> r -->* l <{{A}} [0;0;1] *> [0;1;0;1] *> r. Proof. es. Qed.
50Lemma FLIP l r : l <* d0 <{{A}} [0;0;1] *> r -->* l <* d1 <* <[0;0;1] {{E}}> r. Proof. es. Qed.
51Lemma D0R l r : l <* <[0;0;1] {{E}}> [0;1;0;1] *> r -->* l <* d0 <* <[0;0;1] {{E}}> r. Proof. es. Qed.
52Lemma D0R' l r : l <* <[0;0;1] {{E}}> [0;1] *> [0;1;0;1] *> r -->* l <* d0 <* <[0;0;1] {{E}}> [0;1] *> r.
53Proof. es. Qed.
54Lemma OVL r : 0inf <{{A}} [0;0;1] *> [0;1;0;1] *> r -->* 0inf <* d1 <* <[0;0;1] {{E}}> [0;1] *> r.
55Proof. es. Qed.
56Lemma OVR l r : l <* <[0;0;1] {{E}}> [0;1] *> bAr *> r -->* l <* d0 <{{A}} [0;0;1] *> [1;0;1] *> r.
57Proof. es. Qed.
58Lemma FL l r : l <* bA <* <[1;1;1] <{{A}} [0;0;1] *> r -->* l <{{A}} [0;0;1] *> [0;0;1] *> bBr *> r.
59Proof. es. Qed.
60Lemma FR1 l r : l <* <[0;0;1] {{E}}> [0;0;1] *> bBr *> r -->* l <* bA <{{A}} [0;0;1] *> [0;0;1] *> r.
61Proof. es. Qed.
62Lemma FR2 l r : l <* <[0;0;1] {{E}}> [0;0;1] *> bAr *> r -->* l <* bA <{{A}} [0;0;1] *> [1;0;1] *> r.
63Proof. es. Qed.
64Lemma FR3 l r : l <* <[0;0;1] {{E}}> [1;0;1] *> bAr *> r -->* l <* bA <* <[1;1;1] <* <[0;0;1] {{E}}> r.
65Proof. es. Qed.
66Lemma FR4 l r : l <* <[0;0;1] {{E}}> [1;0;1] *> bBr *> r -->* l <{{A}} [0;0;1] *> [0;0;1] *> bAr *> r.
67Proof. es. Qed.
68Lemma FE0 l : l <* <[0;0;1] {{E}}> [0;0;1] *> 0inf -->* l <* bA <* <[0;0] {{C}}> 0inf.
69Proof. es. Qed.
70Lemma FE1 l : l <* <[0;0;1] {{E}}> [1;0;1] *> 0inf -->* l <{{A}} [0;0;1] *> [0;0;1] *> [0;0;1] *> 0inf.
71Proof. es. Qed.
72Lemma FE2 l : l <* <[0;0;1] {{E}}> [0;0;1] *> [0;0;1] *> 0inf -->* l <* bA <{{A}} [0;0;1] *> [1] *> 0inf.
73Proof. es. Qed.
74Lemma FE3 l : l <* <[0;0;1] {{E}}> [1] *> 0inf -->* l <{{A}} [0;0;1] *> [0;0;1;1] *> 0inf.
75Proof. es. Qed.
76Lemma FE4 l : l <* <[0;0;1] {{E}}> [0;0;1;1] *> 0inf -->* l <* bA <{{A}} [0;0;1] *> [0;0;1] *> 0inf.
77Proof. es. Qed.
79(** * Repeated rules (proof.md 3.2) *)
81Lemma ALs a : forall l r, l <* bA^^a <{{A}} [0;0;1] *> r -->* l <{{A}} [0;0;1] *> bAr^^a *> r.
634Proof.82Proof.
635 rewrite lpow_add,Str_app_assoc.
83 induction a as [|a IH]; intros; [finish | rewrite !lpow_S, !Str_app_assoc; follow AL; follow IH; rewrite lpow_shift'; finish].
636 eapply segRLs_sideRLs_concat.
637 1: eapply BC.Mul2.
⋯ 4 template-only lines (template 638–641), not in ours
642 all: ss.
643 esx.
644Qed.84Qed.
646Lemma Incs n m:
85Lemma BLs a : forall l r, l <* bB^^a <{{A}} [0;0;1] *> r -->* l <{{A}} [0;0;1] *> bBr^^a *> r.
647 segRLs tm (hRL^^(n+m)) (hRL^^m) (w0^^n) (w1^^n).
648Proof.86Proof.
649 eapply UC1.Incs.
87 induction a as [|a IH]; intros; [finish | rewrite !lpow_S, !Str_app_assoc; follow BL; follow IH; rewrite lpow_shift'; finish].
650 all: ss.
651Qed.88Qed.
653Definition RC0 n := w0'^^n *> 0inf.
89Lemma ARs a : forall l r, l <* <[0;0;1] {{E}}> bAr^^a *> r -->* l <* bA^^a <* <[0;0;1] {{E}}> r.
655Lemma Incs0 n:
656 sideRLs tm (hRL^^n) (RC0 0) (RC0 n).
657Proof.90Proof.
658 unfold RC0.
91 induction a as [|a IH]; intros; [finish | rewrite !lpow_S, !Str_app_assoc; follow AR; follow IH; rewrite <-lpow_shift'; finish].
659 sideRLs_ind n.
660Qed.92Qed.
662Lemma Incs' n m:
93Lemma BRs a : forall l r, l <* <[0;0;1] {{E}}> bBr^^a *> r -->* l <* bB^^a <* <[0;0;1] {{E}}> r.
663 segRLs tm (hRL^^(n+m)) (hRL^^m) (w1'^^n) (w0'^^n).
664Proof.94Proof.
665 eapply UC1.Incs.
95 induction a as [|a IH]; intros; [finish | rewrite !lpow_S, !Str_app_assoc; follow BR; follow IH; rewrite <-lpow_shift'; finish].
666 all: ss.
667Qed.96Qed.
669Fixpoint RCa ls :=
97Lemma D1Ls a : forall l r, l <* d1^^a <{{A}} [0;0;1] *> r -->* l <{{A}} [0;0;1] *> [0;1;0;1]^^a *> r.
670match ls with
98Proof.
671| [] => 0inf
99 induction a as [|a IH]; intros; [finish | rewrite !lpow_S, !Str_app_assoc; follow D1L; follow IH; rewrite lpow_shift'; finish].
672| (a,b)::t => w1'^^a *> w0^^b *> RCa t
100Qed.
101Lemma D0R's a : forall l r, l <* <[0;0;1] {{E}}> [0;1] *> [0;1;0;1]^^a *> r -->* l <* d0^^a <* <[0;0;1] {{E}}> [0;1] *> r.
102Proof.
103 induction a as [|a IH]; intros; [finish | rewrite !lpow_S, !Str_app_assoc; follow D0R'; follow IH; rewrite <-lpow_shift'; finish].
104Qed.
106(** * The binary counter: k digits, MSB first (proof.md: C_k(n)) *)
108Fixpoint ctr (k n : nat) : side :=
109 match k with
110 | O => 0inf
111 | S k => ctr k (Nat.div2 n) <* (if Nat.odd n then d1 else d0)
673end.112 end.
675Fixpoint RCb ls n :=
114Lemma ctr_even k q : ctr (S k) (2*q) = ctr k q <* d0.
676match ls with
115Proof. cbn [ctr]. rewrite Nat.div2_double, Nat.odd_even. reflexivity. Qed.
677| [] => RC0 n
117Lemma ctr_odd k q : ctr (S k) (S (2*q)) = ctr k q <* d1.
678| (a,b)::t => w0'^^a *> w1^^b *> RCb t n
118Proof. cbn [ctr]. rewrite Nat.div2_succ_double, Nat.odd_succ, Nat.even_even. reflexivity. Qed.
679end.
120Lemma pow2_pos k : 1 <= 2^k.
681Fixpoint cons(l:nat)(x:list (nat*nat))(r:nat) :=
121Proof. pose proof (Nat.pow_nonzero 2 k). lia. Qed.
682match x with
123(** CTR: one increment, n+1 <= 2^k - 1 *)
683| [] => [(l,r)]
124Lemma CTR k : forall n r, S n < 2^k ->
684| (a,b)::t => (l,a)::cons b t r
125 ctr k n <{{A}} [0;0;1] *> r -->* ctr k (S n) <* <[0;0;1] {{E}}> r.
685end.
687Lemma RCb_shift ls n:
688 RCb ls n = [0;0] *> RCa (cons 0 ls n).
689Proof.126Proof.
690 gen n.
127 induction k as [|k IH]; intros n r H.
691 induction ls; intros.
128 - cbn in H. lia.
692 - cbn; unfold RC0.
129 - rewrite Nat.pow_succ_r' in H.
693 simpl_rotate; reflexivity.
130 destruct (Nat.Even_or_Odd n) as [[q Hq]|[q Hq]]; subst n.
694 - destruct a as [a b].
131 + rewrite ctr_even, ctr_odd.
695 cbn.
132 fw FLIP. finish.
696 rewrite IHls.
133 + replace (S (2*q+1)) with (2 * S q) by lia.
697 destruct ls as [|[a0 b0] ls];
134 replace (2*q+1) with (S (2*q)) by lia.
698 simpl_rotate; reflexivity.
135 rewrite ctr_even, ctr_odd.
136 fw D1L. fw (IH q). fw D0R. finish.
699Qed.137Qed.
701Fixpoint Rn (ls:list (nat*nat)) :=
139Lemma ctr_ones k : ctr k (2^k - 1) = 0inf <* d1^^k.
702match ls with
703| [] => O
⋯ 2 template-only lines (template 704–705), not in ours
707Lemma Rn_cons l ls r:
708 Rn (cons l ls r) = l + Rn ls + r.
709Proof.140Proof.
710 gen l.
141 induction k as [|k IH].
711 induction ls; intros; cbn.
142 - reflexivity.
712 - lia.
143 - pose proof (pow2_pos k).
713 - destruct a as [a b]; cbn.
144 replace (2^(S k) - 1) with (S (2 * (2^k - 1))) by (rewrite Nat.pow_succ_r'; lia).
714 rewrite IHls.
145 rewrite ctr_odd, IH. reflexivity.
715 lia.
716Qed.146Qed.
719Lemma RIncs ls n:
148Lemma ctr_pow k : ctr (S k) (2^k) = 0inf <* d1 <* d0^^k.
720 sideRLs tm (hRL^^(Rn ls+n)) (RCa ls) (RCb ls n).
721Proof.149Proof.
722 induction ls.
150 induction k as [|k IH].
723 - cbn.
151 - reflexivity.
724 apply Incs0.
152 - rewrite Nat.pow_succ_r', ctr_even, IH. reflexivity.
725 - destruct a as [a b].
726 cbn.
⋯ 3 template-only lines (template 727–729), not in ours
730 1: applys_eq (Incs b (Rn ls+n)); flia.
731 apply IHls.
732Qed.153Qed.
734Definition S '(k,ls) :=
155Lemma ctr_ov k : ctr (S (S k)) (2^(S k) + 1) = 0inf <* d1 <* d0^^k <* d1.
735 dh <* d0^^k <* d1 {{{ (hR,R) }}} RCa ls.
737Lemma Rst k ls n:
738 dh <* d1^^k {{{ (hL,L) }}} RCb ls n -->*
739 S (k,cons 0 ls n).
740Proof.156Proof.
741 rewrite RCb_shift.
157 replace (2^(S k) + 1) with (S (2 * 2^k)) by (rewrite Nat.pow_succ_r'; lia).
742 es.
158 rewrite ctr_odd, ctr_pow. reflexivity.
743Qed.159Qed.
745Lemma BigStep k ls:
161(** OV: the counter overflows; it gains a digit and a new front 111 appears *)
746 Rn ls <= (2^k-1)*2 ->
162Lemma OV k r :
747 S (k,ls) -->+
163 ctr (S k) (2^(S k) - 1) <{{A}} [0;0;1] *> bAr *> bAr *> r -->*
748 S (1+k,cons 0 ls ((2^k-1)*2+1-Rn ls)).
164 ctr (S (S k)) (2^(S k) + 1) <* bA <* <[1;1;1] <* <[0;0;1] {{E}}> r.
749Proof.165Proof.
750 intros Hn.
166 rewrite ctr_ones, ctr_ov.
751 remember ((2^k-1)*2-Rn ls+1) as n.
167 fw D1Ls. rewrite lpow_S, Str_app_assoc.
752 unfold S.
168 fw OVL. fw D0R's. fw OVR. fw FLIP. fw FR3. finish.
753 epose proof (sideRLs_concat (LIncs _)) as I1.
169Qed.
754 eapply progress_evstep_trans.
171(** RT: a round trip of the head through the counter (no overflow) *)
755 - apply I1.
172Lemma RT K n a r : S n < 2^K ->
756 rewrite lrcons_lpow1'.
173 ctr K n <* bA^^a <{{A}} [0;0;1] *> r -->* ctr K (S n) <* bA^^a <* <[0;0;1] {{E}}> r.
757 replace ((2^k-1)*2) with (Rn ls+(n-1)) by lia.
174Proof.
758 rewrite <-Nat.add_assoc.
175 intros H. fw ALs. fw CTR. fw ARs. finish.
759 apply RIncs.
176Qed.
760 - follow Rst.
178(** OVRT: a round trip that overflows the counter *)
761 unfold S.
179Lemma OVRT k a r :
180 ctr (S k) (2^(S k) - 1) <* bA^^(S (S a)) <{{A}} [0;0;1] *> r -->*
181 ctr (S (S k)) (2^(S k) + 1) <* bA <* <[1;1;1] <* bA^^a <* <[0;0;1] {{E}}> r.
182Proof.
183 fw ALs. rewrite !lpow_S, !Str_app_assoc. fw OV. fw ARs. finish.
184Qed.
186(** QC: one step of the front (3 round trips, the front moves 2 blocks right) *)
187Lemma QC K n x y r : 3 + n < 2^K ->
188 ctr K n <* bA^^(S x) <* <[1;1;1] <* bA^^(S (S y)) <{{A}} [0;0;1] *> r -->*
189 ctr K (3 + n) <* bA^^(S (S (S x))) <* <[1;1;1] <* bA^^y <* <[0;0;1] {{E}}> r.
190Proof.
191 intros H.
192 fw ALs.
193 fw (FL (ctr K n <* bA^^x) (bAr^^(S (S y)) *> r)).
194 fw (RT K n x).
195 fw FR1.
196 fw (RT K (S n) (S x)).
197 fw (FR2 (ctr K (S (S n)) <* bA^^(S x)) (bAr^^(S y) *> r)).
198 fw (RT K (S (S n)) (S (S x))).
199 fw (FR3 (ctr K (S (S (S n))) <* bA^^(S (S x))) (bAr^^y *> r)).
200 fw ARs.
762 finish.201 finish.
763Qed.202Qed.
204(** * Configurations at the right edge (proof.md 1) *)
206Definition Pc K n X z := ctr K n <* bA^^X <* bB^^z <* <[0;0] {{C}}> 0inf.
207Definition Qc K n x y z := ctr K n <* bA^^x <* <[1;1;1] <* bA^^y <* bB^^z <* <[0;0] {{C}}> 0inf.
209Lemma R1 K n X z : S n < 2^K -> Pc K n X z -->+ Pc K (S n) X (S z).
210Proof.
211 intros H. unfold Pc.
212 fp ENDL. fw BLs. fw RT. fw BRs. fw ENDR. finish.
213Qed.
215Lemma R1s K c : forall n X z, c + n < 2^K -> Pc K n X z -->* Pc K (c + n) X (c + z).
216Proof.
217 induction c as [|c IH]; intros n X z H.
218 - finish.
219 - eapply evstep_trans. { apply progress_evstep, R1. lia. }
220 eapply ev_eq. { apply IH. lia. }
221 f_equal; lia.
222Qed.
224Lemma R2 k X z : Pc (S k) (2^(S k) - 1) (S (S X)) z -->+ Qc (S (S k)) (2^(S k) + 1) 1 X (S z).
225Proof.
226 unfold Pc, Qc.
227 fp ENDL. fw BLs. fw OVRT. fw BRs. fw ENDR. finish.
228Qed.
230(** Pfin: the rest of a P phase (R1 repeatedly, then R2) *)
231Lemma Pfin (k n X z n' x' X' z' : nat) :
232 n < 2^(S k) -> X = 2 + X' -> n' = 2^(S k) + 1 -> x' = 1%nat -> z' = z + 2^(S k) - n ->
233 Pc (S k) n X z -->+ Qc (S (S k)) n' x' X' z'.
234Proof.
235 intros H1 H2 H3 H4 H5. subst.
236 eapply evstep_progress_trans. { apply (R1s (S k) (2^(S k) - 1 - n) n). lia. }
237 replace (2^(S k) - 1 - n + n) with (2^(S k) - 1) by lia.
238 eapply prog_eq. { apply R2. }
239 f_equal; lia.
240Qed.
242Lemma R3 K n x y z : 3 + n < 2^K ->
243 Qc K n (S x) (S (S y)) z -->+ Qc K (3 + n) (S (S (S x))) y (S z).
244Proof.
245 intros H. unfold Qc.
246 fp ENDL. fw BLs. fw QC. fw BRs. fw ENDR. finish.
247Qed.
249(** * The conversion gadget (proof.md 3.3)
251 After FL, the old front plus the B blocks form a word G right of the head. Each round
252 the head goes through the counter and back (+1) and then hits G: a hit either reflects
253 the head, with 0 or 1 new A block (Hit0 / Hit1), or ends at the right edge (FE0).
254 Gad G T D: G takes T rounds in all, which add D A blocks. *)
256Definition Hit0 (G G' : side) := forall l, l <* <[0;0;1] {{E}}> G -->* l <{{A}} [0;0;1] *> G'.
257Definition Hit1 (G G' : side) := forall l, l <* <[0;0;1] {{E}}> G -->* l <* bA <{{A}} [0;0;1] *> G'.
259Inductive Gad : side -> nat -> nat -> Prop :=
260 | Gad_end : Gad ([0;0;1] *> 0inf) 1%nat 1%nat
261 | Gad_h0 G G' T D : Hit0 G G' -> Gad G' T D -> Gad G (S T) D
262 | Gad_h1 G G' T D : Hit1 G G' -> Gad G' T D -> Gad G (S T) (S D).
264Lemma Gad_DT G T D : Gad G T D -> D <= T.
265Proof. induction 1; lia. Qed.
267Lemma Gad_eq {G T D T' D'} : T = T' -> D = D' -> Gad G T D -> Gad G T' D'.
268Proof. intros E1 E2 H. subst. exact H. Qed.
270(** even (y = 0): FR1^(z+1), FE0 *)
271Lemma gad_even z : Gad ([0;0;1] *> bBr^^z *> 0inf) (S z) (S z).
272Proof.
273 induction z as [|z IH].
274 - apply Gad_end.
275 - eapply Gad_h1; [intro l; apply (FR1 l (bBr^^z *> 0inf)) | exact IH].
276Qed.
278(** odd (y = 1): FR1, FR2, (FR4, FR2)^z, FE1, FE2, FE3, FE4, FE0 *)
279Lemma gad_tail : Gad ([1;0;1] *> 0inf) 5 3.
280Proof.
281 eapply Gad_h0; [intro l; apply FE1 |].
282 eapply Gad_h1; [intro l; apply FE2 |].
283 eapply Gad_h0; [intro l; apply FE3 |].
284 eapply Gad_h1; [intro l; apply FE4 |].
285 apply Gad_end.
286Qed.
288Lemma gad_mid z : Gad ([1;0;1] *> bBr^^z *> 0inf) (5 + 2*z) (3 + z).
289Proof.
290 induction z as [|z IH].
291 - exact gad_tail.
292 - apply (Gad_eq (T := S (S (5 + 2*z))) (D := S (3 + z))); [lia | lia |].
293 eapply Gad_h0; [intro l; apply (FR4 l (bBr^^z *> 0inf)) |].
294 eapply Gad_h1; [intro l; apply FR2 |].
295 exact IH.
296Qed.
298Lemma gad_odd z : Gad ([0;0;1] *> bBr *> bAr *> bBr^^z *> 0inf) (7 + 2*z) (5 + z).
299Proof.
300 apply (Gad_eq (T := S (S (5 + 2*z))) (D := S (S (3 + z)))); [lia | lia |].
301 eapply Gad_h1; [intro l; apply FR1 |].
302 eapply Gad_h1; [intro l; apply FR2 |].
303 apply gad_mid.
304Qed.
306(** All T rounds without overflow (R4, R5) *)
307Lemma ConvNo K : forall G T D, Gad G T D -> forall n a, n + T < 2^K ->
308 ctr K n <* bA^^a <{{A}} [0;0;1] *> G -->* Pc K (n + T) (a + D) 0.
309Proof.
310 induction 1 as [|G G' T D HH HG IH|G G' T D HH HG IH]; intros n a Hn.
311 - fw (RT K n a). fw FE0. unfold Pc.
312 replace (n + 1) with (S n) by lia. replace (a + 1) with (S a) by lia. finish.
313 - fw (RT K n a). fw HH. eapply ev_eq. { apply (IH (S n) a). lia. } f_equal; lia.
314 - fw (RT K n a). fw HH. eapply ev_eq. { apply (IH (S n) (S a)). lia. } f_equal; lia.
315Qed.
317(** Rounds after an overflow: a new front (QC) runs while the old gadget converts *)
318Lemma PostOV K : forall G T D, Gad G T D -> forall n x b y,
319 b + D = 2*T + y -> 1 <= y -> 3*T + n < 2^K ->
320 ctr K n <* bA^^(S x) <* <[1;1;1] <* bA^^b <{{A}} [0;0;1] *> G -->*
321 Qc K (3*T + n) (2*T + S x) y 0.
322Proof.
323 induction 1 as [|G G' T D HH HG IH|G G' T D HH HG IH]; intros n x b y Hb Hy Hn.
324 - destruct y as [|y]; [lia|].
325 assert (b = S (S y)) by lia. subst b.
326 fw (QC K n x y). fw FE0. unfold Qc. finish.
327 - pose proof (Gad_DT _ _ _ HG).
328 destruct b as [|[|b]]; [lia|lia|].
329 fw (QC K n x b). fw HH.
330 eapply ev_eq. { apply (IH (3 + n) (S (S x)) b y); lia. }
331 f_equal; lia.
332 - pose proof (Gad_DT _ _ _ HG).
333 destruct b as [|[|b]]; [lia|lia|].
334 fw (QC K n x b). fw HH.
335 eapply ev_eq. { apply (IH (3 + n) (S (S x)) (S b) y); lia. }
336 f_equal; lia.
337Qed.
339(** A conversion during which the counter overflows (R5o) *)
340Lemma ConvOV k : forall G T D, Gad G T D -> forall n a m y,
341 n + T = 2^(S k) + m -> n < 2^(S k) -> a + D = 2 + 2*m + y -> 1 <= y ->
342 3*m + (2^(S k) + 1) < 2^(S (S k)) ->
343 ctr (S k) n <* bA^^a <{{A}} [0;0;1] *> G -->*
344 Qc (S (S k)) (3*m + (2^(S k) + 1)) (1 + 2*m) y 0.
345Proof.
346 pose proof (pow2_pos (S k)) as Hp.
347 induction 1 as [|G G' T D HH HG IH|G G' T D HH HG IH]; intros n a m y E1 E2 E3 E4 E5.
348 - assert (m = 0%nat) by lia. subst m.
349 assert (n = 2^(S k) - 1) by lia. subst n.
350 destruct y as [|y]; [lia|].
351 assert (a = S (S y)) by lia. subst a.
352 fw (OVRT k y). fw FE0. unfold Qc. finish.
353 - pose proof (Gad_DT _ _ _ HG).
354 destruct (Nat.eq_dec n (2^(S k) - 1)) as [En|En].
355 + subst n. assert (m = T) by lia. subst m.
356 destruct a as [|[|a]]; [lia|lia|].
357 fw (OVRT k a). fw HH.
358 eapply ev_eq. { apply (PostOV (S (S k)) _ _ _ HG (2^(S k) + 1) O a y); lia. }
359 f_equal; lia.
360 + fw (RT (S k) n a). fw HH.
361 apply (IH (S n) a m y); lia.
362 - pose proof (Gad_DT _ _ _ HG).
363 destruct (Nat.eq_dec n (2^(S k) - 1)) as [En|En].
364 + subst n. assert (m = T) by lia. subst m.
365 destruct a as [|[|a]]; [lia|lia|].
366 fw (OVRT k a). fw HH.
367 eapply ev_eq. { apply (PostOV (S (S k)) _ _ _ HG (2^(S k) + 1) O (S a) y); lia. }
368 f_equal; lia.
369 + fw (RT (S k) n a). fw HH.
370 apply (IH (S n) (S a) m y); lia.
371Qed.
373(** From a Q configuration with y in {0,1}: the front meets the B blocks *)
374Lemma QG0 K n x z : Qc K n (S x) 0 z -->+
375 ctr K n <* bA^^x <{{A}} [0;0;1] *> [0;0;1] *> bBr^^(S z) *> 0inf.
376Proof.
377 unfold Qc. fp ENDL. fw BLs. fw (FL (ctr K n <* bA^^x) (bBr^^z *> 0inf)). finish.
378Qed.
380Lemma QG1 K n x z : Qc K n (S x) 1 z -->+
381 ctr K n <* bA^^x <{{A}} [0;0;1] *> [0;0;1] *> bBr *> bAr *> bBr^^z *> 0inf.
382Proof.
383 unfold Qc. fp ENDL. fw BLs.
384 fw (AL (ctr K n <* bA^^(S x) <* <[1;1;1]) (bBr^^z *> 0inf)).
385 fw (FL (ctr K n <* bA^^x) (bAr *> bBr^^z *> 0inf)). finish.
386Qed.
388(** R4 *)
389Lemma Conv0 K n x z : n + z + 2 < 2^K ->
390 Qc K n (S x) 0 z -->+ Pc K (n + z + 2) (x + z + 2) 0.
391Proof.
392 intros H. eapply progress_evstep_trans. { apply QG0. }
393 eapply ev_eq. { apply (ConvNo K _ _ _ (gad_even (S z))). lia. }
394 f_equal; lia.
395Qed.
397(** R5 *)
398Lemma Conv1 K n x z : n + 2*z + 7 < 2^K ->
399 Qc K n (S x) 1 z -->+ Pc K (n + 2*z + 7) (x + z + 5) 0.
400Proof.
401 intros H. eapply progress_evstep_trans. { apply QG1. }
402 eapply ev_eq. { apply (ConvNo K _ _ _ (gad_odd z)). lia. }
403 f_equal; lia.
404Qed.
406(** R5o *)
407Lemma Conv1o (k m n x z n' x' y : nat) :
408 n + 2*z + 7 = 2^(S k) + m -> n < 2^(S k) -> x + z + 5 = 2 + 2*m + y -> 1 <= y ->
409 3*m + (2^(S k) + 1) < 2^(S (S k)) -> n' = 3*m + (2^(S k) + 1) -> x' = 1 + 2*m ->
410 Qc (S k) n (S x) 1 z -->+ Qc (S (S k)) n' x' y 0.
411Proof.
412 intros. subst n' x'.
413 eapply progress_evstep_trans. { apply QG1. }
414 apply (ConvOV k _ _ _ (gad_odd z)); lia.
415Qed.
417(** * The cycle (proof.md 4)
419 Index (k,i,y,z) stands for Q(k+2, 2^(k+1)+1+3i, 1+2i, y, z): the Q phase of the cycle
420 whose counter has k+2 digits, after i front steps. In proof.md's cycle coordinates
421 N = 2^(k+1), Y = y+2i, Z = z-i. Inv is the hexagon of proof.md 4 in these coordinates
422 (Z = z-i may be negative), plus N >= 64. *)
424Definition CfgF (k i y z : nat) := Qc (S (S k)) (3*i + (2^(S k) + 1)) (1 + 2*i) y z.
426Definition Inv (k i y z : nat) : Prop :=
427 64 <= 2^(S k) /\ 2^(S k) <= 8*(y + 2*i) /\ 8*(y + 2*i) <= 3 * 2^(S k) /\
428 3*z <= 2^(S k) + 3*i /\ 8*i <= 8*z + 2^(S k) /\
429 2^(S k) <= 4*y + 6*i + 2*z /\ 20*y + 24*i + 16*z <= 9 * 2^(S k).
431Lemma cycle_step k i y z : Inv k i y z ->
432 exists k' i' y' z', CfgF k i y z -->+ CfgF k' i' y' z' /\ Inv k' i' y' z'.
433Proof.
434 unfold Inv, CfgF. intros HI.
435 pose proof (Nat.pow_succ_r' 2 (S k)) as HN.
436 pose proof (Nat.pow_succ_r' 2 (S (S k))) as HN2.
437 destruct y as [|[|y]].
438 - (* y = 0: R4, R1^*, R2 *)
439 exists (S k), O, (2*i + z), (2^(S k) - 3 - 3*i - z). split; [|lia].
440 eapply progress_evstep_trans. { apply Conv0. lia. }
441 apply progress_evstep. apply Pfin; lia.
442 - destruct (Nat.lt_ge_cases (3*i + (2^(S k) + 1) + 2*z + 7) (2^(S (S k)))) as [Hno|Hov].
443 + (* y = 1, no overflow: R5, R1^*, R2 *)
444 exists (S k), O, (2*i + z + 3), (2^(S (S k)) - (3*i + (2^(S k) + 1) + 2*z + 7)).
445 split; [|lia].
446 eapply progress_evstep_trans. { apply Conv1. lia. }
447 apply progress_evstep. apply Pfin; lia.
448 + (* y = 1, overflow during the conversion: R5o *)
449 remember (3*i + (2^(S k) + 1) + 2*z + 7 - 2^(S (S k))) as m eqn:Em.
450 exists (S k), m, (2*i + z + 3 - 2*m), O. split; [|lia].
451 apply (Conv1o (S k) m); lia.
452 - (* y >= 2: R3 *)
453 exists k, (S i), y, (S z). split; [|lia].
454 eapply prog_eq. { apply R3. lia. }
455 f_equal; lia.
456Qed.
458(** * Start: c0 reaches Q(7,65,1,16,0) = CfgF 5 0 16 0 in 17,215 steps *)
460Lemma init0 : c0 -->* 0inf <* d1 <* d0^^5 <* d1 <* bA <* <[1;1;1] <* bA^^16 <* <[0;0] {{C}}> 0inf.
461Proof. esx. Qed.
463Lemma init : c0 -->* CfgF 5 0 16 0.
464Proof. apply init0. Qed.
765Lemma nonhalt: ~halts tm c0.466Lemma nonhalt: ~halts tm c0.
766Proof.467Proof.
767 eapply multistep_nonhalt with (c':=S(2,[(0,3)])%nat).
468 eapply multistep_nonhalt. { apply init. }
768 1: unfold S; esx.
469 apply (progress_nonhalt_cond tm _ (5,0,16,0)%nat
769 eapply progress_nonhalt_cond with (P:=fun '(k,ls) => Rn ls<=(2^k-1)*2).
470 (fun '(k,i,y,z) => CfgF k i y z) (fun '(k,i,y,z) => Inv k i y z)).
770 2: cbn; lia.
471 - intros [[[k i] y] z] HI.
771 intros [k ls] HP.
472 destruct (cycle_step k i y z HI) as (k' & i' & y' & z' & H1 & H2).
772 eexists (_,_); split.
473 exists (k',i',y',z'). split; assumption.
773 1: apply BigStep; lia.
474 - unfold Inv. cbn. lia.
774 rewrite Rn_cons.
775 rewrite Nat.pow_add_r by lia.
776 lia.
777Qed.475Qed.
477(*
478```
4791RB0LA_0RC1RD_0LD1RE_1LA0RB_0RD1RF_1RC---
481C_k(n): n in k bits MSB first, digit 1 -> 1010 (d1), digit 0 -> 0010 (d0) [ctr k n]
482A = 00111, B = 10111 left of the head; A' = 00101, B' = 00001 right of the head
483moving head: <A 001 / 001 E> (TM4's hL / hR)
485P(k,n,X,z) := 0^inf C_k(n) A^X B^z 00 C> 0^inf [Pc]
486Q(k,n,x,y,z) := 0^inf C_k(n) A^x 111 A^y B^z 00 C> 0^inf [Qc]
488R1 P(k,n,X,z) -->+ P(k,n+1,X,z+1) n+1 < 2^k
489R2 P(k,2^k-1,X+2,z) -->+ Q(k+1,2^k+1,1,X,z+1)
490R3 Q(k,n,x+1,y+2,z) -->+ Q(k,n+3,x+3,y,z+1) n+3 < 2^k
491R4 Q(k,n,x+1,0,z) -->+ P(k,n+z+2,x+z+2,0) n+z+2 < 2^k
492R5 Q(k,n,x+1,1,z) -->+ P(k,n+2z+7,x+z+5,0) n+2z+7 < 2^k
493R5o Q(k,n,x+1,1,z) -->+ Q(k+1,2^k+1+3m,1+2m,y,0) n+2z+7 = 2^k+m, n < 2^k,
494 x+z+5 = 2+2m+y, y >= 1, 3m+2^k+1 < 2^(k+1)
496cycle index (k,i,y,z) = Q(k+2, 2^(k+1)+1+3i, 1+2i, y, z); N = 2^(k+1), Y = y+2i, Z = z-i
497 y >= 2: R3 -> (k, i+1, y-2, z+1)
498 y = 0: R4, R1 repeated, R2 -> (k+1, 0, 2i+z, N-3-3i-z)
499 y = 1: R5, R1 repeated, R2 -> (k+1, 0, 2i+z+3, N-8-3i-2z) no overflow
500 R5o, m = 3i+2z+8-N -> (k+1, m, 2i+z+3-2m, 0) overflow
501invariant: N >= 64, 8Y >= N, 8Y <= 3N, 3Z <= N, 8Z >= -N, 4Y+2Z >= N, 20Y+16Z <= 9N
502start: c0 -->(17215) Q(7,65,1,16,0), index (5,0,16,0)
503```
504*)
3Proof outlineCheck: the new items (green) carry the argument; the names read like the proof.md rules.

73 items in 1RB0LA_0RC1RD_0LD1RE_1LA0RB_0RD1RF_1RC---.v (504 lines): 64 Lemma, 7 Definition, 1 Fixpoint, 1 Inductive. Tags against the template: identical = same name and same text once each file's own TM string is <TM> (marked "except the TM string" when that is the only difference); adapted = same name, different text; new = no item of that name in the template part.

#kindnamestatement (no proof body)linevs template
1Definitiontm
Definition tm := Eval compute in (TM_from_str "1RB0LA_0RC1RD_0LD1RE_1LA0RB_0RD1RF_1RC---").
L18identicalexcept the TM string
2Lemmaev_eq
Lemma ev_eq {c1 c2 c2'} : c1 -->* c2 -> c2 = c2' -> c1 -->* c2'.
L35new
3Lemmaprog_eq
Lemma prog_eq {c1 c2 c2'} : c1 -->+ c2 -> c2 = c2' -> c1 -->+ c2'.
L38new
4LemmaENDL
Lemma ENDL l : l <* <[0;0] {{C}}> 0inf -->+ l <{{A}} [0;0;1] *> 0inf.
L43new
5LemmaAL
Lemma AL l r : l <* bA <{{A}} [0;0;1] *> r -->* l <{{A}} [0;0;1] *> bAr *> r.
L44new
6LemmaBL
Lemma BL l r : l <* bB <{{A}} [0;0;1] *> r -->* l <{{A}} [0;0;1] *> bBr *> r.
L45new
7LemmaAR
Lemma AR l r : l <* <[0;0;1] {{E}}> bAr *> r -->* l <* bA <* <[0;0;1] {{E}}> r.
L46new
8LemmaBR
Lemma BR l r : l <* <[0;0;1] {{E}}> bBr *> r -->* l <* bB <* <[0;0;1] {{E}}> r.
L47new
9LemmaENDR
Lemma ENDR l : l <* <[0;0;1] {{E}}> 0inf -->* l <* bB <* <[0;0] {{C}}> 0inf.
L48new
10LemmaD1L
Lemma D1L l r : l <* d1 <{{A}} [0;0;1] *> r -->* l <{{A}} [0;0;1] *> [0;1;0;1] *> r.
L49new
11LemmaFLIP
Lemma FLIP l r : l <* d0 <{{A}} [0;0;1] *> r -->* l <* d1 <* <[0;0;1] {{E}}> r.
L50new
12LemmaD0R
Lemma D0R l r : l <* <[0;0;1] {{E}}> [0;1;0;1] *> r -->* l <* d0 <* <[0;0;1] {{E}}> r.
L51new
13LemmaD0R'
Lemma D0R' l r : l <* <[0;0;1] {{E}}> [0;1] *> [0;1;0;1] *> r -->* l <* d0 <* <[0;0;1] {{E}}> [0;1] *> r.
L52new
14LemmaOVL
Lemma OVL r : 0inf <{{A}} [0;0;1] *> [0;1;0;1] *> r -->* 0inf <* d1 <* <[0;0;1] {{E}}> [0;1] *> r.
L54new
15LemmaOVR
Lemma OVR l r : l <* <[0;0;1] {{E}}> [0;1] *> bAr *> r -->* l <* d0 <{{A}} [0;0;1] *> [1;0;1] *> r.
L56new
16LemmaFL
Lemma FL l r : l <* bA <* <[1;1;1] <{{A}} [0;0;1] *> r -->* l <{{A}} [0;0;1] *> [0;0;1] *> bBr *> r.
L58new
17LemmaFR1
Lemma FR1 l r : l <* <[0;0;1] {{E}}> [0;0;1] *> bBr *> r -->* l <* bA <{{A}} [0;0;1] *> [0;0;1] *> r.
L60new
18LemmaFR2
Lemma FR2 l r : l <* <[0;0;1] {{E}}> [0;0;1] *> bAr *> r -->* l <* bA <{{A}} [0;0;1] *> [1;0;1] *> r.
L62new
19LemmaFR3
Lemma FR3 l r : l <* <[0;0;1] {{E}}> [1;0;1] *> bAr *> r -->* l <* bA <* <[1;1;1] <* <[0;0;1] {{E}}> r.
L64new
20LemmaFR4
Lemma FR4 l r : l <* <[0;0;1] {{E}}> [1;0;1] *> bBr *> r -->* l <{{A}} [0;0;1] *> [0;0;1] *> bAr *> r.
L66new
21LemmaFE0
Lemma FE0 l : l <* <[0;0;1] {{E}}> [0;0;1] *> 0inf -->* l <* bA <* <[0;0] {{C}}> 0inf.
L68new
22LemmaFE1
Lemma FE1 l : l <* <[0;0;1] {{E}}> [1;0;1] *> 0inf -->* l <{{A}} [0;0;1] *> [0;0;1] *> [0;0;1] *> 0inf.
L70new
23LemmaFE2
Lemma FE2 l : l <* <[0;0;1] {{E}}> [0;0;1] *> [0;0;1] *> 0inf -->* l <* bA <{{A}} [0;0;1] *> [1] *> 0inf.
L72new
24LemmaFE3
Lemma FE3 l : l <* <[0;0;1] {{E}}> [1] *> 0inf -->* l <{{A}} [0;0;1] *> [0;0;1;1] *> 0inf.
L74new
25LemmaFE4
Lemma FE4 l : l <* <[0;0;1] {{E}}> [0;0;1;1] *> 0inf -->* l <* bA <{{A}} [0;0;1] *> [0;0;1] *> 0inf.
L76new
26LemmaALs
Lemma ALs a : forall l r, l <* bA^^a <{{A}} [0;0;1] *> r -->* l <{{A}} [0;0;1] *> bAr^^a *> r.
L81new
27LemmaBLs
Lemma BLs a : forall l r, l <* bB^^a <{{A}} [0;0;1] *> r -->* l <{{A}} [0;0;1] *> bBr^^a *> r.
L85new
28LemmaARs
Lemma ARs a : forall l r, l <* <[0;0;1] {{E}}> bAr^^a *> r -->* l <* bA^^a <* <[0;0;1] {{E}}> r.
L89new
29LemmaBRs
Lemma BRs a : forall l r, l <* <[0;0;1] {{E}}> bBr^^a *> r -->* l <* bB^^a <* <[0;0;1] {{E}}> r.
L93new
30LemmaD1Ls
Lemma D1Ls a : forall l r, l <* d1^^a <{{A}} [0;0;1] *> r -->* l <{{A}} [0;0;1] *> [0;1;0;1]^^a *> r.
L97new
31LemmaD0R's
Lemma D0R's a : forall l r, l <* <[0;0;1] {{E}}> [0;1] *> [0;1;0;1]^^a *> r -->* l <* d0^^a <* <[0;0;1] {{E}}> [0;1] *> r.
L101new
32Fixpointctr
Fixpoint ctr (k n : nat) : side :=
match k with
| O => 0inf
| S k => ctr k (Nat.div2 n) <* (if Nat.odd n then d1 else d0)
end.
L108new
33Lemmactr_even
Lemma ctr_even k q : ctr (S k) (2*q) = ctr k q <* d0.
L114new
34Lemmactr_odd
Lemma ctr_odd k q : ctr (S k) (S (2*q)) = ctr k q <* d1.
L117new
35Lemmapow2_pos
Lemma pow2_pos k : 1 <= 2^k.
L120new
36LemmaCTR
Lemma CTR k : forall n r, S n < 2^k ->
ctr k n <{{A}} [0;0;1] *> r -->* ctr k (S n) <* <[0;0;1] {{E}}> r.
L124new
37Lemmactr_ones
Lemma ctr_ones k : ctr k (2^k - 1) = 0inf <* d1^^k.
L139new
38Lemmactr_pow
Lemma ctr_pow k : ctr (S k) (2^k) = 0inf <* d1 <* d0^^k.
L148new
39Lemmactr_ov
Lemma ctr_ov k : ctr (S (S k)) (2^(S k) + 1) = 0inf <* d1 <* d0^^k <* d1.
L155new
40LemmaOV
Lemma OV k r :
ctr (S k) (2^(S k) - 1) <{{A}} [0;0;1] *> bAr *> bAr *> r -->*
ctr (S (S k)) (2^(S k) + 1) <* bA <* <[1;1;1] <* <[0;0;1] {{E}}> r.
L162new
41LemmaRT
Lemma RT K n a r : S n < 2^K ->
ctr K n <* bA^^a <{{A}} [0;0;1] *> r -->* ctr K (S n) <* bA^^a <* <[0;0;1] {{E}}> r.
L172new
42LemmaOVRT
Lemma OVRT k a r :
ctr (S k) (2^(S k) - 1) <* bA^^(S (S a)) <{{A}} [0;0;1] *> r -->*
ctr (S (S k)) (2^(S k) + 1) <* bA <* <[1;1;1] <* bA^^a <* <[0;0;1] {{E}}> r.
L179new
43LemmaQC
Lemma QC K n x y r : 3 + n < 2^K ->
ctr K n <* bA^^(S x) <* <[1;1;1] <* bA^^(S (S y)) <{{A}} [0;0;1] *> r -->*
ctr K (3 + n) <* bA^^(S (S (S x))) <* <[1;1;1] <* bA^^y <* <[0;0;1] {{E}}> r.
L187new
44DefinitionPc
Definition Pc K n X z := ctr K n <* bA^^X <* bB^^z <* <[0;0] {{C}}> 0inf.
L206new
45DefinitionQc
Definition Qc K n x y z := ctr K n <* bA^^x <* <[1;1;1] <* bA^^y <* bB^^z <* <[0;0] {{C}}> 0inf.
L207new
46LemmaR1
Lemma R1 K n X z : S n < 2^K -> Pc K n X z -->+ Pc K (S n) X (S z).
L209new
47LemmaR1s
Lemma R1s K c : forall n X z, c + n < 2^K -> Pc K n X z -->* Pc K (c + n) X (c + z).
L215new
48LemmaR2
Lemma R2 k X z : Pc (S k) (2^(S k) - 1) (S (S X)) z -->+ Qc (S (S k)) (2^(S k) + 1) 1 X (S z).
L224new
49LemmaPfin
Lemma Pfin (k n X z n' x' X' z' : nat) :
n < 2^(S k) -> X = 2 + X' -> n' = 2^(S k) + 1 -> x' = 1%nat -> z' = z + 2^(S k) - n ->
Pc (S k) n X z -->+ Qc (S (S k)) n' x' X' z'.
L231new
50LemmaR3
Lemma R3 K n x y z : 3 + n < 2^K ->
Qc K n (S x) (S (S y)) z -->+ Qc K (3 + n) (S (S (S x))) y (S z).
L242new
51DefinitionHit0
Definition Hit0 (G G' : side) := forall l, l <* <[0;0;1] {{E}}> G -->* l <{{A}} [0;0;1] *> G'.
L256new
52DefinitionHit1
Definition Hit1 (G G' : side) := forall l, l <* <[0;0;1] {{E}}> G -->* l <* bA <{{A}} [0;0;1] *> G'.
L257new
53InductiveGad
Inductive Gad : side -> nat -> nat -> Prop :=
| Gad_end : Gad ([0;0;1] *> 0inf) 1%nat 1%nat
| Gad_h0 G G' T D : Hit0 G G' -> Gad G' T D -> Gad G (S T) D
| Gad_h1 G G' T D : Hit1 G G' -> Gad G' T D -> Gad G (S T) (S D).
L259new
54LemmaGad_DT
Lemma Gad_DT G T D : Gad G T D -> D <= T.
L264new
55LemmaGad_eq
Lemma Gad_eq {G T D T' D'} : T = T' -> D = D' -> Gad G T D -> Gad G T' D'.
L267new
56Lemmagad_even
Lemma gad_even z : Gad ([0;0;1] *> bBr^^z *> 0inf) (S z) (S z).
L271new
57Lemmagad_tail
Lemma gad_tail : Gad ([1;0;1] *> 0inf) 5 3.
L279new
58Lemmagad_mid
Lemma gad_mid z : Gad ([1;0;1] *> bBr^^z *> 0inf) (5 + 2*z) (3 + z).
L288new
59Lemmagad_odd
Lemma gad_odd z : Gad ([0;0;1] *> bBr *> bAr *> bBr^^z *> 0inf) (7 + 2*z) (5 + z).
L298new
60LemmaConvNo
Lemma ConvNo K : forall G T D, Gad G T D -> forall n a, n + T < 2^K ->
ctr K n <* bA^^a <{{A}} [0;0;1] *> G -->* Pc K (n + T) (a + D) 0.
L307new
61LemmaPostOV
Lemma PostOV K : forall G T D, Gad G T D -> forall n x b y,
b + D = 2*T + y -> 1 <= y -> 3*T + n < 2^K ->
ctr K n <* bA^^(S x) <* <[1;1;1] <* bA^^b <{{A}} [0;0;1] *> G -->*
Qc K (3*T + n) (2*T + S x) y 0.
L318new
62LemmaConvOV
Lemma ConvOV k : forall G T D, Gad G T D -> forall n a m y,
n + T = 2^(S k) + m -> n < 2^(S k) -> a + D = 2 + 2*m + y -> 1 <= y ->
3*m + (2^(S k) + 1) < 2^(S (S k)) ->
ctr (S k) n <* bA^^a <{{A}} [0;0;1] *> G -->*
Qc (S (S k)) (3*m + (2^(S k) + 1)) (1 + 2*m) y 0.
L340new
63LemmaQG0
Lemma QG0 K n x z : Qc K n (S x) 0 z -->+
ctr K n <* bA^^x <{{A}} [0;0;1] *> [0;0;1] *> bBr^^(S z) *> 0inf.
L374new
64LemmaQG1
Lemma QG1 K n x z : Qc K n (S x) 1 z -->+
ctr K n <* bA^^x <{{A}} [0;0;1] *> [0;0;1] *> bBr *> bAr *> bBr^^z *> 0inf.
L380new
65LemmaConv0
Lemma Conv0 K n x z : n + z + 2 < 2^K ->
Qc K n (S x) 0 z -->+ Pc K (n + z + 2) (x + z + 2) 0.
L389new
66LemmaConv1
Lemma Conv1 K n x z : n + 2*z + 7 < 2^K ->
Qc K n (S x) 1 z -->+ Pc K (n + 2*z + 7) (x + z + 5) 0.
L398new
67LemmaConv1o
Lemma Conv1o (k m n x z n' x' y : nat) :
n + 2*z + 7 = 2^(S k) + m -> n < 2^(S k) -> x + z + 5 = 2 + 2*m + y -> 1 <= y ->
3*m + (2^(S k) + 1) < 2^(S (S k)) -> n' = 3*m + (2^(S k) + 1) -> x' = 1 + 2*m ->
Qc (S k) n (S x) 1 z -->+ Qc (S (S k)) n' x' y 0.
L407new
68DefinitionCfgF
Definition CfgF (k i y z : nat) := Qc (S (S k)) (3*i + (2^(S k) + 1)) (1 + 2*i) y z.
L424new
69DefinitionInv
Definition Inv (k i y z : nat) : Prop :=
64 <= 2^(S k) /\ 2^(S k) <= 8*(y + 2*i) /\ 8*(y + 2*i) <= 3 * 2^(S k) /\
3*z <= 2^(S k) + 3*i /\ 8*i <= 8*z + 2^(S k) /\
2^(S k) <= 4*y + 6*i + 2*z /\ 20*y + 24*i + 16*z <= 9 * 2^(S k).
L426new
70Lemmacycle_step
Lemma cycle_step k i y z : Inv k i y z ->
exists k' i' y' z', CfgF k i y z -->+ CfgF k' i' y' z' /\ Inv k' i' y' z'.
L431new
71Lemmainit0
Lemma init0 : c0 -->* 0inf <* d1 <* d0^^5 <* d1 <* bA <* <[1;1;1] <* bA^^16 <* <[0;0] {{C}}> 0inf.
L460new
72Lemmainit
Lemma init : c0 -->* CfgF 5 0 16 0.
L463new
73Lemmanonhalt
Lemma nonhalt: ~halts tm c0.
L466adapted
4What a maintainer readsCheck: the rule table below is what the .v proves, and proof.md / README read cleanly for a maintainer.
submission/proof.md line 37: 2. Rule table (busycoq comment-block style)
1RB0LA_0RC1RD_0LD1RE_1LA0RB_0RD1RF_1RC---

C_k(n): n in k bits MSB first, 1 -> 1010, 0 -> 0010;   A = 00111, B = 10111
P(k,n,X,z)   := 0^inf C_k(n) A^X B^z 00 C> 0^inf
Q(k,n,x,y,z) := 0^inf C_k(n) A^x 111 A^y B^z 00 C> 0^inf                    (x >= 1)

R1  P(k,n,X,z)      --> P(k,n+1,X,z+1)                     n+1 <= 2^k-1
R2  P(k,2^k-1,X,z)  --> Q(k+1,2^k+1,1,X-2,z+1)             X >= 2
R3  Q(k,n,x,y+2,z)  --> Q(k,n+3,x+2,y,z+1)                 n+3 <= 2^k-1
R4  Q(k,n,x,0,z)    --> P(k,n+z+2,x+z+1,0)                 n+z+2  <= 2^k-1
R5  Q(k,n,x,1,z)    --> P(k,n+2z+7,x+z+4,0)                n+2z+7 <= 2^k-1
R5o Q(k,n,x,1,z)    --> Q(k+1,2^k+1+3m,1+2m,x+z+2-2m,0)    m := n+2z+7-2^k >= 0,  x+z+2-2m >= 1,  3m <= 2^k-2

remark (true, never used): R4o Q(k,n,x,0,z) --> Q(k+1,2^k+1+3m,1+2m,x+z-1-2m,0),
                           m := n+z+2-2^k >= 0, x+z-1-2m >= 1, 3m <= 2^k-2

steps: R1 32X+32z+16t(n)+47,  R2 32X+32z+16k+61,  R3 96x+32y+32z+16(t(n)+t(n+1)+t(n+2))+197
       (t(n) = number of trailing 1 bits of n)

cycle (N = 2^k):  S(k,Y,Z) := Q(k+1, N+1+3m, 1+2m, Y-2m, Z+m),  m = max(0,-Z)
  (S(k,.) is the first right-edge visit after the counter grows to k+1 digits; its counter
   lies in [N,2N) and overflows at 2N)
  S(k,2j,Z)   -->+ S(k+1, 3j+Z,   N-3-4j-Z)      via R3^(j-m), R4, R1^(N-4-2Y-Z), R2
  S(k,2j+1,Z) -->+ S(k+1, 3j+3+Z, N-8-5j-2Z)     via R3^(j-m), then R5, R1^*, R2  or  R5o
invariant (N >= 64):  8Y >= N, 8Y <= 3N, 3Z <= N, 8Z >= -N, 4Y+2Z >= N, 20Y+16Z <= 9N
start: c0 -->(17215) S(6,16,0) = Q(7,65,1,16,0)

Every case is covered. For P: n < 2^k-1 uses R1, and n = 2^k-1 uses R2 (X ≥ 2 holds; see §4). For Q: y ≥ 2 uses R3. y = 0 uses R4: on the invariant the counter never overflows during an even conversion (§4), so R4o is never needed. y = 1 uses R5 if the counter does not overflow during the conversion, and R5o if it does. The domain conditions that the run must satisfy (no overflow inside a Q phase, R2's X ≥ 2, no overflow in an even conversion, and the R5o conditions) are exactly what the invariant in §4 guarantees. The conditions matter: on each of 677 small out-of-domain instances, the overflow chain of §3.3 does not apply, and the out-of-domain configuration Q(4,8,400,0,180) halts (after 327,891 steps). This shows the conditions matter, not that they are necessary; the domain of R5o is a sufficient condition chosen for the cycle lemma.

5FamilyCheck: related machines are killed together or have a reason to be left open.

2 machines, 2 killed, 0 not. Family links: status.json parent, same transition table with another start (tools/dashboard.py), targeting.md follow-on rows, ledger "= twin" notes. A machine string named in a .v header / proof.md / notes.md is listed but does not make a family.

whomachinestatusrelation to this kill
#4 kill 21RB0LA_0RC1RD_0LD1RE_1LA0RB_0RD1RF_1RC---✓Killed: never haltsthis kill
#4b kill 111RB---_0LC1RF_1LE0RD_0RB1RC_1RD0LE_0RC1RA✓Killed: never haltsparent link; = #4's table, run from state F; named in #4b's .v header; named in #4b's proof.md; named in #4b's notes.md · review · same machine as this kill? (same table, started in #4's F; different orbit; tables, pictures and numbers side by side) · mechanism
6ChecklistCheck: every ✓ is computed; the two ○ are yours to decide; an amber ! is an optional check that did not finish.
  • ✓
    Machine string exact
    the .v literal == holdout list line 681 byte for byte
  • ✓
    Statement is ~halts tm c0
    parsed from the .v and confirmed by check_kill (theorem_text, theorem_rocq)
  • ✓
    No axioms beyond baseline
    0 assumption(s); tools/assumptions_baseline.txt allows only functional_extensionality_dep
  • ✓
    coqchk finished (optional)
    coqchk pass in 2.04 s
  • ✓
    .v hash matches the checked hash
    .v = checked sha256 51e3dea1f666…; submission/ copy = checked sha256 51e3dea1f666…
  • ✓
    No repo-local paths in the .v
    comments name no path of ours (vendor/, machines/, tools/, rocq/, scripts/, reports/, atlas/, data/, journal/, /home/); busycoq's own verify/X.v is fine: none in the .v or the submission/ copy
  • ✓
    Public write-up is clean
    tools/writeup_lint.py on submission/proof.md: 0 error(s)
  • ○
    proof.md reviewed by Dennis (Checkpoint B)
    no Checkpoint B note from Dennis found
    • notes.md L92: - Checkpoint questions are now yes/no questions about the figures. Moved off the card (strategy calls, not figure reading; settle them in proof.md / Checkpoint B):
    • notes.md L116: - No Checkpoint B notes from Dennis were on file when this was packaged. If he adds any, fold them into proof.md and the submission copy first.
    • proof.md L277: ## Review log (Checkpoint B skeptic, 2026-10-10)
  • ○
    Family posted together?
    1 other kill(s) in the family: #4b; the Discord draft names 0 of them

Generated by tools/killreview.py at 2026-10-16 13:29 PDT in 0.1 s from the files linked above; nothing in this review is hand-written except the box “How we proved it never halts” (above), which quotes how_proved.md. Re-run: python3 -B tools/killreview.py 1RB0LA_0RC1RD_0LD1RE_1LA0RB_0RD1RF_1RC---

Files

machines/<tm>/: 11 entries · raw notes, status, scripts, images

namesizechanged
notes.md ↓10 KB2026-10-10 05:16
proof.md ↓29 KB2026-10-10 04:32
how_proved.md ↓1.6 KB2026-10-14 10:51
status.json ↓575 B2026-10-16 10:28
observe.json ↓12 KB2026-10-10 04:41
1RB0LA_0RC1RD_0LD1RE_1LA0RB_0RD1RF_1RC---.v ↓20 KB2026-10-10 11:50
img/9 items2026-10-10 00:32
rocq/3 items2026-10-10 05:10
submission/6 items2026-10-15 15:49
work/19 items2026-10-10 15:58
check_proof.py ↓31 KB2026-10-10 04:29
status.json in full
{
 "tm": "1RB0LA_0RC1RD_0LD1RE_1LA0RB_0RD1RF_1RC---",
 "status": "KILLED_NONHALT",
 "stage": "done",
 "updated": "2026-10-10",
 "reason": "check_kill PASS, independently re-verified",
 "pr": "https://github.com/ccz181078/busycoq/pull/24",
 "pr_state": "merged",
 "pr_file": "verify/M_1RB0LA_0RC1RD_0LD1RE_1LA0RB_0RD1RF_1RCHHH.v",
 "pr_opened": "2026-10-15T22:46:17Z",
 "pr_comments": 0,
 "pr_head_sha": "1b57cbac0ccf590232647c1b29389f2efe7f26a4",
 "posted": "2026-10-15 (Discord; user confirmed sent)",
 "pr_merged_at": "2026-10-16T07:07:18Z",
 "pr_merged_by": "ccz181078"
}