Adds Mathlib specific instances to the UIntX data types. #
The CommRing instances (and the NatCast and IntCast instances from which they is built) are
scoped in the UIntX.CommRing namespace, rather than available globally. As a result, the ring
tactic will not work on UIntX types without open scoped UIntX.Ring.
This is because the presence of these casting operations contradicts assumptions made by the expression tree elaborator, namely that coercions do not form a cycle.
The UInt version also interferes more with software-verification use-cases, which is reason to be more cautious here.
Equations
- One or more equations did not get rendered due to their size.
Equations
- UInt16.instPowNat_mathlib = { pow := fun (a : UInt16) (n : ℕ) => { toBitVec := { toFin := a.val ^ n } } }
To use this instance, use open scoped UInt32.CommRing.
See the module docstring for an explanation
Equations
- UInt32.instNatCast = { natCast := fun (n : ℕ) => { toBitVec := ↑n } }
Instances For
Equations
- UInt64.instPowNat_mathlib = { pow := fun (a : UInt64) (n : ℕ) => { toBitVec := { toFin := a.val ^ n } } }
Equations
- UInt32.instNeg_mathlib = { neg := fun (a : UInt32) => { toBitVec := { toFin := -a.val } } }
Equations
- UInt64.instNeg_mathlib = { neg := fun (a : UInt64) => { toBitVec := { toFin := -a.val } } }
To use this instance, use open scoped UInt32.CommRing.
See the module docstring for an explanation
Equations
- UInt32.instIntCast = { intCast := fun (z : ℤ) => { toBitVec := ↑z } }
Instances For
Equations
- UInt32.instSMulNat = { smul := fun (n : ℕ) (a : UInt32) => { toBitVec := { toFin := n • a.val } } }
Equations
- UInt32.instPowNat_mathlib = { pow := fun (a : UInt32) (n : ℕ) => { toBitVec := { toFin := a.val ^ n } } }
Equations
- USize.instPowNat_mathlib = { pow := fun (a : USize) (n : ℕ) => { toBitVec := { toFin := a.val ^ n } } }
To use this instance, use open scoped UInt32.CommRing.
See the module docstring for an explanation
Equations
- One or more equations did not get rendered due to their size.
Instances For
To use this instance, use open scoped UInt64.CommRing.
See the module docstring for an explanation
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- UInt64.instSMulNat = { smul := fun (n : ℕ) (a : UInt64) => { toBitVec := { toFin := n • a.val } } }
Equations
- One or more equations did not get rendered due to their size.
Equations
- UInt16.instNeg_mathlib = { neg := fun (a : UInt16) => { toBitVec := { toFin := -a.val } } }
Equations
- UInt16.instSMulInt = { smul := fun (z : ℤ) (a : UInt16) => { toBitVec := { toFin := z • a.val } } }
To use this instance, use open scoped UInt16.CommRing.
See the module docstring for an explanation
Equations
- UInt16.instNatCast = { natCast := fun (n : ℕ) => { toBitVec := ↑n } }
Instances For
To use this instance, use open scoped UInt64.CommRing.
See the module docstring for an explanation
Equations
- UInt64.instIntCast = { intCast := fun (z : ℤ) => { toBitVec := ↑z } }
Instances For
Equations
- One or more equations did not get rendered due to their size.
To use this instance, use open scoped UInt8.CommRing.
See the module docstring for an explanation
Equations
- UInt8.instIntCast = { intCast := fun (z : ℤ) => { toBitVec := ↑z } }
Instances For
Equations
- UInt16.instSMulNat = { smul := fun (n : ℕ) (a : UInt16) => { toBitVec := { toFin := n • a.val } } }
Equations
- USize.instSMulInt = { smul := fun (z : ℤ) (a : USize) => { toBitVec := { toFin := z • a.val } } }
To use this instance, use open scoped USize.CommRing.
See the module docstring for an explanation
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
To use this instance, use open scoped UInt8.CommRing.
See the module docstring for an explanation
Equations
- UInt8.instNatCast = { natCast := fun (n : ℕ) => { toBitVec := ↑n } }
Instances For
Equations
- One or more equations did not get rendered due to their size.
Equations
- UInt32.instSMulInt = { smul := fun (z : ℤ) (a : UInt32) => { toBitVec := { toFin := z • a.val } } }
To use this instance, use open scoped UInt8.CommRing.
See the module docstring for an explanation
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- UInt8.instPowNat_mathlib = { pow := fun (a : UInt8) (n : ℕ) => { toBitVec := { toFin := a.val ^ n } } }
To use this instance, use open scoped UInt16.CommRing.
See the module docstring for an explanation
Equations
- UInt16.instIntCast = { intCast := fun (z : ℤ) => { toBitVec := ↑z } }
Instances For
To use this instance, use open scoped USize.CommRing.
See the module docstring for an explanation
Equations
- USize.instIntCast = { intCast := fun (z : ℤ) => { toBitVec := ↑z } }
Instances For
Equations
- UInt8.instNeg_mathlib = { neg := fun (a : UInt8) => { toBitVec := { toFin := -a.val } } }
Equations
- UInt8.instSMulNat = { smul := fun (n : ℕ) (a : UInt8) => { toBitVec := { toFin := n • a.val } } }
Equations
- UInt8.instSMulInt = { smul := fun (z : ℤ) (a : UInt8) => { toBitVec := { toFin := z • a.val } } }
To use this instance, use open scoped UInt64.CommRing.
See the module docstring for an explanation
Equations
- UInt64.instNatCast = { natCast := fun (n : ℕ) => { toBitVec := ↑n } }
Instances For
To use this instance, use open scoped UInt16.CommRing.
See the module docstring for an explanation
Equations
- One or more equations did not get rendered due to their size.
Instances For
To use this instance, use open scoped USize.CommRing.
See the module docstring for an explanation
Equations
- USize.instNatCast = { natCast := fun (n : ℕ) => { toBitVec := ↑n } }
Instances For
Equations
- UInt64.instSMulInt = { smul := fun (z : ℤ) (a : UInt64) => { toBitVec := { toFin := z • a.val } } }
Equations
- USize.instNeg_mathlib = { neg := fun (a : USize) => { toBitVec := { toFin := -a.val } } }
Equations
- USize.instSMulNat = { smul := fun (n : ℕ) (a : USize) => { toBitVec := { toFin := n • a.val } } }
Alias of UInt8.isASCIIUpper.
Is this an uppercase ASCII letter?
Equations
Instances For
Alias of UInt8.isASCIILower.
Is this a lowercase ASCII letter?
Equations
Instances For
Alias of UInt8.isASCIIAlpha.
Is this an alphabetic ASCII character?
Equations
Instances For
Alias of UInt8.isASCIIDigit.
Is this an ASCII digit character?
Equations
Instances For
Alias of UInt8.isASCIIAlphanum.
Is this an alphanumeric ASCII character?
Equations
Instances For
The numbers from 0 to 256 are all valid UTF-8 characters, so we can embed one in the other.
Equations
- n.toChar = { val := n.toUInt32, valid := ⋯ }