Zulip Chat Archive
Stream: Is there code for X?
Topic: monoid_hom from mul_hom?
Scott Morrison (Apr 11 2022 at 12:55):
Do we have the constructor that promotes a mul_hom to a monoid_hom when the source and target are groups?
Scott Morrison (Apr 11 2022 at 12:55):
(I guess the source only needs to be a monoid?)
Yaël Dillies (Apr 11 2022 at 12:56):
I would expect it to be called mul_hom.to_monoid_hom
, so it seems like we don't. However, we do have docs#is_mul_hom.to_is_monoid_hom
Scott Morrison (Apr 11 2022 at 12:56):
In the olden days we had is_mul_hom.to_is_monoid_hom
for this.
Eric Wieser (Apr 11 2022 at 13:01):
Eric Rodriguez (Apr 11 2022 at 13:02):
Can fun_like
do this automatically, BTW?
Yaël Dillies (Apr 11 2022 at 13:02):
Not until Lean 4, because typeclass loop.
Eric Wieser (Apr 11 2022 at 13:02):
Not quite a single argument, but monoid_hom.mk' f f.map_mul
probably works.
Eric Wieser (Apr 11 2022 at 13:03):
I'm not convinced we want this to happen automatically anyway
Yaël Dillies (Apr 11 2022 at 13:03):
I believe we should change monoid_hom.mk'
to use mul_hom
Yaël Dillies (Apr 11 2022 at 13:03):
We do, Eric, we do.
Yaël Dillies (Apr 11 2022 at 13:03):
Typically, for stuff like branch#GroupWithZero_equiv_Group
Eric Wieser (Apr 11 2022 at 13:04):
Does whether it's "automatic" or explicit really make much difference there?
Yaël Dillies (Apr 11 2022 at 13:05):
Eh, I guess not
Eric Wieser (Apr 11 2022 at 13:07):
Automatic is best for things that are unambiguous, unsurprising, and frequent
Last updated: Dec 20 2023 at 11:08 UTC