Skip to content

Phase 3b Stage 1: leaf-only substitution lemma + 2-condition preservation_l2 + Counterexample_L2_nested #239

@hyperpolymath

Description

@hyperpolymath

Stage 1 of the 4-stage Phase 3b resolution plan per #235. Implementation green-lit by owner 2026-05-30.

Scope

Ship Phase 3b under the leaf-only restriction: subst_typing_gen_l1_m_tfuneff proves only for ebody containing no nested TFunEff lambdas. The leaf restriction makes inner T_Lam_L1_*_Eff cases discharge via exfalso, sidestepping option (a)'s insufficiency (#235).

Deliverables:

  1. tfuneff_lambda_free : expr -> bool — syntactic Fixpoint in formal/Syntax.v. ~10 lines.
  2. subst_typing_gen_l1_m_tfuneff Qed — in formal/Semantics_L1.v. Direct (P1, P2) hypotheses (no CPS yet — Stage 3 introduces CPS when nested lambdas re-enter scope). Estimated ~300 lines mirroring subst_typing_gen_l1_m_ground_nonlinear (Phase 2).
  3. preservation_l2_app_eff_beta_tfuneff_l1 + L2 wrapper Qed in formal/TypingL2.v. Conditional statement carries two soundness conditions:
    • tfuneff_lambda_free ebody = true, AND
    • forall r, In r (regions_introduced_by ebody) -> In r R_in_v.
  4. formal/Counterexample_L2_nested.v — new file mechanising the nested-TFunEff soundness gap (parallel to Counterexample_L2.v which mechanises the fresh-region gap). 3 Qed lemmas (e_before_typed, e_step, e_after_untypable) with a nested-lambda configuration.
  5. _CoqProject — add Counterexample_L2_nested.v after Counterexample_L2.v.
  6. SUBST-LEMMA-GENERALIZATION-DESIGN.md — Phase 3b addendum updated: option (a) restated as Stage-1's tfuneff_lambda_free ∧ regions_introduced_by ⊆ R_in_v; original 3 options retired in favour of the staged plan.
  7. STATE.a2ml — phase back to implementation; next_action points at Stage 1 implementation.

What this delivers

The conditional preservation_l2 statement is delivered correctness, not a placeholder. Each soundness condition has a mechanised counterexample (Counterexample_L2.v for fresh-region gap, Counterexample_L2_nested.v for nested-lambda gap). Programs outside the conditional form a precisely-documented soundness class.

What this does NOT deliver

  • Inner T_Lam_L1_*_Eff cases of substitution: deferred to Stage 3 (#TBD2).
  • Unconditional preservation_l2: deferred to Stage 4 (#TBD3) alongside compound non-linear (Phase 5).

Owner-directive compliance

  • ✅ No Semantics.v / Typing.v / Counterexample.v (legacy) touch.
  • ✅ No new Axiom or Admitted markers.
  • ✅ No closure of residual Semantics_L1.v admits.
  • ✅ Pure NEW infrastructure under has_type_l1 / has_type_l2.

References

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions