Here is a stripped down version of something that is causing me trouble.
variables {α : Type*} [decidable_eq α]
def S (a : α) : set α := λ b, b = a
def P (a : α) : decidable_pred (λ (c : α), c = a) :=
by { apply_instance, }
def Q (a : α) : decidable_pred (λ (c : α), c ∈ (S a)) :=
by { simp[S], apply_instance, }
Lean is happy with the definition of P
, but rejects the definition of Q
as follows:
tactic.mk_instance failed to generate instance for
decidable_pred (λ (c : α), c ∈ λ (b : α), b = a)
state:
α : Type u_1,
_inst_1 : decidable_eq α,
a : α
In both P
and Q
, we ask tactic.mk_instance
to generate a decision procedure for a predicate. The predicate in Q
is equivalent under β-reduction to the one in P
, but tactic.mk_instance
succeeds with P
but fails with Q
. Is this just a weakness in the tactic or is there some more subtle issue? Is there some straightforward way to work around this kind of problem?