feat(rocq): wire mathcomp into the toolchain — Coq-Interval is unusable without it - #43
Conversation
Coq-Interval (added in #41) is present but UNUSABLE: `Require Import Interval.Tactic` fails with "Cannot load mathcomp.boot.seq: no physical path bound to mathcomp.boot" — Interval depends on Mathematical Components, which the toolchain does not expose on the coqc load path. This mirrors the Interval/Coquelicot wiring for mathcomp: a rocq_mathcomp nixpkgs_package (coqPackages.mathcomp), a filegroup BUILD, the toolchain `mathcomp` attr, and the extra_libs -Q binding (logical name `mathcomp`). NOT YET VALIDATED end-to-end: on a consumer (relay) with a pinned MODULE.bazel.lock, the module extension did not re-evaluate, so rocq_mathcomp was not materialised and the smoke proof still failed with the same error. Needs: (a) confirm `coqPackages.mathcomp` is the right nix attribute (modern mathcomp is split into boot/ssreflect/algebra — a meta vs component question), (b) confirm the `/mathcomp/` path pattern + lib/coq glob match the nix output layout, (c) a lock refresh so the extension re-runs. Filed so the approximation-layer FP proofs (relay MATHF32-P04/P05) can proceed once green. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HvusAXYbHLyv3uTzfBcMbG
|
Verified this empirically before merging (per the operating discipline: reproduce, don't trust a done-flag). Recommend not merging as-is — the diagnosis is right (Coq-Interval genuinely can't load without mathcomp), but this specific fix doesn't resolve it, and the gap is deeper than one missing package.
It does not contain The real dependency list, read directly off nixpkgs (not guessed): So this is also missing And it goes one level deeper still. What actually works, verified: Using that environment's Recommendation: the real fix is architectural, not a quick patch — either (a) a second, 🤖 Generated with Claude Code |
…rification gate)
… (DD-003)
Replaces the previous commit's coqPackages.mathcomp wiring, which doesn't
fix the bug: `nix build coqPackages.mathcomp` produces only a 1-file
umbrella re-export (lib/coq/9.0/user-contrib/mathcomp/all/all.vo), not
the mathcomp-boot package the original error names
("Cannot load mathcomp.boot.seq").
The real dependency closure, read off nixpkgs directly (not guessed):
`coqPackages.interval.propagatedBuildInputs` = bignums, coquelicot,
flocq, mathcomp-boot, mathcomp-fingroup. mathcomp-boot itself needs
hierarchy-builder, which needs the coq-elpi OCaml plugin, whose own
OCaml findlib deps (ppx_deriving.runtime, ...) go deeper still --
hand-wiring each as a separate nixpkgs_package + -Q flag doesn't scale
past this point.
- rocq/extensions.bzl: @rocq_interval_env is a single
`coq_9_0.withPackages (p: [p.flocq p.interval p.coquelicot])`
composition that resolves the entire transitive closure automatically
(mathcomp-boot/fingroup, bignums, hierarchy-builder, coq-elpi and its
OCaml deps) -- exactly the way nixpkgs is designed to solve this. Its
own subdirs are already named Flocq/Interval/mathcomp/Bignums/HB/elpi,
so exposing the tree needs no manual -Q reconstruction at all.
- rocq/private/rocq.bzl: new rocq_interval_proof rule compiles against
this dedicated environment's own coqc (no -Q flags needed -- it has
its own default load path baked in). The primary toolchain
(coqutil/Hammer/smpl, rocq-of-rust) is untouched.
- examples/interval_proof/: a real smoke test -- Require Import
Interval.Tactic, `interval` tactic discharges a goal. Verified:
`bazel test //examples/interval_proof:smoke_test` -- PASSED. Nothing
exercised this before (#41/#43 both went green on CI without proving
the capability worked).
- artifacts/requirements.yaml: FEAT-001/REQ-002 back to implemented
(genuinely this time); DD-003 records the verified decision and why
hand-wiring the closure was rejected.
- README.md / claims.yaml: document the new capability and gate the
claim the same way as the rest of this repo's doc claims.
Closes #43
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011MptgyfLZuHYCbfpq1zDey
Coq-Interval (added in #41) is present but unusable:
Require Import Interval.Tacticfails withCannot load mathcomp.boot.seq: no physical path bound to mathcomp.boot. Interval depends on Mathematical Components, which the toolchain does not expose on the coqc load path. This blocks the FP approximation-layer proofs (relay MATHF32-P04/P05).Mirrors the Interval/Coquelicot wiring for mathcomp (rocq_mathcomp nixpkgs_package + filegroup + toolchain attr + extra_libs -Q binding).
NOT YET VALIDATED end-to-end — on a consumer with a pinned lock the extension didn't re-evaluate (rocq_mathcomp not materialised, same error). Open: (1) is
coqPackages.mathcompthe right attr (modern mathcomp splits into boot/ssreflect/algebra)? (2) do the path pattern + glob match the nix layout? (3) lock refresh needed. Filed as the prerequisite for the approximation-layer proof track.🤖 Generated with Claude Code