Zulip Chat Archive
Stream: lean4
Topic: instance declaration rfl error
Shreyas Srinivas (Sep 26 2024 at 13:02):
When declaring an instance of a complete lattice for a type I started by sorry
ing out all fields. However I get the usual rfl
error :
The rfl tactic failed. Possible reasons:
- The goal is not a reflexive relation (neither `=` nor a relation with a @[refl] lemma).
- The arguments of the relation are not equal.
Try using the reflexivity lemma for your relation explicitly, e.g. `exact Eq.refl _` or
`exact HEq.rfl` etc.
Shreyas Srinivas (Sep 26 2024 at 13:03):
This makes no sense to me since I haven't even applied rfl
Shreyas Srinivas (Sep 26 2024 at 13:03):
I don't have a good #mwe yet since I don't know where the error is coming from
Matthew Ballard (Sep 26 2024 at 13:04):
Autoparams are being filled somewhere by rfl
most likely
Matthew Ballard (Sep 26 2024 at 13:05):
If you use the code action for the maximal skeleton, you should be able to track it down
Shreyas Srinivas (Sep 26 2024 at 13:05):
how do I trigger this code action?
Matthew Ballard (Sep 26 2024 at 13:06):
instance x : MyClass := _
I think
Matthew Ballard (Sep 26 2024 at 13:06):
The :light_bulb: should pop over the hole
Shreyas Srinivas (Sep 26 2024 at 13:08):
okay so I need to use the :=
instead of where
clause to trigger it
Shreyas Srinivas (Sep 26 2024 at 13:09):
I didn't get it when I tried with where
Shreyas Srinivas (Sep 26 2024 at 13:10):
While I trace down the issue, I am wondering if the code action could be made to work with where
Shreyas Srinivas (Sep 26 2024 at 13:11):
It just looks neater to my haskell brain
Matthew Ballard (Sep 26 2024 at 13:14):
That is reasonable request though you might want where?
or something maybe.
Shreyas Srinivas (Sep 26 2024 at 13:18):
So this was a case of accidentally putting \subset where I really wanted \ssubset. But I was able to use inferInstance
and make the whole issue go away
Last updated: May 02 2025 at 03:31 UTC