Skip to content

Questions: Rocq and Lean recheck legs, ledger rows Q-1 to Q-4 - #25

Merged
hyperpolymath merged 2 commits into
mainfrom
claude/questions-instance
Nov 11, 2026
Merged

hyperpolymath merged 2 commits into
mainfrom
claude/questions-instance

Conversation

@hyperpolymath

@hyperpolymath hyperpolymath commented Nov 11, 2026 •

Copy link
Copy Markdown
Owner

Summary

Follow-up to #24. Adds the Rocq and Lean recheck legs for ResourceAlgebra.Instances.Questions and records the instance in the ledgers.

Changes

  • verification/proofs/coq/ResourceAlgebra.v: Questions, Questions_dioid, Questions_ordered, Questions_annihilating, and the 3 two-question facts, with 5 new Print Assumptions lines.
  • verification/proofs/lean4/ResourceAlgebra.lean: the same theorems, with 6 new #print axioms lines.
  • docs/status/PROOF-STATUS.adoc: rows Q-1 to Q-4, their statement correspondence, a note on eta for the carrier, and the limits of ⊕ in the open list. The census is 26 rows, all ungraded.
  • README.adoc, docs/pre-registration.adoc, CHANGELOG.adoc: the instance is listed.
  • src/ResourceAlgebra/Instances/Questions.agda: the header points to the ledger rows and no longer says "SKETCH, not yet in any ledger". No proof changed. It also gets the SPDX-FileCopyrightText line of the other modules, at the owner's direction.
  • resource-algebra_chora.deed: :purpose names Questions as the fifth instance. CLAUDE.md is regenerated from it with just claude-md (just 1.56.0 and nickel 1.17.0, both checksum-checked), and just validate-claude-md passes.

RSR Quality Checklist

Required

  • Tests pass: see Testing. just is not installed in the session, so the scripts were run directly.
  • Code is formatted (not run)
  • Linter is clean (not run)
  • No banned language patterns
  • No unsafe blocks (none)
  • No banned functions (no Admitted, no sorry, no postulate)
  • SPDX license headers present on the new and changed source files
  • No secrets, credentials, or .env files included

As Applicable

  • Repo deed (ecosystem) :purpose updated, CLAUDE.md regenerated
  • Documentation updated
  • CHANGELOG updated

Testing

  • bash scripts/check-agda.sh: pass (Agda 2.6.3 locally; CI pins 2.6.4.3).
  • bash scripts/check-proofs.sh lean4 with Lean 4.35.0 (the pinned archive, SHA256 checked): pass. 50 of 50 printed theorems depend on no axiom.
  • Rocq: Rocq 9.3.0 was not available locally. The file compiles with Coq 8.18.0 after From Stdlib is replaced by From Coq in a scratch copy, and 42 of 42 printed theorems are closed under the global context. rocqchk was not run. The CI Rocq leg is the authority.
  • check-adoc-renders, check-invisible-characters, check-no-placeholders, check-escape-hatches, check-no-md-in-docs, check-root-shape: pass.

The commit is not signed. The session has no signing key.


Generated by Claude Code

Summary by CodeRabbit

  • New Features
    • Added a Questions resource grade that tracks outcomes across multiple questions, with alternatives combining by intersection and sequences by union.
    • Added examples illustrating how different question outcomes can have the same overall amount, and how combining outcomes can produce all-lost or none-lost results.
  • Documentation
    • Updated the README, changelog, and proof-status records to describe the Questions grade and its current proof status.

Re-prove the Questions instance and its three two-question facts in the
Rocq and Lean legs. Record rows Q-1 to Q-4 and their statement
correspondence in PROOF-STATUS, list the instance in the README, the
provenance ledger and the changelog, and drop the sketch note from the
module header.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_0136P7ZngnAq35mYcMvxDyS4
@coderabbitai

coderabbitai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Caution

Review failed

The pull request is closed.

Walkthrough

Adds Rocq and Lean definitions and proofs for the length-n Boolean-vector Questions algebra, including two-question examples. Updates proof-status records and repository documentation to index the Questions instance and its Q-1 through Q-4 claims.

Changes: Questions algebra

Layer / File(s) Summary
Vector algebra and laws
verification/proofs/coq/ResourceAlgebra.v, verification/proofs/lean4/ResourceAlgebra.lean
Both proof files define length-indexed Boolean vectors, pointwise operations, and the Questions algebra. They add proofs for its monoid laws, distributivity, order, and annihilation properties.
Examples and axiom checks
verification/proofs/coq/ResourceAlgebra.v, verification/proofs/lean4/ResourceAlgebra.lean
Both proof files add two-question examples and assumption checks for the new algebra and example theorems.
Proof status and repository records
docs/status/PROOF-STATUS.adoc, docs/pre-registration.adoc, src/ResourceAlgebra/Instances/Questions.agda, README.adoc, CLAUDE.md, resource-algebra_chora.deed, CHANGELOG.adoc
The proof and provenance records add Questions and Q-1 through Q-4. The README and generated repository description list Questions, and the changelog records the additions. The Agda module header now references the ledger rows and recheck location.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Possibly related PRs

