Zulip Chat Archive
Stream: new members
Topic: Something like `linarith` or `ring` for basic set theory?
Stuart Presnell (Aug 09 2021 at 12:39):
We have tactics like linarith
and ring
to automatically fill in proofs of basic equations and inequalities in arithmetic. Is there a corresponding tactic for proving basic equations and inclusions in set theory (things involving unions, intersections, sdiffs, complements etc.) ?
Johan Commelin (Aug 09 2021 at 12:41):
I think the group that was working on matroids had such a tactic. But I don't think it landed in mathlib...
Yakov Pechersky (Aug 09 2021 at 12:47):
Would tauto or itauto discharge this? Since such statements are just statements over a (generalized) boolean algebra
Bryan Gin-ge Chen (Aug 09 2021 at 12:55):
Johan Commelin said:
I think the group that was working on matroids had such a tactic. But I don't think it landed in mathlib...
For reference: https://github.com/apnelson1/lean-set-tactic
Stuart Presnell (Aug 09 2021 at 12:57):
I've just tried tauto
and itauto
on example {X : Type*} (S T : set X) : T ⊆ (univ \ S) ∪ (S ∩ T)
and they weren't able to solve it.
Stuart Presnell (Aug 09 2021 at 12:58):
Thanks for the pointer Bryan, I'll take a look at that
Kevin Buzzard (Aug 09 2021 at 13:01):
Does intro x, finish
work?
Stuart Presnell (Aug 09 2021 at 13:01):
Oh, it does :)
Stuart Presnell (Aug 09 2021 at 13:03):
Thanks!
Stuart Presnell (Aug 09 2021 at 13:45):
Two notes for the benefit of anyone finding this thread later:
(1) use ext x, finish
to prove set-theoretic equations; use intro x, finish
to prove subset inclusions.
(2) you may need to re-write or unfold some premises. For example, this approach fails with (hST: S ⊆ T) ⊢ univ \ S ∪ T = univ
, but works if we first use rw subset_def at hST
to change the premise to hST: ∀ (x : X), x ∈ S → x ∈ T
.
Kevin Buzzard (Aug 09 2021 at 13:45):
Another finish
tip is that it doesn't try split
, so if you're proving P <-> Q then you might want to try split; finish
(which sometimes works even when finish
doesn't).
Last updated: Dec 20 2023 at 11:08 UTC