Commit 87dcab4
feat(L2): preservation_l2_via_l1 — Phase D slice 4 partial landing (#211)
## Summary
State the full `preservation_l2` goal in a comment block + ship the
provable-now `L2_lift_l1` case as `preservation_l2_via_l1`. The β-case
for `T_App_L2_Eff` requires generalising `subst_typing_gen_l1_m`
(non-linear `T1`) — escalated per CLAUDE.md owner directive rather than
closed via ad-hoc admit.
## What lands
- **`preservation_l2_via_l1`** — closes the `L2_lift_l1` case of
`preservation_l2` by deferring to `Semantics_L1.preservation_l1`.
Provable directly; **no new admits/axioms** in `TypingL2.v`.
- **`preservation_l2_lift_case`** corollary — same theorem, flatter
shape for callers that already destructured the lift.
- **Comprehensive doc block** stating the full `preservation_l2` goal,
the planned structural-induction proof, and the architectural blocker
for the `T_App_L2_Eff` β-case.
## Why partial — the architectural blocker
The β-case (`S_App_Fun` applied to `T_App_L2_Eff`) requires invoking
`subst_typing_gen_l1_m` (`Semantics_L1.v:1358`) with `T1 =` lambda
parameter type. That lemma carries an `is_linear_ty T1 = true`
precondition. Effect-typed lambdas at `TFunEff T1 T2 R_in R_out` may
have non-linear `T1` (`TUnit` / `TBool` / `TI32` / …), so the
substitution lemma does not fire in general.
Per CLAUDE.md owner directive 2026-05-27 §"DO escalate before patching
when a side condition is needed", this is the escalation point —
generalising `subst_typing_gen_l1_m` to non-linear `T1` is next-slice
infrastructure work, **not** an ad-hoc side-condition on the L2 typing
rule.
## Verification (coqc 8.18.0)
- Clean rebuild across `formal/` tree.
- `Print Assumptions preservation_l2_via_l1` →
`Semantics_L1.preservation_l1` (the legacy admit, honest carry-forward).
**Zero NEW axioms introduced.**
- `Print Assumptions weaken_modality` → unchanged ("Closed under the
global context").
- Admit count: `TypingL2.v` retains 0 \`Admitted.\` / 0 \`Axiom\` / 0
inner \`admit.\`; `Semantics_L1.v` + `Semantics.v` unchanged.
## Owner-directive compliance
- ✅ `Semantics.v` untouched
- ✅ `Typing.v` untouched
- ✅ `Counterexample.v` untouched
- ✅ Zero new \`Admitted\`/\`Axiom\` in `TypingL2.v`
- ✅ T_App_L2_Eff β-case **not** closed via \`Admitted.\` (per session-6
memory note's explicit anti-pattern)
## Next-slice infrastructure required to close full preservation_l2
1. **Generalise `subst_typing_gen_l1_m`** to non-linear `T1` (or sibling
lemma) — substitution at a non-linear binding position.
2. **Inversion principles for `has_type_l2`** on `EApp`.
3. **Inversion on `T_Lam_L1_*_Eff`** for body extraction.
(1) is the load-bearing item; (2) and (3) compose mechanically once (1)
lands.
## Refs
- `formal/PRESERVATION-DESIGN.md` §5.1 (lines 468-474) — load-bearing
design quote endorsing the L2 venue for effect-typed application
elimination.
- PR #209 — T_App_L2_Eff constructor (Phase D slice 3).
- PR #210 — STATE.a2ml shift to "state and prove preservation_l2".
## Test plan
- [x] \`coqc 8.18.0\` clean rebuild
- [x] \`Print Assumptions preservation_l2_via_l1\` → only legacy
\`preservation_l1\` admit
- [x] Zero new \`Admitted.\` / \`Axiom.\` / \`admit.\` in TypingL2.v
- [x] GPG-signed commit
- [ ] CI green
- [ ] Auto-merge SQUASH fires
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 5763648 commit 87dcab4
1 file changed
Lines changed: 109 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
| 74 | + | |
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| |||
244 | 244 | | |
245 | 245 | | |
246 | 246 | | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
0 commit comments