Zulip Chat Archive

Stream: general

Topic: squeeze_erw


Scott Morrison (Jun 28 2020 at 00:19):

The rw technology I'd most love would be squeeze_erw that gave some hint why an erw was necessary rather than a rw.

Simon Hudon (Jun 28 2020 at 00:20):

Yes, I'm with you on that. I have no idea where to begin there

Scott Morrison (Jun 28 2020 at 00:20):

I tried thinking about it at one point, and it seemed hard. :-)

Simon Hudon (Jun 28 2020 at 00:21):

Actually, for squeeze_erw, maybe we could start with erw h, rw <- h and then do a diff. We'd expect to land back on the initial state but the differences should be telling

Scott Morrison (Jun 28 2020 at 00:24):

Huh!

Simon Hudon (Jun 28 2020 at 00:25):

I'm not sure how to translate those differences into something the user can find helpful

Scott Morrison (Jun 28 2020 at 00:26):

Can we do a convert to compare the initial and final terms?

Simon Hudon (Jun 28 2020 at 00:33):

I like the idea but because the two terms should be definitionally equal, congr should close the proof with refl. We might need a customized version of convert / congr that refrains from using refl unless we have syntactic equality.

Simon Hudon (Jun 28 2020 at 00:37):

Maybe that could get us to a series of equalities of the form f x y z = _ where we need to unfold f

Simon Hudon (Jun 28 2020 at 00:38):

We might want to advise to user to do unfold f before the rewrite but it might also mess our opportunity to rewrite

Simon Hudon (Jun 28 2020 at 00:39):

Do we have in Lean the equivalent of rewrite _ at 3 in Coq? That would allow us to have very targeted pieces of advice

Bryan Gin-ge Chen (Jun 28 2020 at 00:47):

There's rw _ {occs := occurrences.pos [3]} as I recently learned.

Simon Hudon (Jun 28 2020 at 00:54):

Has this been there all along?

Reid Barton (Jun 28 2020 at 00:57):

Yes

Simon Hudon (Jun 28 2020 at 01:08):

Uh! I learn every day

Johan Commelin (Jun 28 2020 at 04:07):

Simon Hudon said:

Do we have in Lean the equivalent of rewrite _ at 3 in Coq? That would allow us to have very targeted pieces of advice

And there is nth_rewrite


Last updated: Dec 20 2023 at 11:08 UTC