Zulip Chat Archive

Stream: mathlib4

Topic: exact? failing to find a lemma which closes the goal


Bhavik Mehta (Nov 10 2023 at 19:32):

import Mathlib.Data.Set.Lattice
import Mathlib.Tactic.LibrarySearch

example {α : Type*} {s t : Set α} : Disjoint (t  s) (t \ s) := by exact?

This exact? call fails, but disjoint_inf_sdiff closes the goal directly. Why does exact? struggle here?

Ruben Van de Velde (Nov 10 2023 at 19:48):

Probably because of the difference between inf and inter

Bhavik Mehta (Nov 10 2023 at 19:49):

Ah I assumed that it was smart enough to see through that defeq, but I guess in general that's too slow. Cases like this seem unhelpful for beginners...

Ruben Van de Velde (Nov 10 2023 at 19:50):

Clearly we should drop the set notation :innocent:

Yaël Dillies (Nov 10 2023 at 19:52):

cc @Kyle Miller whom I talked about this with

Ruben Van de Velde (Nov 10 2023 at 20:01):

Or if we're entertaining heretical ideas, use \cup and \cap for lattice operations

Yaël Dillies (Nov 10 2023 at 20:04):

Our idea with Kyle was to kill the set-specific operators and let lattice notation delaborate to it instead.

Yaël Dillies (Nov 10 2023 at 20:05):

Then we'd only have and in the terms, but we would keep and in the infoview.

Scott Morrison (Nov 11 2023 at 00:14):

Thereby making copy and paste unnecessarily dangerous? :-)

Scott Morrison (Nov 11 2023 at 00:15):

Bhavik Mehta said:

Ah I assumed that it was smart enough to see through that defeq, but I guess in general that's too slow. Cases like this seem unhelpful for beginners...

Now that exact? is so much faster than in Lean 3, it might be possible to let it see though more defeq. Someone should try!

Yaël Dillies (Nov 11 2023 at 07:26):

Scott Morrison said:

Thereby making copy and paste unnecessarily dangerous? :-)

How so? That would only be a problem if you copy-pasted a Set expression and used it as a Lattice expression (which is already a problem currently). You will still be able to input code using // It just won't show up differently from / in the term.


Last updated: Dec 20 2023 at 11:08 UTC