Documentation

LeanPool.ComputableReal.ComputableReal

The quotient field of interval-Cauchy sequences #

Computableℝ is the quotient of ComputableℝSeq by the equivalence relation of converging to the same real value. This file equips it with its commutative ring, field, and linear order structures. The ring operations are executable interval arithmetic; inversion and the comparison Decidable instances go through the classical ComputableℝSeq.sign and are noncomputable.

Computable reals, defined as the quotient of ComputableℝSeq sequences -- sequences with Cauchy sequences of lower and upper bounds that converge to the same value -- by the equivalence relation of having the same converged value. This is similar to how reals are quotients of Cauchy sequence (without any guarantees on lower/upper bounds).

Equations
Instances For
    @[simp]
    def Computableℝ.mapℝ' (f : ComputableℝSeqComputableℝSeq) (h : ∃ (f₂ : ), ∀ (x : ComputableℝSeq), (f x).val = f₂ x.val) :

    Alternate version of mapℝ that doesn't directly refer to f₂, so it stays computable even if f₂ isn't.

    Equations
    Instances For
      def Computableℝ.mapℝ (f : ComputableℝSeqComputableℝSeq) {f₂ : } (h : ∀ (x : ComputableℝSeq), (f x).val = f₂ x.val) :

      Given a unary function on sequences that clearly matches function on reals, lift it.

      Equations
      Instances For
        theorem Computableℝ.mapℝ'_eq_mapℝ {f : ComputableℝSeqComputableℝSeq} {h : ∃ (f₂ : ), ∀ (x : ComputableℝSeq), (f x).val = f₂ x.val} {f₂✝ : } {h₂ : ∀ (x : ComputableℝSeq), (f x).val = f₂✝ x.val} :
        mapℝ' f h = mapℝ f h₂
        def Computableℝ.map₂ℝ' (f : ComputableℝSeqComputableℝSeqComputableℝSeq) (h : ∃ (f₂ : ), ∀ (x y : ComputableℝSeq), (f x y).val = f₂ x.val y.val) :

        Alternate version of map₂ℝ that doesn't directly refer to f₂, so it stays computable even if f₂ isn't.

        Equations
        Instances For

          Given a binary function that clearly mimics a standard real function, lift that.

          Equations
          Instances For
            theorem Computableℝ.map₂ℝ'_eq_map₂ℝ {f : ComputableℝSeqComputableℝSeqComputableℝSeq} {h : ∃ (f₂ : ), ∀ (x y : ComputableℝSeq), (f x y).val = f₂ x.val y.val} {f₂✝ : } {h₂ : ∀ (x y : ComputableℝSeq), (f x y).val = f₂✝ x.val y.val} :
            @[simp]
            theorem Computableℝ.val_mapℝ_eq_val {f : ComputableℝSeqComputableℝSeq} {f₂ : } {h : ∀ (x : ComputableℝSeq), (f x).val = f₂ x.val} {x : Computableℝ} :
            (mapℝ f h x).val = f₂ x.val
            @[simp]
            theorem Computableℝ.val_map₂ℝ_eq_val {f : ComputableℝSeqComputableℝSeqComputableℝSeq} {f₂ : } {h : ∀ (x y : ComputableℝSeq), (f x y).val = f₂ x.val y.val} {x y : Computableℝ} :
            (map₂ℝ f h x y).val = f₂ x.val y.val
            @[simp]
            theorem Computableℝ.val_add (x y : Computableℝ) :
            (x + y).val = x.val + y.val
            @[simp]
            theorem Computableℝ.val_mul (x y : Computableℝ) :
            (x * y).val = x.val * y.val
            @[simp]
            @[simp]
            theorem Computableℝ.val_sub (x y : Computableℝ) :
            (x - y).val = x.val - y.val
            @[simp]
            @[simp]
            theorem Computableℝ.add_mk (x y : ComputableℝSeq) :
            mk x + mk y = mk (x + y)
            theorem Computableℝ.mul_mk (x y : ComputableℝSeq) :
            mk x * mk y = mk (x * y)
            theorem Computableℝ.sub_mk (x y : ComputableℝSeq) :
            mk x - mk y = mk (x - y)
            @[implicit_reducible]
            Equations
            • One or more equations did not get rendered due to their size.
            @[simp]
            theorem Computableℝ.val_natpow (x : Computableℝ) (n : ) :
            (x ^ n).val = x.val ^ n
            noncomputable def Computableℝ.safeInv' :

            Auxiliary inverse definition that operates on the nonzero Computableℝ values.

            Equations
            Instances For
              theorem Computableℝ.safeInv_def (x : Computableℝ) (hnz : x 0) :
              x.safeInv hnz = (safeInv' x, hnz)
              @[irreducible]
              noncomputable def Computableℝ.safeInv (x : Computableℝ) (hnz : x 0) :

              Inverse of a nonzero Computableℝ, safe (terminating) as long as x is nonzero.

              Equations
              Instances For
                @[simp]
                theorem Computableℝ.safeInv_val (x : Computableℝ) (hnz : x 0) :
                (x.safeInv hnz).val = x.val⁻¹
                @[implicit_reducible]
                Equations
                • One or more equations did not get rendered due to their size.
                @[simp]
                theorem Computableℝ.div_val (x y : Computableℝ) :
                (x / y).val = x.val / y.val

                Definition of lt.

                Equations
                Instances For

                  Definition of le.

                  Equations
                  Instances For
                    @[simp]
                    @[simp]
                    @[implicit_reducible]
                    noncomputable instance Computableℝ.instDecidableLE :
                    DecidableRel fun (x y : Computableℝ) => x y
                    Equations
                    @[implicit_reducible]
                    Equations
                    • One or more equations did not get rendered due to their size.
                    @[implicit_reducible]
                    Equations
                    • One or more equations did not get rendered due to their size.