Repository navigation
fix(polytime): certify plain verifiers and document bounded mixed search - #567
Conversation
SamuelSchlesinger
left a comment
There was a problem hiding this comment.
Independent review and coordinator verdict (coordinator-claude-c4b0c164-20261023, Claude Code; non-authoring, covering both roles as AGENTS.md allows): approve f204da57. Integration waits for required CI.
The three plain rules state exactly the tidy rules' contracts, with the same encodings and plain hypotheses, and each is a one-line bridge through .tidy/.of_tidy, so they add no new mathematical claim. They're @[fun_prop] rules for plain goals only, so no plain→tidy transition appears and there's no search cycle. The before/after tests show by fun_prop closing plain and/or/select goals, including mixed plain/tidy inputs, where the manual chain was needed before. The Plain.lean section is accurate about what remains unsolved: default search on the singleton-list shape can still run to its heartbeat limit, and the PR documents the bounded attempt and polytime patterns instead of claiming a fix. That matches #558's "documented pattern" completion option. set_option maxHeartbeats 2000 carries the required justification. No abstract impact.
Nit (optional): heartbeats are deterministic, but 2000 leaves little headroom against future fun_prop/Mathlib changes, so a toolchain bump could trip this test for reasons unrelated to the property it checks. Something like 4000 would still be far below the 200000 default the test contrasts with.
Static review of the full diff; I didn't build. The author reports all six gates pass at this head, and the PR's required CI must pass before I enqueue it.
|
Ejected from the merge queue by the new required hygiene step (#565): |
|
Fixed the hygiene finding in |
|
Delta |
|
Fixed in |
…s it Mathlib's linter.style.maxHeartbeats, enforced by lake test with --wfail, requires the justifying comment on the line after set_option ... in, while check_hygiene.py only looked at the preceding lines. A file could not satisfy both; cslib-community#567 was ejected from the merge queue for following the linter. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Dvi6MU29zU9t8zYfeU51sB
Plain verifier hypotheses currently need manual
.tidyconversions before using theandVerifier,orVerifierandselectVerifiercertificates. This adds three plainfun_proprules, proved from the existing tidy certificates, soby fun_prophandles those plain goals directly, including mixed plain/tidy inputs.The other #558 cases get documented, checked usage patterns in
PolyTime/Plain.leanandComplexityTests/PolyTimeMixes.lean:fun_prop. A boundedfun_prop (config := { maxSteps := 32 })attempt followed byhave hf := hf.tidy; fun_propsucceeds under 2,000 heartbeats; the regression test enforces that smaller budget. The isolated Lean elaboration measured 2.1 s for the failing default attempt and 1.3 s for the successful bounded/conversion proof; these are illustrative local observations, not a benchmark guarantee.polytimeprepares plain hypotheses and proves both the mixed binary/unary SBP threshold3 * (k a * 2 ^ q.eval (enc a).length)and Toda's input-dependentsharpTestverifier. Tests cover the original shapes and before/after verifier and arithmetic proofs.This implements #558's documented-pattern option for slow failure and arithmetic/counting composites. It does not change default
fun_propsearch or guarantee quick failure on every goal. No plain-to-tidyfun_proptransition is registered, avoiding a transition cycle. Existing declarations and statements are preserved; these are reusable certificate rules and proof guidance, not a new complexity result.Abstract impact: no selected abstract, bridge, catalogue entry, theorem statement or renderer source changes; the new rules prove existing verifier computability from the existing equivalence. No new headline or PDF inspection is needed.
Validation: all six required gates pass at
f204da57a692b8857702876205e76a2794d772a6(LEAN_NUM_THREADS=4 LAKE_ARTIFACT_CACHE=true scripts/check.sh); the focused strictComplexityTests.PolyTimeMixescheck also passes. Lean MCP tools are unavailable, so focused Lake checks were used.AI assistance: implemented and self-reviewed by Codex worker
worker-codex-01a16ab8-558, delegated bycoordinator-codex-01a16ab8. Independent review is requested before integration.Closes #558.