lean4-htt/tests/elab/grind_module_relations.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

28 lines
991 B
Text

module
-- Tests for `grind` as solver for linear equations in an `IntModule` or `RatModule`.
open Lean.Grind
section IntModule
variable (R : Type u) [IntModule R]
-- In an `IntModule`, we should be able to handle relations
-- this is harder, and less important, than being able to do this in `RatModule`.
example (a b : R) (h : a + b = 0) : 3 • a - 7 • b = 9 • a + a := by grind
example (a b c : R) (h : 2 • a + 2 • b = 4 • c) : 3 • a + c = 5 • c - b + (-b) + a := by grind
end IntModule
section RatModule
variable (R : Type u) [IntModule R] [NoNatZeroDivisors R]
example (a b : R) (h : a + b = 0) : 3 • a - 7 • b = 9 • a + a := by grind
example (a b c : R) (h : 2 • a + 2 • b = 4 • c) : 3 • a + c = 5 • c - b + (-b) + a := by grind
-- In a `RatModule` we can clear common divisors.
example (a : R) (h : a + a = 0) : a = 0 := by grind
example (a b c : R) (h : 2 • a + 2 • b = 4 • c) : 3 • a + c = 7 • c - 3 • b := by grind
end RatModule