PDEAtlas

10.9. Validated Solvers and Certificate Workflows🔗

10.9.1. Validated Nonlinear Algebra🔗

Validated numerical work often begins with data that is useful but not yet a proof: an affine approximation, a narrow interval around a suspected root, or a floating-point approximation to a matrix inverse. Each kernel comes with the small mathematical obligation that turns such a proposal into an ordinary Lean theorem: an enclosure, a uniqueness claim, or an invertibility theorem.

Definition10.124
Group: Certified continuous computation (105)
Group member previews
Preview
Definition 10.36
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
uses 1used by 1✓L∃∀N

An affine model, in FloatLib's affine arithmetic FloatLib.Numerics.Enclosure.Affine, consists of an exact rational affine form A(\varepsilon) and a rational interval R for the terms not retained in that form. It represents a real value x when

x-A(\varepsilon)\in R.

The reported range is the interval sum of the affine range and R. The noise variables are shared between occurrences of the same input coordinate, so the model retains dependencies that ordinary interval substitution would forget.

Lean code for Definition10.124●2 definitions
  • def FloatLib.Numerics.Enclosure.Affine.AffineModel.Represents
      (m : FloatLib.Numerics.Enclosure.Affine.AffineModel) (ε : ℕ → ℝ)
      (x : ℝ) : Prop
    def FloatLib.Numerics.Enclosure.Affine.AffineModel.Represents
      (m :
        FloatLib.Numerics.Enclosure.Affine.AffineModel)
      (ε : ℕ → ℝ) (x : ℝ) : Prop

    A model represents x at the noise assignment ε when x minus the value of the form at ε lies in the remainder.

  • def FloatLib.Numerics.Enclosure.Affine.AffineModel.range
      (m : FloatLib.Numerics.Enclosure.Affine.AffineModel) :
      FloatLib.Numerics.Interval ℚ
    def FloatLib.Numerics.Enclosure.Affine.AffineModel.range
      (m :
        FloatLib.Numerics.Enclosure.Affine.AffineModel) :
      FloatLib.Numerics.Interval ℚ

    An enclosure of every value the model represents on the unit box: the range of the form plus the remainder.

Theorem10.125
Group: Certified continuous computation (105)
Group member previews
Preview
Definition 10.36
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
uses 1used by 1✓L∃∀N

Suppose affine models M_A and M_B represent x and y at a common noise assignment satisfying |\varepsilon_i|\leq1. The checked product model represents xy at the same assignment.

Its affine part retains the constant and linear terms. Its interval remainder contains the quadratic noise product, the two affine-remainder cross terms, and the product of the old remainders.

Lean code for Theorem10.125●1 theorem
  • theorem FloatLib.Numerics.Enclosure.Affine.AffineModel.Represents.mul
      {a b : FloatLib.Numerics.Enclosure.Affine.AffineModel} {ε : ℕ → ℝ}
      {x y : ℝ} (hx : a.Represents ε x) (hy : b.Represents ε y)
      (hε : ∀ (i : ℕ), |ε i| ≤ 1) : (a.mul b).Represents ε (x * y)
    theorem FloatLib.Numerics.Enclosure.Affine.AffineModel.Represents.mul
      {a b :
        FloatLib.Numerics.Enclosure.Affine.AffineModel}
      {ε : ℕ → ℝ} {x y : ℝ}
      (hx : a.Represents ε x)
      (hy : b.Represents ε y)
      (hε : ∀ (i : ℕ), |ε i| ≤ 1) :
      (a.mul b).Represents ε (x * y)

    The product of two models represents the product of the represented values, at every assignment with |ε i| ≤ 1 for all i.

Proof for Theorem 10.125
uses 0

Write x=A+r and y=B+s. Expand xy=AB+As+Br+rs, separate the constant-linear part of AB, and enclose the discarded quadratic term using \varepsilon_i^2\in[0,1] on the diagonal and \varepsilon_i\varepsilon_j\in[-1,1] off the diagonal. FloatLib's exact interval addition and multiplication theorems enclose the remaining three terms.

Theorem10.126
Group: Certified continuous computation (105)
Group member previews
Preview
Definition 10.36
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
Statement uses 2
Statement dependency previews
Preview
Theorem 10.125
Loading preview
Statement dependency preview content is loaded from the rendered-fragment cache.
used by 0✓L∃∀N

FloatLib's affine compiler Expr.affineModel? accepts rational constants, variables, addition, subtraction, negation, multiplication, and natural powers. A CAS expression reaches it through the translation into FloatLib's expression language, with one number for each variable. If the compiler returns a model for an expression on a rational box, every point of that box evaluates inside the model's reported range.

Each input interval is recentered as c_i+r_i\varepsilon_i. For any boxed point, the recovered noise lies in [-1,1] and recenters to the original point. On unsupported expression constructors the compiler fails.

Lean code for Theorem10.126●3 declarations
  • theorem FloatLib.Numerics.Enclosure.Affine.Expr.represents_unitNoise
      {e : FloatLib.Numerics.Interval.Expr}
      {box : FloatLib.Numerics.Interval.Box}
      {m : FloatLib.Numerics.Enclosure.Affine.AffineModel}
      (h :
        FloatLib.Numerics.Enclosure.Affine.Expr.affineModel? e box = some m)
      {x : ℕ → ℝ} (hx : box.ContainsReal x) (functions : ℕ → List ℝ → ℝ) :
      m.Represents (FloatLib.Numerics.Enclosure.Affine.unitNoise box x)
        (e.eval x functions)
    theorem FloatLib.Numerics.Enclosure.Affine.Expr.represents_unitNoise
      {e : FloatLib.Numerics.Interval.Expr}
      {box : FloatLib.Numerics.Interval.Box}
      {m :
        FloatLib.Numerics.Enclosure.Affine.AffineModel}
      (h :
        FloatLib.Numerics.Enclosure.Affine.Expr.affineModel?
            e box =
          some m)
      {x : ℕ → ℝ} (hx : box.ContainsReal x)
      (functions : ℕ → List ℝ → ℝ) :
      m.Represents
        (FloatLib.Numerics.Enclosure.Affine.unitNoise
          box x)
        (e.eval x functions)

    A compiled model represents the value of the expression at every real point x of the box, at the noise assignment unitNoise box x.

  • def CAS.Continuum.RationalInterval.affineRange?.{u_1} {ι : Type u_1}
      [DecidableEq ι] (box : ι → CAS.Continuum.RationalInterval)
      (expr : CAS.Verified.Expr ι) : Option CAS.Continuum.RationalInterval
    def CAS.Continuum.RationalInterval.affineRange?.{u_1}
      {ι : Type u_1} [DecidableEq ι]
      (box :
        ι → CAS.Continuum.RationalInterval)
      (expr : CAS.Verified.Expr ι) :
      Option CAS.Continuum.RationalInterval

    The affine range of expr on the rational box box, or none when expr has a rational literal with denominator zero or lies outside the polynomial fragment.

    This is floatLibAffineRange? box expr, FloatLib's affine range of the translation, as a rational interval. Its ends are ordered because it contains the value of expr at the lower corner of the box (containsReal_floatLibAffineRange?).

  • theorem CAS.Continuum.RationalInterval.mem_affineRange_of_memBox.{u_1}
      {ι : Type u_1} [DecidableEq ι]
      (box : ι → CAS.Continuum.RationalInterval)
      (expr : CAS.Verified.Expr ι) (range : CAS.Continuum.RationalInterval)
      (x : ι → ℝ) (hx : ∀ (i : ι), (box i).MemReal (x i))
      (h :
        CAS.Continuum.RationalInterval.affineRange? box expr = some range) :
      range.MemReal (CAS.Verified.Expr.eval x expr)
    theorem CAS.Continuum.RationalInterval.mem_affineRange_of_memBox.{u_1}
      {ι : Type u_1} [DecidableEq ι]
      (box :
        ι → CAS.Continuum.RationalInterval)
      (expr : CAS.Verified.Expr ι)
      (range : CAS.Continuum.RationalInterval)
      (x : ι → ℝ)
      (hx : ∀ (i : ι), (box i).MemReal (x i))
      (h :
        CAS.Continuum.RationalInterval.affineRange?
            box expr =
          some range) :
      range.MemReal
        (CAS.Verified.Expr.eval x expr)

    A successful affine range contains every evaluation on the original variable box.

Proof for Theorem 10.126
uses 0

Induct on the translated expression, using the affine semantic theorem for each accepted constructor. Recover one unit noise per input coordinate from the boxed point, prove its magnitude is at most one, and rewrite the recentered coordinates back to the original point. The model-range theorem then supplies the ordinary enclosure, and the translation's real-denotation equality returns it to the CAS expression.

Theorem10.127
Group: Certified continuous computation (105)
Group member previews
Preview
Definition 10.36
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
Statement uses 2
Statement dependency previews
Preview
Theorem 10.6
Loading preview
Statement dependency preview content is loaded from the rendered-fragment cache.
used by 1✓L∃∀N

A checked interval-Newton step for a rational univariate polynomial uses a nondegenerate input interval and a sign-definite interval enclosure of the derivative. It checks the proposed image against the exact Newton image computed from the midpoint. Every input root lies in that image.

For the checked Newton image N(I), the localization contract is

x\in I\ \land\ p(x)=0\quad\Longrightarrow\quad x\in N(I).

If endpoint signs bracket a root, derivative nonvanishing gives exactly one root in the input interval. If the checked image is disjoint from the input, the input interval contains no root:

N(I)\cap I=\varnothing \quad\Longrightarrow\quad \forall x\in I,\ p(x)\ne0.

Both conclusions are local to the stated interval.

