UInt8 #
theorem
UInt8.toNat_sub
(x : UInt8)
(y : UInt8)
:
(x - y).toNat = (x.toNat + (UInt8.size - y.toNat)) % UInt8.size
UInt16 #
theorem
UInt16.toNat_add
(x : UInt16)
(y : UInt16)
:
(x + y).toNat = (x.toNat + y.toNat) % UInt16.size
theorem
UInt16.toNat_sub
(x : UInt16)
(y : UInt16)
:
(x - y).toNat = (x.toNat + (UInt16.size - y.toNat)) % UInt16.size
UInt32 #
theorem
UInt32.toNat_add
(x : UInt32)
(y : UInt32)
:
(x + y).toNat = (x.toNat + y.toNat) % UInt32.size
theorem
UInt32.toNat_sub
(x : UInt32)
(y : UInt32)
:
(x - y).toNat = (x.toNat + (UInt32.size - y.toNat)) % UInt32.size
UInt64 #
theorem
UInt64.toNat_add
(x : UInt64)
(y : UInt64)
:
(x + y).toNat = (x.toNat + y.toNat) % UInt64.size
theorem
UInt64.toNat_sub
(x : UInt64)
(y : UInt64)
:
(x - y).toNat = (x.toNat + (UInt64.size - y.toNat)) % UInt64.size
USize #
theorem
USize.toNat_sub
(x : USize)
(y : USize)
:
(x - y).toNat = (x.toNat + (USize.size - y.toNat)) % USize.size