Documentation

Batteries.Data.Float.Lemmas.Order

Order lemmas for Float and Float32 #

The lemmas are proved through the logical models Float.Model and Float32.Model. The order is the IEEE 754 partial order, in which NaN is incomparable with everything and -0 = +0.

theorem Float.Model.lt_asymm {a b : Model} :
a < b → ¬b < a
theorem Float.Model.lt_trans {a b c : Model} :
a < b → b < c → a < c
theorem Float.Model.le_trans {a b c : Model} :
a ≤ b → b ≤ c → a ≤ c
theorem Float.Model.lt_of_lt_of_le {a b c : Model} :
a < b → b ≤ c → a < c
theorem Float.Model.lt_of_le_of_lt {a b c : Model} :
a ≤ b → b < c → a < c
theorem Float.Model.le_of_lt {a b : Model} :
a < b → a ≤ b
theorem Float.Model.not_le {a b : Model} (ha : a ≠ nan) (hb : b ≠ nan) :
¬a ≤ b ↔ b < a
@[simp]
@[simp]
@[simp]
theorem Float.Model.neg_lt_neg_iff {a b : Model} :
-a < -b ↔ b < a
@[simp]
theorem Float.Model.neg_le_neg_iff {a b : Model} :
-a ≤ -b ↔ b ≤ a
@[simp]
theorem Float.lt_irrefl (x : Float) :
¬x < x
theorem Float.lt_asymm {x y : Float} :
x < y → ¬y < x
theorem Float.lt_trans {x y z : Float} :
x < y → y < z → x < z
theorem Float.le_trans {x y z : Float} :
x ≤ y → y ≤ z → x ≤ z
theorem Float.lt_of_lt_of_le {x y z : Float} :
x < y → y ≤ z → x < z
theorem Float.lt_of_le_of_lt {x y z : Float} :
x ≤ y → y < z → x < z
theorem Float.le_of_lt {x y : Float} :
x < y → x ≤ y
theorem Float.lt_iff_le_not_ge {x y : Float} :
x < y ↔ x ≤ y ∧ ¬y ≤ x
theorem Float.not_le {x y : Float} (hx : x ≠ nan) (hy : y ≠ nan) :
¬x ≤ y ↔ y < x
@[simp]
theorem Float.not_nan_lt (x : Float) :
@[simp]
theorem Float.not_lt_nan (x : Float) :
@[simp]
theorem Float.not_nan_le (x : Float) :
@[simp]
theorem Float.not_le_nan (x : Float) :
@[simp]
theorem Float.neg_lt_neg_iff {x y : Float} :
-x < -y ↔ y < x
@[simp]
theorem Float.neg_le_neg_iff {x y : Float} :
-x ≤ -y ↔ y ≤ x
theorem Float.min_comm (x y : Float) :
min x y = min y x
theorem Float.max_comm (x y : Float) :
max x y = max y x
theorem Float32.Model.lt_asymm {a b : Model} :
a < b → ¬b < a
theorem Float32.Model.lt_trans {a b c : Model} :
a < b → b < c → a < c
theorem Float32.Model.le_trans {a b c : Model} :
a ≤ b → b ≤ c → a ≤ c
theorem Float32.Model.lt_of_lt_of_le {a b c : Model} :
a < b → b ≤ c → a < c
theorem Float32.Model.lt_of_le_of_lt {a b c : Model} :
a ≤ b → b < c → a < c
theorem Float32.Model.le_of_lt {a b : Model} :
a < b → a ≤ b
theorem Float32.Model.not_le {a b : Model} (ha : a ≠ nan) (hb : b ≠ nan) :
¬a ≤ b ↔ b < a
@[simp]
theorem Float32.Model.neg_lt_neg_iff {a b : Model} :
-a < -b ↔ b < a
@[simp]
theorem Float32.lt_asymm {x y : Float32} :
x < y → ¬y < x
theorem Float32.lt_trans {x y z : Float32} :
x < y → y < z → x < z
theorem Float32.le_trans {x y z : Float32} :
x ≤ y → y ≤ z → x ≤ z
theorem Float32.lt_of_lt_of_le {x y z : Float32} :
x < y → y ≤ z → x < z
theorem Float32.lt_of_le_of_lt {x y z : Float32} :
x ≤ y → y < z → x < z
theorem Float32.le_of_lt {x y : Float32} :
x < y → x ≤ y
theorem Float32.lt_iff_le_not_ge {x y : Float32} :
x < y ↔ x ≤ y ∧ ¬y ≤ x
theorem Float32.not_le {x y : Float32} (hx : x ≠ nan) (hy : y ≠ nan) :
¬x ≤ y ↔ y < x
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
theorem Float32.neg_lt_neg_iff {x y : Float32} :
-x < -y ↔ y < x
@[simp]
theorem Float32.neg_le_neg_iff {x y : Float32} :
-x ≤ -y ↔ y ≤ x
theorem Float32.min_comm (x y : Float32) :
min x y = min y x
theorem Float32.max_comm (x y : Float32) :
max x y = max y x