Zulip Chat Archive

Stream: mathlib4

Topic: BitVec lemmas


Jakob von Raumer (Dec 28 2024 at 12:12):

I agree with the sentiment behind keeping the lemmas about BitVec in mathlib at a minimum, but shouldn't we at least have the ring iso to ZMod (2 ^ m) in there as an off-bridge? Right now it seems it's a CommRing instance without any algebraic properties proven about it? /cc @Kim Morrison @Alex Keizer @Patrick Massot

Eric Wieser (Dec 28 2024 at 13:24):

That equivalence is not true when m=0

Eric Wieser (Dec 28 2024 at 13:24):

I'd expect the iso with Fin (2^m) though

Eric Wieser (Dec 28 2024 at 13:26):

If you want Zmod then I'd expect you to have to compose with another iso

Jakob von Raumer (Dec 28 2024 at 13:31):

Shouldn't all algebraic statements rather be about ZMod? I thought the ring structure on Fin is more or less only defined to then put it on ZMod

Jakob von Raumer (Dec 28 2024 at 13:32):

Hm, though I guess both have their applications in terms of what the zero case should be

Eric Wieser (Dec 28 2024 at 13:56):

The nice thing about the Fin spelling is that the simplification lemmas can reduce the iso to ofFin and toFin, without needing to introduce new ofZMod and toZMod

Patrick Massot (Dec 28 2024 at 17:57):

I have no opinion about BitVec except I know that having BitVec stuff in Mathlib is annoying to the FRO.

Eric Wieser (Dec 28 2024 at 18:02):

Given we have the Ring instance in mathlib, I think a PR to add the corresponding RingEquiv alongside it would be very reasonable

Jakob von Raumer (Dec 29 2024 at 12:18):

Will do!

Jakob von Raumer (Dec 29 2024 at 12:58):

#20322


Last updated: May 02 2025 at 03:31 UTC