Zulip Chat Archive

Stream: maths

Topic: 7 is prime?


Geno Racklin Asher (Jul 01 2023 at 23:00):

In the following example from the book Mathematics in Lean, why is norm_num unable to determine the primality of 7?

example :  m n : , 4 < m  m < n  n < 10  Nat.Prime m  Nat.Prime n := by
  use 5
  use 7
  norm_num
  sorry

Geno Racklin Asher (Jul 01 2023 at 23:05):

Ah, apparently I needed to import Mathlib.Tactic.NormNum.Prime as well as just the base tactic.

Kyle Miller (Jul 01 2023 at 23:20):

(Mathematics in Lean needs to be updated here. The book was ported to Lean 4 recently, and the Prime norm num extension was ported at about the same time, but it was put in a different module from where it used to be. I created an issue to track this.)

Kevin Buzzard (Jul 02 2023 at 03:10):

@Geno Racklin Asher just import Mathlib.Tactic if you want to get all the useful tactics.

Patrick Massot (Jul 02 2023 at 08:57):

I'm sorry about this inconvenience. I just added import Mathlib.Tactic on top of every file in the book.

Kevin Buzzard (Jul 03 2023 at 08:59):

@Patrick Massot this has broken the book. For example in chapter 7 section 1 the local notation notation "𝟙" => One₁.one conflicts with category theory notation, and in chapter 3 section 4 Import Tactic makes norm_num better and it closes a goal too early.

Patrick Massot (Jul 03 2023 at 09:01):

:sad: we really need proper CI for this project... I'm sorry

Patrick Massot (Jul 03 2023 at 09:03):

That being said, I really understand why important Mathlib.Tactic needs category theory...

Patrick Massot (Jul 03 2023 at 09:05):

And category theory also takes 𝟭

Patrick Massot (Jul 03 2023 at 09:05):

We really need to get rid of the habit of putting such notations in the root namespace.

Kevin Buzzard (Jul 03 2023 at 09:28):

If you just remove import Mathlib.Tactic from those two files, it compiles again.

Patrick Massot (Jul 03 2023 at 09:34):

I pushed fixes already.

Patrick Massot (Jul 03 2023 at 09:35):

And I'm currently recompiling mathlib4 with the proper fix.

Sebastien Gouezel (Jul 03 2023 at 09:35):

If you PR a change putting the category theory notations in a namespace and open this namespace in the relevant files, I am sure category theory people will be happy to merge it.

Patrick Massot (Jul 03 2023 at 09:38):

Yes, I'm simply adding scoped at the beginning of a couple of lines in CategoryTheory.Category.Basic. And so far I found only one file where you need to add open CategoryTheory (the sheafify file).

Patrick Massot (Jul 03 2023 at 09:49):

I opened #5685. The final count is that two files needed an extra open CategoryTheory.


Last updated: Dec 20 2023 at 11:08 UTC