Commit 156455f
Phase 1b substrate: expression-evaluation invariants under a store (#113)
## What
The layer the statement-execution relation sits on — three hole-free
lemmas
about how expression evaluation interacts with the runtime store.
| Lemma | Statement |
|---|---|
| `step_store_invariant` | a single expression step never mutates `ρ` |
| `multiStep_store_invariant` | the same for multi-step evaluation, by
transitivity |
| `hasType_lit_any` | literal typing is context-independent — a typing
for `.lit v` in one context holds in any context |
**Why these, in this order.** Per the agreed rule — *land the
lowest-complexity,
safe, **complete** unit first* — these are the substrate the next step
(statement
execution) rests on, strictly above the store-typing lemmas just merged
(#112):
- **Store invariance** is what lets statement execution compose: an
expression
sub-evaluation inside a statement cannot disturb the variable bindings
the
statement effect then acts on (base `Step` rules keep the store;
congruence
rules thread it unchanged; transitivity lifts it to `MultiStep`).
- **`hasType_lit_any`** is the weakening that lifts `StoreWellTyped`'s
`HasType emptyTypeEnv (.lit v) t` into the arbitrary context `Γ` that
statement-level expression typing lives in — needed for the `sVar` case
of the
generalized, store-typed preservation that comes next.
## Correction to an earlier note
The roadmap previously said the expression `Step` is "closed-term-only,
so
variable resolution needs design." That was wrong: `Step` has an `sVar`
rule that
resolves variables from `ρ` directly. The closed-context restriction was
only ever
in the `emptyTypeEnv`-stated `progress`/`preservation`. The roadmap is
corrected,
and the remaining Phase 1b path is now: generalized store-typed
preservation
(`HasType Γ e t` under `StoreWellTyped Γ ρ`) → statement-execution
relation →
statement preservation.
## Verification
- `lean docs/proofs/verification/WokeLang.lean` exits 0 (Lean 4.30.0,
Mathlib-free, single-file).
- Hole-free: `step_store_invariant` / `multiStep_store_invariant` use
the classical
kernel base (`propext`, `Classical.choice`); **`hasType_lit_any` depends
on no axioms**.
No `sorryAx`, no project-specific assumptions.
## Scope
`docs/proofs/verification/WokeLang.lean` (the three lemmas) and a
Progress entry in
`docs/proofs/VERIFICATION-ROADMAP.md`. No changes to existing proofs or
to the
shipping implementation.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_015oyMquf4daB6hMhmqB1wAL
---
_Generated by [Claude
Code](https://claude.ai/code/session_015oyMquf4daB6hMhmqB1wAL)_
Co-authored-by: Claude <noreply@anthropic.com>1 parent c17b2ee commit 156455f
2 files changed
Lines changed: 65 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
148 | 157 | | |
149 | 158 | | |
150 | 159 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1509 | 1509 | | |
1510 | 1510 | | |
1511 | 1511 | | |
| 1512 | + | |
| 1513 | + | |
| 1514 | + | |
| 1515 | + | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
| 1528 | + | |
| 1529 | + | |
| 1530 | + | |
| 1531 | + | |
| 1532 | + | |
| 1533 | + | |
| 1534 | + | |
| 1535 | + | |
| 1536 | + | |
| 1537 | + | |
| 1538 | + | |
| 1539 | + | |
| 1540 | + | |
| 1541 | + | |
| 1542 | + | |
| 1543 | + | |
| 1544 | + | |
| 1545 | + | |
| 1546 | + | |
| 1547 | + | |
| 1548 | + | |
| 1549 | + | |
| 1550 | + | |
| 1551 | + | |
| 1552 | + | |
| 1553 | + | |
| 1554 | + | |
| 1555 | + | |
| 1556 | + | |
| 1557 | + | |
| 1558 | + | |
| 1559 | + | |
| 1560 | + | |
| 1561 | + | |
| 1562 | + | |
| 1563 | + | |
1512 | 1564 | | |
1513 | 1565 | | |
1514 | 1566 | | |
| |||
0 commit comments