Commit 2024-09-14 09:22 c4edb0ea
View on Github →refactor: make (Left|Right)Commutative
typeclasses (#16751)
LeftCommutative
and RightCommutative
are currently pure definitions, but they are used in other declarations as if they were typeclasses. As they are not actually typeclasses they have to be passed in explicitly, which causes unnecessary repetition and code bloat.
This PR makes them typeclasses and adds supporting instances: two converted from the theorems left_comm
and right_comm
and two others extracted from Data.Multiset.Basic
. In #16748 they will be moved with the very structurally similar typeclass IsSymmOp
out of Init.Logic
to a new file.
The shaking of this PR revealed some uses of lemmas deprecated in #16438 but not caught by the linter. We fix these too.