Rendered from rocq-plan.md (raw file). Formalization prep, written before the domain fix in proof.md; its 3-sweep plan (§3.5) was not used.

0. Summary1. Template anatomy1.1 Shared header (SOMDCv6.v lines 1–17)1.2 Module TM7 (lines 1627–1870), item by item2. Standalone TM7 copy (template validation)3. What changes for #23.1 Measured: what breaks when only tm changes3.2 New relation Inc and Inc_spec (segment facts verified)3.3 The two RIncs clauses that change3.4 RIncs_spec: the two new bullets3.5 The domain argument (main risk)3.6 BigStep and nonhalt3.7 Size estimate4. Tactics to reuse, and pitfalls5. Files

Rocq plan for #2 (formalization prep) #

Machine #2 = 1RB0RF_1LC0RE_0LC0LD_1RD1LB_0RF1RA_0RB---. Template: vendor/busycoq/verify/SOMDCv6.v, Module TM7, whose machine differs from #2 only in A1 (TM7 0RC, #2 0RF). Written 2026-10-10. This is preparation only. No proof of #2 has been written; the only Rocq for #2 is the segment probe in §3.2.

0. Summary #

  1. The template route works. A top-level copy of TM7 compiles in 3.8 s with Closed under the global context, and tools/check_kill.sh gives RESULT: PASS on it in 5 s (coqchk passes in 0.8 s).
  2. Most of the file carries over. With only the machine string swapped to #2, everything in TM7 compiles except two cases of RIncs_spec: an eater entering an L, and a drain pass entering an L. BigStep, the start-up from blank, and all non-L cases go through unchanged.
  3. The new low-level facts are proved by the existing automation. The +1 pass is an ordinary h visit (enter as B, leave as C), and both L-entry segments emit h ++ h' ++ h^^(1+k) to the right. All 8 probe lemmas compile in 6.5 s (rocq-scratch/probe_segments_2.v).
  4. The domain lemma does NOT carry over, and it is the real work. TM7 proves nonhalting with the invariant P r := exists r', RIncs hx 0 r r' ("r is in the domain"). For #2 that set is not closed: LLLL10LL1L1 is in the domain, but its image LLLLL1LLLLLLL111 is not.
    • The set image(eat) ∩ dom(eat) is closed in every test so far: exhaustive over inputs of length ≤ 12, plus about 62k random inputs of length ≤ 40.
    • Proving that closure needs a new lemma about three consecutive sweeps. Its invariant has not been found yet (§3.5).
    • A simpler fix, "the same domain with a fixed safety margin", is not closed either. Margin 2 looked closed up to length 10 but failed at length 11.
  5. Size estimate. The finished file should run about 450–700 lines (TM7 has 245). Roughly 150 of those are routine. A 3-sweep domain lemma of 150–400 lines carries almost all of the risk.
  6. What this means for Checkpoint A, Q2 ("extend TM7"). Extending TM7 is still the right route for the machine-facing part. The nonhalting argument needs a genuinely new idea, so proof.md must settle the invariant before any .v work.

1. Template anatomy #

1.1 Shared header (SOMDCv6.v lines 1–17) #

ItemStatement / bodyRole
importsFrom BusyCoq Require Import Individual62 Longitudinal DivModCases., then ZifyNat Lia ZArith String ListIndividual62 provides the machine and the segment machinery. Longitudinal provides segRLs_addmul_v2 and sideRLs_1. DivModCases provides mod2 and sub. All three are on check_kill's allowlist and built (.vo + native).
Ltac esctries BoundedConfig.segRLs_c_spec (T:=10^3), then BoundedConfig.sideRLs_c_spec (T:=10^3), then sideRLs_c_spec (T:=10^6) with vm_computeProves a concrete segRLs/sideRLs goal by computation. Used for the right-end base case and inside am.
Ltac ececonstructorBuilds RIncs derivations.
Ltac am a a' k b b'applys_eq (segRLs_addmul_v2 a a' k b b'); unfold DH0; flia; escProves segRLs tm (h^^(k*a+b)) (h^^(k*a'+b')) w1 w2 from two concrete facts: b visits give b' out, and every further a visits give a' out. Used for the binary-counter digits (a 0-digit absorbing 1+2k or 2+2k passes). flia comes from the import chain. The header does not define it, but it resolves.

Framework pieces TM7 relies on (from Individual.v / Individual62.v / Longitudinal.v):

1.2 Module TM7 (lines 1627–1870), item by item #

