Documentation

Batteries.Data.UInt

UInt8 #

theorem UInt8.ext {x y : UInt8} :
x.toNat = y.toNatx = y
theorem UInt8.toNat_lt (x : UInt8) :
x.toNat < 2 ^ 8
@[simp]
theorem UInt8.toUInt16_toNat (x : UInt8) :
x.toUInt16.toNat = x.toNat
@[simp]
theorem UInt8.toUInt32_toNat (x : UInt8) :
x.toUInt32.toNat = x.toNat
@[simp]
theorem UInt8.toUInt64_toNat (x : UInt8) :
x.toUInt64.toNat = x.toNat

UInt16 #

theorem UInt16.ext {x y : UInt16} :
x.toNat = y.toNatx = y
theorem UInt16.toNat_lt (x : UInt16) :
x.toNat < 2 ^ 16
@[simp]
theorem UInt16.toUInt8_toNat (x : UInt16) :
x.toUInt8.toNat = x.toNat % 2 ^ 8
@[simp]
theorem UInt16.toUInt32_toNat (x : UInt16) :
x.toUInt32.toNat = x.toNat
@[simp]
theorem UInt16.toUInt64_toNat (x : UInt16) :
x.toUInt64.toNat = x.toNat

UInt32 #

theorem UInt32.ext {x y : UInt32} :
x.toNat = y.toNatx = y
theorem UInt32.toNat_lt (x : UInt32) :
x.toNat < 2 ^ 32
@[simp]
theorem UInt32.toUInt8_toNat (x : UInt32) :
x.toUInt8.toNat = x.toNat % 2 ^ 8
@[simp]
theorem UInt32.toUInt16_toNat (x : UInt32) :
x.toUInt16.toNat = x.toNat % 2 ^ 16
@[simp]
theorem UInt32.toUInt64_toNat (x : UInt32) :
x.toUInt64.toNat = x.toNat

UInt64 #

theorem UInt64.ext {x y : UInt64} :
x.toNat = y.toNatx = y
theorem UInt64.toNat_lt (x : UInt64) :
x.toNat < 2 ^ 64
@[simp]
theorem UInt64.toUInt8_toNat (x : UInt64) :
x.toUInt8.toNat = x.toNat % 2 ^ 8
@[simp]
theorem UInt64.toUInt16_toNat (x : UInt64) :
x.toUInt16.toNat = x.toNat % 2 ^ 16
@[simp]
theorem UInt64.toUInt32_toNat (x : UInt64) :
x.toUInt32.toNat = x.toNat % 2 ^ 32

USize #

theorem USize.ext {x y : USize} :
x.toNat = y.toNatx = y
@[simp]
theorem USize.toUInt64_toNat (x : USize) :
x.toUInt64.toNat = x.toNat
@[simp]
theorem UInt32.toUSize_toNat (x : UInt32) :
x.toUSize.toNat = x.toNat