Skip to content

fix(proofs): fail the proof gate on Admitted, sorry and postulate (WO 1.3) - #57

Merged
hyperpolymath merged 1 commit into
mainfrom
marina/eager-dijkstra-wlmapg
Nov 10, 2026
Merged

hyperpolymath merged 1 commit into
mainfrom
marina/eager-dijkstra-wlmapg

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Summary

Work order 1.3 of docs/proposals/mathesis-re-anchoring.adoc. scripts/check-proofs.sh passed a Rocq file with Admitted and a Lean file with sorry, because it checked only that the file compiled. Now each gated module that compiles is also audited (PROOF-POLICY §8.4, "Axioms travel with the grade"). Each audit fails closed when it cannot show that it ran.

Changes

  • Rocq: Print Assumptions for each declared Theorem, Lemma, Corollary, Proposition, Fact and Remark must print "Closed under the global context".
  • Lean: every theorem the source declares must depend on no axiom (Lean.collectAxioms, the function behind #print axioms). The lemmas Lean generates for an inductive (injEq, inj, sizeOf_spec) have no declaration range, so they are not checked as witnesses.
  • Agda: --safe already refuses postulate. The januskey postulate scan (scripts/scan-postulates.sh, the reference gate that §8.4 names) now runs over the first-party modules of the import cone that agda --dependency-graph reports.
  • Test: tests/proofs/gate_controls_test.sh <prover> plants an Admitted, a sorry and a postulate. Each one fails the new gate. On the old gate, the Rocq and Lean controls pass, so the test detects the gap. A clean module with a decoy in a comment passes. The Agda lane runs it now; the Rocq and Lean lanes come with WO 1.4.
  • ApiTypes.lean: under Lean 4.29.0 (the version in the pinned Guix), simp brought propext into the two ApiResult laws. Both now hold by rfl after cases.

The gate and ApiTypes.lean are template files, so the same fix belongs in rsr-template-repo.

RSR Quality Checklist

Required

  • Test added, and watched to fail on the old gate
  • No banned language added

Testing

Checked locally with Rocq 8.18.0, Lean 4.29.0 and Agda 2.6.3 (with its distribution stdlib):

  • bash scripts/check-proofs.sh agda|coq|lean4: PASS for every gated module.
  • bash tests/proofs/gate_controls_test.sh agda|coq|lean4: both controls behave for each prover.
  • just validate-repo-map: up to date.

Generated by Claude Code

… 1.3)

scripts/check-proofs.sh passed a Rocq file with Admitted and a Lean file
with sorry, because it checked only that the file compiled. Each gated
module that compiles is now audited as well (PROOF-POLICY 8.4, "Axioms
travel with the grade"), and each audit fails closed when it cannot show
that it ran:

- Rocq: Print Assumptions for every Theorem, Lemma, Corollary, Proposition,
  Fact and Remark the file declares must print "Closed under the global
  context".
- Lean: every theorem the source declares must depend on no axiom
  (Lean.collectAxioms, behind #print axioms). The lemmas Lean generates for
  an inductive (injEq, inj, sizeOf_spec) have no declaration range and are
  not witnesses.
- Agda: --safe already refuses postulate. The comment-aware postulate scan
  of hyperpolymath/januskey (989a747, scripts/scan-postulates.sh, the
  reference gate PROOF-POLICY 8.4 names) now runs over the first-party
  modules of the import cone that agda --dependency-graph reports.

tests/proofs/gate_controls_test.sh plants an Admitted, a sorry and a
postulate. Each fails the new gate, and the Rocq and Lean ones pass the old
gate, so the test detects the gap. A clean module passes. The Agda lane runs
the Agda controls; the Rocq and Lean lanes come with WO 1.4.

Checked locally with Rocq 8.18.0 and Lean 4.29.0 (the versions the pinned
Guix gives) and Agda 2.6.3 with its distribution stdlib: all gated modules
pass. Under Lean 4.29.0, simp brought propext into the two ApiResult laws of
ApiTypes.lean, a template file; both now hold by rfl after cases.

The gate and ApiTypes.lean are template files: the same fix belongs in
rsr-template-repo.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0136P7ZnDRsCLfZcFcEzvPcM
@sonarqubecloud

Copy link
Copy Markdown

@hyperpolymath
hyperpolymath marked this pull request as ready for review November 10, 2026 18:29
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-10T18:29:22.276232Z
We couldn’t complete this review. Comment @codex review to try again.
770e565 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@hyperpolymath
hyperpolymath merged commit e438060 into main Nov 10, 2026
41 of 42 checks passed
Repository owner deleted a comment from coderabbitai Bot Nov 10, 2026
@coderabbitai

coderabbitai Bot commented Nov 10, 2026

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

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.

3 participants