Stage 3 of the 4-stage Phase 3b resolution plan per #235. Blocked on Stage 2 (ELam annotation). Owner-approved 2026-05-30.
Motivation
Stage 1 ships Phase 3b under the leaf-only restriction (tfuneff_lambda_free ebody). Stage 3 RELAXES this once Stage 2's ELam annotation makes inner R_in/R_out syntactically visible.
Deliverables
-
declared_lambda_r_ins : expr -> list region_name — syntactic Fixpoint in formal/Syntax.v. Walks ELam T R_in R_out body and accumulates R_in ++ declared_lambda_r_ins body. (Defined in Stage 2 already; Stage 3 uses it.)
-
CPS-form substitution lemma: replace
has_type_l1 m R (remove_at k Gin) v (TFunEff Targ Tret R_in_v R_out_v) R (remove_at k Gin)
with the continuation-passing form
(forall R'' G_local,
(forall r, In r R'' -> In r R_in_v) ->
has_type_l1 m R'' G_local v (TFunEff Targ Tret R_in_v R_out_v) R'' G_local)
in subst_typing_gen_l1_m_tfuneff's hypothesis list.
-
Relaxed precondition: replace tfuneff_lambda_free e = true with
(forall r, In r (declared_lambda_r_ins e) -> In r R_in_v)
This combines with the (retained) regions_introduced_by e ⊆ R_in_v precondition.
-
Proof body update: inner T_Lam_L1_*_Eff cases now CONSTRUCTIVELY discharge by:
- Extracting
R_in_inner from the syntactic annotation (Stage 2's premise gives R_in_inner ⊆ declared_lambda_r_ins e ⊆ R_in_v).
- Invoking the CPS-form v-typing at
R_in_inner.
- Recursing on the body with the CPS predicate threaded.
-
preservation_l2_app_eff_beta_tfuneff_l1 updated: drop tfuneff_lambda_free condition. Conditional preservation_l2's nested-condition collapses.
-
Counterexample_L2_nested.v stays Qed but is annotated as "superseded by Stage 3" — kept for historical/regression value.
Why CPS form is necessary HERE
In Stage 1's leaf-only restriction, inner T_Lam_L1_*_Eff cases are exfalso — v is never retyped at fresh R_in_inner's. Direct (P1, P2) hypotheses suffice.
In Stage 3's relaxed restriction, inner cases ARE constructive — v retypes at potentially-arbitrary R_in_inner's. The direct form would need v's typing parametric over an unbounded family of R's; CPS form bundles "v retypes anywhere satisfying P" into a single hypothesis the caller discharges once.
Sets cross-cutting precedent
Stage 3 is the first proof in the codebase using higher-order CPS-style hypotheses. Sets the pattern Stage 4 (compound non-linear) inherits — illuminates where future cross-cutting invariants live.
Owner-directive compliance
- ✅ No
Semantics.v / Typing.v / Counterexample.v touch.
- ✅ No new
Axiom or Admitted markers.
- ✅ No closure of residual
Semantics_L1.v admits — strictly NEW infrastructure under post-Stage-2 ELam annotation.
References
🤖 Generated with Claude Code
Stage 3 of the 4-stage Phase 3b resolution plan per #235. Blocked on Stage 2 (ELam annotation). Owner-approved 2026-05-30.
Motivation
Stage 1 ships Phase 3b under the leaf-only restriction (
tfuneff_lambda_free ebody). Stage 3 RELAXES this once Stage 2's ELam annotation makes inner R_in/R_out syntactically visible.Deliverables
declared_lambda_r_ins : expr -> list region_name— syntactic Fixpoint informal/Syntax.v. WalksELam T R_in R_out bodyand accumulatesR_in ++ declared_lambda_r_ins body. (Defined in Stage 2 already; Stage 3 uses it.)CPS-form substitution lemma: replace
with the continuation-passing form
in
subst_typing_gen_l1_m_tfuneff's hypothesis list.Relaxed precondition: replace
tfuneff_lambda_free e = truewith(forall r, In r (declared_lambda_r_ins e) -> In r R_in_v)This combines with the (retained)
regions_introduced_by e ⊆ R_in_vprecondition.Proof body update: inner
T_Lam_L1_*_Effcases now CONSTRUCTIVELY discharge by:R_in_innerfrom the syntactic annotation (Stage 2's premise givesR_in_inner ⊆ declared_lambda_r_ins e ⊆ R_in_v).R_in_inner.preservation_l2_app_eff_beta_tfuneff_l1updated: droptfuneff_lambda_freecondition. Conditional preservation_l2's nested-condition collapses.Counterexample_L2_nested.vstays Qed but is annotated as "superseded by Stage 3" — kept for historical/regression value.Why CPS form is necessary HERE
In Stage 1's leaf-only restriction, inner
T_Lam_L1_*_Effcases areexfalso— v is never retyped at freshR_in_inner's. Direct(P1, P2)hypotheses suffice.In Stage 3's relaxed restriction, inner cases ARE constructive — v retypes at potentially-arbitrary
R_in_inner's. The direct form would need v's typing parametric over an unbounded family of R's; CPS form bundles "v retypes anywhere satisfying P" into a single hypothesis the caller discharges once.Sets cross-cutting precedent
Stage 3 is the first proof in the codebase using higher-order CPS-style hypotheses. Sets the pattern Stage 4 (compound non-linear) inherits — illuminates where future cross-cutting invariants live.
Owner-directive compliance
Semantics.v/Typing.v/Counterexample.vtouch.AxiomorAdmittedmarkers.Semantics_L1.vadmits — strictly NEW infrastructure under post-Stage-2 ELam annotation.References
🤖 Generated with Claude Code