Skip to content

fix(examples): repair the mult_dist proof in simple_proof.v - #535

Open
hyperpolymath wants to merge 2 commits into
mainfrom
claude/zen-newton-uv9o4h
Open

hyperpolymath wants to merge 2 commits into
mainfrom
claude/zen-newton-uv9o4h

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Summary

examples/simple_proof.v did not compile. The step case of mult_dist fails under Coq 8.18.0 with:

Error: Found no subterm matching "m + n' * m" in the current goal.

The fault is in the proof script, not the Coq version. After rewrite IHn' and the two rewrite <- plus_assoc steps, the goal is

m + (p + (n' * m + n' * p)) = m + (n' * m + (p + n' * p))

so the m + n' * m that rewrite (plus_comm m (n' * m)) needs no longer exists. This was checked with Show. at that point.

Nothing caught it because no CI job compiles examples/: just proofs-coq covers only proofs/coq/. The failure turned up in an arghda verdict run over the echidna corpus at 14ada6d. That run is recorded in the hyperpolymath/arghda-core#67 design note.

Changes

  • The step case of mult_dist now:
    1. right-associates both sides with rewrite <- !Nat.add_assoc;
    2. removes the shared m with f_equal;
    3. closes the remaining commutation with Nat.add_comm and Nat.add_assoc.
  • It uses the non-deprecated Nat.* names. Nothing else in the file changed.

Not in this PR, for a separate decision:

  • Adding examples/ to CI. That is a workflow change.
  • Two stale tracked build artefacts. examples/.simple_proof.aux and examples/simple_proof.glob are tracked in git, and compiling rewrites them. I restored both to their committed bytes and left them alone.

RSR Quality Checklist

Required

  • Tests pass (just test or equivalent): not run. This PR changes one Coq example only, and coqc on it passes (see Testing).
  • Code is formatted: not applicable (no Rust).
  • Linter is clean: not applicable (no Rust).
  • No banned language patterns
  • No unsafe blocks without // SAFETY: comments: none touched
  • No banned functions (believe_me, unsafeCoerce, Obj.magic, Admitted, sorry): the proof ends in Qed
  • SPDX license headers present on all new/modified source files: the existing MPL-2.0 header is unchanged
  • No secrets, credentials, or .env files included

Testing

  • coqc -q examples/simple_proof.v with Coq 8.18.0: exit 0, with only deprecation warnings left from the other theorems' Arith.Plus names.
  • Before this change, the same command failed at line 65 with the error above.
  • Not tested on Rocq 9.x. The new proof uses only Nat.add_assoc and Nat.add_comm, which are current names.

Generated by Claude Code

The proof failed under Coq 8.18.0 with "Found no subterm matching
m + n' * m". The fault is in the proof script, not the Coq version:
after IHn' and two `rewrite <- plus_assoc` steps the goal is
  m + (p + (n' * m + n' * p)) = m + (n' * m + (p + n' * p)),
so the `m + n' * m` that the next rewrite needs no longer exists.

The step case now right-associates both sides, peels the shared `m`
with f_equal, and closes the remaining commutation with Nat.add_comm
and Nat.add_assoc (the non-deprecated names). `coqc -q` on the file
exits 0 with Coq 8.18.0.

No CI job compiles examples/ (`just proofs-coq` covers proofs/coq
only), which is how this went unnoticed. Found by an arghda verdict run
over the echidna corpus.

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

gitnotebooks Bot commented Nov 30, 2026

Copy link
Copy Markdown

Review these changes at https://app.gitnotebooks.com/hyperpolymath/echidna/pull/535

@coderabbitai

coderabbitai Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Documentation
    • Updated the example’s arithmetic proof with clearer intermediate reasoning. The example’s exported declarations remain unchanged, so this update does not alter the available results or capabilities.

The mult_dist proof replaces repeated associativity and commutativity rewrites followed by reflexivity with explicit intermediate equality steps.

Changes: Distributivity proof

Layer / File(s) Summary
Explicit equality steps
examples/simple_proof.v
The proof uses Nat.add_assoc, two f_equal steps and Nat.add_comm. Comments describe intermediate equalities.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

Merge Risk: Minimal · up to 577a9

This PR repairs an example Coq proof and does not touch runtime code. The dependency audit failure is reported on the base branch as well and is separate from this change, so merge risk is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the change: it repairs the mult_dist proof in examples/simple_proof.v. The fix type prefix is conventional. The title matches the main change in the changeset, so it passes.
Description check Passed The description follows the template's main sections: Summary, Changes, RSR Quality Checklist, and Testing. It explains the compile failure, the fix, and the verification with coqc under Coq 8.18.0. I…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description follows the template's main sections: Summary, Changes, RSR Quality Checklist, and Testing. It explains the compile failure, the fix, and the verification with coqc under Coq 8.18.0. It also lists out-of-scope items. The Screenshots section is absent, which is acceptable because it applies only when relevant. Several Required checklist items are unchecked with explanations (tests not run, formatting and linting not applicable). The author states that the Tests item was not run, and the template says PRs failing required checks will not merge. The Testing section gives a reproducible command, so the description is mostly complete.

Resolution

Optionally, confirm that the unchecked Required item 'Tests pass' is acceptable, or run the repository test target (for example, just test) before merge. The Testing section does not cover the Rocq 9.x case, which the author states was not tested.

Finishing Touches

Fix failing CI checks

  • Commit to this branch
  • Create a new PR
  • 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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 399cbadd-a028-4aba-9e30-785389971e90
