lean4-htt/tests/lean/run/grind_order_propagation.lean
Leonardo de Moura 40e1e097c1
fix: grind order nontermination and propagation issues (#11026)
This PR fixes a nontermination and missing propagation bug in `grind
order`. It also register relevant case-splits for arithmetic.

Closes #11001
2025-10-30 23:12:51 +00:00

106 lines
2.3 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 propagation rules for `grind order`
-/
example (p q : Prop) : ((0 : Rat) < (1 : Rat) → p)
→ ¬ p q
→ ¬ p ¬q
→ False
:= by
grind -linarith (splits := 0)
example (p q : Prop) : ((0 : Rat) ≤ (1 : Rat) → p)
→ ¬ p q
→ ¬ p ¬q
→ False
:= by
grind -linarith (splits := 0)
example (p q s : Prop) : (if (0 : Rat) < (1 : Rat) then p else s)
→ ¬ p q
→ ¬ p ¬q
→ False
:= by
grind -linarith (splits := 0)
example (p q s : Prop) : (if (0 : Rat) ≤ (0 : Rat) then p else s)
→ ¬ p q
→ ¬ p ¬q
→ False
:= by
grind -linarith (splits := 0)
example (p q s : Prop) : (if (0 : Rat) > (1 : Rat) then s else p)
→ ¬ p q
→ ¬ p ¬q
→ False
:= by
grind -linarith (splits := 0)
example (p q s : Prop) : (if (0 : Rat) >= (1 : Rat) then s else p)
→ ¬ p q
→ ¬ p ¬q
→ False
:= by
grind -linarith (splits := 0)
-----
example (p q : Prop) (a : Rat) : (a < a + 1 → p)
→ ¬ p q
→ ¬ p ¬q
→ False
:= by
grind -linarith (splits := 0)
example (p q : Prop) (a : Rat) : (a ≤ a → p)
→ ¬ p q
→ ¬ p ¬q
→ False
:= by
grind -linarith (splits := 0)
example (p q s : Prop) (a : Rat) : (if a < a + 1 then p else s)
→ ¬ p q
→ ¬ p ¬q
→ False
:= by
grind -linarith (splits := 0)
example (p q s : Prop) (a : Rat) : (if a ≤ a then p else s)
→ ¬ p q
→ ¬ p ¬q
→ False
:= by
grind -linarith (splits := 0)
example (p q s : Prop) (a : Rat) : (if a > a + 1 then s else p)
→ ¬ p q
→ ¬ p ¬q
→ False
:= by
grind -linarith (splits := 0)
example (p q s : Prop) (a : Rat) : (if a >= a + 1 then s else p)
→ ¬ p q
→ ¬ p ¬q
→ False
:= by
grind -linarith (splits := 0)
-----
example [LE α] [Std.IsPreorder α] [DecidableLE α] (a : α) (p q s : Prop)
: (if a ≤ a then p else s)
→ ¬ p q
→ ¬ p ¬q
→ False
:= by
grind (splits := 0)
example [LE α] [LT α] [Std.LawfulOrderLT α] [Std.IsPreorder α] [DecidableLT α] (a : α) (p q s : Prop)
: (if a < a then s else p)
→ ¬ p q
→ ¬ p ¬q
→ False
:= by
grind (splits := 0)