Documentation

LeanCert.Core.IntervalRealEndpoints

Intervals with Real Endpoints #

This file defines IntervalReal, an interval type with real (ℝ) endpoints. Unlike IntervalRat (which has rational endpoints and is suitable for computation), IntervalReal allows us to represent intervals involving transcendental values like [1, Real.exp 1] or [Real.log 2, π].

Main definitions #

Main theorems #

Design notes #

This type complements IntervalRat for proving facts about transcendental functions. While IntervalRat is used for numerical computation (since rationals are computable), IntervalReal is used for correctness proofs involving exp, log, etc.

Typical workflow:

  1. Use IntervalRat for actual interval arithmetic computations
  2. Convert to IntervalReal when proving facts about transcendental functions
  3. Use mathlib's analysis lemmas directly on real intervals

An interval with real endpoints

Instances For

    The set of reals contained in this interval

    Equations
    Instances For
      @[simp]

      Create an interval from a single real

      Equations
      Instances For

        Convert from IntervalRat to IntervalReal

        Equations
        Instances For

          Interval addition #

          Add two intervals

          Equations
          Instances For
            theorem LeanCert.Core.IntervalReal.mem_add {x y : } {I J : IntervalReal} (hx : x I) (hy : y J) :
            x + y I.add J

            FTIA for addition

            Interval negation #

            Negate an interval

            Equations
            Instances For
              theorem LeanCert.Core.IntervalReal.mem_neg {x : } {I : IntervalReal} (hx : x I) :
              -x I.neg

              FTIA for negation

              Interval multiplication #

              Multiply two intervals

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For

                Exponential interval #

                Interval bound for exp. Since exp is strictly increasing, exp([a,b]) = [exp(a), exp(b)].

                Equations
                Instances For

                  FTIA for exp: if x ∈ [a,b], then exp(x) ∈ [exp(a), exp(b)]. This is FULLY PROVED - no sorry, no axioms.

                  Logarithm interval (for positive intervals) #

                  An interval that is strictly positive

                  Instances For

                    Interval bound for log on positive intervals. Since log is strictly increasing on (0, ∞), log([a,b]) = [log(a), log(b)] for a > 0.

                    Equations
                    Instances For

                      FTIA for log: if x ∈ [a,b] with a > 0, then log(x) ∈ [log(a), log(b)]. This is FULLY PROVED - no sorry, no axioms.

                      Trigonometric intervals (global bounds) #

                      Interval bound for sin. Since |sin x| ≤ 1 for all x, we use [-1, 1].

                      Equations
                      Instances For

                        Interval bound for cos. Since |cos x| ≤ 1 for all x, we use [-1, 1].

                        Equations
                        Instances For

                          Interval bound for atan. Since arctan x ∈ (-π/2, π/2) ⊂ [-2, 2] for all x.

                          Equations
                          Instances For

                            |arsinh x| ≤ |x| for all x. This follows from MVT and |arsinh'| ≤ 1.

                            Interval bound for arsinh. Uses a conservative bound based on input interval.

                            Equations
                            Instances For

                              Hyperbolic function intervals #

                              Interval bound for sinh. Since sinh is strictly monotonic increasing, sinh([a,b]) = [sinh(a), sinh(b)].

                              Equations
                              Instances For

                                FTIA for sinh: if x ∈ [a,b], then sinh(x) ∈ [sinh(a), sinh(b)]. This is FULLY PROVED - no sorry, no axioms.

                                Interval bound for cosh. cosh is convex with minimum at 0:

                                • If interval is all non-negative: cosh is increasing
                                • If interval is all non-positive: cosh is decreasing
                                • If interval contains 0: minimum is cosh(0) = 1, max is at endpoints
                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For

                                  FTIA for cosh: if x ∈ [a,b], then cosh(x) ∈ coshInterval([a,b]). This is FULLY PROVED - no sorry, no axioms.

                                  Square root interval #

                                  Interval bound for sqrt. For any interval I, sqrt(x) ∈ [0, max(hi, 1)] for x ∈ I. This is always sound because:

                                  • sqrt(x) ≥ 0 for all x (Mathlib convention: sqrt(negative) = 0)
                                  • sqrt(x) ≤ max(x, 1) for x ≥ 0, so sqrt(x) ≤ max(hi, 1)
                                  Equations
                                  Instances For

                                    FTIA for sqrt: if x ∈ I, then sqrt(x) ∈ sqrtInterval(I). Works for all x including negative (where sqrt returns 0 by Mathlib convention).