0036 — LR closed-value carrier: enforced at Krel/Srel quantification, not EnvRel alone
-
Status: Accepted
-
Summary: LR closed-value carrier enforced at
Krel/Srelquantification (notEnvRelalone); unblockscloseC_subst_comm+ the binder cases. -
Depends-on: 0034, 0033, 0025, 0030, 0016
-
Layer: P (LR / proof-statement, with 0033 / 0034)
-
Status: Accepted
-
Depends on: 0034 (env-closed fundamental), 0033 (LR relations row-indexed), 0025 (closed CK focus), 0030 (closed heap cells), 0016
Context
The env-closed fundamental theorem (ADR-0034) relates an open computation to itself under
Vrel-related closing environments (EnvRel/closeC, Bang/Meta/LR.lean §5.2b). The ◊4 resume
point proposed adding a closedness carrier to EnvRel to discharge closeC_subst_comm —
the substitution-descent lemma that unblocks every binder case of the induction.
Proving closeC_subst_comm (◊4 U6 Phase 1) showed the EnvRel-only carrier is insufficient.
Decision
Enforce closed values — Val.Closed v := ∀ k, Val.shiftFrom k v = v — at the quantification
sites where values enter the relations: Krel's return-half (∀ v₁ v₂, Val.Closed v₁ → Val.Closed v₂ → Vrel … → …) and Srel's resume-half; PLUS an explicit Val.Closed conjunct on
EnvRel fillers (maintained by construction under binders in the fundamental induction). Not
EnvRel alone. Landed f6d0ce2.
Why this model
- The binder cases force it. The
letCfundamental case extends the environment viaEnvRel n (A::Γ) (v₁::δ₁) (v₂::δ₂), where the plug-valuesv₁ v₂flow fromKrel's return-half∀ v₁ v₂, Vrel n A v₁ v₂ → ….Vrelis not closed in general — decisive case:Vrel n (U φ B) v₁ v₂ ⟹ v₁ = vthunk c₁ ∧ Crel n B φ c₁ c₂, andCrel(biorthogonal/behavioural) puts zero syntactic constraint onc₁, so avthunkof an open computation isVrel-related. Closedness must therefore be enforced where the values are quantified, not merely asserted on the env. - Faithful to the machine. The CK machine only ever plugs/returns CLOSED values (ADR-0025 closed
focus, ADR-0030 closed heap cells — the same invariant the heap-cell shift-identity uses).
Restricting
Krel/Srelto closed values matches what the operational semantics actually feeds in. closeC_subst_commneeds BOTH fillers closed. The de Bruijn substitution-swap traverses into each filler, so the env fillervAND the substituted bound valuewmust each be shift-invariant to survive the other's renumbering.wis itself a returned value (closed), so this is free;crel_retcorrespondingly gainedVal.Closed v₁ v₂hypotheses, supplied by the closed return-half.
What it commits to
Krel/Srel/EnvRelcarryVal.Closed;crel_retcarriesVal.Closedhypotheses.closeC_subst_comm,closeCUnderBinders(generald-binder fold;closeCUnderBinder = …Binders 1),closeC_letC/_lam/_case/_split,substFrom_swap_closedall proven sorry-free (f6d0ce2).- Ripple absorbed with no statement smell:
krel_nil_succ/lr_sound_closed/crel_forceunaffected; ◊2no_accidental_handlingstayed 0-axiom; ◊3 CalcVM trusted-three intact (gated on the committed tree).
Rejected alternatives
- Closedness on
EnvRelalone (the resume-point recipe). Why not: incomplete — the binder cases' plug-values come fromKrel's ∀-quantifier; without a guard there, they may be open, breakingcloseC_subst_commat nested binders. - A
Val.Closedconjunct on everyVrelclause. Why not: larger blast radius (everyVreluse) and wrong locus — values become open-relevant only where plugged (Krel/Srel), so guard there. - Carry typing (
HasVTy [] []) as the closedness witness. Why not: couples the LR to the typing judgment; the semanticVal.Closed(shift-invariance) is the minimal fact and reuses the existingVal.substFrom_shiftFromcancellation — no new induction.
Revisit if
- A future
Vrelclause introduces values that are not closed by plug-time (none in the current kernel), OR the CK closed-focus invariant (ADR-0025/0030) is relaxed.
Surfaced + landed by ◊4 U6 Phase 1 (f6d0ce2, 2026-06-23); main-loop design pin confirmed against the
letC trace, then proven by the proof-engineer thread.