Lean code for Theorem10.127●3 theorems
  • theorem CAS.Polynomial.RealRoot.IntervalNewtonCertificate.root_mem_image
      (polynomial : CAS.Polynomial.Sparse.Univariate)
      (certificate : CAS.Polynomial.RealRoot.IntervalNewtonCertificate)
      (hvalid :
        CAS.Polynomial.RealRoot.IntervalNewtonCertificate.valid polynomial
            certificate =
          true)
      {x : ℝ} (hx : certificate.interval.MemReal x)
      (hroot : CAS.Polynomial.Sparse.evalReal polynomial x = 0) :
      certificate.image.MemReal x
    theorem CAS.Polynomial.RealRoot.IntervalNewtonCertificate.root_mem_image
      (polynomial :
        CAS.Polynomial.Sparse.Univariate)
      (certificate :
        CAS.Polynomial.RealRoot.IntervalNewtonCertificate)
      (hvalid :
        CAS.Polynomial.RealRoot.IntervalNewtonCertificate.valid
            polynomial certificate =
          true)
      {x : ℝ}
      (hx : certificate.interval.MemReal x)
      (hroot :
        CAS.Polynomial.Sparse.evalReal
            polynomial x =
          0) :
      certificate.image.MemReal x

    Every root in the input interval belongs to the checked interval-Newton image.

  • theorem CAS.Polynomial.RealRoot.IntervalNewtonCertificate.existsUnique_root
      (polynomial : CAS.Polynomial.Sparse.Univariate)
      (certificate : CAS.Polynomial.RealRoot.IntervalNewtonCertificate)
      (hvalid :
        CAS.Polynomial.RealRoot.IntervalNewtonCertificate.isolatesRoot
            polynomial certificate =
          true) :
      ∃! x,
        certificate.interval.MemReal x ∧
          CAS.Polynomial.Sparse.evalReal polynomial x = 0
    theorem CAS.Polynomial.RealRoot.IntervalNewtonCertificate.existsUnique_root
      (polynomial :
        CAS.Polynomial.Sparse.Univariate)
      (certificate :
        CAS.Polynomial.RealRoot.IntervalNewtonCertificate)
      (hvalid :
        CAS.Polynomial.RealRoot.IntervalNewtonCertificate.isolatesRoot
            polynomial certificate =
          true) :
      ∃! x,
        certificate.interval.MemReal x ∧
          CAS.Polynomial.Sparse.evalReal
              polynomial x =
            0

    An accepted isolating interval-Newton certificate has exactly one root in its input interval.

    Uniqueness is relative to the input interval. root_mem_image separately localizes this root to the checked Newton image, and no conclusion is made about roots outside the input interval.

  • theorem CAS.Polynomial.RealRoot.IntervalNewtonCertificate.nonzeroOn_of_excludesRoots_eq_true
      (polynomial : CAS.Polynomial.Sparse.Univariate)
      (certificate : CAS.Polynomial.RealRoot.IntervalNewtonCertificate)
      (hvalid :
        CAS.Polynomial.RealRoot.IntervalNewtonCertificate.excludesRoots
            polynomial certificate =
          true) :
      CAS.Domain.NonzeroOn (CAS.Polynomial.Sparse.evalReal polynomial)
        (Set.Icc ↑certificate.interval.lo ↑certificate.interval.hi)
    theorem CAS.Polynomial.RealRoot.IntervalNewtonCertificate.nonzeroOn_of_excludesRoots_eq_true
      (polynomial :
        CAS.Polynomial.Sparse.Univariate)
      (certificate :
        CAS.Polynomial.RealRoot.IntervalNewtonCertificate)
      (hvalid :
        CAS.Polynomial.RealRoot.IntervalNewtonCertificate.excludesRoots
            polynomial certificate =
          true) :
      CAS.Domain.NonzeroOn
        (CAS.Polynomial.Sparse.evalReal
          polynomial)
        (Set.Icc ↑certificate.interval.lo
          ↑certificate.interval.hi)

    An accepted disjoint interval-Newton image proves root exclusion on the input interval.

Proof for Theorem 10.127
uses 0

The mean value theorem expresses a root relative to the interval midpoint. The derivative enclosure and its sign select a valid reciprocal interval, so interval arithmetic places the root in the proposed Newton image. Endpoint signs give existence by the intermediate value theorem and strict monotonicity gives uniqueness. Disjointness contradicts image membership and therefore proves root exclusion.

For p(x)=x^2-2 on I=[1,2], take the midpoint m=3/2. Then p(m)=1/4 and p'(I)\subseteq[2,4]. Any root z\in I satisfies 0=p(m)+p'(\xi)(z-m) for some intermediate \xi, hence

z\in m-\frac{p(m)}{[2,4]} =\frac32-\left[\frac1{16},\frac18\right] =\left[\frac{11}{8},\frac{23}{16}\right].

This narrows a width-one bracket to width 1/16. The endpoint signs p(1)<0<p(2) establish existence, and p'>0 establishes uniqueness. The Newton-image calculation localizes that root; its localization implication alone would also be true if there were no root.

Definition10.128
Group: Certified continuous computation (105)
Group member previews
Preview
Definition 10.36
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
uses 0
Used by 2
Reverse dependency previews
Preview
Theorem 10.129
Loading preview
Reverse dependency preview content is loaded from the rendered-fragment cache.
✓L∃∀N

For finite square matrices, an approximate-inverse candidate stores a target matrix A, a proposed inverse B, and a nonnegative residual bound \eta. The proposal contains no proof. Certification requires

\lVert I-BA\rVert\leq\eta<1

in Mathlib's Euclidean matrix operator norm.

Lean code for Definition10.128●2 definitions
  • structure(3 fields)defined in CAS/Continuum/MatrixVerification.lean
    complete
    structure CAS.Continuum.MatrixVerification.ApproximateInverseCandidate.{u_1, u_2}
      (n : Type u_1) (𝕜 : Type u_2) : Type (max u_1 u_2)
    structure CAS.Continuum.MatrixVerification.ApproximateInverseCandidate.{u_1,
        u_2}
      (n : Type u_1) (𝕜 : Type u_2) :
      Type (max u_1 u_2)

    Proof-free data proposed by a finite-dimensional approximate-inverse computation.

    matrix : Matrix n n 𝕜

    Square matrix whose invertibility is to be certified.

    proposedInverse : Matrix n n 𝕜

    Numerically proposed inverse. It is not assumed to be exact.

    residualBound : NNReal

    Proposed nonnegative upper bound for the operator norm of the left residual.

  • def CAS.Continuum.MatrixVerification.ApproximateInverseCandidate.IsCertified.{u_1,
        u_2}
      {n : Type u_1} {𝕜 : Type u_2} [Fintype n] [DecidableEq n] [RCLike 𝕜]
      (candidate :
        CAS.Continuum.MatrixVerification.ApproximateInverseCandidate n 𝕜) :
      Prop
    def CAS.Continuum.MatrixVerification.ApproximateInverseCandidate.IsCertified.{u_1,
        u_2}
      {n : Type u_1} {𝕜 : Type u_2}
      [Fintype n] [DecidableEq n] [RCLike 𝕜]
      (candidate :
        CAS.Continuum.MatrixVerification.ApproximateInverseCandidate
          n 𝕜) :
      Prop

    The mathematical obligations for an approximate-inverse certificate.

    The norm is Mathlib's Euclidean operator norm on matrices. This proposition is kept separate from ApproximateInverseCandidate: untrusted numerical code may propose the data, but the residual inequality and strict threshold must be proved in Lean.

Theorem10.129
Group: Certified continuous computation (105)
Group member previews
Preview
Definition 10.36
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
uses 1
Used by 2
Reverse dependency previews
Preview
Theorem 10.130
Loading preview
Reverse dependency preview content is loaded from the rendered-fragment cache.
✓L∃∀N

Every certified approximate inverse proves that A is a unit and that its Euclidean continuous linear operator is bijective. It also gives the a posteriori estimate

\lVert A^{-1}-B\rVert \leq \eta\,\lVert A^{-1}\rVert.

The proposed inverse need not equal A^{-1}.

Lean code for Theorem10.129●3 theorems
  • complete
    theorem CAS.Continuum.MatrixVerification.ApproximateInverseCandidate.matrix_isUnit.{u_1,
        u_2}
      {n : Type u_1} {𝕜 : Type u_2} [Fintype n] [DecidableEq n] [RCLike 𝕜]
      {candidate :
        CAS.Continuum.MatrixVerification.ApproximateInverseCandidate n 𝕜}
      (hcert : candidate.IsCertified) : IsUnit candidate.matrix
    theorem CAS.Continuum.MatrixVerification.ApproximateInverseCandidate.matrix_isUnit.{u_1,
        u_2}
      {n : Type u_1} {𝕜 : Type u_2}
      [Fintype n] [DecidableEq n] [RCLike 𝕜]
      {candidate :
        CAS.Continuum.MatrixVerification.ApproximateInverseCandidate
          n 𝕜}
      (hcert : candidate.IsCertified) :
      IsUnit candidate.matrix

    A certified one-sided approximate inverse proves that the target square matrix is a unit.

  • complete
    theorem CAS.Continuum.MatrixVerification.ApproximateInverseCandidate.toEuclideanCLM_bijective.{u_1,
        u_2}
      {n : Type u_1} {𝕜 : Type u_2} [Fintype n] [DecidableEq n] [RCLike 𝕜]
      {candidate :
        CAS.Continuum.MatrixVerification.ApproximateInverseCandidate n 𝕜}
      (hcert : candidate.IsCertified) :
      Function.Bijective ⇑(Matrix.toEuclideanCLM candidate.matrix)
    theorem CAS.Continuum.MatrixVerification.ApproximateInverseCandidate.toEuclideanCLM_bijective.{u_1,
        u_2}
      {n : Type u_1} {𝕜 : Type u_2}
      [Fintype n] [DecidableEq n] [RCLike 𝕜]
      {candidate :
        CAS.Continuum.MatrixVerification.ApproximateInverseCandidate
          n 𝕜}
      (hcert : candidate.IsCertified) :
      Function.Bijective
        ⇑(Matrix.toEuclideanCLM
            candidate.matrix)

    The matrix associated to a certified candidate acts bijectively on Euclidean space.

  • complete
    theorem CAS.Continuum.MatrixVerification.ApproximateInverseCandidate.inverse_sub_proposedInverse_norm_le.{u_1,
        u_2}
      {n : Type u_1} {𝕜 : Type u_2} [Fintype n] [DecidableEq n] [RCLike 𝕜]
      {candidate :
        CAS.Continuum.MatrixVerification.ApproximateInverseCandidate n 𝕜}
      (hcert : candidate.IsCertified) :
      ‖Ring.inverse candidate.matrix - candidate.proposedInverse‖ ≤
        ↑candidate.residualBound * ‖Ring.inverse candidate.matrix‖
    theorem CAS.Continuum.MatrixVerification.ApproximateInverseCandidate.inverse_sub_proposedInverse_norm_le.{u_1,
        u_2}
      {n : Type u_1} {𝕜 : Type u_2}
      [Fintype n] [DecidableEq n] [RCLike 𝕜]
      {candidate :
        CAS.Continuum.MatrixVerification.ApproximateInverseCandidate
          n 𝕜}
      (hcert : candidate.IsCertified) :
      ‖Ring.inverse candidate.matrix -
            candidate.proposedInverse‖ ≤
        ↑candidate.residualBound *
          ‖Ring.inverse candidate.matrix‖

    A posteriori error bound for the proposed inverse.

    The right side uses the certified residual bound and the norm of the ring inverse, which the certificate itself does not bound.

