Zulip Chat Archive

Stream: Is there code for X?

Topic: set equality


Bernd Losert (May 17 2022 at 16:35):

I'm looking for the lemma that says that two sets are equal if and only if they have the same members. I can't seem to find it, not even with library_search.

Ruben Van de Velde (May 17 2022 at 16:37):

That's called extensionality, so probably set.ext or use the ext tactic

Kalle Kytölä (May 17 2022 at 16:38):

import set_theory.cardinal.basic -- import something

example (X : Type*) (A B : set X) : A = B  ( x, x  A  x  B) :=
by library_search -- Found: `refine ext_iff`

Bernd Losert (May 17 2022 at 16:38):

Ah, I see it now. I wonder why it gave me such a hard time.

Bernd Losert (May 17 2022 at 16:39):

I was trying this:

example (s t : set α) (heq : s = t) :  x, x  s  x  t := by library_search

Kyle Miller (May 17 2022 at 16:41):

That one is true because you can substitute t for s (by subst heq, cases heq, simp [heq], etc.)

Ruben Van de Velde (May 17 2022 at 16:41):

In that direction, subst heq, probably also works... Yeah, that

Bernd Losert (May 17 2022 at 16:42):

I see. I was trying simp alone and it wasn't working.

Kevin Buzzard (May 17 2022 at 16:50):

simp proves equalities and iff statements but it doesn't look in your tactic state, so simp alone won't know about heq. Probably simp [heq] would work?


Last updated: Dec 20 2023 at 11:08 UTC