Zulip Chat Archive

Stream: new members

Topic: More equality of sets


Pranav cs22b015 (Oct 03 2025 at 10:41):

Is there a nice way to prove the equality of two sets automatically? For example, is there an easy way to show the following

theorem sets_equal: forall (s: Set Int), {b | b  s  {5}  b != 5} = {a | a  s}

Aaron Liu (Oct 03 2025 at 10:46):

docs#Set.ext

Ruben Van de Velde (Oct 03 2025 at 10:54):

And then simp or grind will probably work

Notification Bot (Oct 03 2025 at 10:55):

3 messages were moved here from #new members > Encoding FStar-like sets axiomatically by Ruben Van de Velde.

Rémy Degenne (Oct 03 2025 at 11:02):

Your goal is false by the way. If you fix it, grind solves it.

import Mathlib.Data.Set.Insert

theorem not_sets_equal : ¬  (s: Set Int),
    {b | b  s  {5}  b != 5} = {a | a  s} := by
  push_neg
  use {(5 : )}
  symm
  simp

theorem sets_equal' :  (s: Set Int),
    {b | b  s  {5}  b != 5} = {a | a  s  a  5} := by
  grind

Last updated: Dec 20 2025 at 21:32 UTC