Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Blank virtual tape zigzag work-bit pattern

Definition
sgl_blank_workbits

by Henry Yuen · Jul 24, 2026 · Mathlib 0df444a (Lean v4.33.1)

complexity-theorysipser-gacs-lautemannturing-machines

This module computes the exact zigzag work-bit pattern for the blank virtual tape at virtual head position 000. The marked head record is [true, false, false], and every subsequent blank record is [false, false, false]; consequently the work area for recordCount + 1 records is the head marker followed by 3 * recordCount false bits.

This identifies the precise finite bit string that the remaining scheduler/padding phase must create before handing control to the published left-zigzag simulator.

Definition code
import Definitions.Def_sgl_raw_archive_layout

namespace SipserGacsLautemann

theorem zigzagRecordBits_blank_zero :
    zigzagRecordBits blankVirtualTape 0 0 =
      [true, false, false] := by
  rfl

theorem zigzagRecordBits_blank_succ (n : Nat) :
    zigzagRecordBits blankVirtualTape 0 (n + 1) =
      [false, false, false] := by
  have hne : n + 1 ≠ 0 := Nat.succ_ne_zero n
  simp only [zigzagRecordBits, zigzagRecordFlag,
    zigzagRecordSymbol, blankVirtualTape, zigzagIndex,
    hne, ↓reduceIte, decide_false, encodeTapeSymbol]
  cases hcoord : zigzagCoordinate (n + 1) with
  | ofNat coordinate =>
      cases coordinate <;> rfl
  | negSucc coordinate =>
      rfl

theorem zigzagWorkBitsFrom_blank_succ_start
    (start recordCount : Nat) :
    zigzagWorkBitsFrom blankVirtualTape 0 (start + 1)
        recordCount =
      List.replicate (3 * recordCount) false := by
  induction recordCount generalizing start with
  | zero =>
      rfl
  | succ recordCount ih =>
      rw [zigzagWorkBitsFrom_succ,
        zigzagRecordBits_blank_succ start,
        ih (start + 1)]
      rw [show 3 * (recordCount + 1) =
          3 + 3 * recordCount by omega]
      rw [List.replicate_add]
      rfl

theorem zigzagWorkBits_blank_succ (recordCount : Nat) :
    zigzagWorkBits blankVirtualTape 0 (recordCount + 1) =
      [true, false, false] ++
        List.replicate (3 * recordCount) false := by
  simp only [zigzagWorkBits, zigzagWorkBitsFrom_succ,
    zigzagRecordBits_blank_zero]
  rw [zigzagWorkBitsFrom_blank_succ_start 0 recordCount]

end SipserGacsLautemann
Source
Prove2me Sipser--Gács--Lautemann mission; direct computation from the published zigzag simulator encoding.

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me