Proof for Theorem 10.129
uses 0

The strict residual bound makes I-(I-BA)=BA a unit by Mathlib's Neumann theorem. Direct finiteness of the square matrix algebra then implies that both factors B and A are units. Mapping the matrix unit into continuous linear maps gives bijectivity. Finally, A^{-1}-B=(I-BA)A^{-1} and norm submultiplicativity give the error bound.

Theorem10.130
Group: Certified continuous computation (105)
Group member previews
Preview
Definition 10.36
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
uses 1used by 1✓L∃∀N

An alternative checker accepts exact rational upper bounds u_{ij} for the absolute values of the entries of I-BA. If every row sum of these bounds is at most \eta<1, then the matrix infinity norm of the residual is below one and A is invertible.

This route matches the output of entrywise interval evaluation. Its conclusion is algebraic invertibility, so later Euclidean arguments do not need to identify the infinity norm with the Euclidean operator norm.

Lean code for Theorem10.130●3 theorems
  • theorem CAS.Continuum.MatrixVerification.ResidualEntryBounds.row_norm_sum_le.{u_1,
        u_2}
      {n : Type u_1} {𝕜 : Type u_2} [Fintype n] [DecidableEq n] [RCLike 𝕜]
      (bounds : CAS.Continuum.MatrixVerification.ResidualEntryBounds n)
      (candidate :
        CAS.Continuum.MatrixVerification.ApproximateInverseCandidate n 𝕜)
      (hcert : bounds.IsCertified candidate) (i : n) :
      ∑ j, ‖candidate.leftResidual i j‖ ≤ ↑candidate.residualBound
    theorem CAS.Continuum.MatrixVerification.ResidualEntryBounds.row_norm_sum_le.{u_1,
        u_2}
      {n : Type u_1} {𝕜 : Type u_2}
      [Fintype n] [DecidableEq n] [RCLike 𝕜]
      (bounds :
        CAS.Continuum.MatrixVerification.ResidualEntryBounds
          n)
      (candidate :
        CAS.Continuum.MatrixVerification.ApproximateInverseCandidate
          n 𝕜)
      (hcert : bounds.IsCertified candidate)
      (i : n) :
      ∑ j, ‖candidate.leftResidual i j‖ ≤
        ↑candidate.residualBound

    Certified entry bounds imply the corresponding absolute row-sum estimates.

  • theorem CAS.Continuum.MatrixVerification.ResidualEntryBounds.residual_norm_lt_one.{u_1,
        u_2}
      {n : Type u_1} {𝕜 : Type u_2} [Fintype n] [DecidableEq n] [RCLike 𝕜]
      (bounds : CAS.Continuum.MatrixVerification.ResidualEntryBounds n)
      (candidate :
        CAS.Continuum.MatrixVerification.ApproximateInverseCandidate n 𝕜)
      (hcert : bounds.IsCertified candidate) : ‖candidate.leftResidual‖ < 1
    theorem CAS.Continuum.MatrixVerification.ResidualEntryBounds.residual_norm_lt_one.{u_1,
        u_2}
      {n : Type u_1} {𝕜 : Type u_2}
      [Fintype n] [DecidableEq n] [RCLike 𝕜]
      (bounds :
        CAS.Continuum.MatrixVerification.ResidualEntryBounds
          n)
      (candidate :
        CAS.Continuum.MatrixVerification.ApproximateInverseCandidate
          n 𝕜)
      (hcert : bounds.IsCertified candidate) :
      ‖candidate.leftResidual‖ < 1

    Certified entry bounds put the matrix infinity norm of the residual below one.

  • theorem CAS.Continuum.MatrixVerification.ResidualEntryBounds.matrix_isUnit.{u_1,
        u_2}
      {n : Type u_1} {𝕜 : Type u_2} [Fintype n] [DecidableEq n] [RCLike 𝕜]
      (bounds : CAS.Continuum.MatrixVerification.ResidualEntryBounds n)
      (candidate :
        CAS.Continuum.MatrixVerification.ApproximateInverseCandidate n 𝕜)
      (hcert : bounds.IsCertified candidate) : IsUnit candidate.matrix
    theorem CAS.Continuum.MatrixVerification.ResidualEntryBounds.matrix_isUnit.{u_1,
        u_2}
      {n : Type u_1} {𝕜 : Type u_2}
      [Fintype n] [DecidableEq n] [RCLike 𝕜]
      (bounds :
        CAS.Continuum.MatrixVerification.ResidualEntryBounds
          n)
      (candidate :
        CAS.Continuum.MatrixVerification.ApproximateInverseCandidate
          n 𝕜)
      (hcert : bounds.IsCertified candidate) :
      IsUnit candidate.matrix

    Entrywise row-sum verification proves that the target square matrix is invertible.

Proof for Theorem 10.130
uses 0

Sum the checked entry bounds along each row and use Mathlib's formula for the matrix infinity norm as the maximum absolute row sum. The strict row-sum bound allows the same Neumann argument for BA; direct finiteness again projects invertibility to A.

Theorem10.131
Group: Certified continuous computation (105)
Group member previews
Preview
Definition 10.36
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
Statement uses 2
Statement dependency previews
Preview
Theorem 10.41
Loading preview
Statement dependency preview content is loaded from the rendered-fragment cache.
used by 0✓L∃∀N

Let A(x) and the proposed inverse B(x) be square matrices of reflected real expressions. A constant rational matrix is one possible choice of B. The compiler forms I-B(x)A(x), evaluates every entry through one checked interval context, replaces each interval by its exact endpoint absolute maximum, and computes the largest rational row sum q.

If every entry compiles and q<1, then for every parameter point x in the context domain the real matrix A(x) is invertible. Failure of any entry or of the strict comparison returns none.

Lean code for Theorem10.131●3 declarations
  • theorem CAS.Continuum.MatrixVerification.Expression.evalMatrix_leftResidual.{u_1}
      {n : ℕ} {ι : Type u_1} (ρ : ι → ℝ)
      (matrix proposedInverse :
        Matrix (Fin n) (Fin n) (CAS.Verified.Expr ι)) :
      CAS.Continuum.MatrixVerification.Expression.evalMatrix ρ
          (CAS.Continuum.MatrixVerification.Expression.leftResidual matrix
            proposedInverse) =
        1 -
          CAS.Continuum.MatrixVerification.Expression.evalMatrix ρ
              proposedInverse *
            CAS.Continuum.MatrixVerification.Expression.evalMatrix ρ matrix
    theorem CAS.Continuum.MatrixVerification.Expression.evalMatrix_leftResidual.{u_1}
      {n : ℕ} {ι : Type u_1} (ρ : ι → ℝ)
      (matrix proposedInverse :
        Matrix (Fin n) (Fin n)
          (CAS.Verified.Expr ι)) :
      CAS.Continuum.MatrixVerification.Expression.evalMatrix
          ρ
          (CAS.Continuum.MatrixVerification.Expression.leftResidual
            matrix proposedInverse) =
        1 -
          CAS.Continuum.MatrixVerification.Expression.evalMatrix
              ρ proposedInverse *
            CAS.Continuum.MatrixVerification.Expression.evalMatrix
              ρ matrix

    Symbolic left-residual formation commutes with evaluation.

  • def CAS.Continuum.MatrixVerification.Expression.ApproximateInverseData.certify?.{u_1,
        u_2}
      {α : Type u_1} {ι : Type u_2} {s : Set α} {ρ : α → ι → ℝ} {n : ℕ}
      (context :
        CAS.Continuum.ExprIntervalContext CAS.Continuum.RationalInterval s
          ρ)
      (data :
        CAS.Continuum.MatrixVerification.Expression.ApproximateInverseData n
          ι) :
      Option
        (CAS.Continuum.MatrixVerification.Expression.ResidualIntervals n)
    def CAS.Continuum.MatrixVerification.Expression.ApproximateInverseData.certify?.{u_1,
        u_2}
      {α : Type u_1} {ι : Type u_2}
      {s : Set α} {ρ : α → ι → ℝ} {n : ℕ}
      (context :
        CAS.Continuum.ExprIntervalContext
          CAS.Continuum.RationalInterval s ρ)
      (data :
        CAS.Continuum.MatrixVerification.Expression.ApproximateInverseData
          n ι) :
      Option
        (CAS.Continuum.MatrixVerification.Expression.ResidualIntervals
          n)

    Run the full automatic checker.

    The strict row-sum threshold is decided over exact rationals. Failure of any entry evaluation or failure of the threshold returns none.

  • theorem CAS.Continuum.MatrixVerification.Expression.ApproximateInverseData.matrix_isUnitAt.{u_1,
        u_2}
      {α : Type u_1} {ι : Type u_2} {s : Set α} {ρ : α → ι → ℝ} {n : ℕ}
      (context :
        CAS.Continuum.ExprIntervalContext CAS.Continuum.RationalInterval s
          ρ)
      (data :
        CAS.Continuum.MatrixVerification.Expression.ApproximateInverseData n
          ι)
      (result :
        CAS.Continuum.MatrixVerification.Expression.ResidualIntervals n)
      (hresult :
        CAS.Continuum.MatrixVerification.Expression.ApproximateInverseData.certify?
            context data =
          some result)
      (x : α) (hx : x ∈ s) :
      IsUnit
        (CAS.Continuum.MatrixVerification.Expression.evalMatrix (ρ x)
          data.matrix)
    theorem CAS.Continuum.MatrixVerification.Expression.ApproximateInverseData.matrix_isUnitAt.{u_1,
        u_2}
      {α : Type u_1} {ι : Type u_2}
      {s : Set α} {ρ : α → ι → ℝ} {n : ℕ}
      (context :
        CAS.Continuum.ExprIntervalContext
          CAS.Continuum.RationalInterval s ρ)
      (data :
        CAS.Continuum.MatrixVerification.Expression.ApproximateInverseData
          n ι)
      (result :
        CAS.Continuum.MatrixVerification.Expression.ResidualIntervals
          n)
      (hresult :
        CAS.Continuum.MatrixVerification.Expression.ApproximateInverseData.certify?
            context data =
          some result)
      (x : α) (hx : x ∈ s) :
      IsUnit
        (CAS.Continuum.MatrixVerification.Expression.evalMatrix
          (ρ x) data.matrix)

    Every matrix accepted by the expression checker is invertible throughout the domain.

