Zulip Chat Archive

Stream: Is there code for X?

Topic: false_of_lt_of_lt


Eric Wieser (May 30 2022 at 17:14):

I'm surprised that linarith can't solve this:

import tactic.linarith
import order.complete_boolean_algebra

example {R} {a b : R} [linear_order R] (hab : a < b) (hba : b < a) : false :=
by linarith [hab, hba] -- fails

example {R} {a b : R} [linear_order R] (hab : a < b) (hba : b < a) : false :=
(hab.trans hba).not_le le_rfl -- ok

Do we have this as a lemma anywhere?

Alex J. Best (May 30 2022 at 17:18):

Linarith is linear arithmetic, but here there is no arithmetic, that is, linarith requires a linear ordered commutative ring https://leanprover-community.github.io/mathlib_docs/tactic/linarith/frontend.html

Eric Wieser (May 30 2022 at 17:30):

Ah indeed, linarith is happy to solve it with linear_ordered_comm_ring


Last updated: Dec 20 2023 at 11:08 UTC