Commit 45469e8
authored
## Summary
- Ships the **retype lemma half** of Phase 3 per
`formal/SUBST-LEMMA-GENERALIZATION-DESIGN.md`.
- Adds `is_tfuneff_ty` predicate (Syntax.v) mirroring
`is_ground_nonlinear_ty`.
- Adds `tfuneff_lambda_retype_l1_m` lemma (Semantics_L1.v): retype
TFunEff lambda value across `(m, R, G) → (m, R', G)` under side
condition `forall r, In r R' → In r R_in`.
- **Phase 3b (substitution-lemma extension) DESCOPED** to a follow-up PR
after structural analysis revealed the `T_Region_L1` fresh-region
obstacle. STATE.a2ml documents the three candidate solutions.
## Why split
`SUBST-LEMMA-GENERALIZATION-DESIGN.md` Phase 3 proposed two pieces
(retype + substitution extension). Walking the substitution proof
revealed: every retype across a threaded `R_n` inside the term `e`
demands `forall r, In r R_n → In r R_in_arg`, and `T_Region_L1` firings
inside `e` introduce fresh `r ∉ R_outer` — freshness wrt the threaded R
does **not** imply membership in the value-type's fixed `R_in_arg`.
Three candidate fixes (syntactic side condition on `e`; universal-R
Hv_type with per-case discharge; restrict to region-free terms) need
Phase 4 prototyping of the actual `subst 0 varg ebody` shape before
choosing. Phase 3a's retype lemma stands on its own as clean
infrastructure usable in 3b and Phase 4.
## Proof shape
`tfuneff_lambda_retype_l1_m`:
- `destruct Hval` (10 value-form cases)
- `inversion Ht; subst; try discriminate`
- Non-ELam forms: types don't match TFunEff → `discriminate`.
- ELam at TFun (legacy rules `T_Lam_L1_Linear` / `T_Lam_L1_Affine`):
type mismatch TFun ≠ TFunEff → `discriminate`.
- ELam at TFunEff (`T_Lam_L1_Linear_Eff` / `T_Lam_L1_Affine_Eff`):
re-apply rule with new `Hsub`, body via `eassumption`.
Zero new admits, zero new axioms. Coqc 8.18.0 clean rebuild across all
10 .v files.
## Owner-directive compliance (per `CLAUDE.md` 2026-05-27)
- ✅ No closure of legacy `preservation` in `Semantics.v` (untouched).
- ✅ No closure-support lemmas in `Semantics.v` (untouched).
- ✅ No closure of residual `Semantics_L1.v` admits — strictly NEW
orthogonal infrastructure.
- ✅ No patching `Typing.v` (untouched).
- ✅ No new `Admitted` / `Axiom`.
- ✅ Anti-pattern detector clean.
## Test plan
- [x] `coqc -Q . Ephapax` clean across all 10 .v files locally.
- [ ] CI green on `formal/` build job.
Refs: standards#134 (proof-debt epic), #220 (Phase 2), #213 (design
doc).
1 parent 5bb4ca6 commit 45469e8
3 files changed
Lines changed: 91 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
| 9 | + | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1308 | 1308 | | |
1309 | 1309 | | |
1310 | 1310 | | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
1311 | 1384 | | |
1312 | 1385 | | |
1313 | 1386 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
472 | 472 | | |
473 | 473 | | |
474 | 474 | | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
475 | 491 | | |
476 | 492 | | |
477 | 493 | | |
| |||
0 commit comments