Proof for Theorem 10.131
uses 0

Expression evaluation commutes with matrix multiplication, so the generated symbolic matrix denotes the actual residual I-B(x)A(x). Interval soundness bounds each residual entry. Summing endpoint absolute maxima bounds every row, and taking the finite maximum gives the advertised q. The checked row-sum Neumann theorem then proves invertibility pointwise.

Definition10.132
Group: Certified continuous computation (105)
Group member previews
Preview
Definition 10.36
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
Statement uses 2
Statement dependency previews
Preview
Theorem 10.127
Loading preview
Statement dependency preview content is loaded from the rendered-fragment cache.
used by 1✓L∃∀N

For a real map F:\mathbb R^n\to\mathbb R^n, a ball-form Krawczyk proposal stores a center x_0, nonnegative radius r, real approximate-inverse matrix B, and nonnegative contraction bound q. Certification requires an actual Fréchet Jacobian J(x) on the closed ball together with

\lVert I-BJ(x)\rVert_2\leq q<1, \qquad \lVert BF(x_0)\rVert_2+qr\leq r.

For a fixed rational matrix B, the interval layer encloses the entries of J(x) and compiles those bounds to I-BJ(x). Its Frobenius checker computes the sum of squared endpoint absolute bounds in exact nonnegative-rational arithmetic. The certificate is stated for a closed Euclidean ball rather than for the rectangular boxes of the classical Krawczyk operator.

Lean code for Definition10.132●4 definitions
  • structure(4 fields)defined in CAS/Continuum/Krawczyk/Certificate.lean
    complete
    structure CAS.Continuum.Krawczyk.Certificate.{u_2} (n : Type u_2) : Type u_2
    structure CAS.Continuum.Krawczyk.Certificate.{u_2}
      (n : Type u_2) : Type u_2

    Proof-free numerical data proposed for a Krawczyk verification.

    center : EuclideanSpace ℝ n

    Center of the localization ball.

    radius : NNReal

    Intrinsically nonnegative radius of the localization ball.

    approximateInverse : Matrix n n ℝ

    Numerically proposed inverse for the Jacobian.

    contractionBound : NNReal

    Proposed uniform bound for ‖I - B J(x)‖.

  • def CAS.Continuum.Krawczyk.Certificate.IsCertified.{u_1} {n : Type u_1}
      [Fintype n] [DecidableEq n]
      (certificate : CAS.Continuum.Krawczyk.Certificate n)
      (function : EuclideanSpace ℝ n → EuclideanSpace ℝ n)
      (jacobian : EuclideanSpace ℝ n → Matrix n n ℝ) : Prop
    def CAS.Continuum.Krawczyk.Certificate.IsCertified.{u_1}
      {n : Type u_1} [Fintype n]
      [DecidableEq n]
      (certificate :
        CAS.Continuum.Krawczyk.Certificate n)
      (function :
        EuclideanSpace ℝ n →
          EuclideanSpace ℝ n)
      (jacobian :
        EuclideanSpace ℝ n → Matrix n n ℝ) :
      Prop

    Kernel-checked mathematical obligations for a Krawczyk proposal.

    The first conjunct is q < 1. The second is the ball form of the Krawczyk forward-inclusion estimate: ‖B F(center)‖ + q * radius ≤ radius. The final two conjuncts are the Jacobian identity HasJacobianOn and the residual bound ResidualEnclosedOn on the ball.

  • def CAS.Continuum.Krawczyk.residualBounds.{u_1} {n : Type u_1} [Fintype n]
      [DecidableEq n] (approximateInverse : Matrix n n ℚ)
      (jacobianBounds : Matrix n n CAS.Continuum.RationalInterval) :
      Matrix n n CAS.Continuum.RationalInterval
    def CAS.Continuum.Krawczyk.residualBounds.{u_1}
      {n : Type u_1} [Fintype n]
      [DecidableEq n]
      (approximateInverse : Matrix n n ℚ)
      (jacobianBounds :
        Matrix n n
          CAS.Continuum.RationalInterval) :
      Matrix n n
        CAS.Continuum.RationalInterval

    Entrywise rational interval enclosure of I - B J.

    The finite sum is evaluated using exact rational interval arithmetic. Dependency between Jacobian entries is conservatively discarded at this layer.

  • def CAS.Continuum.Krawczyk.certifyFrobenius.{u_1} {n : Type u_1} [Fintype n]
      (bounds : Matrix n n CAS.Continuum.RationalInterval) (bound : ℚ≥0) :
      Bool
    def CAS.Continuum.Krawczyk.certifyFrobenius.{u_1}
      {n : Type u_1} [Fintype n]
      (bounds :
        Matrix n n
          CAS.Continuum.RationalInterval)
      (bound : ℚ≥0) : Bool

    Check a Frobenius proposal using exact nonnegative-rational arithmetic.

    Returning true means only that the executable rational comparison succeeded; certifyFrobenius_sound supplies its kernel-checked semantic interpretation.

The two inequalities have different jobs. For T(x)=x-BF(x), the Jacobian bound contracts distances throughout the ball. Writing \eta=\|BF(x_0)\|, the center moves by \eta, so

\|T(x)-x_0\| \leq\|T(x)-T(x_0)\|+\|T(x_0)-x_0\| \leq qr+\eta.

Thus \eta+qr\leq r keeps the entire image inside the ball. Equivalently, the radius must absorb the amplified center defect \eta/(1-q). This is the local finite-dimensional version of the defect estimate in the fixed-point chapter, with the self-map condition checked explicitly.

Theorem10.133
Group: Certified continuous computation (105)
Group member previews
Preview
Definition 10.36
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
Statement uses 2
Statement dependency previews
Preview
Theorem 10.129
Loading preview
Statement dependency preview content is loaded from the rendered-fragment cache.
used by 0✓L∃∀N

Every certified ball-form Krawczyk proposal proves

\exists!x\in\overline B(x_0,r),\qquad F(x)=0.

Uniqueness is local to the certified ball. The proof derives the invertibility of B from the contraction bound.

