← Back to Pull requests

Encode arity as `Fin.t n` and get rid of functional extensionality axiom #16

Closed
unknown closed this pull request without merging on Jun 22, 2026 07:29 UTC
View on GitHub
unknown unknown commented on Jun 21, 2026 13:03 UTC
Author

Overview

This PR implements a refactoring of Bonak to represent arity using Fin.t n instead of an arbitrary type. This PR adds Vec.v, a representation of vectors as n-length dependent tuples and uses them to encode layers in νSet construction.

We prove various lemmas for them, such as:

vec_nth_map: vec_nth (vec_map f xs) i = f i (vec_nth xs i)

And the extensionality principle:

vec_ext: (forall i, vec_nth xs i = vec_nth ys i) -> xs = ys

The latter replaces the use of functional_extensionality_dep axiom in the proofs of coherences for layers.

The vector module is parameterised over the module type encapsulating the algebra of Σ-types. This generality is added in order to support not only the current implementation limited to h-sets, but also the work-in-progress extension to h-groupoids.

Achievements

This refactoring allows us to make (after also making some opaque lemmas transparent) the SemiSimplicial4 example fully computable, without being stuck on opaque functional_extensionality_dep axiom.

Tradeoffs

Encoding of layers with vectors requires the use of a few additional lemmas in the proofs of coherences. In mkCohLayer and the base case of mkCohPainting we now have to perform a rewrite with vec_nth_map lemma. Similar rewrites are also added to νDgnSet coherences.

For this reason I make this PR to the newly created no-funext branch rather than to master.

Update: another downside of this branch is that apparently it makes compilation time slightly worse.

Diff: 198 lines (+148 / -50) across 2 files Reviewer: olympichek Review duration: 1106m
All Vouch review confidence checks passed
Residual risk 0.14 = Change Risk (0.36) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 198 lines diff across 2 files
0.36
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.317
Shallow Review Depth shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #16"
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: 36.1% (MEDIUM) · Higher = larger blast radius
36.1%
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: 14.3% · Safe to merge
14.3%
Repository