Zulip Chat Archive

Stream: lean4

Topic: exact? errors


Shreyas Srinivas (Nov 19 2024 at 00:04):

The following is an #mwe for the errors I am encountering:

import Mathlib


example {α : Type} :  x y : α, x  y  Disjoint ({x} : Finset α) ({y} : Finset α )  := by
  -- exact?
  -- Below is the proof deduced by exact?
  exact fun x y a => (fun {α} {a b} => Finset.disjoint_singleton.mpr) a
  sorry



example {α : Type} :  x y : α, x  y  Disjoint ({x} : Finset α) ({y} : Finset α )  := by
  -- exact?
  -- Below is the correct proof
  exact fun x y a => (Finset.disjoint_singleton.mpr) a

Shreyas Srinivas (Nov 19 2024 at 00:05):

why is exact? adding some extra binders?

Shreyas Srinivas (Nov 19 2024 at 00:23):

I should point out that it exact? continues to work very well when I intro everything

Eric Wieser (Nov 19 2024 at 00:30):

To be fair, exact? really is finding that proof, the pretty-printing just doesn't round-trip:

theorem foo {α : Type} :  x y : α, x  y  Disjoint ({x} : Finset α) ({y} : Finset α )  := by
  exact?

#print foo

Shreyas Srinivas (Nov 19 2024 at 00:32):

It's a bit more weird. See the "observe errors" thread below this one

Shreyas Srinivas (Nov 19 2024 at 00:32):

I recall that observe is similar to exact? inside a have

Eric Wieser (Nov 19 2024 at 00:33):

Interestingly even set_option pp.all true fails to round-trip here

Eric Wieser (Nov 19 2024 at 00:47):

I filed lean4#6122

Markus Himmel (Nov 19 2024 at 04:42):

Is this a duplicate of lean4#5407 ?

Kevin Buzzard (Nov 19 2024 at 05:33):

Does doing all the intros first fix this problem? This has come up before and sensible intros was a workaround for the previous example

Shreyas Srinivas (Nov 19 2024 at 09:34):

Oh it does. I already mentioned it above


Last updated: May 02 2025 at 03:31 UTC