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.
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
- 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
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
- UInt16.instNeg_mathlib = { neg := fun (a : UInt16) => { toBitVec := { toFin := -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
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
- 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
- One or more equations did not get rendered due to their size.
Instances For
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
Equations
- UInt8.instNeg_mathlib = { neg := fun (a : UInt8) => { toBitVec := { toFin := -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.instIntCast = { intCast := fun (z : ℤ) => { toBitVec := ↑z } }
Instances For
Equations
- USize.instNeg_mathlib = { neg := fun (a : USize) => { toBitVec := { toFin := -a.val } } }
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
Is this an alphabetic ASCII character?
Equations
- c.isASCIIAlpha = (c.isASCIIUpper || c.isASCIILower)
Instances For
Is this an alphanumeric ASCII character?
Equations
- c.isASCIIAlphanum = (c.isASCIIAlpha || c.isASCIIDigit)