ItemStatementRole
tmEval compute in (TM_from_str "1RB0RC_…")The machine. This is the only line that names A1.
notationsld:=[1;1;0] (L), d0:=[0;0;0], d1:=[1;0;0]; hR:=(B,[]), hR':=(D,[1]), hL:=(C,[]); h:=[(hR,hL)], h':=[(hR',hL)]Digits, and the two visit kinds. h is the drain-pass visit and, for #2, also the +1 pass. h' is the eater (state D with a 1 on its left).
RD, HLD \| D0 \| D1; hx \| h1Digit names. hx is the eater; h1 is count mode, which has a stray 1 in front, so the alignment shifts by one cell.
toRClist RD -> side, digits then 0infConverts the digit list to the tape side.
toH', toHtoH' hx=[], toH' h1=[1]; toH hx=h', toH h1=[]The extra cell in front of the side, and the first visit of the mode.
RIncs10 clauses, H -> nat -> list RD -> list RD -> Prop (mode, pass count k, input, output)The sweep as a relation. hx_ld, hx_d0: eat, k+1. hx_d1: switch to h1 with k. h1_ld: back to hx with the same k. h1_d1: absorb one pass. h1_d0_0/1: halve. h1_rh_0/1/2: write k at the right end (bijective binary followed by a terminating D1).
cat3, tr1, wal, tr2Ltacscat3 peels a 3-cell digit off the side. tr1 splits h^^(1+k) and proves the first visit by esx. wal handles k identical visits through a wall. tr2 handles a leading sideRLs step.
RIncs_specRIncs tp k r r' -> sideRLs tm (toH tp++h^^k) (toH' tp*>toRC r) (toRC r')Soundness: the relation is what the machine does. Proved by induction on the derivation, one bullet per clause.
RIncs_nxt_1exists r, RIncs h1 k [] rThe right end always succeeds in count mode. Proved by well-founded induction on k with mod2.
solve_v2, solve_v1LtacsAutomation tailored to the case list of RIncs_nxt.
RIncs_nxtRIncs tp k r r' -> cond(tp,k,tp',k') -> exists r'', RIncs tp' k' r' r'', where cond is: hx,hx: k<=k'; h1,h1: 2k+1<=k'; h1,hx: k+1<=k'; otherwise FalseThe domain lemma: the output of a sweep is again in the domain. Proved by induction on r, with a nested lt_wf_ind on k for []. It does not mention tm.
lh, S'lh := 0inf<*<[1]; S' r := lh {{{(hR',R)}}} toH' hx *> toRC rThe boundary configuration 0^inf 1 1 D> r.
BigStepRIncs hx 0 r r' -> S' r -->+ S' r'One sweep: RIncs_spec, then sideRLs_1 and follow10, then es steps back from the left wall.
nonhalt~halts tm c0multistep_nonhalt to S' [D1] (esx, 5 steps), then progress_nonhalt_cond with P r := exists r', RIncs hx 0 r r', closed by RIncs_nxt (hx,0)->(hx,0).

TM8 (line 1874, A1 = 0LC) reuses the same proof text.

2. Standalone TM7 copy (template validation) #

3. What changes for #2 #

3.1 Measured: what breaks when only tm changes #

I swapped the string in the TM7 copy and compiled it (scratchpad only, not kept):

3.2 New relation Inc and Inc_spec (segment facts verified) #

Inductive Inc: list RD -> list RD -> Prop :=
| Inc_nil: Inc [] [D1]
| Inc_d0 r: Inc (D0::r) (D1::r)
| Inc_d1 r r': Inc r r' -> Inc (D1::r) (D0::r')
| Inc_ld r r': Inc r r' -> Inc (LD::r) (LD::r').
Lemma Inc_spec r r': Inc r r' -> sideRLs tm h (toRC r) (toRC r').

Each case is cat3 plus one segment fact. The segment facts are proved in rocq-scratch/probe_segments_2.v (compiles in 6.5 s):

Planned helper lemmas:

3.3 The two RIncs clauses that change #

| RIncs_hx_ld k r r1 r':  Inc r r1 -> RIncs hx (1+k) r1 r' -> RIncs hx k (LD::r) (LD::r')
| RIncs_h1_ld k r r1 r':  Inc r r1 -> RIncs hx (1+k) r1 r' -> RIncs h1 (1+k) (LD::r) (LD::r')

The other 8 clauses are TM7's, verbatim. Simulation agrees with this relation:

3.4 RIncs_spec: the two new bullets #

Segment facts, verified in the probe:

Both proofs are:

Bullet shape: eapply segRLs_sideRLs_concat with the segment fact, then eapply (sideRLs_trans (ls1:=h)); [apply Inc_spec; eauto | eauto].

TM7's cat3 ends in [|eauto 1], which cannot find the sideRLs_trans split, so these bullets are written out (about 4 lines each).

3.5 The domain argument (main risk) #

TM7's invariant fails for #2. Script: rocq-scratch/py/domain_facts.py.

So RIncs_nxt has no #2 analogue with any condition on (tp, k, tp', k'). I derived this by hand and the measurements back it: the constraints forced on a bound g(k) are contradictory (g(k+2) ≤ g(k)+1 versus g(k) ≥ k−1).

What holds instead (tested, not proved):

  1. Commutation lemma RIncs_Inc: RIncs tp k r r' -> Inc r' r'' -> RIncs tp (1+k) r r''. In words, a +1 applied to a sweep's output is the same as one more pass in that sweep.
    • It holds because the count-mode digits encode the leftover passes in bijective base 2 (D0=1, D1=2, terminated by D1), and Inc is exactly bijective +1 on that code.
    • Checked on 659,938 cases (all words of length ≤ 8, k < 40).
    • Proof: induction on the RIncs derivation, inverting Inc. Every case closes with one constructor and the IH; the D0 cases need mod2 arithmetic. Estimate 40–60 lines.
  2. image(eat) ∩ dom(eat) is closed under eat.
    • 0 failures exhaustive: 26,011 image words from inputs of length ≤ 10, and 197,471 from inputs of length ≤ 12.
    • 0 failures random: about 62k image words from inputs of length ≤ 40.
    • The real orbit lies in this set, since every config after S(1) is an image.

Proposed proof shape:

3.6 BigStep and nonhalt #

3.7 Size estimate #

PieceLinesRisk
TM7 text kept (notations, toRC, 8 RIncs clauses, 8 RIncs_spec bullets, RIncs_nxt_1, BigStep)~150none (compiles today)
Inc, Inc_spec, Inc_total, Inc_fun40–60low (segments verified)
2 new RIncs_spec bullets~10low (verified)
RIncs determinism, RIncs_Inc60–90low–medium
3-sweep domain lemma (replaces RIncs_nxt)150–400high: invariant unknown
nonhalt~25low
Total~450–700Compile should stay under 30 s: the computation is local segments only.

4. Tactics to reuse, and pitfalls #

Reuse:

Pitfalls (each hit while probing):

5. Files #

Reproduce the data: cd rocq-scratch/py, then run: