Draft — mutable and not usable as a dependency; its citation marks the draft state.

Algorithmic Experiments on a Random Access Machine

lax-11·formalized by Jan Dreier·Claude Fable 5 (Anthropic)·created 2026-08-02·GitHub @d82625d·Lean v4.30.0 epoch · mathlib c5ea00351c28

Loading review…

Sign in with ORCID

Community review

Flags

Each flag is tied to a public ORCID identity and explains why this submission may be incorrect.

No flags have been submitted.

    Community review

    Flag this submission

    State precisely what appears incorrect. This explanation will be public under your ORCID name.

    Abstract

    This submission collects running-time theorems about concrete algorithms, stated on the word RAM of the archive's model submission The Word RAM — which it requires — and measured by the machine's own instruction count, including a fetched final halthalt. The programs read their counted input blocks sequentially and pay for loading them into working memory. Every statement has the same elementary shape: there are a program and a constant such that, at every word length ww, on every admissible input — admissibility including an explicit fitting inequality against 2w2^w — the machine halts within an explicit bound, having written the answer. Nothing is asymptotic: a linear-time claim is the bound c(x+1)c(|x|+1), and every uniformity claim, over the input, over a parameter, over the word length, is carried by the order of the quantifiers.

    Two theorems are stated. The connected components of a graph can be computed in linear time: given any graph in compressed sparse row form as a word xx, one program halts within c(x+1)c(|x|+1) steps having labelled every vertex by the least vertex of its component. Courcelle's theorem holds in the Courcelle–Makowsky–Rotics form: for every sentence of monadic second-order logic and every width bound kk there are a program and a constant cc such that, given a graph in compressed sparse row form followed by a kk-expression evaluating to it, the machine halts within c(x+1)c(|x|+1) steps having decided the sentence. The surface also fixes the encodings these are stated on: the compressed sparse row form of a graph with nothing precomputed, monadic second-order logic on graphs, kk-expressions, the instance encoding pairing a graph with a kk-expression, and the parameterized instance format that appends one parameter entry to a graph.

    Both theorems are discharged through the verified pipeline of The Word RAM: algorithms are written in its structured while-language, costed by its loop rule with an invariant and a cost potential, and carried to the machine by its simulation theorem, so the derivation that yields the running time also shows that no intermediate value outgrows a word — which is where the fitting conditions come from. The components algorithm is the textbook sweep of breadth-first searches, verified against a pure model of the search state under a single global potential, so that the searches are amortized together. Courcelle's theorem is proved as on paper, with the machine kept out of the mathematics until the mathematics is finished: an Ehrenfeucht–Fraïssé type algebra with adequacy and a composition lemma for gluing along a marked, edge-free overlap handles the four operations of a kk-expression uniformly; the value table of the fold is extracted by finiteness and choice; and a generic bottom-up fold, verified once against a table it knows nothing about, evaluates it in a fixed number of steps per input entry after a prologue that pays for the table once. The proof package also contains the bounded search tree of Downey and Fellows, deciding vertex cover within c2k(x+1)c\,2^k(|x|+1) steps over the parameterized instance format.

    Concepts

    thm✓proven claimdefdefinition

    Concept map

    Proven claimOpen claimDefinitionThis submissionOther submissionA → B: B builds on A

    Proofs

    Proof networkview on GitHub

    assumptions conclusionProven claimThis submissionProof — click to open

    Proof code is not displayed; the archive records each proof's checked relationship between claims.

    Related submissions

    Submission map

    This submissionOther submissionA → B: B's concepts build on A

    Cite this

    @misc{lax-11,
      author = {Jan Dreier and Claude Fable 5 (Anthropic)},
      title = {Algorithmic Experiments on a Random Access Machine},
      year = {2026},
      howpublished = {Lax Archive, lax-11},
      url = {https://laxarchive.org/lax-11/},
      note = {draft},
    }

    References

    1. Alfred V. Aho, John E. Hopcroft and Jeffrey D. Ullman. The Design and Analysis of Computer Algorithms. Addison-Wesley, 1974.
    2. Stephen A. Cook and Robert A. Reckhow. Time bounded random access machines. Journal of Computer and System Sciences 7(4):354–375, 1973. doi:10.1016/S0022-0000(73)80029-7
    3. Bruno Courcelle. The monadic second-order logic of graphs. I. Recognizable sets of finite graphs. Information and Computation 85(1):12–75, 1990. doi:10.1016/0890-5401(90)90043-H
    4. Bruno Courcelle and Stephan Olariu. Upper bounds to the clique width of graphs. Discrete Applied Mathematics 101(1–3):77–114, 2000. doi:10.1016/S0166-218X(99)00184-5
    5. Bruno Courcelle, Johann A. Makowsky and Udi Rotics. Linear time solvable optimization problems on graphs of bounded clique-width. Theory of Computing Systems 33(2):125–150, 2000. doi:10.1007/s002249910009
    6. Rodney G. Downey and Michael R. Fellows. Parameterized Complexity. Springer, 1999. doi:10.1007/978-1-4612-0515-9
    7. Sang-il Oum and Paul Seymour. Approximating clique-width and branch-width. Journal of Combinatorial Theory, Series B 96(4):514–528, 2006. doi:10.1016/j.jctb.2005.10.006

    Community review

    Discussion

    Ask a question or add context. Endorsements and structured flags are kept in the review panel above; your ORCID profile must share a public name.

    0 comments

    Loading discussion…