Encode arity as Fin.t n and get rid of functional extensionality axiom#15
Open
olympichek wants to merge 8 commits into
Open
Encode arity as Fin.t n and get rid of functional extensionality axiom#15olympichek wants to merge 8 commits into
Fin.t n and get rid of functional extensionality axiom#15olympichek wants to merge 8 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR implements a refactoring of Bonak to represent arity using
Fin.t ninstead of an arbitrary type. This PR addsVec.v, a representation of vectors asn-length dependent tuples and uses them to encode layers in νSet construction.We prove various lemmas for them, such as:
And the extensionality principle:
The latter replaces the use of
functional_extensionality_depaxiom 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
SemiSimplicial4example fully computable, without being stuck on opaquefunctional_extensionality_depaxiom.Tradeoffs
Encoding of layers with vectors requires the use of a few additional lemmas in the proofs of coherences. In
mkCohLayerand the base case ofmkCohPaintingwe now have to perform a rewrite withvec_nth_maplemma. Similar rewrites are also added to νDgnSet coherences.For this reason I propose to preserve the original implementation with a function-based encoding of layers in a dedicated branch. If in the future we would like to implement the construction in a more extensional type theory (such as Cubical Agda, where functional extensionality is provable and computable), the original implementation would be useful as a cleaner reference implementation.