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

apply_rules with discharger #3844

Open
hrmacbeth opened this issue May 8, 2023 · 0 comments
Open

apply_rules with discharger #3844

hrmacbeth opened this issue May 8, 2023 · 0 comments

Comments

@hrmacbeth
Copy link
Member

Using apply_rules with a discharger is a cheap way to write a nontrivial tactic. This worked before #3480 but now seems to be broken:

import Mathlib.Tactic.Positivity
import Mathlib.Tactic.SolveByElim

open Lean Mathlib

def PositivityDischarge (g : MVarId) : MetaM (Option (List MVarId)) :=
do Meta.Positivity.positivity g; pure (some []) <|> pure none

-- works
example (x : ℤ) : 0 ≤ x ^ 2 := by
  solve_by_elim (config := { discharge := PositivityDischarge })

-- fails
example (x : ℤ) : 0 ≤ x ^ 2 := by
  solve_by_elim (config := { discharge := PositivityDischarge, backtracking := false })

-- fails
example (x : ℤ) : 0 ≤ x ^ 2 := by
  apply_rules (config := { discharge := PositivityDischarge })

See Zulip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

1 participant