Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing withAssignableSyntheticOpaque for assumption tactic? #2361

Closed
kmill opened this issue Jul 27, 2023 · 1 comment · Fixed by #2596
Closed

Missing withAssignableSyntheticOpaque for assumption tactic? #2361

kmill opened this issue Jul 27, 2023 · 1 comment · Fixed by #2596
Assignees

Comments

@kmill
Copy link
Collaborator

kmill commented Jul 27, 2023

When you use refine in place of constructor, then the metavariables you get are all synthetic opaque. If you focus on a later goal, then you cannot use assumption to assign both the goal and a preceding metavariable since this causes it to fail the isDefEq check.

import Lean

example {α : Type} {P : α → Prop} (a : α) (h : P a) : ∃ x, P x := by
  constructor
  assumption -- succeeds

example {α : Type} {P : α → Prop} (a : α) (h : P a) : ∃ x, P x := by
  refine ⟨?m, ?c⟩
  case c =>
    /-
    α : Type
    P : α → Prop
    a : α
    h : P a
    ⊢ P ?m
    -/
    assumption -- fails

open Lean Elab Tactic Meta in
elab "assumption'" : tactic => do
  liftMetaTactic fun mvarId => withAssignableSyntheticOpaque do mvarId.assumption; pure []

example {α : Type} {P : α → Prop} (a : α) (h : P a) : ∃ x, P x := by
  refine ⟨?m, ?c⟩
  case c => assumption' -- succeeds
@semorrison
Copy link
Collaborator

@kmill, I made #2596 following this suggestion. Mathlib builds fine. Would you be interested in adding a few tests?

@semorrison semorrison self-assigned this Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants