Documentation

Mathlib.Data.Dyadic

Dyadic rationals #

This file provides general API for Dyadic rationals that are used in Mathlib but not available in core.

@[instance_reducible]
Equations
  • One or more equations did not get rendered due to their size.
@[instance_reducible]
Equations
  • One or more equations did not get rendered due to their size.
def Dyadic.step (prec : ) :

One unit on the dyadic grid with precision prec.

Equations
Instances For
    theorem Dyadic.ofIntWithPrec_one (prec : ) :
    ofIntWithPrec 1 prec = step prec

    Interpret a dyadic rational as a real number.

    Equations
    Instances For
      @[simp]
      theorem Dyadic.toReal_natCast (n : ) :
      (↑n).toReal = n
      @[simp]
      theorem Dyadic.toReal_intCast (z : ) :
      (↑z).toReal = z
      @[simp]
      theorem Dyadic.toReal_add (a b : Dyadic) :
      (a + b).toReal = a.toReal + b.toReal
      @[simp]
      theorem Dyadic.toReal_mul (a b : Dyadic) :
      (a * b).toReal = a.toReal * b.toReal
      @[simp]
      theorem Dyadic.toReal_pow (a : Dyadic) (n : ) :
      (a ^ n).toReal = a.toReal ^ n

      Dyadic.toReal as an additive monoid homomorphism.

      Equations
      Instances For
        @[simp]
        @[simp]
        theorem Dyadic.toReal_lt_toReal {a b : Dyadic} :
        a.toReal < b.toReal a < b