feat: omega doesn't get stuck on bare Int.negSucc (#6276)

This PR ensures `omega` doesn't get stuck on bare `Int.negSucc` terms in
goals.

This came up in https://github.com/ImperialCollegeLondon/FLT/pull/260.
This commit is contained in:
Kim Morrison 2024-12-02 10:57:15 +11:00 committed by GitHub
parent 6bf8ff32f0
commit 29e84fa7ea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 0 deletions

View file

@ -228,6 +228,7 @@ partial def asLinearComboImpl (e : Expr) : OmegaM (LinearCombo × OmegaM Expr ×
| .app (.app (.app (.app (.const ``Prod.mk [u, v]) _) _) x) y =>
rewrite e (mkApp4 (.const ``Prod.snd_mk [u, v]) α x β y)
| _ => mkAtomLinearCombo e
| (``Int.negSucc, #[n]) => rewrite e (mkApp (.const ``Int.negSucc_eq []) n)
| _ => mkAtomLinearCombo e
where
/--

View file

@ -466,6 +466,12 @@ example (z : Int) : z.toNat = 0 ↔ z ≤ 0 := by
example (z : Int) (a : Fin z.toNat) (h : 0 ≤ z) : ↑↑a ≤ z := by
omega
/-! ### Int.negSucc
Make sure we aren't stopped by stray `Int.negSucc` terms.
-/
example (x : Int) (h : Int.negSucc 0 < x ∧ x < 1) : x = 0 := by omega
/-! ### BitVec -/
open BitVec