Zulip Chat Archive

Stream: new members

Topic: Getting "unknown identifier 'ℕ'" on #check ℕ


Ritobrata Ghosh (May 07 2024 at 20:45):

I have done all the setup as mentioned in the getting started tutorials. But I am getting this error.

#check 2 works as expected.
But the same problem also persists for pi-

#check π

leads to

unknown identifier 'π'

But, instead of ℕ, if I use #check Nat, it works as expected, and I get- "Nat : Type".

What is this problem, and how do I resolve it?

Kyle Miller (May 07 2024 at 20:57):

The notation is defined in mathlib. You can get it if you import nearly anything from mathlib (provided you have mathlib as part of your project), and the minimal import is import Mathlib.Init.Data.Nat.Notation

Kyle Miller (May 07 2024 at 20:58):

It looks like the notation for docs#Real.pi comes from Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic, and to activate it you further have to do open scoped Real

Ritobrata Ghosh (May 09 2024 at 18:40):

Kyle Miller said:

The notation is defined in mathlib.

I just did import Mathlib and restarted the file, and it worked very well.

Thanks for the help.


Last updated: May 02 2025 at 03:31 UTC