Zulip Chat Archive

Stream: Is there code for X?

Topic: le and lt is the same as lt


Eric Paul (Oct 22 2024 at 18:14):

Is there some single theorem or tactic that can solve this in one go?

import Mathlib

theorem test [LinearOrder α] {a b : α} : a  b  a < b  a < b := by
    constructor
    · rintro ⟨-, this
      exact this
    · intro h
      exact h.le, h

None of tauto, aesop, and exact? worked for me.

Yaël Dillies (Oct 22 2024 at 18:15):

I'm pretty sure simp does it, or maybe simp [le_of_lt] (sorry, I don't have Lean open right now)

Eric Paul (Oct 22 2024 at 18:17):

Strangely enough that leaves the goal as a < b → a ≤ b

Damiano Testa (Oct 22 2024 at 18:54):

Try

  simp (config := {contextual := true}) [le_of_lt]

Eric Paul (Oct 22 2024 at 19:29):

That works thank you!

And thanks to the new language reference I was able to easily read about the simp configurations which is cool


Last updated: May 02 2025 at 03:31 UTC