Linear-Time Construction on the Word RAM
Lax920634.LinearConstruction · concepts/Lax920634/LinearConstruction.lean · lax-920634
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Theorem
One fixed deterministic word-RAM program constructs the specified subcubic graphs in linear time in their output order. The program receives a requested order as one word and outputs the complete word-sized matching table.
There are constants such that its actual instruction count is at most at every word width satisfying , where is the selected graph's order. Consequently -bit words suffice. The program and constants are chosen before the request and the word width. The proof supplies and .
Concept map
Evidence
Each proof establishes this claim relative to its assumptions.
Lean source view on GitHub
| 1 | import Lax920634.WordEncoding |
| 2 | import Lax808846.RamComputes |
| 3 | |
| 4 | /-! |
| 5 | --- |
| 6 | title: Linear-Time Construction on the Word RAM |
| 7 | type: theorem |
| 8 | --- |
| 9 | One fixed deterministic word-RAM program constructs the specified subcubic |
| 10 | graphs in linear time in their output order. The program receives a requested |
| 11 | order as one word and outputs the complete word-sized matching table. |
| 12 | |
| 13 | There are constants such that its actual instruction count is at |
| 14 | most at every word width satisfying , where is |
| 15 | the selected graph's order. Consequently -bit words suffice. |
| 16 | The program and constants are chosen before the request and the word width. |
| 17 | The proof supplies and . |
| 18 | |
| 19 | # Proof strategy |
| 20 | |
| 21 | Materialize the fixed seed and build the rotation tables from the bottom up. |
| 22 | Each new row uses a constant number of lookups in the seed and preceding table. |
| 23 | Geometric growth bounds the total number of rows by a constant multiple of |
| 24 | . A verified compiler transfers this bound to actual registered RAM |
| 25 | instructions, including initialization and output. The fixed seed and |
| 26 | level-zero table are program literals determined by the specified seed scan; |
| 27 | writing these literals into RAM is charged. No data depending on the request |
| 28 | or word width are built into the program. |
| 29 | -/ |
| 30 | |
| 31 | namespace Lax920634.LinearConstruction |
| 32 | |
| 33 | open ZigZagConstruction Lax808846.Ram |
| 34 | open GraphEncoding (selectedLevel) |
| 35 | open WordEncoding (construct) |
| 36 | |
| 37 | /-- A uniform deterministic RAM constructs the precise family in linear output time. -/ |
| 38 | axiom linear_time : ∃ (program : Program) (timeConstant wordConstant : ℕ), |
| 39 | 0 < timeConstant ∧ 0 < wordConstant ∧ |
| 40 | ∀ (n w : ℕ), |
| 41 | wordConstant * (order (selectedLevel n) + 1) ≤ 2 ^ w → |
| 42 | ∃ t ≤ timeConstant * (order (selectedLevel n) + 1), |
| 43 | RunsTo w program [n] (construct n) t |
| 44 | |
| 45 | end Lax920634.LinearConstruction |
| 46 |
Proof strategy
Materialize the fixed seed and build the rotation tables from the bottom up. Each new row uses a constant number of lookups in the seed and preceding table. Geometric growth bounds the total number of rows by a constant multiple of . A verified compiler transfers this bound to actual registered RAM instructions, including initialization and output. The fixed seed and level-zero table are program literals determined by the specified seed scan; writing these literals into RAM is charged. No data depending on the request or word width are built into the program.
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments