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.
To use this instance, use open scoped USize.CommRing
.
See the module docstring for an explanation
Equations
- USize.instIntCast = { intCast := fun (z : ℤ) => { val := ↑z } }
Instances For
Equations
- UInt64.instSMulNat = { smul := fun (n : ℕ) (a : UInt64) => { val := n • a.val } }
To use this instance, use open scoped USize.CommRing
.
See the module docstring for an explanation
Equations
- USize.instNatCast = { natCast := fun (n : ℕ) => { val := ↑n } }
Instances For
Equations
- USize.instSMulNat = { smul := fun (n : ℕ) (a : USize) => { val := n • a.val } }
To use this instance, use open scoped UInt64.CommRing
.
See the module docstring for an explanation
Equations
- UInt64.instIntCast = { intCast := fun (z : ℤ) => { val := ↑z } }
Instances For
To use this instance, use open scoped UInt16.CommRing
.
See the module docstring for an explanation
Equations
- UInt16.instNatCast = { natCast := fun (n : ℕ) => { val := ↑n } }
Instances For
Equations
- USize.instNeg_mathlib = { neg := fun (a : USize) => { val := -a.val } }
Equations
- UInt32.instNeg_mathlib = { neg := fun (a : UInt32) => { val := -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
- UInt8.instNeg_mathlib = { neg := fun (a : UInt8) => { val := -a.val } }
To use this instance, use open scoped UInt8.CommRing
.
See the module docstring for an explanation
Equations
- UInt8.instNatCast = { natCast := fun (n : ℕ) => { val := ↑n } }
Instances For
Equations
- One or more equations did not get rendered due to their size.
Equations
- UInt8.instSMulNat = { smul := fun (n : ℕ) (a : UInt8) => { val := n • a.val } }
Equations
- UInt64.instSMulInt = { smul := fun (z : ℤ) (a : UInt64) => { val := z • a.val } }
Equations
- UInt16.instSMulInt = { smul := fun (z : ℤ) (a : UInt16) => { val := z • a.val } }
To use this instance, use open scoped UInt16.CommRing
.
See the module docstring for an explanation
Equations
- UInt16.instIntCast = { intCast := fun (z : ℤ) => { val := ↑z } }
Instances For
Equations
- One or more equations did not get rendered due to their size.
Equations
- UInt64.instNeg_mathlib = { neg := fun (a : UInt64) => { val := -a.val } }
Equations
- UInt32.instSMulInt = { smul := fun (z : ℤ) (a : UInt32) => { val := z • a.val } }
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 UInt16.CommRing
.
See the module docstring for an explanation
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- USize.instPowNat_mathlib = { pow := fun (a : USize) (n : ℕ) => { val := a.val ^ n } }
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
Equations
- UInt32.instSMulNat = { smul := fun (n : ℕ) (a : UInt32) => { val := n • a.val } }
Equations
- One or more equations did not get rendered due to their size.
Equations
- USize.instSMulInt = { smul := fun (z : ℤ) (a : USize) => { val := z • a.val } }
Equations
- UInt32.instPowNat_mathlib = { pow := fun (a : UInt32) (n : ℕ) => { val := a.val ^ n } }
Equations
- UInt16.instPowNat_mathlib = { pow := fun (a : UInt16) (n : ℕ) => { val := a.val ^ n } }
To use this instance, use open scoped UInt64.CommRing
.
See the module docstring for an explanation
Equations
- UInt64.instNatCast = { natCast := fun (n : ℕ) => { val := ↑n } }
Instances For
To use this instance, use open scoped UInt8.CommRing
.
See the module docstring for an explanation
Equations
- UInt8.instIntCast = { intCast := fun (z : ℤ) => { val := ↑z } }
Instances For
Equations
- UInt64.instPowNat_mathlib = { pow := fun (a : UInt64) (n : ℕ) => { val := a.val ^ n } }
Equations
- UInt8.instPowNat_mathlib = { pow := fun (a : UInt8) (n : ℕ) => { val := 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 : ℕ) => { val := ↑n } }
Instances For
Equations
- UInt16.instSMulNat = { smul := fun (n : ℕ) (a : UInt16) => { val := n • a.val } }
Equations
- UInt16.instNeg_mathlib = { neg := fun (a : UInt16) => { val := -a.val } }
Equations
- UInt8.instSMulInt = { smul := fun (z : ℤ) (a : UInt8) => { val := z • a.val } }
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
To use this instance, use open scoped UInt32.CommRing
.
See the module docstring for an explanation
Equations
- UInt32.instIntCast = { intCast := fun (z : ℤ) => { val := ↑z } }
Instances For
Equations
- One or more equations did not get rendered due to their size.
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 := ⋯ }