Repository navigation
Engine: check a named reading in the kernel, as a table - #191
Merged
Merged
Conversation
`satisfied_by` and `leaves_open` proved a model by having `simp` unfold the premise list and rewrite the semantics of every formula, a second for one sola fide case. A reading over an enumeration is a table: each claim True or False. `Testimony.Logic.ModelCheck` reads the table off the definition, as a function to Bool with the proof by cases that it agrees with the reading, and the kernel evaluates every premise under it; `models_iff_holdsB` proves the evaluation the semantics, constructively, so every theorem rests on the axioms it did. A reading that is not a table falls back to the old recipe; none in the arguments or the examples does. `refute_with` keeps its recipe: the refutation check counts on it unfolding every definition through the argument's unfold set. Five interleaved rounds against main: the Pauline case's model 1.11 s to 45 ms (-96%, p = 0.008); a granted denial of Trent's 1.05 s to 46 ms (-96%); the parity reply's independence 204 ms to 15 ms (-93%). By hand, two runs each: SolaFide.Dispute 48.4 s to 35.8 s, SolaFide.Results 18.6 s to 12.6 s. Ledger round 9; the style guide says to write a reading as a table; the citation check's pin moves to 2304 definitions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BC49XsbtehCbmJMavF1K5Q
# Conflicts: # arguments/TestimonyArguments/Checks.lean # docs/src/performance.md
# Conflicts: # arguments/TestimonyArguments/Checks.lean # arguments/bench/Engine.lean # docs/src/performance.md
deanberris
marked this pull request as ready for review
November 3, 2026 15:27
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The third item of the profiling plan, after #189 and #190.
Why
After round 6,
simpwas most of the elaboration time in the slowest modules, and most of thatsimpcame fromsatisfied_by. Measured serially:SolaFide.Dispute's elaboration;SolaFide.Results'.Its recipe unfolds the premise list and rewrites the semantics of every formula, which takes about a second for one sola fide case.
What changes
Testimony.Logic.ModelCheck. A reading over an enumeration of claims is a table:TrueorFalseat each claim.tableOfreads that table off the definition at elaboration time, as a function toBool. It also builds the proof that the table agrees with the reading, by cases, as a term rather than goal by goal. The kernel then evaluates every premise under the table withdecide +kernel.models_iff_holdsBproves that this evaluation agrees with Foundation's semantics.satisfiable_of_tableandindependent_of_tablesbuild on it.satisfied_byandleaves_opentry the table first, and otherwise fall back to the old recipe. Their syntax is unchanged. I built once with the fallback disabled: nosatisfied_byorleaves_openin the arguments or the examples falls back. The only fallback is the tactic module's own deliberate example,fun a => a = Pair.q.refute_withis unchanged, on purpose. The refutation check relies onrefute_withunfolding every definition through the argument's unfold set. That is how it tells a genuine "not Horn" failure from a definition someone forgot to tag. A kernel check unfolds everything, tagged or not, so moving it would drop that guarantee silently.tauto, which putClassical.choiceunder every model it checked. The generated pages print each theorem's axioms, and caught it. The proof is now constructive, so the theorems rest onpropextandQuot.soundas before, and no generated page changes.CLAUDE.md's layout table and ledger round 9 are updated. The citation check's pin moves from 2298 to 2304 definitions, the new module's.Measured
scripts/bench-ab.sh origin/main, five interleaved rounds:mainsatisfied_by: the Pauline casesatisfied_by: Trent grants the subjective genitiveleaves_open: parity leaves the canon openBy hand, two runs each, with only the tactic module's table alternative removed for the base:
SolaFide.Disputeelaborates in 35.8 s, against 48.4 s;SolaFide.Resultsin 12.6 s, against 18.6 s.The axiom audit now covers 9,670 declarations in the arguments, against 12,414. My reading is that the old recipe's
simpproofs created auxiliary declarations. I haven't checked that declaration by declaration. Every theorem is still audited.Round 7 is in #189 and round 8 in #190, so this is round 9. The ledger table and the pin in
arguments/TestimonyArguments/Checks.leanwill conflict trivially with whichever merges first.Gates
All run locally on this head and all pass:
lake buildandlake build TestimonyTools;lake lintandlake exe axiom-audit, in all three packages;bibgen,argtex,statusgenandargdocwith--check, andexampletex --check;testimony_lint.pyandmdbook build.Generated by Claude Code