Suggested reviewers: claude

Merge Risk: Low · up to f50fd

This PR adds the Questions instance proofs and documentation. The proof content is sound, but the proof-status ledger marks one inequality claim as proven without a corresponding theorem. Tighten the wording or add the proofs, which is a small follow-up and not a merge blocker.

Pre-merge checks: Inconclusive 2

Failed Failed checks: 2 inconclusive

Check name Status Explanation Resolution
Title check Pending This assessment has not completed. The check will be retried on the next pre-merge check run.
Description check Pending This assessment has not completed. The check will be retried on the next pre-merge check run.
  • 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

…opyright line

The deed :purpose lists Questions as the fifth instance and CLAUDE.md is
regenerated from it with just claude-md. Questions.agda gets the
SPDX-FileCopyrightText line the other modules carry, at the owner's
direction.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_0136P7ZngnAq35mYcMvxDyS4
@sonarqubecloud

Copy link
Copy Markdown

@hyperpolymath
hyperpolymath marked this pull request as ready for review November 11, 2026 10:55
@hyperpolymath
hyperpolymath merged commit 5bd4872 into main Nov 11, 2026
45 checks passed
@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 deleted the claude/questions-instance branch November 11, 2026 10:55
hyperpolymath added a commit that referenced this pull request Nov 11, 2026
## Summary

Follow-up to #25, part 1 of 2. Classifies morphisms out of the Questions
instance and gives it a unit test and an expected-rejection control.
Part 2 records receipts and grades; it must follow the merge of this PR,
because this PR changes the inputs of all three proof legs.

## Changes

- `src/ResourceAlgebra/Morphism.agda`:
- F-8: `one-question-hom`, `one-question-needs`, `one-question-unique`.
Out of one question there is exactly one strict morphism into an algebra
`B`, and it exists exactly when `B` has 𝟘 ⊗ 𝟘 ≡ 𝟘.
- F-9: `first-question`, `later-questions`. Each question can be read
alone.
- F-10: `count-not-⊕`. The number of lost questions does not preserve ⊕.
- `verification/proofs/coq/ResourceAlgebra.v` and
`verification/proofs/lean4/ResourceAlgebra.lean`: the same theorems,
with 6 new assumption/axiom print lines in each.
- `tests/unit/QuestionsTest.agda`, imported by `AllTests.agda`.
- `tests/reject/QuestionsMeetIsABranch.agda`: the ninth expected
rejection, the control for Q-4.
- `docs/status/PROOF-STATUS.adoc`: rows F-8 to F-10, correspondence,
nine rejections, the open list. Census: 29 rows, all ungraded.
- `README.adoc`, `docs/pre-registration.adoc`, `CHANGELOG.adoc`.

Which morphisms to classify was a design choice made in this PR, not
specified by the owner. Not classified: morphisms out of `Questions n`
for n ≥ 2 beyond the projections, and every morphism into Questions.

## RSR Quality Checklist

### Required

- [x] Tests pass: see Testing. `just test` and `just quality` were not
run as recipes.
- [ ] Code is formatted (not run)
- [ ] Linter is clean (not run)
- [x] No banned language patterns
- [x] No `unsafe` blocks (none)
- [x] No banned functions (no `Admitted`, no `sorry`, no `postulate`)
- [x] SPDX license headers present on the new source files, copied from
the sibling files
- [x] No secrets, credentials, or `.env` files included

### As Applicable

- [x] Documentation updated
- [x] `CHANGELOG` updated

## Testing

- `bash scripts/check-agda.sh`: pass, with all 9 expected rejections
(Agda 2.6.3 locally; CI pins 2.6.4.3).
- `bash tests/unit/resource_algebra_test.sh`: pass.
- `bash scripts/check-proofs.sh lean4` with Lean 4.35.0: pass. 56 of 56
printed theorems depend on no axiom.
- Rocq: compiled with Coq 8.18.0 in a scratch copy with `From Stdlib`
replaced by `From Coq`; 48 of 48 printed theorems are closed. Rocq 9.3.0
and `rocqchk` run only in CI.
- `check-adoc-renders`, `check-invisible-characters`,
`check-no-placeholders`, `check-escape-hatches`, `check-no-md-in-docs`,
`check-root-shape`, `just validate-claude-md`: pass.

The commit is not signed. The session has no signing key.

---
_Generated by [Claude
Code](https://claude.ai/code/session_0136P7ZngnAq35mYcMvxDyS4)_

Co-authored-by: Claude <[email protected]>
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