Random access machines: operational metatheory (proof internals) #
This module proves the structural facts about RAM.run, RAM.logTimeUpto,
RAM.unitTimeUpto, and register support that the surface theorems rely on:
- Unfolding lemmas and the fixed-point behaviour of a halted configuration
(
step_halted,run_halted,logTimeUpto_halted,unitTimeUpto_halted). - Run/cost algebra:
run_one,run_succ_step, and the additive decompositionsrun_add,logTimeUpto_add,unitTimeUpto_add, giving stationarity of the run and cost once halted, and monotonicity of the cost in the fuel. - Cost lower bounds: every executed step costs at least one time unit
(
Instr.one_le_logCost), so the step count never exceeds the logarithmic time (unitTimeUpto_le_logTimeUpto). - Finite support: the register file has finite support along any run from
a finitely-supported start (
run_finiteSupport), which is what makes thefinsum-based space measureRAM.Cfg.spacea genuine finite sum.
Not intended for human audit: the definitions in Defs.lean and the theorem
statements in the surface module carry the mathematical content.
Unfolding lemmas #
Halted configurations are fixed points #
A halted configuration accumulates no logarithmic time.
A halted configuration accumulates no unit time.
Run/cost algebra #
Logarithmic time decomposes additively along the run.
Unit time decomposes additively along the run.
Logarithmic time is monotone in the fuel.
Unit time is monotone in the fuel.
Cost lower bounds #
Every executed step costs at least one time unit.
The number of steps taken never exceeds the logarithmic time: each step costs at least one time unit, so log-time dominates the step count.
Finite support of the register file #
The support of an updated function is contained in the support of the original with the written index inserted.
The initial register file has finite support: only registers 0 … |x| can
be nonzero.
One instruction preserves finite support of the register file: each instruction writes at most one register.
One step preserves finite support of the register file.
Finite support of the register file is a run invariant.
Finite support along any run started from an initial configuration. This
guarantees RAM.Cfg.space is a genuine finite sum, not the finsum
fallback value 0.