Zulip Chat Archive

Stream: new members

Topic: rw inside quantifier


Darij Grinberg (Nov 04 2025 at 20:47):

How do I make Lean's rw do its job inside a quantifier?
Say, I have a goal of the form ... ↔ ∃ a ∈ range (n + 1), .... I want to rewrite the a ∈ range (n + 1) part using mem_range, but without necessarily having avalanche effects elsewhere in the goal (there's simp for that). Is there some "stronger rewrite" for that?

Etienne Marion (Nov 04 2025 at 20:52):

You can use simp_rw.

Kenny Lau (Nov 04 2025 at 20:56):

simp (only) and simp_rw both work for this case.

Darij Grinberg (Nov 04 2025 at 21:01):

Ah, hadn't heard about simp_rw. But it does too much, doesn't it? Can I rewrite only a specific instance?

Ruben Van de Velde (Nov 04 2025 at 21:02):

You can use conv for that

Darij Grinberg (Nov 04 2025 at 21:04):

ah!

Kenny Lau (Nov 04 2025 at 21:05):

btw just in case you didn't know, ∃ a ∈ x, p is sugar for ∃ a, a ∈ x ∧ p

Darij Grinberg (Nov 04 2025 at 21:36):

yep, this is why I was hoping for mem_range to help :)


Last updated: Dec 20 2025 at 21:32 UTC