Zulip Chat Archive

Stream: general

Topic: ne.def


Johan Commelin (Sep 10 2020 at 03:11):

Would it be evil to teach rw about ne.def? I find it quite frustrating that rw fails because I have \ne instead of a \not _ = _ or vice versa.

Jalex Stark (Sep 10 2020 at 11:38):

I guess to combat the evilness we want a story for how to avoid scope creep that turns rw into simp_rw or something else it's not supposed to be. Maybe something like "we teach it only about 'basic logic synonyms'"?

Reid Barton (Sep 10 2020 at 11:50):

What's an example where this is an issue? As far as I can tell ne is reducible and rw should already look through reducible things.

Johan Commelin (Sep 10 2020 at 11:51):

If you have \not n = 0, and you want to rw \l nat.pos_iff_ne_zero, that seems to fail. Let me build a mwe

Reid Barton (Sep 10 2020 at 11:51):

I guess there are two possible cases: the goal contains a \ne b but you want to rewrite using a lemma that says a = b \iff ...; or the goal contains \not (a = b) but you want to rewrite using a lemma that says a \ne b \iff

Johan Commelin (Sep 10 2020 at 11:53):

https://leanprover-community.github.io/lean-web-editor/#code=import%20data.nat.basic%0A%0Aexample%20%28n%20%3A%20%E2%84%95%29%20%28h%20%3A%20%C2%AC%20n%20%3D%200%29%20%3A%20n%20%3E%200%20%3A%3D%0Abegin%0A%20%20rw%20%E2%86%90%20nat.pos_iff_ne_zero%20at%20h%2C%0Aend

Kevin Buzzard (Sep 10 2020 at 11:54):

lemma ne1 (n : ) : n  0  true := sorry
lemma ne2 (n : ) : ¬(n = 0)  true := sorry

example (n : ) : n  0  false :=
begin
  rw ne2, -- fails
end

example (n : ) : ¬ (n = 0)  false :=
begin
  rw ne1, -- fails
end

They're both failing for me.

Reid Barton (Sep 10 2020 at 11:55):

I wonder what md := reducible in rewrite_cfg does then

Reid Barton (Sep 10 2020 at 11:56):

actually even erw fails, and even if you tell it n

Kevin Buzzard (Sep 10 2020 at 13:28):

Has this always been the case?


Last updated: Dec 20 2023 at 11:08 UTC