Zulip Chat Archive

Stream: Is there code for X?

Topic: rfl using #eval


Kenny Lau (Jul 01 2025 at 20:49):

I know it's potentially unsafe, but is there a version of rfl that uses #eval instead of the kernel? (sorry if i'm mixing up some terms, they still feel like the same thing to me)

Mario Carneiro (Jul 01 2025 at 20:53):

by native_decide

Kenny Lau (Jul 01 2025 at 20:53):

what if the rfl is not decidable?

Mario Carneiro (Jul 01 2025 at 20:54):

then you won't be able to use #eval to prove it

Kenny Lau (Jul 01 2025 at 20:54):

:thinking:

Kenny Lau (Jul 01 2025 at 20:55):

but in the example it's an inductive wrapper around something eval-able

Mario Carneiro (Jul 01 2025 at 20:57):

the issue is that while #eval can interpret a lot of types, it still needs to read the result back into the lean world, and this is difficult in nontrivial cases because the interpreter lost all the typing information. So the kernel primitive that lets you do this is only able to work with reifying elements of Bool and Nat since it's easy to interpret an interpreted value in one of these types. So the way native_decide works is it turns any goal into a check that a bool is equal to true and then runs that in #eval


Last updated: Dec 20 2025 at 21:32 UTC