Skip to content

Commit bb905dc

Browse files
committed
docs: substantive proof-debt.adoc per standards#203 (supersedes #37)
Replaces the thin index in PR #37 with a substantive classification under the standards#203 trusted-base reduction policy schema. Corrects the marker count (#37 said "3 escape hatches"; actual is 1). Classifies the single hatch: - (a) DISCHARGED: none - (b) BUDGETED: none - (c) NECESSARY AXIOM: proofs/BetLang.lean:392 substTop_preserves_typing — classical substitution lemma over de Bruijn substitution. Cited from Pierce TAPL Ch. 6 + Software Foundations Vol 2 + Programming Language Foundations in Agda. Promotion path documented per PR #27. - (d) DEBT: none. The repo has zero sorry declarations. The author's in-file framing at BetLang.lean:387-391 already distinguishes this as an explicit axiom rather than a proof hole; the (c) classification formalises that disposition under the estate-wide policy schema. Format: .adoc (matches estate-wide doc convention per estate CLAUDE.md "All docs must be .adoc except GitHub-required files").
1 parent 6702d2d commit bb905dc

1 file changed

Lines changed: 84 additions & 0 deletions

File tree

docs/proof-debt.adoc

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
// SPDX-License-Identifier: MPL-2.0
2+
// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell (hyperpolymath)
3+
= Proof debt
4+
:policy: https://github.com/hyperpolymath/standards/blob/main/docs/TRUSTED-BASE-REDUCTION-POLICY.adoc
5+
:tapl: TAPL (Pierce 2002) Chapter 6
6+
:discharge-pr: https://github.com/hyperpolymath/betlang/pull/27
7+
8+
Per link:{policy}[standards#203] (trusted-base reduction policy), every
9+
soundness-relevant escape hatch in this repo is classified below as one
10+
of: (a) DISCHARGED, (b) BUDGETED, (c) NECESSARY AXIOM, or (d) DEBT.
11+
12+
Supersedes the thin index in
13+
https://github.com/hyperpolymath/betlang/pull/37[betlang#37] (which
14+
declared "3 escape hatches" — the actual count is 1).
15+
16+
== Marker count
17+
18+
1 soundness-relevant escape hatch in this repo:
19+
20+
* `proofs/BetLang.lean:392` — `axiom substTop_preserves_typing`
21+
22+
Zero `sorry` declarations. Zero `noncomputable` in soundness positions.
23+
24+
== (a) Discharged
25+
26+
No entries.
27+
28+
== (b) Budgeted — tested with refutation budget
29+
30+
No entries.
31+
32+
== (c) NECESSARY AXIOM
33+
34+
=== `proofs/BetLang.lean:392` — `axiom substTop_preserves_typing`
35+
36+
[source,lean]
37+
----
38+
axiom substTop_preserves_typing :
39+
∀ (Γ : Ctx) (S T : Ty) (body v : Expr),
40+
HasType (S :: Γ) body T → HasType Γ v S → HasType Γ (substTop v body) T
41+
----
42+
43+
* **Kind**: classical substitution lemma for typed lambda terms under
44+
de Bruijn substitution.
45+
* **Justification**: discharging requires the full shifting /
46+
substitution calculus over de Bruijn indices, which would triple
47+
the file size and is orthogonal to the BetLang-specific content of
48+
this formalisation. The property is standard and well-known to
49+
hold for this style of substitution.
50+
* **Citation**: {tapl} ("Pure Simply Typed Lambda Calculus" — the
51+
substitution lemma is the canonical preservation prerequisite).
52+
Mechanised independently in many libraries: Software Foundations
53+
Volume 2 § STLC, Programming Language Foundations in Agda §
54+
Properties, Lean Mathlib's `Mathlib.Logic.Function.Iterate`
55+
substitution machinery.
56+
* **Used by**: `preservation` theorem at `proofs/BetLang.lean:398`
57+
(invoked in the `appLam` case to thread typing across
58+
beta-reduction).
59+
* **Author's framing**: the in-file comment at
60+
`proofs/BetLang.lean:387-391` is explicit that this is an axiom,
61+
not a `sorry`: _"IMPORTANT: This is NOT sorry — it is an axiom.
62+
The difference is that axioms are explicit assumptions in the
63+
logical framework, whereas sorry is a proof hole."_
64+
* **Promotion path** (optional, not blocking): see
65+
link:{discharge-pr}[betlang PR #27] body for a discharge recipe.
66+
Promotion would move this entry to §(a) DISCHARGED and remove the
67+
`axiom` declaration in favour of a proof using the Lean Mathlib
68+
substitution lemmas.
69+
70+
== (d) DEBT — actively to be closed
71+
72+
No entries. (If the promotion path above is pursued, the §(c) entry
73+
moves to §(a); it does not pass through §(d) because it has a
74+
principled disposition today.)
75+
76+
== Cross-references
77+
78+
* link:{policy}[standards#203] — trusted-base reduction policy
79+
(canonical estate-wide definition)
80+
* `proofs/BetLang.lean` — the formal model where the axiom is
81+
declared and used
82+
* `docs/semantics.md` — language semantics overview
83+
* link:{discharge-pr}[betlang PR #27] — discharge recipe (optional
84+
promotion to §(a))

0 commit comments

Comments
 (0)