Skip to content

BendTT: adequacy, a checked law holds at each closed instance - #1627

Merged
Lorenzobattistela merged 2 commits into
bendlang:mainfrom
ScottMoore0:bendtt-adequacy
Oct 22, 2026
Merged

Lorenzobattistela merged 2 commits into
bendlang:mainfrom
ScottMoore0:bendtt-adequacy

Conversation

@ScottMoore0

Copy link
Copy Markdown
Contributor

Opened after Nico's go-ahead on Discord.

Claim.consistent says no checked def has type <>. This adds the claim a law's user relies on: a checked proof of {a == b} means a and b convert. It holds for any closed, live term, so a checked law holds at each closed instance (its proof def applied to closed values), in the kernel's own reduction (opaque defs at their models, as in Part 2).

def Claim.adequate : Prop :=
  ∀ bk t T a b A, Book.check bk = .ok () → Term.Closed t → Term.Live bk t →
    Typed bk [] t T → Conv bk T (Eql a b A) → Conv bk a b

The proof is adequate, after consistent. It reuses halts, progress, pars_sr, value_form, gen and fits_conv, plus two small lemmas after canon_enu: eql_inj (the sides of convertible equations convert) and canon_eql (a closed value at an equation is {==}). It changes no line that Book.check or main runs.

What I ran on this exact file (identical to main at 22d627b plus this patch; bendtt.lean is unchanged since 234cb9b, where I ran these):

Check Result
lake build (Lean 4.34.0) builds
#print axioms on all 10 theorems, Book.check, main propext, Classical.choice, Quot.sound only
leanchecker --fresh passes
Lean4Lean --fresh (its 4.33.0-rc2 toolchain) 93,251 declarations checked
lean -c + leanc -O3 -DNDEBUG kernel binary byte-identical to main's
tests/ + demos/*/PROOF.bend (1,666 files) through --verdict same verdict and output text for every file
Size (ttok==0.3, which matches CI) 62,092 → 62,676 of the 64,000 cap

Happy to shorten it, rename, or restate it in the file's style.

Found and tested with Claude Code, running Claude Opus 5.5, during an audit of --verdict.

Claim.consistent says no checked def has type <>. Claim.adequate says what
a law's user relies on: a closed live term of a checked book typed at
{a == b} has convertible sides, so a law's proof def applied to closed
values makes its two sides compute to a common term. By halts, progress
and sr the term reaches a value at {a == b}, and canon_eql shows that value
is {==} with convertible sides. No line Book.check or main runs changes;
the CLI binary builds byte-identical.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Lorenzobattistela Lorenzobattistela self-assigned this Oct 22, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@Lorenzobattistela
Lorenzobattistela merged commit b8664b0 into bendlang:main Oct 22, 2026
1 check passed
@Lorenzobattistela Lorenzobattistela mentioned this pull request Oct 23, 2026
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.

2 participants