-
Notifications
You must be signed in to change notification settings - Fork 297
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
unexpected failures with omega
#1484
Comments
Additionally, |
Another example of strange behavior: the first one succeeds, the second fails. In other cases, lemma int.pred_ne_self (n : ℤ) : n - 1 ≠ n :=
by intro h; omega
lemma int.pred_ne_self' (n : ℤ) : n - 1 ≠ n :=
by omega |
I believe that I have also found a case where omega fails to solve the goal. I got error for the lemma: Version: 1.39.2 |
Indeed, that's a bug. Note that
|
omega
@kbuzzard mentioned this example on Zulip: example {X : Type} [fintype X] (n k : ℕ) (hk : k + 1 ≤ n) : n - k = n - (k + 1) + 1 :=
begin
omega
end
|
here is another failure
|
I'm not sure what the expected behavior of -- omega isn't happy with nat division
lemma foo1 (m : ℕ) : m / 3 ≤ m :=
by omega -- failed
-- it's even less happy when you try to help it out.
lemma foo2 (m : ℕ) : m / 3 ≤ m :=
by { have h : m % 3 + 3 * (m / 3) = m := nat.mod_add_div m 3,
omega } -- invalid eval_expr, expression must be closed
-- if you generalize the `/` in `h` it succeeds
lemma foo3 (m p : ℕ) (h : m % 3 + 3 * p = m) : p ≤ m :=
by omega -- succeeds
lemma foo4 (m p : ℕ) (h : m % 3 + 3 * p = m) (h2 : p = m / 3) : m / 3 ≤ m :=
by omega -- succeeds |
Another problem: this one seems easier to fix. example (h : 0 > 1) : false := by omega -- Cannot reify expr : false |
And from #2376 :
|
Gabriel pointed out that as a preprocessing step mathlib/src/tactic/omega/nat/main.lean Line 24 in f723f37
|
…ommunity#1484) (leanprover-community#1620) * Fix omega bugs, add docstring * style(tactic/omega/main): trivial cleaning
…tation (leanprover-community#2377) This is helpful when debugging issues such as leanprover-community#2376 and leanprover-community#1484.
…tation (leanprover-community#2377) This is helpful when debugging issues such as leanprover-community#2376 and leanprover-community#1484.
This is an expected failure, but with an unexpected message: import tactic.omega
example (p : ℕ) : p = p*p := by omega
-- invalid eval_expr, expression must be closed |
( |
…tation (leanprover-community#2377) This is helpful when debugging issues such as leanprover-community#2376 and leanprover-community#1484.
omega
fails when there are things in the context that are not linear inequalities and depend on the nat/int atoms. This makes it way less convenient than one would hope, since it's pretty common to have hypotheses like these floating around, and clearing them manually is a pain.All of the following fail:
@skbaek would it be possible to improve the hypothesis filtering? I don't think it would be hard to check whether an expression is in the language
omega
understands.The text was updated successfully, but these errors were encountered: