Tactic Examples #
This file demonstrates using LeanCert's interval arithmetic to prove bounds on expressions.
Verified Examples #
All examples in this file are FULLY PROVED using interval arithmetic. No sorry, no axioms beyond the standard Lean/Mathlib foundations.
Computability Design #
We have two evaluation strategies:
Core (computable): For expressions in
ExprSupportedCore(const, var, add, mul, neg, sin, cos), we useevalIntervalCore1which is fully computable. Theinterval_le,interval_ge, etc. tactics work withnative_decide.Extended (noncomputable): For expressions with
exp, we useevalInterval1which requires noncomputable evaluation due to Real.exp floor/ceil bounds. These proofs use FTIA directly.
Basic interval bound examples #
The expression x²
Equations
Instances For
Proof that x² is in the core (computable) subset
Equations
Instances For
Proof that x² is supported
Equations
Instances For
The unit interval [0, 1]
Equations
- LeanCert.Examples.Tactics.I01 = { lo := 0, hi := 1, le := LeanCert.Examples.Tactics.I01._proof_1 }
Instances For
Example: x² ≤ 1 for all x ∈ [0, 1] using the interval_le tactic. This uses the computable core evaluator with native_decide.
Example: 0 ≤ x² for all x ∈ [0, 1] using native_decide.
Example: x² ≤ 1 for all x ∈ [0, 1]. Manual proof for reference.
Example: 0 ≤ x² for all x ∈ [0, 1]. Manual proof for reference.
Trigonometric bounds #
The expression sin(x)
Equations
Instances For
Proof that sin(x) is in the core subset
Equations
Instances For
Proof that sin(x) is supported
Equations
Instances For
Example: sin(x) ≤ 1 for all x ∈ [0, 1] using native_decide.
Example: -1 ≤ sin(x) for all x ∈ [0, 1] using native_decide.
Example: sin(x) ≤ 1 for all x ∈ [0, 1]. Manual proof for reference.
Example: -1 ≤ sin(x) for all x ∈ [0, 1]. Manual proof for reference.
Combined expressions #
The expression x² + sin(x)
Equations
Instances For
Proof that x² + sin(x) is in the core subset
Equations
Instances For
Proof that x² + sin(x) is supported
Equations
Instances For
Example: x² + sin(x) ≤ 2 for all x ∈ [0, 1] using native_decide.
Example: -1 ≤ x² + sin(x) for all x ∈ [0, 1] using native_decide.
Example: x² + sin(x) ≤ 2 for all x ∈ [0, 1]. Manual proof for reference.
Example: -1 ≤ x² + sin(x) for all x ∈ [0, 1]. Manual proof for reference.
Strict bounds #
The expression x² - 2
Equations
Instances For
Proof that x² - 2 is in the core subset
Equations
Instances For
Proof that x² - 2 is supported
Equations
Instances For
Example: x² - 2 < 0 for all x ∈ [0, 1] using native_decide. Since x² ≤ 1 on [0,1], we have x² - 2 ≤ -1 < 0.
Example: x² - 2 < 0 for all x ∈ [0, 1]. Manual proof for reference.
Working with polynomials #
The expression 2x² + 3x + 1
Equations
- One or more equations did not get rendered due to their size.
Instances For
Proof that 2x² + 3x + 1 is in the core subset
Equations
Instances For
Proof that 2x² + 3x + 1 is supported
Equations
Instances For
Example: 2x² + 3x + 1 ≤ 6 for all x ∈ [0, 1] using native_decide. At x=1: 2 + 3 + 1 = 6.
Example: 1 ≤ 2x² + 3x + 1 for all x ∈ [0, 1] using native_decide. At x=0: 0 + 0 + 1 = 1.
Example: 2x² + 3x + 1 ≤ 6 for all x ∈ [0, 1]. Manual proof for reference.
Example: 1 ≤ 2x² + 3x + 1 for all x ∈ [0, 1]. Manual proof for reference.
Examples with exp (noncomputable) #
Expressions containing exp use the extended evaluator evalInterval1,
which is noncomputable due to Real.exp floor/ceil bounds. These examples
demonstrate bounds using direct FTIA application rather than native_decide.
The expression exp(x)
Equations
Instances For
Proof that exp(x) is supported (but NOT in ExprSupportedCore)
Equations
Instances For
Example: exp(x) ≤ 3 for all x ∈ [0, 1]. Since exp(1) ≈ 2.718, this bound holds. This uses the extended evaluator and requires direct proof.
Example: 1 ≤ exp(x) for all x ∈ [0, 1]. Since exp(0) = 1 and exp is increasing, this holds.
The expression x + exp(x)
Equations
Instances For
Proof that x + exp(x) is supported
Equations
Instances For
Example: x + exp(x) ≤ 4 for all x ∈ [0, 1]. x ≤ 1 and exp(x) ≤ 3, so x + exp(x) ≤ 4.
Example: 1 ≤ x + exp(x) for all x ∈ [0, 1]. x ≥ 0 and exp(x) ≥ 1, so x + exp(x) ≥ 1.