Skip to content

Commit

Permalink
refactor: Multiplicativise abs (#9553)
Browse files Browse the repository at this point in the history
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 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 in `Algebra.Order.Group.Abs`!

This PR changes the notation typeclass with two new definitions (related through `to_additive`): `mabs` and `abs`. `abs` inherits the `|a|` notation and `mabs` gets `|a|ₘ` instead.

The first half of `Algebra.Order.Group.Abs` gets multiplicativised. A later PR will multiplicativise the second half,  and another one will deduplicate the lemmas in `Algebra.Order.Group.PosPart`.

Part of #9411.




Co-authored-by: Jeremy Tan Jie Rui <reddeloostw@gmail.com>
  • Loading branch information
YaelDillies and Parcly-Taxel committed Jan 13, 2024
1 parent c0a2a52 commit cc7c881
Show file tree
Hide file tree
Showing 30 changed files with 351 additions and 490 deletions.
1 change: 0 additions & 1 deletion Mathlib.lean
@@ -1,4 +1,3 @@
import Mathlib.Algebra.Abs
import Mathlib.Algebra.AddTorsor
import Mathlib.Algebra.Algebra.Basic
import Mathlib.Algebra.Algebra.Bilinear
Expand Down
80 changes: 0 additions & 80 deletions Mathlib/Algebra/Abs.lean

This file was deleted.

0 comments on commit cc7c881

Please sign in to comment.