Commit 2026-06-06 05:44 1d780199
View on Github →fix(RingTheory/Valuation): change ValueGroup from taking HomClass to Hom (#36911)
Main description
Following rules described in #mathlib4 > Mathlib's morphism hierarchy @ đź’¬, this PR
- refactors
MonoidWithZeroHom.valueMonoid,MonoidWithZeroHom.valueGroup,MonoidWithZeroHom.ValueGroupâ‚€, andMonoidWithZeroHom.ValueGroupâ‚€.embeddingto take a concreteMonoidWithZeroHomas input instead of aMonoidWithZeroHomClassinstance; - renames
MonoidWithZeroHomClass.toMonoidWithZeroHomtoMonoidWithZeroHom.ofClass - makes
MonoidWithZeroHom.ofClassno longer an instance.
What we gain
As a result, we are able to remove several erw and many set_option backward.isDefEq.respectTransparency false in.
Foreseen problems and its solution
The trade-off is that now definitions taking a MonoidWithZeroHom as input can no longer take a valuation v directly. The fix (foreseen by the same zulip thread) is that we write an explicit coercion .ofClass v replacing v. A simple replacement solves the problem in most of the cases. e.g. ValueGroupâ‚€ (.ofClass (Valued.v (R := R))) instead of ValueGroupâ‚€ (Valued.v (R := R)).
Things not implemented in this PR:
MonoidHom.mrangestill takes aMonoidHomClass. This should be refactored together with renamingMonoidHomClass.toMonoidHomtoMonoidHom.ofClassin the future.