You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Stage 4 of the 4-stage Phase 3b resolution plan per #235. Multi-session scope. Owner-approved 2026-05-30. Equivalent to Phase 5 in SUBST-LEMMA-GENERALIZATION-DESIGN.md.
Motivation
Stage 3 lands the relaxed Phase 3b for TFunEff lambdas (post-Stage-2 ELam annotation + CPS proof style). The final soundness condition on preservation_l2_app_eff_beta_tfuneff_l1 — regions_introduced_by ebody ⊆ R_in_v — remains.
Stage 4 closes this last condition by addressing compound non-linear values as substituends and arguments: EPair, EInl, EInr, EEcho, and EBorrow of non-locations. These are the value-shape categories not covered by Phase 1 (ground non-linear), Phase 2 (substitution lemma), or Phase 3 (TFunEff lambdas).
Why compound non-linear is the last gap
The current Phase 4c soundness gap (Counterexample_L2.v) — "TFunEff value substituted inside fresh-region scope" — generalises to:
A substituend v whose typing depends on regions r ∈ R, when substituted into a context that extends R via fresh-region introduction, may fail to re-type.
For TFunEff lambdas the dependency is via the side condition forall r, In r R -> In r R_in_v (concentrated in T_Lam_L1_*_Eff). For compound non-linear values (e.g. EPair (ELam …) (ELoc l r) or EEcho T (ELam …)), the dependency is via sub-components' typings.
A general region-substitution lemma at the value level — "rewriting r ↦ r' in a well-typed value preserves typing under appropriate side conditions" — closes both cases.
Deliverables
Region-substitution machinery:
region_subst_value_l1 : value -> region_name -> region_name -> value
Unconditional preservation_l2: preservation_l2_app_eff_beta Qed (no soundness-class condition). β-case CLOSED for all substituend shapes.
Counterexample_L2.v and Counterexample_L2_nested.v: retained as regression witnesses but annotated as "resolved by Stage 4" — they showed soundness gaps that the region-substitution machinery now closes.
Stage 4 of the 4-stage Phase 3b resolution plan per #235. Multi-session scope. Owner-approved 2026-05-30. Equivalent to Phase 5 in
SUBST-LEMMA-GENERALIZATION-DESIGN.md.Motivation
Stage 3 lands the relaxed Phase 3b for TFunEff lambdas (post-Stage-2 ELam annotation + CPS proof style). The final soundness condition on
preservation_l2_app_eff_beta_tfuneff_l1—regions_introduced_by ebody ⊆ R_in_v— remains.Stage 4 closes this last condition by addressing compound non-linear values as substituends and arguments:
EPair,EInl,EInr,EEcho, andEBorrowof non-locations. These are the value-shape categories not covered by Phase 1 (ground non-linear), Phase 2 (substitution lemma), or Phase 3 (TFunEff lambdas).Why compound non-linear is the last gap
The current Phase 4c soundness gap (
Counterexample_L2.v) — "TFunEff value substituted inside fresh-region scope" — generalises to:For TFunEff lambdas the dependency is via the side condition
forall r, In r R -> In r R_in_v(concentrated in T_Lam_L1_*_Eff). For compound non-linear values (e.g.EPair (ELam …) (ELoc l r)orEEcho T (ELam …)), the dependency is via sub-components' typings.A general region-substitution lemma at the value level — "rewriting r ↦ r' in a well-typed value preserves typing under appropriate side conditions" — closes both cases.
Deliverables
Region-substitution machinery:
region_subst_value_l1 : value -> region_name -> region_name -> valueregion_subst_typing_preserves_l1lemma.Phase 5 substitution-lemma extension:
subst_typing_gen_l1_m_compoundcovering EPair / EInl / EInr / EEcho / EBorrow substituends. Builds on Stage 3's CPS proof style.Unconditional preservation_l2:
preservation_l2_app_eff_betaQed (no soundness-class condition). β-case CLOSED for all substituend shapes.Counterexample_L2.vandCounterexample_L2_nested.v: retained as regression witnesses but annotated as "resolved by Stage 4" — they showed soundness gaps that the region-substitution machinery now closes.preservation_l2Qed overhas_type_l2— combining the β-case (this stage) with the L2_lift_l1 case (already shipped viapreservation_l2_via_l1, PR feat(L2): preservation_l2_via_l1 — Phase D slice 4 partial landing #211).Sequencing
Stage 4 is the natural successor to Stage 3 once the CPS proof style is established. Internally splits into:
Owner-directive compliance
Semantics.v/Typing.v/Counterexample.v(legacy) touch.Axiom/Admittedmarkers.References
formal/SUBST-LEMMA-GENERALIZATION-DESIGN.mdPhase 5 (canonical predecessor scope).formal/PRESERVATION-DESIGN.md§5 — L2 closure design.🤖 Generated with Claude Code