Commit 5bb4ca6
feat(L1): Phase D slice 4 Phase 3a —
## Summary
- Adds `tfuneff_lambda_retype_l1_m` to `formal/Semantics_L1.v` —
re-types values at `TFunEff T1 T2 R_in R_out` across `R → R'` under the
side condition `forall r, In r R' -> In r R_in`.
- Phase 3a of the SUBST-LEMMA-GENERALIZATION-DESIGN.md plan; mirrors
Phase 1 / Phase 2 split shipped in #219 / #220.
- Zero new admits, zero new axioms, no patch to legacy `preservation` in
`Semantics.v`.
## Why
For values typed at `TFunEff T1 T2 R_in R_out`, the lambda's body is
typed at `R_in` (carried in the type, independent of the outer `R`). The
outer `R` enters the typing rule only through the side condition `forall
r, In r R -> In r R_in`. Re-typing at any `R'` reduces to discharging
the analogous side condition for `R'`.
Two value-shape × typing-rule cases survive `inversion`:
- `T_Lam_L1_Linear_Eff` — Linear-modality TFunEff lambda
- `T_Lam_L1_Affine_Eff` — Affine-modality TFunEff lambda
Legacy `T_Lam_L1_Linear` and `T_Lam_L1_Affine` produce `TFun …` (not
`TFunEff …`) so `inversion` auto-discharges them via
constructor-conclusion equation discrimination. Non-lambda value shapes
(`EUnit` / `EBool` / `EI32` / `EPair` / `EInl` / `EInr` / `ELoc` /
`EBorrow` / `EEcho`) are typed at base / product / sum / borrow / region
/ echo types — all distinct from `TFunEff` — and discharge identically.
## Why split Phase 3 into 3a + 3b
SUBST-LEMMA-GENERALIZATION-DESIGN.md Phase 3 originally combined (a) the
retype lemma + (b) the substitution-lemma extension. Splitting follows
the Phase 1 / Phase 2 pattern (Phase 1 = retype lemma; Phase 2 = subst
lemma) and keeps the PR minimal-purpose. Phase 3b (extend
`subst_typing_gen_l1_m` to TFunEff lambda substituends) is queued as a
follow-on.
## Constraints preserved (owner directive 2026-05-27)
- ✅ Does not patch legacy `Semantics.v` `preservation` (provably false
via `Counterexample.v`).
- ✅ Does not extend `Semantics.v` with closure-support lemmas.
- ✅ Does not close residual `Semantics_L1.v` axioms via proof tricks —
Phase 3a adds NEW infrastructure orthogonal to legacy admits.
- ✅ Does not follow pre-2026-05-26 closure plans.
- ✅ Works per-layer (L1 infrastructure → L2 preservation closure
downstream).
- ✅ Modality `m` preserved (cannot vary like Phase 1's ground lemma —
body's modality matches conclusion's).
- ✅ Context `G` preserved (body typed in `ctx_extend G T1`).
## Build
`just -f formal/Justfile all` — Rocq 9.1.1 / Coq 8.18.x.
\`\`\`
COQC Syntax.v
COQC Typing.v
COQC Modality.v
COQC TypingL1.v
COQC Semantics.v
COQC Semantics_L1.v ← contains the new lemma
COQC Counterexample.v
COQC Echo.v
COQC TypingL2.v
COQC L4.v
\`\`\`
Zero errors, zero new admits.
## Diff
- \`formal/Semantics_L1.v\` +60 (lemma + 35-line docstring)
## Refs
Refs hyperpolymath/standards#124 (estate proof-debt epic)
Refs hyperpolymath/standards#134 (ephapax sub-issue)
Refs \`formal/SUBST-LEMMA-GENERALIZATION-DESIGN.md\` Phase 3
## Phase ladder
- ✅ Phase 1 — \`ground_nonlinear_retype_l1_m\` (#219)
- ✅ Phase 2 — \`subst_typing_gen_l1_m_ground_nonlinear\` + helpers
(#220)
- ✅ Phase 3a — \`tfuneff_lambda_retype_l1_m\` ← **this PR**
- ⏳ Phase 3b — \`subst_typing_gen_l1_m_tfuneff\` (extend subst to
TFunEff substituends)
- ⏳ Phase 4 — close \`preservation_l2\` β-case using Phases 1-3
- ⏳ Phase 5 (deferred) — compound non-linear values
## Test plan
- [x] Toolchain build green (\`just -f formal/Justfile all\`)
- [x] No new \`Admitted.\`, no new \`Axiom\`
- [x] GPG-signed commit
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>tfuneff_lambda_retype_l1_m (#223)1 parent 8200ed7 commit 5bb4ca6
1 file changed
Lines changed: 60 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1217 | 1217 | | |
1218 | 1218 | | |
1219 | 1219 | | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
1220 | 1280 | | |
1221 | 1281 | | |
1222 | 1282 | | |
| |||
0 commit comments