Commit 43ab705
feat(L2): Phase D slice 4 Phase 4a —
## Summary
Two L2-layer additions and one hotfix for a parallel-session merge
collision.
### Phase 4a — β-case closure for linear T1
The `T_App_L2_Eff` β-case (S_App_Fun step) closes for linear T1 via the
existing m-indexed substitution lemma `subst_typing_gen_l1_m`. Pure new
infrastructure orthogonal to legacy admits.
- **`preservation_l2_app_eff_beta_linear_l1`** — L1-level kernel. Takes
inverted T_App_L2_Eff premises (lambda formed at `TFunEff` + value
argument typed at `T1`) and produces the post-β L1 typing of `subst 0 v2
ebody`. Inversion on the lambda forces `T_Lam_L1_*_Eff`;
`value_R_G_preserving_l1` on the argument collapses `R_in` / `G''` to
`R` / `G`.
- **`preservation_l2_app_eff_beta_linear`** — L2 wrapper. Inverts both
`has_type_l2` hypotheses through `L2_lift_l1` (the `T_App_L2_Eff`
discriminate cases: lambda's head is `ELam` not `EApp`; argument is a
value so cannot be `EApp`). Defers to the L1 kernel and re-lifts via
`L2_lift_l1`.
- **`linear_value_retype_l1_m`** — small local m-poly helper. Linear
values at L1 are exactly locations (`T_Loc_L1` is m-polymorphic); retype
at any `m'`. Needed because `subst_typing_gen_l1_m`'s premise 5 uses the
bare `|=L1` notation which is Linear-mode-only, so the Affine branch
must re-derive the substituend at Linear.
**Phase 4 follow-ons** (NOT in this PR):
- 4b: ground-non-linear `T1` via Phase 2's
`subst_typing_gen_l1_m_ground_nonlinear`.
- 4c: TFunEff non-linear `T1` — blocked on Phase 3b (issue #225).
- 4d: compound non-linear — deferred to Phase 5.
These three helpers compose with `preservation_l2_via_l1` toward
eventual closure of `preservation_l2` over the full `has_type_l2`
judgment.
### Hotfix — duplicate \`tfuneff_lambda_retype_l1_m\`
PRs #223 and #224 (parallel-session merges 2026-05-30) both added
\`tfuneff_lambda_retype_l1_m\` with different argument orders, leaving
main with a Coq "already exists" compile error. CI didn't catch it
because there's no Coq build job in the gates — this PR surfaces that
gap as a seam observation (Coq is the only merge oracle for proof PRs,
but is not part of CI).
Kept the chronologically-first definition (PR #223: \`(Hval, Ht, HR')\`
arg order) and removed the second (PR #224: \`(Hval, Hsub, Ht)\`). Both
proofs were semantically equivalent. No external call sites existed yet,
so argument order is free choice.
## Build + assumption audit
- coqc 8.18.0 clean rebuild across all 10 .v files.
- \`Print Assumptions preservation_l2_app_eff_beta_linear\` shows only
the pre-existing \`region_liveness_at_split_l1_gen\` axiom inherited
transitively via \`subst_typing_gen_l1_m\`. **No new admits/axioms.**
- \`Print Assumptions linear_value_retype_l1_m\` shows "Closed under the
global context" — fully axiom-free.
## Owner-directive compliance (CLAUDE.md 2026-05-27)
- ✅ Does not close \`Theorem preservation\` in \`formal/Semantics.v\`.
- ✅ Does not extend \`Semantics.v\` / \`Typing.v\` /
\`Counterexample.v\`.
- ✅ Does not close any residual \`Semantics_L1.v\` admit (the
duplicate-removal is mechanical de-duplication, not proof closure).
- ✅ Works per-layer: L1 kernel + L2 wrapper, both at the post-redesign
m-indexed \`has_type_l1\` judgment.
- ✅ Reads \`PRESERVATION-DESIGN.md\` /
\`SUBST-LEMMA-GENERALIZATION-DESIGN.md\` first.
- ✅ No new \`Axiom\` or \`Admitted\` markers.
## Test plan
- [x] \`coqc -R . Ephapax\` rebuild across all 10 .v files, zero errors
/ warnings.
- [x] \`Print Assumptions\` audit shows no new axioms beyond the
pre-existing L1 \`region_liveness_at_split_l1_gen\`.
- [x] Duplicate hotfix verified by \`grep -n
"tfuneff_lambda_retype_l1_m\b" Semantics_L1.v\` showing single hit.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>preservation_l2_app_eff_beta_linear + hotfix duplicate tfuneff_lambda_retype_l1_m (#228)1 parent 178f978 commit 43ab705
2 files changed
Lines changed: 141 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
| 9 | + | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
74 | 77 | | |
75 | 78 | | |
76 | 79 | | |
| |||
352 | 355 | | |
353 | 356 | | |
354 | 357 | | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
0 commit comments