Zulip Chat Archive

Stream: new members

Topic: Decidable version of monotone_lt


Julia Scheaffer (Sep 30 2025 at 21:02):

I am trying to figure out how to prove this

import Mathlib
def f (i : Nat) : Nat -> Bool := (i < ·)

example {i : Nat} : Monotone (f i) := by
  unfold f
  exact monotone_lt -- doesn't work because of decide i think

Is it possible to use docs#monotone_lt for this or do I need to use another method?

Aaron Liu (Sep 30 2025 at 21:07):

import Mathlib
def f (i : Nat) : Nat -> Bool := (i < ·)

example {i : Nat} : Monotone (f i) := by
  intro a b hab
  simp only [f, Bool.le_iff_imp, decide_eq_true_eq]
  order

Julia Scheaffer (Sep 30 2025 at 21:09):

Thank you :smile:

Kenny Lau (Oct 01 2025 at 13:25):

@Julia Scheaffer it's because the theorem you want to use monotone_lt is about a function to Prop, whereas the theorem you want to provev is about a function to Bool, and Prop and Bool are very different even though you might have taught a mental model where they are the "same"

Julia Scheaffer (Oct 01 2025 at 13:25):

Yeah, I just wasn't sure about how to convert between them in the case that i have a decidable prop

Julia Scheaffer (Oct 01 2025 at 13:26):

But thanks to Aaron, I got it worked out.


Last updated: Dec 20 2025 at 21:32 UTC