Commits

Reviewing files that changed from the base of the PR and between 6165b8f and 577a93e.

Files selected for processing: 1

  • examples/simple_proof.v

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Recent review details

Context from checks skipped due to timeout: 29

  • GitHub Check: CodeRabbit
  • GitHub Check: governance / Exemption ratchet
  • GitHub Check: governance / Workflow security linter
  • GitHub Check: governance / JS runtimes — pnpm
  • GitHub Check: governance / JS runtimes — deno
  • GitHub Check: governance / UUID v8 conformance
  • GitHub Check: governance / Live Actions policy (credentialed advisory)
  • GitHub Check: governance / Debt ratchet
  • GitHub Check: governance / Actions lockfile verify
  • GitHub Check: governance / Security policy checks
  • GitHub Check: governance / Code quality + docs
  • GitHub Check: governance / Licence consistency
  • GitHub Check: governance / JS runtimes — environment provisions Bun first
  • GitHub Check: governance / Well-Known (RFC 9116 + RSR)
  • GitHub Check: governance / Language / package anti-pattern policy
  • GitHub Check: governance / JS runtimes — bun
  • GitHub Check: governance / UUID v7 conformance
  • GitHub Check: governance / Trusted-base reduction policy
  • GitHub Check: governance / Check Workflow Staleness
  • GitHub Check: governance / Guix packaging policy (Nix retired)
  • GitHub Check: governance / Allowlist Preflight
  • GitHub Check: analyze (actions, none)
  • GitHub Check: zig-ffi / fmt + test (ffi/zig)
  • GitHub Check: Banned-runtime check
  • GitHub Check: panic-attack assail
  • GitHub Check: Validate DEED manifests
  • GitHub Check: zig-ffi / unified-api-adapter purity
  • GitHub Check: hypatia / Hypatia Neurosymbolic Analysis
  • GitHub Check: PR (address)
CI failures not shown inline: 1

GitHub Actions: Cargo Audit / Dependency audit: fix(examples): repair the mult_dist proof in simple_proof.v

Conclusion: failure

View job details

##[group]Run bash scripts/ci/audit-dependencies.sh
 �[36;1mbash scripts/ci/audit-dependencies.sh�[0m
 shell: /usr/bin/bash -e {0}
 env:
   CARGO_HOME: /home/runner/.cargo
   CARGO_INCREMENTAL: 0
   CARGO_TERM_COLOR: always
 ##[endgroup]
 Cargo.lock: FAILED (vulnerabilities found)
 fuzz/Cargo.lock: FAILED (vulnerabilities found)
 ##[error]Process completed with exit code 1.
Additional context used

Code guidelines: 1

CLAUDE.md — auto-discovered
Path-based instructions: 1

Source excerpt: **Version + release history**: [`CHANGELOG.adoc`](CHANGELOG.adoc) (single source of truth; do not duplicate version strings elsewhere)

CodeRabbit inference engine (CLAUDE.md)

Files:

  • examples/simple_proof.v
Additional comments: 1

examples/simple_proof.v: 1

63-69: LGTM!

Copy link
Copy Markdown
Owner Author

Dependency audit: failing on main as well, so not caused by this PR.

This PR changes only examples/simple_proof.v. It touches no Cargo.lock, manifest or Rust code.

  • The job fails with Cargo.lock: FAILED (vulnerabilities found) and fuzz/Cargo.lock: FAILED (vulnerabilities found).
  • The same check fails on main at 6165b8f, this PR's base, on four days in a row (2026-11-27 to 2026-11-30).
  • The CI log does not name the advisories. cargo audit is not available in my session, so I have not identified the crates.

A fix means bumping or replacing the flagged dependencies in both lockfiles. That belongs in its own PR, so I have not added it here.


Generated by Claude Code

@hyperpolymath
hyperpolymath marked this pull request as ready for review December 1, 2026 20:11
@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.

@sonarqubecloud

sonarqubecloud Bot commented Dec 1, 2026

Copy link
Copy Markdown

@hyperpolymath
hyperpolymath enabled auto-merge (squash) December 1, 2026 20:16

Copy link
Copy Markdown
Owner Author

Auto-merge is waiting on CI/gate, which nothing on this repository currently produces.

CI/gate is required by the Branch-Floor ruleset and comes from the Rust CI workflow (rust-ci.yml). That workflow ends in startup_failure, with no jobs, so the gate never reports. This is not caused by this PR:

  • It is startup_failure on main itself since 6165b8f (2026-11-27). The last success was 14ada6d. 6165b8f changed no workflow file.
  • It is startup_failure on every recent PR branch, not just this one.
  • The other workflows that fail to start on this head are live-provers, mvp-smoke, server-boot-gate and proof-safety. Every one of them uses Swatinem/rust-cache@v2.9.3. cargo-audit.yml, which uses the same checkout and toolchain actions but not rust-cache, starts normally.

Unverified lead. The generated .github/workflows/actions.lock records the action as swatinem/rust-cache@v2.9.3 (lowercase), while the workflows say Swatinem/rust-cache@v2.9.3. If lockfile enforcement compares these case-sensitively, that would explain the pattern. I cannot see the Actions settings or the startup error from this session, so this is a lead, not a diagnosis. The startup error text on any of these runs, for example run 46734851545, will say.

The fix belongs in the workflows or the lockfile on main, not in this PR. Until it lands, this PR cannot merge without an override.


Generated by Claude Code

This branch has not been deployed

No deployments
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