Documentation

Init.Data.Nat.Compare

Basic lemmas about comparing natural numbers #

This file introduce some basic lemmas about compare as applied to natural numbers.

theorem Nat.compare_def_lt (a b : Nat) :
compare a b = if a < b then Ordering.lt else if b < a then Ordering.gt else Ordering.eq
theorem Nat.compare_def_le (a b : Nat) :
compare a b = if a b then if b a then Ordering.eq else Ordering.lt else Ordering.gt
theorem Nat.compare_swap (a b : Nat) :
(compare a b).swap = compare b a