Commit 2024-01-13 13:48 cc7c881a
View on Github →refactor: Multiplicativise abs (#9553)
The current design for abs is flawed:
- The
Absnotation typeclass has exactly two instances: one for[Neg α] [Sup α], one for[Inv α] [Sup α]. This means that:- We can't write a meaningful hover for
Abs.abs - Fields have two
Absinstances!
- We can't write a meaningful hover for
- We have the multiplicative definition but:
- All the lemmas in
Algebra.Order.Group.Absare about the additive version. - The only lemmas about the multiplicative version are in
Algebra.Order.Group.PosPart, and they get additivised to duplicates of the lemmas inAlgebra.Order.Group.Abs! This PR changes the notation typeclass with two new definitions (related throughto_additive):mabsandabs.absinherits the|a|notation andmabsgets|a|ₘinstead. The first half ofAlgebra.Order.Group.Absgets multiplicativised. A later PR will multiplicativise the second half, and another one will deduplicate the lemmas inAlgebra.Order.Group.PosPart. Part of #9411.
- All the lemmas in