Commit 1e45e3f
proof(L1): Semantics_L1.v skeleton — preservation_l1 theorem stated (#157)
## Summary
L1 preservation theorem **statement** lands in Coq, with three
helper-lemma stubs Admitted for incremental closure. Task #19's first
checkpoint. Stacked on PR #153 (which contains TypingL1.v).
## What's in
\`formal/Semantics_L1.v\`:
| Lemma | Status | Notes |
|---|---|---|
| \`remove_first_eq_l1\` | **Qed** | Proves operational \`remove_first\`
≡ \`remove_first_L1\` |
| \`value_R_G_preserving_l1\` | Admitted | Needs induction on
\`is_value\` |
| \`region_shrink_preserves_typing_l1\` | Admitted | Mirrors legacy
lemma under L1 |
| \`subst_preserves_typing_l1\` | Admitted | Mirrors legacy lemma under
L1 |
| **\`preservation_l1\`** | **Admitted** | Depends on the three helpers
|
\`formal/_CoqProject\`: adds \`Semantics_L1.v\`.
## Per-case proof sketches (in file docstring)
Simple cases that close without any helper (validated during authoring):
- **S_StringNew**: \`apply T_Loc_L1\`
- **S_StringConcat**: invert children to align regions/contexts, \`apply
T_Loc_L1\`
- **S_StringLen**: invert the borrow, \`apply T_I32_L1\`
- **S_If_True / S_If_False**: invert condition, \`assumption\`
- **S_Region_Enter**: re-apply \`T_Region_Active_L1\` with the same
R_body
- **S_Drop**: \`apply T_Unit_L1\`
Cases needing each helper:
- \`region_shrink_preserves_typing_l1\`: **S_Region_Exit** (both typing
sub-cases)
- \`value_R_G_preserving_l1\`: **all congruence S_X_Step cases** via
IH-threading
- \`subst_preserves_typing_l1\`: **β-reduction** (S_Let_Val,
S_LetLin_Val, S_App_Fun, S_Case_Inl, S_Case_Inr)
Vacuous: **S_Borrow_Step** (inner can't step under either typing rule).
## Honest bound
Four Admitted lemmas in this file. Plus the legacy \`preservation\` in
Semantics.v remains Admitted (superseded but not deleted — out of scope
here). This PR does NOT pay down those admits; it lands the statement
and the structure so future PRs can close them one at a time.
## Why stop here
The per-case proof body has a bullet-structure subtlety: ERegion typing
inverts to TWO sub-cases (T_Region_L1 and T_Region_Active_L1), doubling
subgoals for the three region step rules. Authoring the bullet-clean
version requires the three helpers in place to avoid blocking on
dead-end paths. Sequencing them in separate PRs is mechanical follow-up;
doing it inline would mean reverting to the proof scaffold every time a
helper changes.
## Test plan
- [x] \`coqc 8.18.0\` builds \`Semantics_L1.vo\` cleanly
- [x] All other \`.v\` files in the project still build (full \`make\`
succeeds)
- [x] No regressions on \`Counterexample.v\` (4 lemmas \`Qed\`,
\`bad_input_untypable_l1\` still passes)
- [ ] CI green
- [ ] Review: helper lemma statements match what the per-case proofs
would need
Base: \`proof/l1-region-threading-design\` (PR #153). Will rebase onto
main once that lands.
Refs ephapax#153, task #19 in the project queue.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 1e9d40f commit 1e45e3f
2 files changed
Lines changed: 151 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
0 commit comments