← Back to Pull requests

Replace coinduction with an ω-limit construction #35

Closed
unknown closed this pull request without merging on Aug 26, 2026 20:30 UTC
View on GitHub
unknown unknown commented on Aug 20, 2026 19:23 UTC
Author

Replacing coinduction with an ω-limit construction

Overview

The correspondence between the indexed and fibred presentations of ν-sets (#33) assumes univalence, functional extensionality, and one additional axiom on the indexed side:

Axiom νSetFromEquivEq: forall SA SB: νSets,
  νSetFromEquiv trTower0 SA SB -> SA = SB.

The axiom was needed because the indexed construction was closed by a coinductive tower, and Rocq's rules for coinductive records do not derive this identity principle. The intensional-stream model of Boulier, Pédrot, and Tabareau (The Next 700 Syntactical Models of Type Theory, Theorem 13) shows that bisimilarity and identity can consistently differ for coinductive streams, even in the presence of univalence.

This pull request represents the tower instead as the ω-limit of its chain of finite prefixes, following the construction of M-types without coinductive types in Ahrens, Capriotti, and Spadotti, Non-wellfounded Trees in Homotopy Type Theory (arXiv:1504.02949). On this representation the extensionality principle is provable: the new Equiv/Extensionality.v derives νSetsEquivEq, the conversion of a levelwise equivalence of towers into an equality, from univalence and functional extensionality. The change is applied uniformly to the three towers (νSetFrom, νGpdFrom, and the fibred νDgnSetFrom) and to the levelwise equivalence relation itself (νSetsEquiv), so no coinductive type remains in the development, and the final result presheafEqνSets: Presheaf = νSets assumes exactly univalence and functional extensionality.

The ω-limit tower

The coinductive closure

CoInductive νSetFrom n (X: (νSetAt n).(prefix)): Type := cons {
  this: mkFrame (toDepsRestr ((νSetAt n).(data) X).(restrFrames)) -> HSet;
  next: νSetFrom n.+1 (X; this);
}.

becomes a record over the chain of finite prefixes:

Record νSetFrom n (X: (νSetAt n).(prefix)): Type := cons {
  approx l: n <= l -> (νSetAt l).(prefix);
  approxO: approx n leR_refl = X;
  approxS l (Hl: n <= l) (HSl: n <= l.+1): (approx l.+1 HSl).1 = approx l Hl;
}.

(νSetAt l.+1).(prefix) is definitionally a Σ-type over (νSetAt l).(prefix), so the bonding map is first projection, and this/next become derived destructors. Chains built by iteration (ana) bond by eq_refl, so the destructors of the resulting tower compute by conversion; the new Eval compute examples in νSet.v exercise this.

The levelwise equivalence as a chain

The relation used by the round trip has the same recursive shape as the towers and receives the same representation: νSetsEquiv SA SB is a coherent chain of per-level translation data (the filler equivalence and its restr-painting commutations), interpreted into translation towers by iterating trTowerStep. The witness fg: νSetsEquiv (f (g X)) X is a chain fixpoint in the style of pshChain, bonding by eq_refl.

Proving the extensionality theorem

νSetsEquivEq: νSetsEquiv SA SB -> SA = SB proceeds in three stages. An equality of towers is reduced to a coherent family of prefix paths (νSetsEqIntro); the destructor unfoldings are aligned with the stored chains (packPath); and the paths are generated by recursion over the witness's chain — at each level, univalence and functional extensionality turn the stored filler equivalences into the next prefix path, and path induction reduces the preservation step to a diagonal translation tower whose stored equivalences are pointwise identities, closed by layer extensionality and UIP of the frame HSets.

Adaptations of the correspondence proof

The translation f: Presheaf -> νSets is likewise closed by a chain fixpoint (pshChain) with eq_refl bonding; the resulting computation of its destructors is what the round-trip proofs rely on. Face.v and νSetRoundtrip.v shed the chain helpers that existed only for the coinductive closure, and Lib/RewLemmas.v and Lib/SigT.v gain the path and Σ-type lemmas the new proofs use.

| result | assumptions |
| --- | --- |
| f, g, gf, fg | none |
| presheafEquivEq, νSetsEquivEq, presheafνSetsEquiv, presheafEqνSets | univalence and functional extensionality |

Diff: 543 lines (+407 / -136) across 6 files Reviewer: olympichek Review duration: 8707m
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.48) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.48 · 543 lines diff across 6 files
0.48
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.377
Shallow Review Depth shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #35"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 48% (MEDIUM) · Higher = larger blast radius
48%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 19.0% · Safe to merge
19.0%
Repository