Zulip Chat Archive

Stream: lean4

Topic: instances of nat


Jiatong Yang (Sep 21 2022 at 03:50):

def isSame (l : List ℕ) : Bool := l.all (λx => x == l.head!)
Why Lean4 cannot synthesize instance Inhabited ℕ or BEq ℕ?

Mario Carneiro (Sep 21 2022 at 04:19):

because the syntax is not declared (it probably looks blue / variable colored in vscode)

Mario Carneiro (Sep 21 2022 at 04:20):

it's spelled Nat if you don't have mathlib4 imported

Jiatong Yang (Sep 21 2022 at 05:45):

Oh, thank you!

Jiatong Yang (Sep 21 2022 at 05:58):

I prefer lean4's syntax, but it seems that it is still a long time before mathlib4 can be put into use. :sob:

Jiatong Yang (Sep 21 2022 at 05:59):

Is there a way to use lean3's mathlib in lean4?

Scott Morrison (Sep 21 2022 at 06:29):

Jiatong Yang said:

Is there a way to use lean3's mathlib in lean4?

We're working on it... :-) But it's a huge task, with many moving parts. Have a look at the stream mathlib4 for progress.


Last updated: Dec 20 2023 at 11:08 UTC