Zulip Chat Archive

Stream: lean4

Topic: Synthesising Decidable.


Wrenna Robson (Oct 10 2025 at 15:15):

Suppose a proposition depending on a variable t has two instance of Decidable defined for it, but one of them depends on the typeclass [MyClass t] being availiable - it's more efficient, so essentially if it IS possible to use this instance for deciding the proposition, that is preferred. Will Lean automatically use the more-specific instance if it is available? Is there a way to make sure it does?

Kenny Lau (Oct 10 2025 at 15:16):

instance (priority := 100)

Wrenna Robson (Oct 10 2025 at 15:16):

On which one?

Kenny Lau (Oct 10 2025 at 15:17):

on the less specific one

Wrenna Robson (Oct 10 2025 at 15:17):

Great, thanks.

François G. Dorais (Oct 12 2025 at 03:45):

instance (priority := low) is more intuitive.


Last updated: Dec 20 2025 at 21:32 UTC