-
Notifications
You must be signed in to change notification settings - Fork 246
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
Where should homomorphisms live in the stdlib
hierarchy?
#1871
Comments
I agree the asymmetry is somewhat displeasing. The main issue I see with this proposal is dependency cycles.
|
Food for thought! Thanks! |
Ah were you suggesting a single module per morphism target pair? e.g. one for |
[EDITED to roll my three comments into one] |
Finally catching up, now that I've submitted the paper due today... Key to this is
In In this case, I think And yes, this does have the advantage of being 'thin' and thus not leading to import cycles. |
Hmm so the problem with this naming scheme is that its not unique. For example, there will be a zillion |
So that just leaves this issue:
Which I don't see addressed anywhere. How will the current contents of |
If I were doing that, I'd split it along additive, multiplicative, order, etc lines. |
I don't (yet) have good solutions to the problems raised by @MatthewDaggitt , sorry to say. |
i've definitely found that the vast majority of import cycles and like issues can be solved by slicing things into smaller modules. |
Closing this now as we seem to have argued ourselves out of my (much) more fine-grained position towards having individual definitions of |
Knocking off the last outstanding task in Issue #1851 re-raised a question in my mind as well regarding where, in general, proofs homomorphism-like properties belong in the library: under the source type, in
*.Properties
, or somewhere else?For example, in PR#1852 I currently have
Parity
importSign
in order to define the operations, but it strikes me that there's an asymmetry to that decision, which might better be reflected in having subdirectories of theAlgebra.*
hierarchy which record concrete instances of(Semi)RingHomomorphisms
etc. Similar considerations apply, mutatis mutandis, to @Taneb 's recent #1857 / #1863 : I don't regardList.length
as being a homomorphism fromList _
toNat
as a property ofList _
, rather it's a (consequence of the) universal property of the free monoid construction, of whichList _
is merely a very convenient representative for the underlying carrier type of that free algebra.Moreover the amount of additional work involved in these proofs, and especially also for the
Semiring
homomorphismparity
fromNat
toParity
, led me eventually to write this last one in a module on its own; I was at the limits of how to disambiguate all the various equational/algebraic reasoning from that already intrinsic to the structure ofNat
itself, when I first tried to shoehorn this proof intoData.Nat.Properties
.It struck me before I embarked on this, but especially now afterwards, and with a categorical eye on what's going on, that it doesn't make sense to me to regard this homomorphism as a property inherent to
Nat
, importing structure fromParity
: rather that each (through the particular lens of their respectiveSemiring
structure) participates in the construction of a new structure/bundle, taking components from the (intrinsic/internal)Properties
of each typeNat
andParity
... and neither 'side' has ownership of the homomorphism. Rather, if rather prosaically, I've constructed an arrow in the (Set
-/Setoid-
based) category ofSemiring
s and their homomorphisms... such that each of theProperties
modules is responsible for witnessing thatNat
resp.Parity
is even permitted to be considered as candidate domain/codomain for such an arrow. But the arrow itself lives/should live... somewhere else, associated in the hierarchy with the abstract algebraic structure involved.Accordingly, I suggest/propose that we have a new hierarchy below
Algebra.Homomorphism|Morphism
, corresponding to each of the (concrete) categories of algebras where the domain/codomain of any such homomorphism should live.All of these decisions may already have been debated/decided/resolved in
agda-categories
, so it would be nice to get input from that community (esp. @JacquesCarette ?), as well perhaps as this being further impetus to migrate that development intostdlib
itself...Discussion and suggestions welcome!
(And my especial thanks to @MatthewDaggitt and @Taneb for forcing me to put my money where my mouth is ;-)
The views above are, of course, entirely my own, but I might hope might be more widely shared...)
The text was updated successfully, but these errors were encountered: