lean4-htt/tests/elab/lia_with_cases.lean
Garmelon 08eb78a5b2
chore: switch to new test/bench suite (#12590)
This PR sets up the new integrated test/bench suite. It then migrates
all benchmarks and some related tests to the new suite. There's also
some documentation and some linting.

For now, a lot of the old tests are left alone so this PR doesn't become
even larger than it already is. Eventually, all tests should be migrated
to the new suite though so there isn't a confusing mix of two systems.
2026-02-25 13:51:53 +00:00

30 lines
900 B
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- Test that lia now uses grind tactic script with cases_next
-- Basic linear arithmetic - should still work without case-splits
example (x y : Int) : 2 * x + 4 * y ≠ 5 := by
lia
example (x y : Int) : 2 * x + 3 * y = 0 → 1 ≤ x → y < 1 := by
lia
example (a b : Int) : 2 a + 1 → 2 b + a → ¬ 2 b + 2 * a := by
lia
-- Tests that require case-splitting
-- These require the `cases_next` to split on hypotheses before lia can solve
-- Case-split on hypothesis, then solve with lia
example (x : Nat) (h : x = 0 x = 1) : x ≤ 1 := by
lia
-- Multiple nested case-splits
example (x y : Nat) (h1 : x = 0 x = 1) (h2 : y = 0 y = 1) : x + y ≤ 2 := by
lia
-- Case-split on if-then-else
example (x : Int) : (if x > 0 then x else -x) ≥ 0 := by
lia
-- Case-split with arithmetic in branches
example (x : Int) : (if x > 0 then 2*x else 0) ≥ 0 := by
lia