Open kim-em opened 1 year ago
Should
example (p q : Prop) : (p ↔ q) ↔ (¬p ↔ ¬q) := by library_search
work? The flipped version successfully finds not_iff_not
, and I thought library_search
was meant to handle the symmetric versions of lemmas.
import Mathlib.Data.Fintype.Sigma
import Mathlib.Tactic.LibrarySearch
instance [Fintype α] (f : α ≃ β) : Fintype β := by library_search
-- suggestion: refine { elems := ?_ (id (Equiv.symm f)), complete := (_ : ∀ (x : β), x ∈ ?_) }
@semorrison I hope you don't mind that I hijacked your first comment here to keep track of some Zulip threads where I reported issues.
import Mathlib
example {n : ℕ} : n = 0 ∨ 0 < n := by exact? -- Fails to find `eq_zero_or_pos`
including reply from @dwrensha pointing out that this is a consequence of the isInternal'
heuristic here: https://github.com/leanprover-community/mathlib4/blob/a1451be4b1cafd4d5e780a690b9e26c8891d3220/Mathlib/Lean/Expr/Basic.lean#L97
import Mathlib.Tactic
example (h : ¬P ∨ Q) (h' : P) : Q := by exact? -- fails
example (h : ¬P ∨ Q) (h' : P) : Q := imp_iff_not_or.mpr h h'
@grhkm21 I believe this is an intentional limitation: some lemmas apply to every goal, and for performance reasons they are not tried by exact?
. Your example is one such lemma.
But it might well be possible to re-enable trying these universal lemmas, as in the current model they would be tried last, and we have an automatic mechanism to stop before reaching a timeout. Someone should try!
import Mathlib
example (x y c : ℝ) (h: 0 < c) : x < y → c * x < c * y := by exact?
suggests the malformed term
exact fun a =>
(fun {α} {a b c} [Mul α] [Zero α] [Preorder α] [PosMulStrictMono α] [PosMulReflectLT α] a0 =>
(mul_lt_mul_left a0).mpr)
h a
Please list bugs in these tactics here.
apply?
suggestionrw?
errors and panicsapply?
cache corrupts on update