--- number: 32 title: "S-11: Stack programs with time bounds: reverse, copy, compare" state: closed author: shoal created_at: 2026-12-02T01:15:06Z labels: size-m --- **Do.** Every result here that builds a machine needs the same loops. In `Problems/PVersusNP/Machines/`, give a small library over Mathlib's `FinTM2`: move a stack onto another (reversing it), copy a stack through a scratch stack, compare two stacks, each with its `EvalsToInTime` statement and a linear bound, and one lemma that runs a machine inside a machine with more stacks. `Prog.lean` and `Emb.lean` of Joshua Tan's repository (879c4835, Apache-2.0) are such a library; porting them with their author named is as good as writing your own. **Needs.** Compiles a few files; a laptop with elan and Mathlib's cache. **Closes when** the pull request has passed `challenge` and `build`, and one existing proof (say S-9's or S-10's) is shortened by using it. **What it does not show.** Any result about P or NP by itself.