TorchLean API

FloatLib.Numerics.Enclosure.Expression.Real

Sound interval evaluation of real expressions #

Each backend operation must enclose its real result for every real member of the input intervals. Structural induction then gives the same guarantee for a complete expression. The theorem does not restrict variable values to rationals or to the interval's endpoint representation.

Curried real functions; arity zero is a real constant.

Instances For
    noncomputable def FloatLib.Numerics.Interval.RealFunction.apply {n : ℕ} (f : RealFunction n) (args : List ℝ) :

    Apply a curried real function to its argument list. Successful extension evaluation checks the arity before this interpretation is used.

    Instances For

      A successful user enclosure contains the result for every real input member. The argument count is checked by the common evaluator, independently of the user's procedure.

      Instances For
        theorem FloatLib.Numerics.Interval.Extension.constant_sound (bounds : Backend.Config → Option (Interval ℚ)) (c : ℝ) (h : ∀ (config : Backend.Config) (output : Interval ℚ), bounds config = some output → ContainsReal some output c) :
        (constant bounds).Sound c

        A certified constant enclosure satisfies the common extension contract.

        Rational lower and upper bounds for a real constant, indexed by requested precision.

        • bounds : ℕ → Interval ℚ

          Compute the lower and upper endpoints.

        • valid (precision : ℕ) : ↑(self.bounds precision).lo ≤ c ∧ c ≤ ↑(self.bounds precision).hi

          The constant lies between those endpoints at every precision.

        Instances For

          Adapt proved constant bounds to the general enclosure evaluator.

          Instances For

            Ordinary endpoint inequalities suffice to certify a constant enclosure.

            theorem FloatLib.Numerics.Interval.Extension.unary_sound (bounds : Backend.Config → Interval ℚ → Option (Interval ℚ)) (f : ℝ → ℝ) (h : ∀ (config : Backend.Config) (I J : Interval ℚ) (x : ℝ), bounds config I = some J → ContainsReal some I x → ContainsReal some J (f x)) :
            (unary bounds).Sound f

            Lift an existing unary containment theorem to a registered enclosure.

            theorem FloatLib.Numerics.Interval.Extension.binary_sound (bounds : Backend.Config → Interval ℚ → Interval ℚ → Option (Interval ℚ)) (f : ℝ → ℝ → ℝ) (h : ∀ (config : Backend.Config) (I J K : Interval ℚ) (x y : ℝ), bounds config I J = some K → ContainsReal some I x → ContainsReal some J y → ContainsReal some K (f x y)) :
            (binary bounds).Sound f

            Lift an existing binary containment theorem to a registered enclosure.

            Real interpretation of a unary expression operation.

            Instances For

              Real interpretation of a binary expression operation.

              Instances For

                Real interpretation of a three-input expression operation.

                Instances For
                  noncomputable def FloatLib.Numerics.Interval.Expr.eval (e : Expr) (env : ℕ → ℝ) (functions : ℕ → List ℝ → ℝ := fun (x : ℕ) (x_1 : List ℝ) => 0) :

                  Evaluate an expression at arbitrary real variable values.

                  Instances For
                    noncomputable def FloatLib.Numerics.Interval.Expr.evalArgs (args : List Expr) (env : ℕ → ℝ) (functions : ℕ → List ℝ → ℝ) :

                    Real interpretation of the ordered arguments of a registered call.

                    Instances For
                      structure FloatLib.Numerics.Interval.Backend.Sound {α : Type u_1} (B : Backend α) (functions : ℕ → List ℝ → ℝ := fun (x : ℕ) (x_1 : List ℝ) => 0) :

                      Containment contracts for all successful operations of an interval backend.

                      Instances For
                        theorem FloatLib.Numerics.Interval.Expr.containsReal_eval? {α : Type u_1} (e : Expr) {B : Backend α} {functions : ℕ → List ℝ → ℝ} (hB : B.Sound functions) {env : ℕ → Option (Interval α)} {values : ℕ → ℝ} (henv : ∀ (i : ℕ) (I : Interval α), env i = some I → ContainsReal B.decode I (values i)) {I : Interval α} (h : e.eval? B env = some I) :
                        ContainsReal B.decode I (e.eval values functions)

                        A successful expression evaluation encloses the exact real value throughout the input box.

                        Only variables actually supplied by the interval environment need a membership proof. A missing variable prevents successful evaluation, so it cannot create an unproved assumption.