Documentation

Mathlib.Data.UInt

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.

@[simp]
theorem UInt32.toBitVec_intCast (z : ) :
(↑z).toBitVec = z
@[simp]
theorem UInt64.toBitVec_natCast (n : ) :
(↑n).toBitVec = n
@[simp]
theorem USize.toBitVec_zsmul (z : ) (a : USize) :
@[simp]
theorem UInt32.toBitVec_zsmul (z : ) (a : UInt32) :
@[simp]
theorem UInt64.toBitVec_zsmul (z : ) (a : UInt64) :
@[simp]
theorem UInt32.toBitVec_natCast (n : ) :
(↑n).toBitVec = n
@[simp]
theorem USize.toBitVec_natCast (n : ) :
(↑n).toBitVec = n
@[simp]
theorem UInt16.toBitVec_zsmul (z : ) (a : UInt16) :
@[simp]
theorem UInt8.toBitVec_zsmul (z : ) (a : UInt8) :
@[simp]
theorem UInt8.toBitVec_intCast (z : ) :
(↑z).toBitVec = z
@[simp]
theorem UInt16.toBitVec_natCast (n : ) :
(↑n).toBitVec = n
theorem USize.toBitVec_nsmul (n : ) (a : USize) :
@[simp]
theorem UInt64.toBitVec_intCast (z : ) :
(↑z).toBitVec = z
theorem UInt8.toBitVec_nsmul (n : ) (a : UInt8) :
@[simp]
theorem UInt16.toBitVec_intCast (z : ) :
(↑z).toBitVec = z
@[simp]
theorem UInt8.toBitVec_natCast (n : ) :
(↑n).toBitVec = n
@[simp]
theorem USize.toBitVec_intCast (z : ) :
(↑z).toBitVec = z

To use this instance, use open scoped USize.CommRing.

See the module docstring for an explanation

Equations
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

        To use this instance, use open scoped UInt8.CommRing.

        See the module docstring for an explanation

        Equations
        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

            Is this an uppercase ASCII letter?

            Equations
            Instances For

              Is this a lowercase ASCII letter?

              Equations
              Instances For

                Is this an alphabetic ASCII character?

                Equations
                Instances For

                  Is this an ASCII digit character?

                  Equations
                  Instances For

                    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
                      Instances For