Zulip Chat Archive

Stream: mathlib4

Topic: AddGroup for Fin


Daniel Weber (Sep 23 2024 at 03:59):

Is there a reason there's no AddGroup (I actually need AddGroupWithOne) instance for Fin? I want to apply docs#Nat.cast_sub but I can't

Kevin Buzzard (Sep 23 2024 at 06:16):

Fin 0 isn't a group

Kevin Buzzard (Sep 23 2024 at 06:16):

I can recommend ZMod n

Kevin Buzzard (Sep 23 2024 at 06:17):

Or Fin (n+1) if you are convinced it's Fin you want even though you want a group structure

Daniel Weber (Sep 23 2024 at 06:18):

It is a concrete Fin 31, but there's no AddGroup instance for it

Daniel Weber (Sep 23 2024 at 06:20):

Is there anything convenient to convert from Fin to ZMod and vice versa? I get my input as Fin, so if I want to use ZMod I'll have to convert to it

Yaël Dillies (Sep 23 2024 at 06:21):

Daniel Weber said:

It is a concrete Fin 31, but there's no AddGroup instance for it

Try adding NeZero 31 to your context

Yaël Dillies (Sep 23 2024 at 06:22):

Daniel Weber said:

Is there anything convenient to convert from Fin to ZMod and vice versa? I get my input as Fin, so if I want to use ZMod I'll have to convert to it

ZMod 31 is defined as Fin 31 (and all operations agree

Daniel Weber (Sep 23 2024 at 06:23):

Wouldn't using that be defeq abuse?

Kevin Buzzard (Sep 23 2024 at 06:24):

You can't call a definition defeq abuse surely

Daniel Weber (Sep 23 2024 at 06:24):

Oh, I see there's docs#Fin.instCommRing, but I didn't find it because I was missing the import and loogling for AddGroup, Fin doesn't find it :man_facepalming:

Kevin Buzzard (Sep 23 2024 at 06:25):

Yeah this is an annoying consequence of the current "minimise imports" culture, it also minimises the chance that you've got the correct stuff imported to actually prove what you've just stated


Last updated: May 02 2025 at 03:31 UTC