-
Notifications
You must be signed in to change notification settings - Fork 71
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
Refactor coproduct equivalences #1137
base: master
Are you sure you want to change the base?
Conversation
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.
Thanks for the contribution, and apologies for taking so long! I have a couple of requests on naming and good-practice definitions.
( map-coproduct (map-equiv f) (map-equiv g)) ∘ | ||
( map-coproduct (map-inv-equiv f) (map-inv-equiv g)) ~ id |
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.
Looks to me like you should define
map-equiv-coproduct = map-coproduct (map-equiv f) (map-equiv g)
and
map-inv-equiv-coproduct = map-coproduct (map-inv-equiv f) (map-inv-equiv g)
And then this should be
is-section map-equiv-coproduct map-inv-equiv-coproduct
( map-coproduct (map-inv-equiv f) (map-inv-equiv g)) ∘ | ||
( map-coproduct (map-equiv f) (map-equiv g)) ~ id |
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.
Same as above
is-retraction map-equiv-coproduct map-inv-equiv-coproduct
@@ -69,6 +72,29 @@ inr-coproduct-Fin k l = map-coproduct-Fin k l ∘ inr | |||
compute-inl-coproduct-Fin : | |||
(k : ℕ) → inl-coproduct-Fin k 0 ~ id | |||
compute-inl-coproduct-Fin k x = refl | |||
|
|||
map-Fin-add-ℕ : |
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.
I see that the original name Fin-add-ℕ
is not your fault, but having a capitalized word (Fin
) before an uncapitalized one (add
) is a sure sign that the naming should be improved.
I think better names for the entries in this file would be, in order,
coproduct-Fin
->compute-coproduct-Fin
map-coproduct-Fin
->map-compute-coproduct-Fin
Fin-add-ℕ
->inv-compute-coproduct-Fin
, and then please add a definition formap-inv-compute-coproduct-Fin
inl-coproduct-Fin
is fineinr-coproduct-Fin
is finemap-Fin-add-ℕ
->map-compute-map-inv-compute-coproduct-Fin
(since the maps are not definitionally the same)compute-map-Fin-add-ℕ
->compute-map-inv-compute-coproduct-Fin
Could you please make these renamings as part of this pull request?
( map-coproduct (map-Fin-add-ℕ k l) id) | ||
|
||
compute-map-Fin-add-ℕ : | ||
(k l : ℕ) → map-equiv (Fin-add-ℕ k l) ~ map-Fin-add-ℕ k l |
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.
After my above suggested renamings
(k l : ℕ) → map-equiv (Fin-add-ℕ k l) ~ map-Fin-add-ℕ k l | |
(k l : ℕ) → | |
map-inv-compute-coproduct-Fin k l ~ | |
map-compute-map-inv-compute-coproduct-Fin k l |
Hey @fredrik-bakke No worries for the delay, and sorry for the delay on my end :). I'll implement these changes this weekend. |
@morphismz I'm marking this one as a draft for now, feel free to get back to it when you have time |
Refactors some equivalences related to coproducs and adds one new definition.
removes the abstract block around
is-equiv-coproduct
infoundation.functorality-coproduct-types
, thus allowingmap-inv-equiv (equiv-coproduct e e')
to compute tomap-coproduct (map-inv-equiv e) (map-inv-equiv e')
. We keep abstract blocks around the proof that the inverse map is a section and retractioncomputes the underlying map of the equivalence
Fin-add-ℕ
inunivalent-combinatorics.coproduct-types