Commit 2024-01-13 13:48 cc7c881a
View on Github →refactor: Multiplicativise abs
(#9553)
The current design for abs
is flawed:
- The
Abs
notation 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
Abs
instances!
- We can't write a meaningful hover for
- We have the multiplicative definition but:
- All the lemmas in
Algebra.Order.Group.Abs
are 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
):mabs
andabs
.abs
inherits the|a|
notation andmabs
gets|a|ₘ
instead. The first half ofAlgebra.Order.Group.Abs
gets 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