Repository navigation
feat(Algebra/Group/Units/Hom): the units of a torsion-free monoid are torsion-free - #46840
MichaelStollBayreuth wants to merge 2 commits into
Conversation
PR summary 0557a282deImport changes for modified filesNo significant changes to the import graph Import changes for all files
|
|
!radar |
|
Benchmark results for 0a54377 against 5d21013 are in. No significant results found. @MichaelStollBayreuth
Small changes (3✅, 9🟥)
|
| instance instIsMulTorsionFree [IsMulTorsionFree M] : IsMulTorsionFree Mˣ := | ||
| coeHom_injective.isMulTorsionFree _ | ||
|
|
||
| @[to_additive AddUnits.instHasUniqueDiv] -- the dictionary gives `insthasUniqueDiv` | ||
| instance instHasUniqueRoots [HasUniqueRoots M] : HasUniqueRoots Mˣ := |
There was a problem hiding this comment.
I would suggest not naming them at all:
| instance instIsMulTorsionFree [IsMulTorsionFree M] : IsMulTorsionFree Mˣ := | |
| coeHom_injective.isMulTorsionFree _ | |
| @[to_additive AddUnits.instHasUniqueDiv] -- the dictionary gives `insthasUniqueDiv` | |
| instance instHasUniqueRoots [HasUniqueRoots M] : HasUniqueRoots Mˣ := | |
| instance [IsMulTorsionFree M] : IsMulTorsionFree Mˣ := | |
| coeHom_injective.isMulTorsionFree _ | |
| @[to_additive] | |
| instance [HasUniqueRoots M] : HasUniqueRoots Mˣ := |
Unless you have a very specific use case that needs their names.
There was a problem hiding this comment.
I guess it's not within scope of this PR, but since it's so short, why not change the second projection of line 344 in Mathlib/Tactic/Translate/ToAdditive.lean from hasUniqueDiv to HasUniqueDiv. :)
There was a problem hiding this comment.
I would suggest not naming them at all
OK; I don't think we need to refer to them explicitly.
I guess it's not within scope of this PR, but since it's so short, why not change the second projection of line 344 in
Mathlib/Tactic/Translate/ToAdditive.leanfromhasUniqueDivtoHasUniqueDiv. :)
I can do that, but I think this is better done separately. Claude tells me that it needs a couple further edits (e.g., in attribute [to_additive existing HasUniqueDiv] HasUniqueRoots, the existing part is then no longer necessary and in fact gives a warning or error).
|
Opus tells me these instances give a loop: To reproduce: import Mathlib.Algebra.GroupWithZero.Torsion
import Mathlib.RingTheory.Int.Basic
set_option pp.explicit true in
set_option trace.Meta.synthInstance true in
example : HasUniqueRoots ℤ := inferInstanceRadar doesn't show any slowdowns, because presumably there aren't many files that import both? Maybe this is OK. |
|
Loops in instance search should be OK; they should be broken automatically when something repeats. (At least, this is my understanding. It used to be different (in Lean 3?).) |
tb65536
left a comment
There was a problem hiding this comment.
Thanks!
maintainer merge
|
🚀 Pull request has been placed on the maintainer queue by tb65536. |
The units of a torsion-free monoid are torsion-free; the units of a monoid with unique roots have unique roots. We add suitable instances based on the injectivity of
Mˣ →* M.A later PR uses unique roots in
(FractionalIdeal R⁰ K)ˣfor a Dedekind domainR. At present no instance finds them, althoughFractionalIdeal R⁰ Khas unique roots.🤖 Claude Code helped with this PR.
MulOpposite,Prod,PiandSubgrouphave these instances already. They are inUnits/Hom.leanbecauseFunction.Injective.isMulTorsionFreeneedsMonoidHom.