Lean code for Theorem10.133●3 theorems
  • complete
    theorem CAS.Continuum.Krawczyk.certifyFrobenius_sound.{u_1} {n : Type u_1}
      [Fintype n] [DecidableEq n]
      {bounds : Matrix n n CAS.Continuum.RationalInterval} {bound : ℚ≥0}
      (hverified :
        CAS.Continuum.Krawczyk.certifyFrobenius bounds bound = true) :
      CAS.Continuum.Krawczyk.CertifiesOperatorNorm bounds ↑bound
    theorem CAS.Continuum.Krawczyk.certifyFrobenius_sound.{u_1}
      {n : Type u_1} [Fintype n]
      [DecidableEq n]
      {bounds :
        Matrix n n
          CAS.Continuum.RationalInterval}
      {bound : ℚ≥0}
      (hverified :
        CAS.Continuum.Krawczyk.certifyFrobenius
            bounds bound =
          true) :
      CAS.Continuum.Krawczyk.CertifiesOperatorNorm
        bounds ↑bound

    A successful exact-rational Frobenius check proves CertifiesOperatorNorm.

  • complete
    theorem CAS.Continuum.Krawczyk.isCertified_of_intervals.{u_1} {n : Type u_1}
      [Fintype n] [DecidableEq n]
      {certificate : CAS.Continuum.Krawczyk.Certificate n}
      {function : EuclideanSpace ℝ n → EuclideanSpace ℝ n}
      {jacobian : EuclideanSpace ℝ n → Matrix n n ℝ}
      {rationalInverse : Matrix n n ℚ}
      {jacobianBounds : Matrix n n CAS.Continuum.RationalInterval}
      (hcontraction : certificate.contractionBound < 1)
      (hselfMap :
        ‖(CAS.Continuum.Krawczyk.matrixOperator
                  certificate.approximateInverse)
                (function certificate.center)‖ +
            ↑certificate.contractionBound * ↑certificate.radius ≤
          ↑certificate.radius)
      (hderivative :
        CAS.Continuum.Krawczyk.Certificate.HasJacobianOn function jacobian
          certificate.domain)
      (hinverse :
        certificate.approximateInverse =
          CAS.Continuum.Krawczyk.castMatrix rationalInverse)
      (hjacobian :
        CAS.Continuum.Krawczyk.EnclosesMatrixOn jacobianBounds jacobian
          certificate.domain)
      (hnorm :
        CAS.Continuum.Krawczyk.CertifiesOperatorNorm
          (CAS.Continuum.Krawczyk.residualBounds rationalInverse
            jacobianBounds)
          certificate.contractionBound) :
      certificate.IsCertified function jacobian
    theorem CAS.Continuum.Krawczyk.isCertified_of_intervals.{u_1}
      {n : Type u_1} [Fintype n]
      [DecidableEq n]
      {certificate :
        CAS.Continuum.Krawczyk.Certificate n}
      {function :
        EuclideanSpace ℝ n →
          EuclideanSpace ℝ n}
      {jacobian :
        EuclideanSpace ℝ n → Matrix n n ℝ}
      {rationalInverse : Matrix n n ℚ}
      {jacobianBounds :
        Matrix n n
          CAS.Continuum.RationalInterval}
      (hcontraction :
        certificate.contractionBound < 1)
      (hselfMap :
        ‖(CAS.Continuum.Krawczyk.matrixOperator
                  certificate.approximateInverse)
                (function
                  certificate.center)‖ +
            ↑certificate.contractionBound *
              ↑certificate.radius ≤
          ↑certificate.radius)
      (hderivative :
        CAS.Continuum.Krawczyk.Certificate.HasJacobianOn
          function jacobian
          certificate.domain)
      (hinverse :
        certificate.approximateInverse =
          CAS.Continuum.Krawczyk.castMatrix
            rationalInverse)
      (hjacobian :
        CAS.Continuum.Krawczyk.EnclosesMatrixOn
          jacobianBounds jacobian
          certificate.domain)
      (hnorm :
        CAS.Continuum.Krawczyk.CertifiesOperatorNorm
          (CAS.Continuum.Krawczyk.residualBounds
            rationalInverse jacobianBounds)
          certificate.contractionBound) :
      certificate.IsCertified function
        jacobian

    Build a full analytic Krawczyk certificate from an entrywise Jacobian enclosure. For a proposed inverse with rational entries, q < 1, the self-map inequality, the exact Jacobian identity on the ball, an interval matrix that encloses the Jacobian there, and CertifiesOperatorNorm for the compiled residual intervals give Certificate.IsCertified.

  • complete
    theorem CAS.Continuum.Krawczyk.Certificate.existsUnique_zero.{u_1}
      {n : Type u_1} [Fintype n] [DecidableEq n]
      {certificate : CAS.Continuum.Krawczyk.Certificate n}
      {function : EuclideanSpace ℝ n → EuclideanSpace ℝ n}
      {jacobian : EuclideanSpace ℝ n → Matrix n n ℝ}
      (hcert : certificate.IsCertified function jacobian) :
      ∃! x, x ∈ certificate.domain ∧ function x = 0
    theorem CAS.Continuum.Krawczyk.Certificate.existsUnique_zero.{u_1}
      {n : Type u_1} [Fintype n]
      [DecidableEq n]
      {certificate :
        CAS.Continuum.Krawczyk.Certificate n}
      {function :
        EuclideanSpace ℝ n →
          EuclideanSpace ℝ n}
      {jacobian :
        EuclideanSpace ℝ n → Matrix n n ℝ}
      (hcert :
        certificate.IsCertified function
          jacobian) :
      ∃! x,
        x ∈ certificate.domain ∧
          function x = 0

    Soundness of a multivariate Krawczyk certificate.

    There exists exactly one zero of function in the certified closed ball. Uniqueness holds within this ball only.

Proof for Theorem 10.133
uses 0

The map T(x)=x-BF(x) has derivative I-BJ(x), hence is q-Lipschitz on the convex ball. The self-map inequality sends that ball into itself, so Banach's fixed-point theorem gives a unique fixed point. At the center, the same strict residual estimate proves BJ(x_0) and then B invertible by the Neumann argument. Thus T(x)=x implies BF(x)=0 and hence F(x)=0. Conversely every zero is a fixed point, which transfers fixed-point uniqueness to zero uniqueness.

10.9.2. Certificate Workflows🔗

Checked numerical certificates enter an ordinary Lean proof through the cega tactic, which can project a supplied certificate or construct one through a checked rational-box query. For an ordinary inequality goal, bare cega can read the box off rational literal bounds among the hypotheses; explicit box syntax supplies the query directly. In either route, a checked soundness proof must establish the target, including any domain or error weakening.

Theorem10.134
Group: Certified continuous computation (105)
Group member previews
Preview
Definition 10.36
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
uses 1
Used by 2
Reverse dependency previews
Preview
Definition 10.136
Loading preview
Reverse dependency preview content is loaded from the rendered-fragment cache.
✓L∃∀N

An independently certified numerical value may replace the exact-real quadrature value. Its roundoff bound is added to the analytic quadrature error by the triangle inequality. The theorem is the common interface for a verified exact, interval, or floating-point implementation: a backend must prove the displayed norm bound before its computed value enters the quadrature certificate.

Concretely, if Q is the value stored in a certificate with error E and \widehat Q is a computed replacement satisfying \lVert Q-\widehat Q\rVert\leq\delta, then

\left\lVert\int_a^b f(x)\,dx-\widehat Q\right\rVert \leq E+\delta.

Lean code for Theorem10.134●1 theorem
  • complete
    theorem CAS.Continuum.QuadratureCert.replaceValue_sound.{u_1} {E : Type u_1}
      [NormedAddCommGroup E] [NormedSpace ℝ E] {a b : ℝ} {f : ℝ → E}
      (q : CAS.Continuum.QuadratureCert f a b) (computed : E) (roundoff : ℝ)
      (hroundoff : ‖q.value - computed‖ ≤ roundoff) :
      ‖(∫ (x : ℝ) in a..b, f x) - computed‖ ≤ q.error + roundoff
    theorem CAS.Continuum.QuadratureCert.replaceValue_sound.{u_1}
      {E : Type u_1} [NormedAddCommGroup E]
      [NormedSpace ℝ E] {a b : ℝ} {f : ℝ → E}
      (q : CAS.Continuum.QuadratureCert f a b)
      (computed : E) (roundoff : ℝ)
      (hroundoff :
        ‖q.value - computed‖ ≤ roundoff) :
      ‖(∫ (x : ℝ) in a..b, f x) - computed‖ ≤
        q.error + roundoff

    Replacing a certified value adds the backend roundoff to the analytic error.

Proof for Theorem 10.134
uses 0

Insert and subtract the exact certificate value Q. The triangle inequality bounds the new integral error by the original quadrature error plus \lVert Q-\widehat Q\rVert; applying the two stored bounds yields E+\delta.

Theorem10.135
Group: Certified continuous computation (105)
Group member previews
Preview
Definition 10.36
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
uses 1used by 1✓L∃∀N

Approximation, residual, upper-bound, enclosure, and model-approximation certificates may be restricted from a domain s to any subset t ⊆ s. The resulting theorem is the original sound field composed with the subset proof; no backend computation is repeated.

For every semantic predicate P, the restriction step is simply

t\subseteq s,\qquad \bigl(\forall x\in s,\ P(x)\bigr) \quad\Longrightarrow\quad \forall x\in t,\ P(x).

Lean code for Theorem10.135●6 declarations
  • complete
    theorem CAS.Certificate.ApproxCert.sound_restrict.{u_1, u_2} {α : Type u_1}
      {E : Type u_2} [NormedAddCommGroup E] {s : Set α}
      (c : CAS.Certificate.ApproxCert α E s) (t : Set α) (hsub : t ⊆ s) :
      CAS.Certificate.ApproxOn c.lhs c.rhs t c.eps
    theorem CAS.Certificate.ApproxCert.sound_restrict.{u_1,
        u_2}
      {α : Type u_1} {E : Type u_2}
      [NormedAddCommGroup E] {s : Set α}
      (c : CAS.Certificate.ApproxCert α E s)
      (t : Set α) (hsub : t ⊆ s) :
      CAS.Certificate.ApproxOn c.lhs c.rhs t
        c.eps

    Expose domain restriction directly as an ordinary approximation theorem.

  • complete
    theorem CAS.Certificate.ResidualCert.sound_restrict.{u_1, u_2} {α : Type u_1}
      {E : Type u_2} [NormedAddCommGroup E] {s : Set α}
      (c : CAS.Certificate.ResidualCert α E s) (t : Set α) (hsub : t ⊆ s) :
      CAS.Certificate.ResidualBound c.residual t c.eps
    theorem CAS.Certificate.ResidualCert.sound_restrict.{u_1,
        u_2}
      {α : Type u_1} {E : Type u_2}
      [NormedAddCommGroup E] {s : Set α}
      (c : CAS.Certificate.ResidualCert α E s)
      (t : Set α) (hsub : t ⊆ s) :
      CAS.Certificate.ResidualBound c.residual
        t c.eps

    Expose domain restriction directly as an ordinary residual theorem.

  • theoremdefined in CAS/Certificate/Bound.lean
    complete
    theorem CAS.Certificate.BoundCert.sound_restrict.{u_1} {α : Type u_1}
      {s : Set α} (c : CAS.Certificate.BoundCert α s) (t : Set α)
      (hsub : t ⊆ s) : CAS.Certificate.BoundOn c.fn t c.upper
    theorem CAS.Certificate.BoundCert.sound_restrict.{u_1}
      {α : Type u_1} {s : Set α}
      (c : CAS.Certificate.BoundCert α s)
      (t : Set α) (hsub : t ⊆ s) :
      CAS.Certificate.BoundOn c.fn t c.upper

    Expose domain restriction directly as an ordinary upper-bound theorem.

  • complete
    theorem CAS.Certificate.EnclosureCert.sound_restrict.{u_1} {α : Type u_1}
      {s : Set α} (c : CAS.Certificate.EnclosureCert α s) (t : Set α)
      (hsub : t ⊆ s) : CAS.Certificate.EnclosedOn c.fn t c.lo c.hi
    theorem CAS.Certificate.EnclosureCert.sound_restrict.{u_1}
      {α : Type u_1} {s : Set α}
      (c : CAS.Certificate.EnclosureCert α s)
      (t : Set α) (hsub : t ⊆ s) :
      CAS.Certificate.EnclosedOn c.fn t c.lo
        c.hi

    Expose domain restriction directly as an ordinary enclosure theorem.

  • def CAS.Certificate.ModelApproxCert.restrict.{u_1, u_2} {α : Type u_1}
      {E : Type u_2} [NormedAddCommGroup E] {patch : Set α}
      (cert : CAS.Certificate.ModelApproxCert α E patch) (smaller : Set α)
      (hsub : smaller ⊆ patch) : CAS.Certificate.ModelApproxCert α E smaller
    def CAS.Certificate.ModelApproxCert.restrict.{u_1,
        u_2}
      {α : Type u_1} {E : Type u_2}
      [NormedAddCommGroup E] {patch : Set α}
      (cert :
        CAS.Certificate.ModelApproxCert α E
          patch)
      (smaller : Set α)
      (hsub : smaller ⊆ patch) :
      CAS.Certificate.ModelApproxCert α E
        smaller

    Restrict a model approximation certificate to a smaller patch.

  • complete
    theorem CAS.Certificate.ModelApproxCert.sound.{u_1, u_2} {α : Type u_1}
      {E : Type u_2} [NormedAddCommGroup E] {patch : Set α}
      (cert : CAS.Certificate.ModelApproxCert α E patch) :
      CAS.Certificate.ApproxOn cert.toApproxCert.lhs cert.toApproxCert.rhs
        patch cert.toApproxCert.eps
    theorem CAS.Certificate.ModelApproxCert.sound.{u_1,
        u_2}
      {α : Type u_1} {E : Type u_2}
      [NormedAddCommGroup E] {patch : Set α}
      (cert :
        CAS.Certificate.ModelApproxCert α E
          patch) :
      CAS.Certificate.ApproxOn
        cert.toApproxCert.lhs
        cert.toApproxCert.rhs patch
        cert.toApproxCert.eps

    The reference function approximates the source within the stored error budget.

