-
Notifications
You must be signed in to change notification settings - Fork 71
Discreteness and H-Levels of W-types #498
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
TOTBWF
wants to merge
8
commits into
main
Choose a base branch
from
w-type-properties
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+331
−4
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
I needed this at some point during a proof, but ended up refactoring it away. Still might be useful though?
Changed pages
|
ncfavier
reviewed
May 18, 2025
Comment on lines
+591
to
+602
sup x f ≡ sup y g | ||
≃⟨ ap-equiv W-fixpoint ⟩ | ||
(x , f) ≡ (y , g) | ||
≃˘⟨ Iso→Equiv Σ-pathp-iso ⟩ | ||
Σ[ p ∈ (x ≡ y) ] PathP (λ i → B (p i) → W A B) f g | ||
≃˘⟨ Σ-ap-snd (λ p → funext-dep≃) ⟩ | ||
Σ[ p ∈ (x ≡ y) ] (∀ {bw bv} → PathP (λ i → B (p i)) bw bv → f bw ≡ g bv) | ||
≃⟨ Σ-ap-snd (λ p → Π-impl-cod≃ λ bw → Π-impl-cod≃ λ bv → Π-cod≃ (λ q → Path≃Code (f bw) (g bv))) ⟩ | ||
Σ[ p ∈ (x ≡ y) ] (∀ {bw bv} → PathP (λ i → B (p i)) bw bv → Code (f bw) (g bv)) | ||
≃⟨⟩ | ||
Code (sup x f) (sup y g) | ||
≃∎ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool!
I have this much simpler identity system construction sitting around: W-is-hlevel {ℓ} {ℓ'} {A = A} {B = B} n ahl = identity-system→hlevel n W-ids W-tr where
W-code : W A B → W A B → Type (ℓ ⊔ ℓ')
W-code (sup x f) (sup y g) = Σ[ p ∈ x ≡ᵢ y ] (∀ i → W-code (f i) (g (substᵢ B p i)))
W-code-refl : ∀ x → W-code x x
W-code-refl (sup x f) = reflᵢ , λ a → W-code-refl (f a)
W-decode : ∀ x y → W-code x y → x ≡ y
W-decode (sup x f) (sup y g) (reflᵢ , p) = ap (sup x) (funext λ a → W-decode _ _ (p a))
W-coh : ∀ x y (p : W-code x y) → PathP (λ i → W-code x (W-decode x y p i)) (W-code-refl x) p
W-coh (sup x f) (sup y g) (reflᵢ , p) = Σ-pathp refl (funextP λ x → W-coh (f x) (g x) (p x))
W-ids : is-identity-system W-code W-code-refl
W-ids .to-path = W-decode _ _
W-ids .to-path-over = W-coh _ _
W-tr : ∀ x y → is-hlevel (W-code x y) n
W-tr (sup x f) (sup y g) = Σ-is-hlevel n (≡ᵢ-is-hlevel' ahl x y) λ x → Π-is-hlevel n λ i → W-tr _ _ |
I think there is value in having both, but mostly because I think the proof of We should probably provide a version of your identity system as an extensionality transformer though. |
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.
Description
This PR proves that a W-type$O(n^2)$ case bash, we can construct an equivalence with a W-type instead. Some automation on this front would be useful, but I've spent enough time shaving this yak already :)
W A B
is discrete whenA
is discrete andB x
isListable
for everyx
. I've also addeda characterisation of equality types of W-types. These should make arguments about decidable equality a bit easier to make for inductive types: instead of doing a giant
Checklist
Before submitting a merge request, please check the items below:
support/sort-imports.hs
(ornix run --experimental-features nix-command -f . sort-imports
).If your change affects many files without adding substantial content, and
you don't want your name to appear on those pages (for example, treewide
refactorings or reformattings), start the commit message and PR title with
chore:
.