[Merged by Bors] - feat(Data/ZMod): coprime_mod_iff_coprime#34500
Closed
metakunt wants to merge 2 commits intoleanprover-community:masterfrom
Closed
[Merged by Bors] - feat(Data/ZMod): coprime_mod_iff_coprime#34500metakunt wants to merge 2 commits intoleanprover-community:masterfrom
metakunt wants to merge 2 commits intoleanprover-community:masterfrom
Conversation
PR summary 01988d5fe9Import changes for modified filesNo significant changes to the import graph Import changes for all files
Declarations diff
You can run this locally as follows## summary with just the declaration names:
./scripts/declarations_diff.sh <optional_commit>
## more verbose report:
./scripts/declarations_diff.sh long <optional_commit>The doc-module for No changes to technical debt.You can run this locally as
|
joneugster
reviewed
Jan 30, 2026
Contributor
There was a problem hiding this comment.
Wouldn't it be better to add the following lemma instead:
@[simp]
lemma coprime_mod_iff_coprime (m n : ℕ) : (m % n).Coprime n ↔ m.Coprime n := by
-- copied from PR, can probably be golfed
suffices (m % n).gcd n = m.gcd n by grind
exact Nat.ModEq.gcd_eq (by simp [Nat.ModEq])then your lemma is simply the following:
lemma coprime_of_cast_of_val_iff_coprime (m n : ℕ) : (m : ZMod n).val.Coprime n ↔ m.Coprime n := by
simp only [val_natCast, coprime_mod_iff_coprime](also could you then reevaluate if the second lemma needs to be added at all, please? Didn't think about it myself)
Collaborator
Author
|
I've removed my lemma and added yours. I spent about 30 minutes trying to golf the proof but failed. |
Contributor
|
Thanks! Sorry I made you waste your time. maintainer merge |
|
🚀 Pull request has been placed on the maintainer queue by joneugster. |
Member
|
Thanks! bors merge |
Contributor
|
Pull request successfully merged into master. Build succeeded: |
YellPika
pushed a commit
to YellPika/mathlib4
that referenced
this pull request
Feb 3, 2026
michaellee94
pushed a commit
to michaellee94/mathlib4
that referenced
this pull request
Feb 15, 2026
Maldooor
pushed a commit
to Maldooor/mathlib4
that referenced
this pull request
Feb 25, 2026
pfaffelh
pushed a commit
to pfaffelh/mathlib4
that referenced
this pull request
Mar 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.