Documentation

Batteries.Data.UInt

UInt8 #

theorem UInt8.ext {x y : UInt8} :
x.toNat = y.toNatx = y
theorem UInt8.ext_iff {x y : UInt8} :
x = y x.toNat = y.toNat
theorem UInt8.max_def (x y : UInt8) :
max x y = if x y then y else x
theorem UInt8.min_def (x y : UInt8) :
min x y = if x y then x else y
theorem UInt8.toNat_max (x y : UInt8) :
(max x y).toNat = max x.toNat y.toNat
theorem UInt8.toNat_min (x y : UInt8) :
(min x y).toNat = min x.toNat y.toNat

UInt16 #

theorem UInt16.ext {x y : UInt16} :
x.toNat = y.toNatx = y
theorem UInt16.ext_iff {x y : UInt16} :
x = y x.toNat = y.toNat
@[simp]
theorem UInt16.max_def (x y : UInt16) :
max x y = if x y then y else x
theorem UInt16.min_def (x y : UInt16) :
min x y = if x y then x else y
theorem UInt16.toNat_max (x y : UInt16) :
(max x y).toNat = max x.toNat y.toNat
theorem UInt16.toNat_min (x y : UInt16) :
(min x y).toNat = min x.toNat y.toNat

UInt32 #

theorem UInt32.ext {x y : UInt32} :
x.toNat = y.toNatx = y
theorem UInt32.ext_iff {x y : UInt32} :
x = y x.toNat = y.toNat
@[simp]
@[simp]
theorem UInt32.max_def (x y : UInt32) :
max x y = if x y then y else x
theorem UInt32.min_def (x y : UInt32) :
min x y = if x y then x else y
theorem UInt32.toNat_max (x y : UInt32) :
(max x y).toNat = max x.toNat y.toNat
theorem UInt32.toNat_min (x y : UInt32) :
(min x y).toNat = min x.toNat y.toNat

UInt64 #

theorem UInt64.ext {x y : UInt64} :
x.toNat = y.toNatx = y
theorem UInt64.ext_iff {x y : UInt64} :
x = y x.toNat = y.toNat
@[simp]
@[simp]
@[simp]
theorem UInt64.max_def (x y : UInt64) :
max x y = if x y then y else x
theorem UInt64.min_def (x y : UInt64) :
min x y = if x y then x else y
theorem UInt64.toNat_max (x y : UInt64) :
(max x y).toNat = max x.toNat y.toNat
theorem UInt64.toNat_min (x y : UInt64) :
(min x y).toNat = min x.toNat y.toNat

USize #

theorem USize.ext {x y : USize} :
x.toNat = y.toNatx = y
theorem USize.ext_iff {x y : USize} :
x = y x.toNat = y.toNat
theorem USize.toNat_ofNat_of_le_of_lt {n i : Nat} (h : n < size) (hn : i n) :
(ofNat i).toNat = i
theorem USize.pred_toNat {i : USize} (h_gt : 0 < i) :
(i - 1).toNat = i.toNat - 1