Basic Examples #
This file demonstrates LeanCert's verified interval arithmetic core.
All examples in this file use only the fully-verified subset of expressions: const, var, add, mul, neg, sin, cos
The correctness theorems (evalInterval_correct, evalDual_val_correct) are FULLY PROVED with no sorry, no axioms for this subset.
Building supported expressions #
The expression x² (x squared)
Equations
Instances For
Proof that x² is in the supported subset
Equations
Instances For
The expression x² + 2x + 1 = (x + 1)²
Equations
- One or more equations did not get rendered due to their size.
Instances For
Proof that x² + 2x + 1 is in the supported subset
Equations
Instances For
The expression sin(x) + cos(x)
Equations
Instances For
Proof that sin(x) + cos(x) is in the supported subset
Equations
Instances For
Interval construction #
The unit interval [0, 1]
Equations
- LeanCert.Examples.Basic.I01 = { lo := 0, hi := 1, le := LeanCert.Examples.Basic.I01._proof_1 }
Instances For
The interval [-1, 1]
Equations
- LeanCert.Examples.Basic.symInterval = { lo := -1, hi := 1, le := LeanCert.Examples.Basic.symInterval._proof_1 }
Instances For
A small interval around 0: [-1/10, 1/10]
Equations
- LeanCert.Examples.Basic.smallInterval = { lo := -1 / 10, hi := 1 / 10, le := LeanCert.Examples.Basic.smallInterval._proof_1 }
Instances For
Interval membership examples #
Expression evaluation examples #
Verified interval evaluation #
Using smart constructors #
Build x² using smart constructors that carry the support proof
Equations
Instances For
Multi-variable example #
The expression x * y (product of two variables)
Equations
Instances For
Equations
Instances For
Multi-variable interval environment