Zulip Chat Archive
Stream: Is there code for X?
Topic: How to prove that a specific integer is irreducible
Daniel Weber (Sep 07 2024 at 14:57):
How do I prove Irreducible (47 : ℤ)
? I know how to do it as a natural number, but I can't find lemmas for getting that as an integer
import Mathlib.Algebra.Associated.Basic
import Mathlib.Algebra.Group.Int
import Mathlib.Data.Nat.Prime.Defs
import Mathlib.Tactic.NormNum.Prime
example : Irreducible 47 := by rw [Nat.irreducible_iff_nat_prime]; norm_num
example : Irreducible (47 : ℤ) := by sorry
Michael Stoll (Sep 07 2024 at 15:02):
import Mathlib.RingTheory.Int.Basic
import Mathlib.Tactic.NormNum.Prime
example : Irreducible 47 := by rw [Nat.irreducible_iff_nat_prime]; norm_num
example : Irreducible (47 : ℤ) := by
rw [irreducible_iff_prime, Int.prime_iff_natAbs_prime]
norm_num
Note that there are more imports.
Daniel Weber (Sep 07 2024 at 15:06):
Thanks
Michael Stoll (Sep 07 2024 at 15:09):
(It turns out that the first two imports, even though listed by #min_imports
, are not necessary. Edited the code above accordingly.)
Last updated: May 02 2025 at 03:31 UTC