Zulip Chat Archive
Stream: general
Topic: recursive rw
Bernd Losert (Apr 25 2022 at 21:07):
Say I have ¬ (∃ (U ∈ f) (V ∈ g), U ∩ V = ∅)
and I want to apply rw not_exists
recursively to it. How do I do this?
Patrick Stevens (Apr 25 2022 at 21:09):
Does repeat { rw not_exists, }
do what you want?
Patrick Stevens (Apr 25 2022 at 21:09):
(Actually iterate { rw not_exists, }
may be better, and it also lets you specify an n
)
Bernd Losert (Apr 25 2022 at 21:12):
No, it does not seem to work.
Yaël Dillies (Apr 25 2022 at 21:12):
Why do you get this in the first place? Did you use by_contra
instead of by_contra'
?
Yaël Dillies (Apr 25 2022 at 21:12):
simp_rw not_exists
Bernd Losert (Apr 25 2022 at 21:13):
That worked. Nice.
Yaël Dillies (Apr 25 2022 at 21:13):
The problem with repeat { rw not_exists }
is that rw
does not look under binders, and ∃
is a binder, so it will only rewrite the first one.
Bernd Losert (Apr 25 2022 at 21:14):
I got it from using iff.not
on filter.inf_eq_bot_iff
.
Patrick Johnson (Apr 25 2022 at 21:14):
Bernd Losert (Apr 25 2022 at 21:16):
That's even better.
Kyle Miller (Apr 25 2022 at 21:48):
Yaël Dillies said:
rw
does not look under binders
A reminder that rw
does look under binders, it just can't rewrite subexpressions that contain local variables. simp
can do it because it knows about funext
.
Yaël Dillies (Apr 25 2022 at 21:48):
Sorry, never know how to put it best!
Kyle Miller (Apr 25 2022 at 21:49):
"can't look under binders" is a good meme, so it's too bad it's inaccurate.
Last updated: Dec 20 2023 at 11:08 UTC