Proof for Theorem 10.135
uses 0

At a point of the smaller domain, the subset hypothesis places that point in the original domain, where the stored semantic theorem already applies. Every certificate family uses this same set-theoretic argument.

Definition10.136
Group: Certified continuous computation (105)
Group member previews
Preview
Definition 10.36
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
Statement uses 3
Statement dependency previews
Preview
Definition 10.83
Loading preview
Statement dependency preview content is loaded from the rendered-fragment cache.
used by 1✓L∃∀N

The certificate-projection route of cega searches the local context and target for a recognized checked certificate. It first tries the certificate's semantic theorem exactly, then permits a proved domain restriction, a larger error budget, or a wider enclosure when those changes match the goal. Any new real inequalities are discharged separately by ordinary arithmetic. The tactic succeeds only after Lean confirms that the constructed proof has the user's target type.

For an approximation certificate, the representative projection is

t\subseteq s,\quad c.\mathrm{eps}\leq\varepsilon \quad\Longrightarrow\quad \forall x\in t,\qquad \lVert c.\mathrm{lhs}(x)-c.\mathrm{rhs}(x)\rVert\leq\varepsilon.

Residual, bound, enclosure, model, and quadrature goals use the analogous typed projection; cega never changes the proposition being proved.

Lean code for Definition10.136●1 definition
  • complete
    def CAS.Tactic.Certificate.closeFromLocalCertificates :
      Lean.Elab.Tactic.TacticM Unit
    def CAS.Tactic.Certificate.closeFromLocalCertificates :
      Lean.Elab.Tactic.TacticM Unit

    Close the main goal from a matching checked certificate in the local context or among the subterms of the target.

    Exact projections are tried first. Approximation, residual, bound, model, and quadrature certificates may then be weakened to a larger requested budget; enclosures may be widened at both endpoints. Every generated inequality must be discharged by the shared arithmetic phase. A certificate whose domain differs from the goal's is then restricted to the goal's domain (inferSubsetProof) and tried again in the same way.

Certificate example: cosine near the origin.

PDE/Examples/Numerics/CosineEnclosure.lean compiles a complete enclosure of Real.cos on

D=\left[-\frac1{10},\frac1{10}\right].

CEGA certifies [199/200,1] on D. The interval and its proof are stored as CAS.Examples.Numerics.CosineEnclosure.cosineEnclosure, an EnclosureCert ℝ D whose fields have the following meaning:

  • fn is Real.cos;

  • lo is 199 / 200;

  • hi is 1;

  • sound proves 199/200\leq\cos x\leq1 for every x\in D.

The theorem-facing use is short:

-- Import the backend-independent certificate propositions. open CAS.Certificate -- CEGA projects the certificate's soundness -- theorem into the target. example (domain : Set ℝ) (cosineEnclosure : EnclosureCert ℝ domain) : EnclosedOn cosineEnclosure.fn domain cosineEnclosure.lo cosineEnclosure.hi := domain:Set ℝcosineEnclosure:EnclosureCert ℝ domain⊢ EnclosedOn cosineEnclosure.fn domain cosineEnclosure.lo cosineEnclosure.hi All goals completed! 🐙

The tactic projects the stored theorem; cosine is not evaluated again.

The same object can support a smaller domain. Given D'\subseteq D, cosineEnclosure.restrict D' hsub stores the same function and endpoints with soundness restricted along hsub. It can also support a coarser conclusion: EnclosureCert.weaken turns [199/200,1] into any proved wider interval, for example [-1,1]. These operations are set inclusion and transitivity proofs.

The generic proof pattern is therefore:

-- A certificate on s proves the same -- enclosure on a subset t. example {s t : Set ℝ} (c : EnclosureCert ℝ s) (hsub : t ⊆ s) : EnclosedOn c.fn t c.lo c.hi := s:Set ℝt:Set ℝc:EnclosureCert ℝ shsub:t ⊆ s⊢ EnclosedOn c.fn t c.lo c.hi All goals completed! 🐙

Here cega finds the domain restriction needed to match the target.

Theorem10.137
Group: Certified continuous computation (105)
Group member previews
Preview
Definition 10.36
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
Statement uses 2
Statement dependency previews
Preview
Definition 10.36
Loading preview
Statement dependency preview content is loaded from the rendered-fragment cache.
used by 0✓L∃∀N

An ODETrajectoryCert stores an ordinary Lean curve, its proposed velocity, continuity on [a,b], a proof that the velocity is its right derivative on [a,b), membership in the state region, and one backend-independent residual bound for u'(t)-F(t,u(t)). Mathlib's approximate-trajectory Grönwall theorem compares two such trajectories. The pointwise estimate is converted to a uniform ApproxCert by evaluating the monotone Grönwall bound at the right endpoint. No ordering hypothesis is needed: if the left endpoint is below the right one, residual soundness there makes both budgets nonnegative, and otherwise the claim is immediate.

As an example, the affine Euler curve 1+t is compared with the exact trajectory \exp t for u'=u on [0,1]. Its residual is -t, hence has norm at most one, and the generated uniform error is \exp(1)-1. An exact CAS proof or a FloatLib enclosure may supply the residual bound. The ODE stability theorem consumes that real bound and gives the same final ApproxOn statement.

Lean code for Theorem10.137●3 theorems
  • complete
    theorem CAS.Continuum.ODETrajectoryCert.dist_velocity_vectorField_le.{u_1}
      {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E]
      {vectorField : ℝ → E → E} {state : ℝ → Set E} {a b : ℝ}
      (cert : CAS.Continuum.ODETrajectoryCert vectorField state a b)
      (t : ℝ) :
      t ∈ Set.Ico a b →
        dist (cert.velocity t) (vectorField t (cert.curve t)) ≤
          cert.residualError
    theorem CAS.Continuum.ODETrajectoryCert.dist_velocity_vectorField_le.{u_1}
      {E : Type u_1} [NormedAddCommGroup E]
      [NormedSpace ℝ E]
      {vectorField : ℝ → E → E}
      {state : ℝ → Set E} {a b : ℝ}
      (cert :
        CAS.Continuum.ODETrajectoryCert
          vectorField state a b)
      (t : ℝ) :
      t ∈ Set.Ico a b →
        dist (cert.velocity t)
            (vectorField t (cert.curve t)) ≤
          cert.residualError

    The residual certificate gives the metric defect required by Mathlib's ODE theorem.

  • complete
    theorem CAS.Continuum.ODETrajectoryCert.dist_le_gronwall.{u_1} {E : Type u_1}
      [NormedAddCommGroup E] [NormedSpace ℝ E] {vectorField : ℝ → E → E}
      {state : ℝ → Set E} {a b : ℝ}
      (left right : CAS.Continuum.ODETrajectoryCert vectorField state a b)
      (K : NNReal)
      (hLipschitz :
        ∀ t ∈ Set.Ico a b, LipschitzOnWith K (vectorField t) (state t))
      {delta : ℝ} (hinitial : dist (left.curve a) (right.curve a) ≤ delta)
      (t : ℝ) :
      t ∈ Set.Icc a b →
        dist (left.curve t) (right.curve t) ≤
          gronwallBound delta (↑K)
            (left.residualError + right.residualError) (t - a)
    theorem CAS.Continuum.ODETrajectoryCert.dist_le_gronwall.{u_1}
      {E : Type u_1} [NormedAddCommGroup E]
      [NormedSpace ℝ E]
      {vectorField : ℝ → E → E}
      {state : ℝ → Set E} {a b : ℝ}
      (left right :
        CAS.Continuum.ODETrajectoryCert
          vectorField state a b)
      (K : NNReal)
      (hLipschitz :
        ∀ t ∈ Set.Ico a b,
          LipschitzOnWith K (vectorField t)
            (state t))
      {delta : ℝ}
      (hinitial :
        dist (left.curve a) (right.curve a) ≤
          delta)
      (t : ℝ) :
      t ∈ Set.Icc a b →
        dist (left.curve t) (right.curve t) ≤
          gronwallBound delta (↑K)
            (left.residualError +
              right.residualError)
            (t - a)

    Pointwise Grönwall comparison for two certified approximate trajectories.

    This is a direct certificate-facing specialization of Mathlib's dist_le_of_approx_trajectories_ODE_of_mem. The two residual budgets remain separate until the theorem combines them.

  • complete
    theorem CAS.Continuum.ODETrajectoryCert.comparison_sound.{u_1} {E : Type u_1}
      [NormedAddCommGroup E] [NormedSpace ℝ E] {vectorField : ℝ → E → E}
      {state : ℝ → Set E} {a b : ℝ}
      (left right : CAS.Continuum.ODETrajectoryCert vectorField state a b)
      (K : NNReal)
      (hLipschitz :
        ∀ t ∈ Set.Ico a b, LipschitzOnWith K (vectorField t) (state t))
      (delta : ℝ) (hinitial : dist (left.curve a) (right.curve a) ≤ delta) :
      CAS.Certificate.ApproxOn left.curve right.curve (Set.Icc a b)
        (gronwallBound delta (↑K) (left.residualError + right.residualError)
          (b - a))
    theorem CAS.Continuum.ODETrajectoryCert.comparison_sound.{u_1}
      {E : Type u_1} [NormedAddCommGroup E]
      [NormedSpace ℝ E]
      {vectorField : ℝ → E → E}
      {state : ℝ → Set E} {a b : ℝ}
      (left right :
        CAS.Continuum.ODETrajectoryCert
          vectorField state a b)
      (K : NNReal)
      (hLipschitz :
        ∀ t ∈ Set.Ico a b,
          LipschitzOnWith K (vectorField t)
            (state t))
      (delta : ℝ)
      (hinitial :
        dist (left.curve a) (right.curve a) ≤
          delta) :
      CAS.Certificate.ApproxOn left.curve
        right.curve (Set.Icc a b)
        (gronwallBound delta (↑K)
          (left.residualError +
            right.residualError)
          (b - a))

    The uniform Grönwall bound of comparison, without the hypothesis a < b: the two curves stay within gronwallBound delta K (ε₁ + ε₂) (b - a) of each other on [a, b], where ε₁ and ε₂ are the two residual budgets. When b ≤ a the interval has at most the point a, where the Grönwall bound at time 0 is delta.

