Skip to content

docs(proof-debt): seed docs/proof-debt.md per standards#203 schema#41

Merged
hyperpolymath merged 1 commit into
mainfrom
claude/proof-debt-schema-202605
May 27, 2026
Merged

docs(proof-debt): seed docs/proof-debt.md per standards#203 schema#41
hyperpolymath merged 1 commit into
mainfrom
claude/proof-debt-schema-202605

Conversation

@hyperpolymath
Copy link
Copy Markdown
Owner

Per-repo proof-debt triage for betlang, applying the estate-wide
Trusted-Base Reduction Policy that landed at
standards#203 and
was filled in by
standards#222.
The detection gate is scripts/check-trusted-base.sh
(standards#211).

What this PR does

  1. Adds docs/proof-debt.md matching the schema-conformant per-repo
    form (the same shape as
    standards/docs/proof-debt.md@standards#213).
  2. Enumerates the 1 real marker in proofs/BetLang.lean (the
    axiom substTop_preserves_typing at L392) under §(d) DEBT, with
    a full discharge recipe inlined from the body of
    PR #27.
  3. Documents the 3 comment-skip false positives (lines 19, 387, 388)
    at the top of docs/proof-debt.md as a marker-count table.
  4. Adds an inline -- AXIOM: substTop_preserves_typing — disposition §(d) DEBT ... annotation 5 lines preceding the axiom so the
    check-trusted-base.sh gate flips from naked-marker to documented.

Classification rationale

substTop_preserves_typing is §(d) DEBT, not §(c) NECESSARY AXIOM:

  • It is the standard top-level substitution-preservation lemma (Pierce,
    TAPL Ch.9). It is constructively provable in Lean 4 by induction on
    the typing derivation, factored through a generalised
    substAt_preserves_typing plus three Ctx.insertAt lookup lemmas.
  • It does not encode any metatheoretic assumption (no funExt, no
    choice, no UIP, no propositional truncation).
  • It exists in the source only because a full de Bruijn substitution
    calculus would, per the inline doc-comment, "triple the file size" —
    a cost judgement (which §(d) DEBT captures) not a necessity
    judgement (which §(c) would capture).
  • A partial implementation already lives on a local working branch
    (proofs/discharge-substTop-axiom-23, commit 8fa128d); the
    six-step discharge recipe is inlined verbatim in the new
    docs/proof-debt.md from the body of merged PR
    #27.
  • Issue #23 was
    closed optimistically when PR WIP: discharge substTop_preserves_typing axiom (Refs #23) #27 merged the build-fix half of the
    work; the axiom itself remained in source. The new §(d) entry
    records "INDEFINITE" as the deadline pending re-open.

Verification

Locally:

$ bash /path/to/standards/scripts/check-trusted-base.sh .
[INFO] Found 3 soundness-relevant escape hatch(es).
[OK] proof-debt document(s) found: docs/proof-debt.md PROOF-NEEDS.md
[OK] All 3 escape hatch(es) are documented (inline annotation
     or entry in: docs/proof-debt.md PROOF-NEEDS.md).

(The "3" reflects the post-comment-skip count from the script's
is_comment_line heuristic: L19 is line-comment-skipped, L387 + L388
survive as continuation lines of a /-- ... -/ block, L392 is the
real declaration. All three are covered by docs/proof-debt.md's
path enumeration plus the inline AXIOM: annotation within 5 lines.)

References

Test plan

  • bash scripts/check-trusted-base.sh . exits 0 on this branch (verified locally)
  • CI trusted-base job (when wired) reports [OK] on the merged main

Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

🤖 Generated with Claude Code

Per the estate-wide Trusted-Base Reduction Policy (standards#203,
filled in by standards#222), seed `docs/proof-debt.md` for betlang
following the canonical schema.

Classifications:
- §(d) DEBT: `axiom substTop_preserves_typing` at proofs/BetLang.lean:392
  — standard TAPL Ch.9 substitution-preservation lemma. NOT §(c)
  NECESSARY because the property is constructively provable in Lean 4;
  the axiom only exists because a full de Bruijn substitution calculus
  would "triple the file size" per the inline doc-comment (a cost
  judgement, not a necessity judgement). Discharge plan inlined from
  the PR #27 body (~300-400 LoC standard TAPL mechanisation).
- Comment-skip false positives (proofs/BetLang.lean:19, :387, :388):
  documented at the top of docs/proof-debt.md but require no further
  action. The check-trusted-base.sh `is_comment_line` heuristic strips
  the line-19 case but not :387/:388 (they are continuation lines of a
  `/-- ... -/` block, not `--`-prefixed); coverage is via path
  enumeration in docs/proof-debt.md.

Adds an inline `-- AXIOM: substTop_preserves_typing — disposition §(d)
DEBT` comment 5 lines preceding the axiom so the check-trusted-base.sh
gate (standards#211) flips from a naked-marker error to documented.

Verified locally:
  $ bash /path/to/standards/scripts/check-trusted-base.sh .
  [OK] All 3 escape hatch(es) are documented.

Refs hyperpolymath/standards#203
Refs hyperpolymath/standards#211
Refs hyperpolymath/standards#222
Refs #23
Refs #27

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@hyperpolymath hyperpolymath enabled auto-merge (squash) May 27, 2026 08:16
auto-merge was automatically disabled May 27, 2026 11:11

Pull request was closed

@hyperpolymath hyperpolymath reopened this May 27, 2026
@hyperpolymath hyperpolymath enabled auto-merge (squash) May 27, 2026 11:11
@hyperpolymath hyperpolymath merged commit 81c71c9 into main May 27, 2026
27 of 51 checks passed
@hyperpolymath hyperpolymath deleted the claude/proof-debt-schema-202605 branch May 27, 2026 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant