Commit 3413a72
feat(L2): Phase 3b Stage 1b — preservation_l2 β-case for closed TFunEff substituents
Ships the L2-judgment half of Stage 1b. Closes the [T_App_L2_Eff]
β-case for T1 = TFunEff Ta Tb R_in_v R_out_v under the three-condition
statement (P1 leaf-only body + P2 regions ⊆ R_in_v + P3 closure of v2).
Mirrors PR #228's [preservation_l2_app_eff_beta_linear] (Phase 4a,
linear T1) and Phase 4b's [preservation_l2_app_eff_beta_ground_nonlinear]
(ground-non-linear T1) structurally with the same
`value_R_G_preserving_l1`-collapse pattern.
Two Qed lemmas:
- `preservation_l2_app_eff_beta_tfuneff_l1` — the L1-level kernel.
Inverts the lambda derivation through `T_Lam_L1_Linear_Eff` /
`T_Lam_L1_Affine_Eff`; collapses R_in = R1 = R and G'' = G' = G
via `value_R_G_preserving_l1`; then defers to the substitution
kernel `subst_typing_gen_l1_m_tfuneff` (Phase 3b Stage 1b, this
branch's prior commit) at k = 0.
- `preservation_l2_app_eff_beta_tfuneff` — the L2 wrapper. Inverts
both `has_type_l2` hypotheses through `L2_lift_l1` (the
`T_App_L2_Eff` cases discriminate via expression-shape mismatch),
then defers to the L1 kernel and re-lifts via `L2_lift_l1`.
Combined with PRs #228 (Phase 4a, linear T1) and #233 (Phase 4b,
ground-non-linear T1), this closes the `T_App_L2_Eff` β-case for
T1 ∈ {linear, ground-non-linear, TFunEff}. Phase 4d (compound non-
linear EPair / EInl / EInr / EEcho) remains open at Phase 5.
Print Assumptions verdict:
- preservation_l2_app_eff_beta_tfuneff_l1: Closed under the global context
- preservation_l2_app_eff_beta_tfuneff: Closed under the global context
Zero new axioms. Zero new admits.
The mechanised soundness-gap witnesses for the conditional form are
preserved in:
- Counterexample_L2.v (PR #234, Phase 4c) — fresh-region gap (the
counterexample to dropping P2).
- Counterexample_L2_nested.v (Stage 1a, this PR's predecessor #252)
— nested-lambda gap (the counterexample to dropping P1).
The two files together justify why Stage 1 ships the two-condition
(plus P3 closure) statement rather than an unconditional version.
Stage 4 (#242) achieves the unconditional form once the L4
annotation extension (#240) and CPS argument (#241) land — the
proof content of this PR's `closed_value_typing_*` family is
reused unchanged in Stage 4 as the closure-discharge kernel.
Also: STATE.a2ml refreshed — last_action now records the full
Stage 1b deliverable surface; next_action advances to Stages 2-4.
Owner-directive compliance (CLAUDE.md 2026-05-27):
- ✅ No touch to formal/Semantics.v / Typing.v / Counterexample.v.
- ✅ No closure of residual Semantics_L1.v admits attempted.
- ✅ Anti-pattern detector clean.
- ✅ Strictly NEW infrastructure orthogonal to legacy.
Refs:
- ephapax issue #249 (Stage 1b tracking — closes via this PR).
- ephapax PR #252 (Stage 1a prerequisite).
- ephapax issue #239 (parent Stage 1; closes via #252 + this PR).
- formal/SUBST-LEMMA-GENERALIZATION-DESIGN.md Phase 3b Stage 1b.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 491ff14 commit 3413a72
2 files changed
Lines changed: 122 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
11 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
574 | 574 | | |
575 | 575 | | |
576 | 576 | | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
0 commit comments