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

26 lines
1.6 KiB
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 for fix: grind diseq_cancel_var was using wrong variable index after renaming
-- Previously this would produce a kernel type mismatch error
-- The unused variable `hr` is intentional - it triggers the variable renaming that exposed the bug
set_option linter.unusedVariables false in
example (r : Rat) (hr : r ≤ r) : 2⁻¹ * 2 = (1 : Rat) := by grind
-- Leo's test cases for diseq_cancel_var (from Zulip)
-- These should still work after the fix
open Std Lean.Grind
variable {α : Type} [Field α] [LE α] [LT α] [LawfulOrderLT α] [IsLinearOrder α] [OrderedRing α] [NoNatZeroDivisors α]
example (a b : α) (h : a = b / 2) : a + a ≤ b := by grind
example (a : α) (h : a ≠ 1/2) : 2*a > 1 2*a < 1 := by grind
example (a : α) (h : a ≠ (1/2)^3) : 8*a > 1 8*a < 1 := by grind
example (a : α) (h : a ≠ (1/2)^3) : 8*a > 1 8*a < 1 := by grind
example (a : α) (h : a ≠ (1/3)*(1/2)^3) : 24*a > 1 24*a < 1 := by grind
example (a : α) (h : a ≠ b*(2⁻¹)^3) : 8*a > b 8*a < b := by grind
example (a : α) (h : a ≠ (2⁻¹)^3*b) : 8*a > b 8*a < b := by grind
example (a : α) (h : 5*(2⁻¹)^3*b ≠ a) : 8*a > 5*b 8*a < 5*b := by grind
example (a : α) (h : 5*(2⁻¹)*(2⁻¹)^3*b + (3/2)*c ≠ a) : 16*a > 5*b + 24*c 16*a < 5*b + 24*c := by grind
example (x : α) : x ≥ 1/3 → x ≥ 0 := by grind
example (a : α) (h : a ≠ 1/2 + 1/3) : 6*a > 5 6*a < 5 := by grind
example (a : α) (h : 1/2 + 1/3 ≠ a) : 6*a > 5 6*a < 5 := by grind
example (h : (1/4:α) ≠ (1/2)*(1/2)) : False := by grind
example (h : (1/4:α) + 1/4 ≠ (1/2)) : False := by grind
example (h : (1/2:α) + 1/3 ≠ (5/6)) : False := by grind