You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Constructive pi with extractable separation witnesses — would CoRN be interested? (referred from stdlib#316) #227
A constructive pi for the constructive Cauchy reals, realized by the alternating Leibniz series, with the strong irrationality separation theorem: for every rational q, an explicit computable margin c > 0 and index N with c < |p_m - q| for all m >= N — both extracting to runnable OCaml (zero Obj.magic, zero axioms, coqchk clean).
24 new .v files, ~35.1K lines; premise-free main theorems at top level
CI: 180/180 checks green across Rocq 9.2 / 9.3 / master / Alpine; zero compiler warnings
Full per-module map, dependency graph, and review-aid materials in stdlib#316 (see the "review-aid" comment)
Lineage
The development extends the constructive-reals line this repository is home of: the method family — alternating series with easy error bounds computing pi in exact real arithmetic — is due to O'Connor (TYPES 2007) and Krebbers–Spitters (LMCS 2013). Our increment is what that line does not carry: apartness statements and per-rational extraction-ready witnesses.
Two questions for the maintainers
Interest in principle? Would a verified constructive pi with extractable separation witnesses fit CoRN's scope?
Dependency stance? Our stack currently builds on stdlib's ConstructiveCauchyReals (CReal / CReal_appart / inject_Q, distributed with Rocq 9.x) plus our own small escape-window engine (stdlib#313). Would CoRN accept that as a dependency, or would you require porting onto CoRN's own CReal? We are willing to port — the escape-window engine is our own mathematics, so the instantiation layer is adaptation work, and we would of course deliver it with the same verification standard (coqchk / Print Assumptions / extraction differential / multi-toolchain CI).
Maintenance
Long-term maintenance is committed publicly (compatibility upkeep across future Rocq releases; review responses within days) — see the maintenance-commitment comment in stdlib#316.
Happy to provide anything else that helps the assessment.
Following up on this issue: a draft PR is now open that makes the CoRN-native form of the separation engine concrete and CI-testable.
Draft PR opened: #228 — native-CR port complete and green (five-proof + PA Closed + zero axioms); ready to mark RFC on your preference (this native-CR form, or the stdlib-CReal-dependency variant also prepared).
In short:
The draft adds reals/fast/CrnEscapeSep.v (287 lines): the escape-window irrationality criterion carried directly by CoRN's fast constructive reals. From a family of positive window widths that eventually escapes the dyadic approximations of x, it derives forall q : Q, CRapartT x ('q) with an extractable side certificate — CRapartT is the disjoint sum exhibiting the side, and each component carries a positive rational distance witness (CRltT = CRpos (y - x)).
The port is shorter than the standard-library CReal engine: the positivity witness of CRpos_char is a single positive rational, so the Archimedean index pushdown disappears entirely; the witness is the quarter of the escape margin, and the coherence of the approximation function (crn_reg_le) transports the escape inequality across precisions. Top-level statements are premise-free, carried by Set/the sum type, with no axiom and no classical logic (Print Assumptions closed).
The PR is marked as a draft and is in a discussion stage — not requesting merge yet. It is meant as a concrete, CI-testable anchor for the question asked here; happy to rework scope, or hold entirely, per maintainer preference.
This is a sizeable contribution that stands well enough on its own. I don't think we have the bandwidth to maintain this as part of CoRN, whereas you clearly have the machine power to maintain your project on your side, so I recommend you do just that and there's no need to add anything to CoRN.
Thank you for the clear and prompt assessment. We accept the recommendation: the development will continue as a standalone project, and we will not pursue inclusion in CoRN.
For the record, the standalone form is already in place: the package is in the official opam repository (opam install rocq-pi-leibniz, v1.0.4, archived on Zenodo with a DOI), with the verification chain (coqchk, Print Assumptions, extraction audit, multi-toolchain CI) running on every push.
I will close draft PR #228 and keep the branch in our own repository. Thanks again to you and to the stdlib maintainers for the quick and concrete guidance at every step.
Activity
hy7pc8gfmf-dotcom commentedon Oct 14, 2026
Following up on this issue: a draft PR is now open that makes the CoRN-native form of the separation engine concrete and CI-testable.
Draft PR opened: #228 — native-CR port complete and green (five-proof + PA Closed + zero axioms); ready to mark RFC on your preference (this native-CR form, or the stdlib-CReal-dependency variant also prepared).
In short:
reals/fast/CrnEscapeSep.v(287 lines): the escape-window irrationality criterion carried directly by CoRN's fast constructive reals. From a family of positive window widths that eventually escapes the dyadic approximations ofx, it derivesforall q : Q, CRapartT x ('q)with an extractable side certificate —CRapartTis the disjoint sum exhibiting the side, and each component carries a positive rational distance witness (CRltT = CRpos (y - x)).CRealengine: the positivity witness ofCRpos_charis a single positive rational, so the Archimedean index pushdown disappears entirely; the witness is the quarter of the escape margin, and the coherence of the approximation function (crn_reg_le) transports the escape inequality across precisions. Top-level statements are premise-free, carried bySet/the sum type, with no axiom and no classical logic (Print Assumptionsclosed).crn-pi-stdlibdepon the fork carries the sibling form of the Leibniz-pi construction that depends on the standard library'sConstructiveCauchyReals(the form Constructive pi with extractable separation witnesses — would CoRN be interested? (referred from stdlib#316) #227 describes, 26-file supply chain over there); the native-CR form above is the CoRN-side half of the same program.Lysxia commentedon Oct 26, 2026
This is a sizeable contribution that stands well enough on its own. I don't think we have the bandwidth to maintain this as part of CoRN, whereas you clearly have the machine power to maintain your project on your side, so I recommend you do just that and there's no need to add anything to CoRN.
hy7pc8gfmf-dotcom commentedon Oct 27, 2026
Thank you for the clear and prompt assessment. We accept the recommendation: the development will continue as a standalone project, and we will not pursue inclusion in CoRN.
For the record, the standalone form is already in place: the package is in the official opam repository (opam install rocq-pi-leibniz, v1.0.4, archived on Zenodo with a DOI), with the verification chain (coqchk, Print Assumptions, extraction audit, multi-toolchain CI) running on every push.
I will close draft PR #228 and keep the branch in our own repository. Thanks again to you and to the stdlib maintainers for the quick and concrete guidance at every step.