-
Notifications
You must be signed in to change notification settings - Fork 380
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Merged by Bors] - feat(Mathlib/Data/Nat/Factorial/NatCast): add IsUnit
lemmas
#22237
Conversation
PR summary 5084bccb6eImport changes for modified filesNo significant changes to the import graph Import changes for all files
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems reasonable
maintainer merge
🚀 Pull request has been placed on the maintainer queue by Ruben-VandeVelde. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bors d+
✌️ mariainesdff can now approve this pull request. To approve and merge a pull request, simply reply with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bors d+
Thanks!
✌️ mariainesdff can now approve this pull request. To approve and merge a pull request, simply reply with |
-- TODO: move / golf | ||
theorem natCast_iff_of_charP {n : ℕ} : IsUnit (n : A) ↔ ¬ (p ∣ n) := by | ||
constructor | ||
· rintro ⟨x, hx⟩ | ||
rw [← CharP.cast_eq_zero_iff (R := A), ← hx] | ||
have := CharP.nontrivial_of_char_ne_one (R := A) (Nat.Prime.ne_one Fact.out : p ≠ 1) | ||
exact x.ne_zero | ||
· intro h | ||
rw [ ← ZMod.cast_natCast' (n := p)] | ||
refine ⟨⟨ZMod.cast (n : ZMod p), ZMod.cast (n⁻¹ : ZMod p), ?_, ?_⟩, rfl⟩ | ||
all_goals rw [← ZMod.cast_mul (m := p) dvd_rfl] | ||
· rw [mul_inv_cancel₀ (G₀ := ZMod p), ZMod.cast_one'] | ||
rw [ne_eq, ZMod.natCast_zmod_eq_zero_iff_dvd] | ||
assumption | ||
· rw [inv_mul_cancel₀ (G₀ := ZMod p), ZMod.cast_one'] | ||
rw [ne_eq, ZMod.natCast_zmod_eq_zero_iff_dvd] | ||
assumption |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is now in #22669
bors r+ |
Co-authored-by: AntoineChambert-Loir <[email protected]> Co'authored-by: Eric Wieser [eric-wieser](https://github.com/eric-wieser) Co-authored-by: Eric Wieser <[email protected]>
Pull request successfully merged into master. Build succeeded: |
IsUnit
lemmasIsUnit
lemmas
Co-authored-by: AntoineChambert-Loir [email protected]
Co'authored-by: Eric Wieser eric-wieser