Proof for Theorem 10.137
uses 0

The residual certificate bounds the defect between the proposed velocity and the vector field. Apply the approximate-trajectory Grönwall estimate to this defect and the initial discrepancy, then use monotonicity of the exponential bound to replace its time-dependent right-hand side by its value at the final time. This produces the uniform approximation certificate.

The stability estimate explains how the residual enters the trajectory error. If the vector field is L-Lipschitz in the state variable, the initial discrepancy is e_0, and the sum of the two residual budgets is \delta, Grönwall gives, for L>0,

\|u(t)-v(t)\| \leq e^{L(t-a)}e_0+ \delta\,\frac{e^{L(t-a)}-1}{L}.

For L=0, the corresponding bound is e_0+\delta(t-a). In the 1+t versus e^t example, e_0=0, L=1, and \delta=1, giving the stated e-1 budget at time one. The actual maximum error is e-2: the certificate is conservative because it replaces the varying defect t by the uniform bound one. Both curves are hypotheses of the comparison theorem.

Theorem10.138
Group: Certified continuous computation (105)
Group member previews
Preview
Definition 10.36
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
Statement uses 2
Statement dependency previews
Preview
Theorem 10.122
Loading preview
Statement dependency preview content is loaded from the rendered-fragment cache.
used by 0✓L∃∀N

Under the trapezoidal regularity and second-derivative-bound hypotheses, one user-supplied tolerance can control analytic truncation and verified numerical error. Let I have radius r<\mathrm{tolerance}. The enclosure proof must refer to the exact-real trapezoidal value on the mesh planned with the budget \mathrm{tolerance}-r. Replacing that exact rule value by the interval midpoint then has total certified error at most the original tolerance.

Lean code for Theorem10.138●1 theorem
  • complete
    theorem CAS.Continuum.QuadratureCert.trapezoidalToTotalToleranceOfInterval_sound_le.{u_1}
      {ι : Type u_1} [CAS.Continuum.RealIntervalBackend ι] {f : ℝ → ℝ}
      {a b ζ tolerance : ℝ} (hf : ContDiffOn ℝ 2 f (Set.uIcc a b))
      (hsecond : ∀ (x : ℝ), |iteratedDerivWithin 2 f (Set.uIcc a b) x| ≤ ζ)
      (I : ι)
      (hencloses :
        CAS.Continuum.RealIntervalBackend.MemReal I
          (CAS.Continuum.QuadratureCert.trapezoidalToTolerance hf
              hsecond).value)
      (hradius : CAS.Continuum.RealIntervalBackend.radius I < tolerance) :
      ‖(∫ (x : ℝ) in a..b, f x) -
            (CAS.Continuum.QuadratureCert.trapezoidalToTotalToleranceOfInterval
                hf hsecond I hencloses).value‖ ≤
        tolerance
    theorem CAS.Continuum.QuadratureCert.trapezoidalToTotalToleranceOfInterval_sound_le.{u_1}
      {ι : Type u_1}
      [CAS.Continuum.RealIntervalBackend ι]
      {f : ℝ → ℝ} {a b ζ tolerance : ℝ}
      (hf : ContDiffOn ℝ 2 f (Set.uIcc a b))
      (hsecond :
        ∀ (x : ℝ),
          |iteratedDerivWithin 2 f
                (Set.uIcc a b) x| ≤
            ζ)
      (I : ι)
      (hencloses :
        CAS.Continuum.RealIntervalBackend.MemReal
          I
          (CAS.Continuum.QuadratureCert.trapezoidalToTolerance
              hf hsecond).value)
      (hradius :
        CAS.Continuum.RealIntervalBackend.radius
            I <
          tolerance) :
      ‖(∫ (x : ℝ) in a..b, f x) -
            (CAS.Continuum.QuadratureCert.trapezoidalToTotalToleranceOfInterval
                hf hsecond I
                hencloses).value‖ ≤
        tolerance

    For a C² function f on [[a, b]] with |f''| ≤ ζ: if the interval I encloses the value of the trapezoidal plan for the tolerance minus the radius of I, and that radius is smaller than the tolerance, then the certified value, the center of I, is within the tolerance of ∫ₐᵇ f.

Proof for Theorem 10.138
uses 0

Reserve the interval radius r for replacement error and invoke the trapezoidal planner with the positive remaining budget \tau-r. The roundoff-replacement theorem adds the two contributions, and (\tau-r)+r=\tau gives the requested total bound.

Theorem10.139
Group: Certified continuous computation (105)
Group member previews
Preview
Definition 10.36
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
Statement uses 2
Statement dependency previews
Preview
Definition 10.36
Loading preview
Statement dependency preview content is loaded from the rendered-fragment cache.
used by 0✓L∃∀N

Patch covers assemble local approximation or residual proofs into a global theorem on the covered domain. The atlas layer, used near singularities or across piecewise regimes, rests on this theorem.

The shared logical contract is

\left(\forall x\in s,\ \exists i,\ x\in s_i\right) \land \left(\forall i,\ \forall x\in s_i,\ P(x)\right) \quad\Longrightarrow\quad \forall x\in s,\ P(x).

For approximation and residual atlases, P(x) is the corresponding stored norm bound.

Lean code for Theorem10.139●3 theorems
  • theoremdefined in CAS/Domain/PatchCover.lean
    complete
    theorem CAS.Domain.PatchCover.lift.{u_1, u_2} {α : Type u_1} {ι : Type u_2}
      {domain : Set α} {P : α → Prop}
      (cover : CAS.Domain.PatchCover α ι domain)
      (hlocal : ∀ (i : ι), ∀ x ∈ cover.patch i, P x) (x : α) :
      x ∈ domain → P x
    theorem CAS.Domain.PatchCover.lift.{u_1, u_2}
      {α : Type u_1} {ι : Type u_2}
      {domain : Set α} {P : α → Prop}
      (cover :
        CAS.Domain.PatchCover α ι domain)
      (hlocal :
        ∀ (i : ι), ∀ x ∈ cover.patch i, P x)
      (x : α) : x ∈ domain → P x

    Lift a proposition proved on every patch to the covered domain.

  • theorem CAS.Certificate.ApproxAtlasCert.sound.{u_1, u_2, u_3} {α : Type u_1}
      {E : Type u_2} {ι : Type u_3} [NormedAddCommGroup E] {domain : Set α}
      (c : CAS.Certificate.ApproxAtlasCert α E ι domain) :
      CAS.Certificate.ApproxOn c.lhs c.rhs domain c.eps
    theorem CAS.Certificate.ApproxAtlasCert.sound.{u_1,
        u_2, u_3}
      {α : Type u_1} {E : Type u_2}
      {ι : Type u_3} [NormedAddCommGroup E]
      {domain : Set α}
      (c :
        CAS.Certificate.ApproxAtlasCert α E ι
          domain) :
      CAS.Certificate.ApproxOn c.lhs c.rhs
        domain c.eps

    Assemble the local estimates into a uniform approximation on the covered domain.

  • complete
    theorem CAS.Certificate.ResidualAtlasCert.sound.{u_1, u_2, u_3} {α : Type u_1}
      {E : Type u_2} {ι : Type u_3} [NormedAddCommGroup E] {domain : Set α}
      (c : CAS.Certificate.ResidualAtlasCert α E ι domain) :
      CAS.Certificate.ResidualBound c.residual domain c.eps
    theorem CAS.Certificate.ResidualAtlasCert.sound.{u_1,
        u_2, u_3}
      {α : Type u_1} {E : Type u_2}
      {ι : Type u_3} [NormedAddCommGroup E]
      {domain : Set α}
      (c :
        CAS.Certificate.ResidualAtlasCert α E
          ι domain) :
      CAS.Certificate.ResidualBound c.residual
        domain c.eps

    Assemble the local residual estimates on the covered domain.

Proof for Theorem 10.139
uses 0

Fix a point in the global domain and use the cover property to choose a patch containing it. The local certificate on that patch proves the desired predicate at the point. Since the argument is independent of the selected patch, it assembles the local soundness fields into the global theorem.

External data and analytic proofs.

A numerical solver can propose rational coefficients, interval endpoints, or binary64 words in JSON. The exact-data importer embeds integer columns as Lean data, rejecting incorrect lengths and invalid word ranges. Decimal strings preserve large integers even when the producer's JSON tools use floating point. The data file is a Lake dependency, so changing it invalidates the build trace. Importing those values proves no numerical or analytic property.

Theorem10.140
Group: Certified continuous computation (105)
Group member previews
Preview
Definition 10.36
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
uses 0used by 0✓L∃∀N

For any positive batch size, consecutive truncated batches cover every index of a finite domain. A sound checker therefore supplies all finite hypotheses of an analytic theorem, independently of the chosen batch size.

Lean code for Theorem10.140●2 theorems
  • theoremdefined in CAS/Numerics/Finite.lean
    complete
    theorem CAS.Numerics.forall_of_batchAll {n size : ℕ} {p : Fin n → Prop}
      (hsize : 0 < size)
      (hbatch :
        ∀ (b : Fin (CAS.Numerics.batchCount n size)),
          CAS.Numerics.BatchAll p (↑b * size) size)
      (i : Fin n) : p i
    theorem CAS.Numerics.forall_of_batchAll
      {n size : ℕ} {p : Fin n → Prop}
      (hsize : 0 < size)
      (hbatch :
        ∀
          (b :
            Fin
              (CAS.Numerics.batchCount n
                size)),
          CAS.Numerics.BatchAll p (↑b * size)
            size)
      (i : Fin n) : p i

    Consecutive batches of positive size cover every index, including the truncated final batch. No batch checks are required when the domain is empty.

  • theoremdefined in CAS/Numerics/Finite.lean
    complete
    theorem CAS.Numerics.claim_of_batch_checks.{u_1} {W : Type u_1} {n size : ℕ}
      (check : W → Fin n → Bool) (claim : W → Prop)
      (sound : ∀ (w : W), (∀ (i : Fin n), check w i = true) → claim w)
      (w : W) (hsize : 0 < size)
      (hbatch :
        ∀ (b : Fin (CAS.Numerics.batchCount n size)),
          CAS.Numerics.BatchAll (fun i ↦ check w i = true) (↑b * size)
            size) :
      claim w
    theorem CAS.Numerics.claim_of_batch_checks.{u_1}
      {W : Type u_1} {n size : ℕ}
      (check : W → Fin n → Bool)
      (claim : W → Prop)
      (sound :
        ∀ (w : W),
          (∀ (i : Fin n), check w i = true) →
            claim w)
      (w : W) (hsize : 0 < size)
      (hbatch :
        ∀
          (b :
            Fin
              (CAS.Numerics.batchCount n
                size)),
          CAS.Numerics.BatchAll
            (fun i ↦ check w i = true)
            (↑b * size) size) :
      claim w

    A sound numerical checker supplies the hypotheses of an analytic theorem. The witness can contain coefficients, rational bounds, or interval subdivisions; sound is the mathematical bridge from all checked indices to the final claim.

Proof for Theorem 10.140
uses 0

For index i and batch size b>0, Euclidean division writes i=b\lfloor i/b\rfloor+(i\bmod b). The remainder lies in its batch, including the shorter final batch. Apply that batch's check and then the analytic soundness theorem. The empty domain needs no checks.

The tactic forms cega [batch := 128] and cega [fast, batch := 128] generate these internal proof steps without numbered source modules. The fast form follows the configured native/kernel checking profile. Native checking additionally trusts Lean's compiler and runtime; kernel checking computes the same proposition and can take longer.

The analytic bridge remains essential. Bounds at sampled points alone do not control the function between them: an interval cover, interpolation estimate, derivative remainder, or stability theorem must supply that argument. In the De Gregorio spline construction, verified smoothing replay identifies the candidate values, exact row checks bound the linear-system residual, and diagonal dominance converts that budget to an error bound against the exact slope vector.

Finite-dimensional numerical commands.

Theorem10.141
Group: Certified continuous computation (105)
Group member previews
Preview
Definition 10.36
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
Statement uses 2
Statement dependency previews
Preview
Definition 10.36
Loading preview
Statement dependency preview content is loaded from the rendered-fragment cache.
used by 1✓L∃∀N

The public query layer accepts an arbitrary finite rational box and reports failure unless it can produce a proof. One successful enclosure supplies four theorems: the two-sided range, an ordinary upper bound, a bound for the magnitude, and uniform approximation by the rational center with the rational radius as error. Each theorem connects the executable query result to an ordinary semantic proposition. Route steps remain diagnostic metadata.

Writing B=\prod_i[a_i,b_i] and [\ell,h] for the certified interval of a successful enclosure of e on B, the four contracts are

\begin{aligned} &\forall x\in B,\quad \ell\leq e(x)\leq h,\\ &\forall x\in B,\quad e(x)\leq h,\\ &\forall x\in B,\quad |e(x)|\leq\max(|\ell|,|h|),\\ &\forall x\in B,\quad \left|e(x)-\tfrac{\ell+h}{2}\right|\leq\tfrac{h-\ell}{2}. \end{aligned}

Lean code for Theorem10.141●4 theorems
  • complete
    theorem CAS.Continuum.RationalInterval.EnclosureAttempt.enclosedOn_of_interval_eq.{u_1}
      {α : Type u_1} {s : Set α} {fn : α → ℝ}
      (a : CAS.Continuum.RationalInterval.EnclosureAttempt α s fn)
      (lo hi : ℚ) (hlo : a.interval.lo = lo) (hhi : a.interval.hi = hi) :
      CAS.Certificate.EnclosedOn fn s ↑lo ↑hi
    theorem CAS.Continuum.RationalInterval.EnclosureAttempt.enclosedOn_of_interval_eq.{u_1}
      {α : Type u_1} {s : Set α} {fn : α → ℝ}
      (a :
        CAS.Continuum.RationalInterval.EnclosureAttempt
          α s fn)
      (lo hi : ℚ) (hlo : a.interval.lo = lo)
      (hhi : a.interval.hi = hi) :
      CAS.Certificate.EnclosedOn fn s ↑lo ↑hi

    Restate an enclosure attempt using displayed rational endpoints.

  • complete
    theorem CAS.Continuum.RationalInterval.EnclosureAttempt.boundOn_of_interval_eq.{u_1}
      {α : Type u_1} {s : Set α} {fn : α → ℝ}
      (a : CAS.Continuum.RationalInterval.EnclosureAttempt α s fn)
      (upper : ℚ) (hupper : a.interval.hi = upper) :
      CAS.Certificate.BoundOn fn s ↑upper
    theorem CAS.Continuum.RationalInterval.EnclosureAttempt.boundOn_of_interval_eq.{u_1}
      {α : Type u_1} {s : Set α} {fn : α → ℝ}
      (a :
        CAS.Continuum.RationalInterval.EnclosureAttempt
          α s fn)
      (upper : ℚ)
      (hupper : a.interval.hi = upper) :
      CAS.Certificate.BoundOn fn s ↑upper

    Restate the derived upper bound using a displayed rational endpoint.

  • complete
    theorem CAS.Continuum.RationalInterval.EnclosureAttempt.boundOn_abs_of_interval_eq.{u_1}
      {α : Type u_1} {s : Set α} {fn : α → ℝ}
      (a : CAS.Continuum.RationalInterval.EnclosureAttempt α s fn)
      (upper : ℚ) (hupper : a.interval.absMax = upper) :
      CAS.Certificate.BoundOn (fun x ↦ |fn x|) s ↑upper
    theorem CAS.Continuum.RationalInterval.EnclosureAttempt.boundOn_abs_of_interval_eq.{u_1}
      {α : Type u_1} {s : Set α} {fn : α → ℝ}
      (a :
        CAS.Continuum.RationalInterval.EnclosureAttempt
          α s fn)
      (upper : ℚ)
      (hupper : a.interval.absMax = upper) :
      CAS.Certificate.BoundOn (fun x ↦ |fn x|)
        s ↑upper

    Restate the derived absolute bound using a displayed rational endpoint.

  • complete
    theorem CAS.Continuum.RationalInterval.EnclosureAttempt.approxOn_center_of_interval_eq.{u_1}
      {α : Type u_1} {s : Set α} {fn : α → ℝ}
      (a : CAS.Continuum.RationalInterval.EnclosureAttempt α s fn)
      (center radius : ℚ) (hcenter : a.interval.center = center)
      (hradius : a.interval.radius = radius) :
      CAS.Certificate.ApproxOn fn (fun x ↦ ↑center) s ↑radius
    theorem CAS.Continuum.RationalInterval.EnclosureAttempt.approxOn_center_of_interval_eq.{u_1}
      {α : Type u_1} {s : Set α} {fn : α → ℝ}
      (a :
        CAS.Continuum.RationalInterval.EnclosureAttempt
          α s fn)
      (center radius : ℚ)
      (hcenter : a.interval.center = center)
      (hradius : a.interval.radius = radius) :
      CAS.Certificate.ApproxOn fn
        (fun x ↦ ↑center) s ↑radius

    Restate the midpoint approximation using displayed rational data.

Proof for Theorem 10.141
uses 0

Successful interval evaluation first supplies a two-sided enclosure for every point of the input box. The enclosure query returns it directly; the upper-bound and absolute-bound queries project elementary consequences of its endpoints; and the midpoint query rewrites membership in the interval as a distance bound from its center. Each projection preserves the evaluator's quantification over the whole domain.

How the certificate layer fits together.

Exact symbolic proofs are the zero-error case. Approximation certificates add a uniform error, enclosure certificates retain a function and scalar endpoints, and quadrature certificates combine an exact-real rule with an analytic remainder. Patch covers glue pointwise identities, enclosures, and uniform error bounds on a covered domain. Quadrature certificates on adjacent oriented intervals compose using interval integrability and integral additivity, with their error budgets added.

For PDE applications, the patch theorem's pointwise conclusion should be kept explicit. A piecewise constant function can have classical derivative zero on both sides of an interface while its distributional derivative contains a jump term at that interface. Covering those open pieces and checking their residuals does not settle the interface equation. A weak solution assembled from local pieces also needs the appropriate matching or flux conditions, as well as integrability.