← Back to Pull requests

Lib, νGpd: introduce square and hexagonal coherence definitions #48

Closed
unknown closed this pull request without merging on Sep 30, 2026 09:12 UTC
View on GitHub
unknown unknown commented on Sep 28, 2026 16:44 UTC
Author

Background

On groupoid-no-funext (the early ν-groupoid development branch), abstract coherence types and lemmas were introduced in the AbstractShapes module to answer a question: can hexagonal coherence be proved once and for all, as square coherence can?

It was shown that naturality squares always have fillers, whereas a proof of every abstract hexagon would be equivalent to global UIP. These types were not integrated into the νGpd construction at the time.

PR #45 implemented a broad refactoring aimed at improving comprehension of the ν-groupoid construction.

Overview

This PR continues that effort using the idea from AbstractShapes: give the coherence shapes names and use them throughout the construction. These named types let us express the statements of lemmas used in the ν-groupoid construction at a higher level of abstraction, making their mathematical content easier to follow.

Coherence shapes

The new Lib/CohShapes.v defines square_coherence and hexagonal_coherence, following the naming scheme of the existing permutahedral_coherence.

  • square_coherence has a proof once and for all, supplied by square_coherence_fill.

  • hexagonal_coherence requires coherence data. We port the abstract hexagon–UIP proof: a filler for every hexagonal boundary is equivalent to global UIP.

  • Both shapes have a _dep version, expressing dependent coherence over a chosen base coherence.
  • Use in the construction

    mkCoh2FrameType becomes an instance of hexagonal_coherence. The layer and painting coherence types become instances of hexagonal_coherence_dep.

    The building blocks of the permutahedral_coherence now clearly consist of instances of hexagonal_coherence (supplied) and square_coherence (built via square_coherence_fill).

    The frame-coherence assumption of rew_cohLayer_hex is expressed as hexagonal_coherence. One level up, rew_coh2Layer_perm4 takes a painting coherence expressed as hexagonal_coherence_dep and, using the permutahedral frame coherence, produces another dependent hexagon for the second-order layer coherence.

    The decomposition lemmas eq_existT_curried_hex and eq_existT_curried_hex_dep, used for frame and painting coherence respectively, now state explicitly how hexagonal coherences of dependent pairs are assembled from their components.

    The same definitions shorten the types of other lemmas in Layer.v, Lemmas.v, and Pasting.v, so the construction and its supporting lemmas describe their coherences in a common language.

    Diff: 336 lines (+252 / -84) across 4 files Reviewer: artagnon Review duration: 2427m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.42) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.42 · 336 lines diff across 4 files
    0.42
    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.348
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #48"
    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: 42.2% (MEDIUM) · Higher = larger blast radius
    42.2%
    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: 16.7% · Safe to merge
    16.7%
    Repository