Skip to content

feat(evm): decompose X and Ξ into runs - #6

Draft
Th0rgal wants to merge 2 commits into
mainfrom
feat/f4b-x-xi-runs-29a3f1a0
Draft

feat(evm): decompose X and Ξ into runs#6
Th0rgal wants to merge 2 commits into
mainfrom
feat/f4b-x-xi-runs-29a3f1a0

Conversation

@Th0rgal

@Th0rgal Th0rgal commented Aug 25, 2026

Copy link
Copy Markdown
Member

Builds on F4a (EvmYul.EVM.Proof.Execution: the X 6-case split and XRuns), which landed in #5. Additive: one import in EvmYul.lean plus one new module. F4a is not modified.

What this closes

F4a's six theorems are sufficient conditions — each says that if such-and-such holds, X does such-and-such. That leaves two gaps, and Ξ was not covered at all.

The cases are exhaustive. X_succ_complete shows every X (fuel + 1) is one of five cases, packaged as XOneStep. Each constructor carries both the side conditions and the resulting value of X, so cases on it is a complete case split that also supplies the equation for its branch.

Every X is a maximal run plus one terminal event. X_decompose extracts from an arbitrary X an XRuns prefix ending in a configuration that takes no further non-halting iteration. XStuck.X_terminal then shows such a configuration is out of fuel, raises, or halts — the progress case is ruled out via X_succ_complete rather than merely not chosen, which is what makes the run maximal. X_runs_terminal adds that trace.length + rem = fuel, so the fuel is accounted for exactly.

Ξ is X on a fresh state. Ξ_succ_eq proves that equation, transporting every X-level result to the transaction level. xiState/xiJumps/xiResult mirror the state, jump table and result narrowing that Ξ builds; Ξ_succ_eq is what validates them, so drift breaks the proof rather than passing silently.

The XRuns endings X_revert, X_exception and X_stepError complete F4a's X_success, and each gets a Ξ counterpart (Ξ_of_XRuns_*, including outOfFuel). Ξ_decompose is the transaction-level decomposition.

Non-vacuity

The Ξ_of_XRuns_* theorems are conditional, so they would hold trivially if nothing satisfied their hypotheses. Ξ_empty_code discharges them for a real transaction: a call into an account with no code decodes past the end of the code to X's default STOP, halts, and returns a success with empty output. The witness is symbolic in the account map, substate and execution environment — only the code is fixed — so it does not depend on evaluating a concrete machine state.

Verification

  • lake build exit 0.
  • No sorry, no project axiom, no native_decide.
  • #print axioms on all 15 new results: each depends only on [propext, Classical.choice, Quot.sound].

Draft — not for merge yet.

`EVM.Proof.Execution` gives six sufficient conditions for one iteration of
`X` and chains the non-halting ones into `XRuns`. That leaves two gaps: the
cases are never shown to be exhaustive, and `Ξ` is not covered at all.

`X_succ_complete` closes the first: every `X (fuel + 1)` is one of the five
positive-fuel cases, so `cases` on `XOneStep` is a complete case split. On top
of it, `X_decompose` extracts from an arbitrary `X` a maximal `XRuns` prefix
ending in a configuration that takes no further non-halting iteration, and
`XStuck.X_terminal` shows such a configuration is out of fuel, raises, or
halts — ruling the continuing case out rather than merely not choosing it.

`Ξ_succ_eq` closes the second by proving `Ξ` is exactly `X` on the fresh state
it builds, which transports every `X`-level result to the transaction level.
The `XRuns` endings `X_revert`, `X_exception` and `X_stepError` complete
`X_success`, and each gets a `Ξ` counterpart.

`Ξ_empty_code` keeps the conditional `Ξ` theorems honest: a call into an
account with no code decodes to `X`'s default `STOP`, halts, and returns a
success, so their hypotheses are inhabited.

Additive: one import plus one new module. No `sorry`, no new axiom, no
`native_decide`; all new results reduce to propext/Classical.choice/Quot.sound.
Keep F4b Interpreter (X / Ξ / runs) and F4d Block (runUntil) both imported.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant