Documentation

LeanCert.Validity.DyadicBounds

Certificate-Driven Verification with Dyadic Arithmetic #

This file provides Golden Theorems for the Dyadic arithmetic backend, mirroring the structure of Validity/Bounds.lean but using the high-performance IntervalDyadic type.

Overview #

The Dyadic backend offers significant performance advantages over rational arithmetic for many verification tasks, while maintaining full soundness. This module exposes the Dyadic evaluator as a first-class citizen for certificate-driven verification.

Main definitions #

Boolean Checkers #

Golden Theorems #

For ExprSupported expressions (no log), convenience versions are provided that don't require explicit domain validity proofs.

Design #

The Dyadic backend uses IntervalDyadic which represents intervals with dyadic endpoints (numbers of the form m · 2^e). This allows for faster arithmetic than arbitrary rationals while still providing rigorous bounds.

Key parameters:

Trust Hierarchy #

This provides an alternative verification path to the rational-based Validity/Bounds.lean:

The Dyadic path is faster but the rational path may be preferred for reproducibility across different platforms.

Boolean Checkers #

These check the computed interval bounds. Domain validity is handled separately.

def LeanCert.Validity.checkUpperBoundDyadic (e : Core.Expr) (lo hi : ) (hle : lo hi) (c : ) (prec : ) (depth : ) :

Check if an expression's computed upper bound is ≤ c using Dyadic arithmetic. This is the computable check that native_decide will execute.

Note: Domain validity must be established separately.

Equations
  • One or more equations did not get rendered due to their size.
Instances For
    def LeanCert.Validity.checkLowerBoundDyadic (e : Core.Expr) (lo hi : ) (hle : lo hi) (c : ) (prec : ) (depth : ) :

    Check if an expression's computed lower bound is ≥ c using Dyadic arithmetic.

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

      Golden Theorems #

      These theorems convert the boolean true from the checkers into semantic proofs about Real numbers.

      theorem LeanCert.Validity.verify_upper_bound_dyadic (e : Core.Expr) (hsupp : Core.ExprSupportedCore e) (lo hi : ) (hle : lo hi) (c : ) (prec : ) (depth : ) (h_prec : prec 0) (hdom : Engine.evalDomainValidDyadic e (fun (x : ) => Core.IntervalDyadic.ofIntervalRat { lo := lo, hi := hi, le := hle } prec) { precision := prec, taylorDepth := depth }) (h_check : checkUpperBoundDyadic e lo hi hle c prec depth = true) (x : ) :
      x Set.Icc lo hiCore.Expr.eval (fun (x_1 : ) => x) e c

      Golden Theorem for Dyadic Upper Bounds

      If the bound check passes and domain validity holds, then ∀ x ∈ [lo, hi], Expr.eval (fun _ => x) e ≤ c.

      This is the key theorem for certificate-driven verification using the Dyadic backend.

      Parameters:

      • e: The expression to evaluate
      • hsupp: Proof that the expression is supported (ExprSupportedCore)
      • lo, hi, hle: The interval [lo, hi] with proof lo ≤ hi
      • c: The upper bound to verify
      • prec: Precision (must be ≤ 0)
      • depth: Taylor series depth
      • h_prec: Proof that prec ≤ 0
      • hdom: Proof of domain validity (automatic for ExprSupported)
      • h_check: The boolean check result
      theorem LeanCert.Validity.verify_lower_bound_dyadic (e : Core.Expr) (hsupp : Core.ExprSupportedCore e) (lo hi : ) (hle : lo hi) (c : ) (prec : ) (depth : ) (h_prec : prec 0) (hdom : Engine.evalDomainValidDyadic e (fun (x : ) => Core.IntervalDyadic.ofIntervalRat { lo := lo, hi := hi, le := hle } prec) { precision := prec, taylorDepth := depth }) (h_check : checkLowerBoundDyadic e lo hi hle c prec depth = true) (x : ) :
      x Set.Icc lo hic Core.Expr.eval (fun (x_1 : ) => x) e

      Golden Theorem for Dyadic Lower Bounds

      If the bound check passes and domain validity holds, then ∀ x ∈ [lo, hi], c ≤ Expr.eval (fun _ => x) e.

      Convenience Theorems for ExprSupported #

      For expressions that don't use log, domain validity is automatic. These versions don't require the hdom hypothesis.

      theorem LeanCert.Validity.verify_upper_bound_dyadic' (e : Core.Expr) (hsupp : Core.ExprSupported e) (lo hi : ) (hle : lo hi) (c : ) (prec : ) (depth : ) (h_prec : prec 0) (h_check : checkUpperBoundDyadic e lo hi hle c prec depth = true) (x : ) :
      x Set.Icc lo hiCore.Expr.eval (fun (x_1 : ) => x) e c

      Convenience theorem for ExprSupported expressions (no log). Domain validity is automatic, so only the bound check is needed.

      theorem LeanCert.Validity.verify_lower_bound_dyadic' (e : Core.Expr) (hsupp : Core.ExprSupported e) (lo hi : ) (hle : lo hi) (c : ) (prec : ) (depth : ) (h_prec : prec 0) (h_check : checkLowerBoundDyadic e lo hi hle c prec depth = true) (x : ) :
      x Set.Icc lo hic Core.Expr.eval (fun (x_1 : ) => x) e

      Convenience theorem for ExprSupported expressions (no log). Domain validity is automatic, so only the bound check is needed.