Zulip Chat Archive

Stream: general

Topic: mem_preimage_eq


view this post on Zulip Patrick Massot (Jul 03 2019 at 13:59):

Is there any reason why mem_preimage_eq is stated as an equality rather than an iff? It seems contrary to the mathlib way

view this post on Zulip Chris Hughes (Jul 03 2019 at 14:02):

My guess is because it's stronger in the world without propext.

view this post on Zulip Kenny Lau (Jul 03 2019 at 14:04):

you can blame it on commit 8f4327a by digama0 on 15 Oct 2017:
https://github.com/leanprover-community/mathlib/commit/8f4327ae0c45ed36037beb1449f8285cae1ebe9c#diff-d076c0ad9beb03e207eb6ed5d354f5d5R497

view this post on Zulip Kenny Lau (Jul 03 2019 at 14:04):

or, in other words, it's because the code is 2 years old

view this post on Zulip Chris Hughes (Jul 03 2019 at 14:07):

I guess it means dsimp will use it.

view this post on Zulip Chris Hughes (Jul 03 2019 at 14:07):

Which is handy

view this post on Zulip Patrick Massot (Jul 03 2019 at 14:07):

@Mario Carneiro?

view this post on Zulip Mario Carneiro (Jul 03 2019 at 14:14):

I think it just predates the mathlib convention

view this post on Zulip Patrick Massot (Jul 03 2019 at 14:15):

Would you merge a PR changing this?

view this post on Zulip Mario Carneiro (Jul 03 2019 at 14:15):

also dsimp doesn't use iff.rfl lemmas unfortunately

view this post on Zulip Patrick Massot (Jul 03 2019 at 14:16):

Or maybe adding a mem_preimage_iff lemma if that dsimp thing is important?

view this post on Zulip Mario Carneiro (Jul 03 2019 at 14:16):

@Kenny Lau Actually that's not the origin; you can see it got moved in that commit but predates it

view this post on Zulip Mario Carneiro (Jul 03 2019 at 14:17):

I would merge such a PR

view this post on Zulip Mario Carneiro (Jul 03 2019 at 14:17):

I don't think the dsimp thing is a very big deal

view this post on Zulip Patrick Massot (Jul 03 2019 at 14:17):

Which version? Changing the lemma or adding a new one?

view this post on Zulip Mario Carneiro (Jul 03 2019 at 14:19):

changing the lemma

view this post on Zulip Patrick Massot (Jul 03 2019 at 14:22):

Should the new name be mem_preimage or mem_preimage_iff?

view this post on Zulip Mario Carneiro (Jul 03 2019 at 14:25):

I like mem_preimage if it's not already taken

view this post on Zulip Patrick Massot (Jul 03 2019 at 14:27):

It seems to exists in many namespaces but not the root one

view this post on Zulip Mario Carneiro (Jul 03 2019 at 14:27):

this one should be in the set namespace

view this post on Zulip Patrick Massot (Jul 03 2019 at 14:28):

actually it is

view this post on Zulip Patrick Massot (Jul 03 2019 at 14:28):

I didn't pay attention but this lemma is in the set namespace

view this post on Zulip Patrick Massot (Jul 03 2019 at 14:30):

Ok, let's see what Travis thinks about https://github.com/leanprover-community/mathlib/pull/1174


Last updated: May 13 2021 at 05:21 UTC