Zulip Chat Archive

Stream: mathlib4

Topic: Quotient map explicit arguments


Patrick Massot (Aug 08 2024 at 13:51):

Is there any reason why docs#QuotientGroup.map and docs#Submodule.mapQ take the subobjects are explicit arguments? Is this done so that writing proofs on the fly is more convenient? It would be really nice to have documentation when such choices are made.

Patrick Massot (Aug 08 2024 at 13:57):

Note that the map could also be implicit, but I understand this would seem a bit weird (although we could also switch to a version that takes any map and has property only under appropriate assumptions).

Eric Wieser (Aug 08 2024 at 13:57):

(I assume you mean docs#Submodule.Quotient.map, which doesn't exist?)

Edward van de Meent (Aug 08 2024 at 13:59):

are you thinking of docs#Submodule.mapQ ?

Patrick Massot (Aug 08 2024 at 14:02):

Sorry, I meant mapQ

Patrick Massot (Aug 08 2024 at 14:02):

This is one of our many inconsistencies in naming.

Patrick Massot (Aug 08 2024 at 14:03):

I fixed the original post.

Patrick Massot (Aug 08 2024 at 14:08):

I just checked very quickly that the file defining quotient module compiles without any trouble after making those arguments implicit, the only adaptation being to remove those arguments. But this experiment doesn’t say whether it would have been more painful to write.

Edward van de Meent (Aug 08 2024 at 14:13):

i imagine there might be some cases where it gets used as Quotient.map N M f (by _), which could be considered a tad more annoying to write...

Edward van de Meent (Aug 08 2024 at 14:14):

where you rely on the explicit parameters to fill in the precise type required of by _

Patrick Massot (Aug 08 2024 at 14:16):

I understand this possibility, this is why I said that fixing existing proofs is not completely convincing. But I would like to know whether leaving those arguments implicit has actually been tried.

Kevin Buzzard (Aug 08 2024 at 15:06):

Now of course we can write (N := N) to mitigate against this, when preparing a proof.

Matthew Ballard (Aug 08 2024 at 15:12):

I would mainly be worried about the strain placed on the elaboration. But it should be tried.

Patrick Massot (Aug 08 2024 at 15:14):

Matthew, is there any reason you fear this more than with a random implicit argument?

Matthew Ballard (Aug 08 2024 at 15:17):

I have run into situations before involving significant differences in performance where the arguments to the quotient are implicit or explicit. I don't think this is one and I can't put my finger on the exact cause or line of code at the moment.


Last updated: May 02 2025 at 03:31 UTC