Interval Arithmetic Tactics #
This file provides tactics for proving bounds on expressions using interval arithmetic.
Main tactics #
interval_le,interval_ge,interval_lt,interval_gt- Prove bounds usingnative_decide
Design notes #
We provide two sets of lemmas:
Core (computable) - uses evalIntervalCore1 #
For expressions in ExprSupportedCore (const, var, add, mul, neg, sin, cos),
the bound checking is fully computable and works with native_decide.
Extended (noncomputable) - uses evalInterval1 #
For expressions in ExprSupported (core + exp), the bound checking requires
noncomputable evaluation due to Real.exp. These cannot use native_decide.
The tactics use the core evaluator to enable native_decide.
Helper lemmas for decidable bounds (core, computable) #
Decidable version of hi ≤ c for core rational bounds
Decidable version of c ≤ lo for core rational bounds
Decidable version of hi < c for core rational bounds
Decidable version of c < lo for core rational bounds
Combined lemmas for tactic use (core, computable) #
Prove f(x) ≤ c by core interval arithmetic with decidable check. This combines the correctness theorem with decidability and works with native_decide. Requires domain validity (e.g., log arguments must be positive).
Prove c ≤ f(x) by core interval arithmetic with decidable check. Requires domain validity (e.g., log arguments must be positive).
Prove f(x) < c by core interval arithmetic with decidable check. Requires domain validity (e.g., log arguments must be positive).
Prove c < f(x) by core interval arithmetic with decidable check. Requires domain validity (e.g., log arguments must be positive).
Universal quantifier versions (core, computable) #
Prove ∀ x ∈ I, f(x) ≤ c by core interval arithmetic. Works with native_decide for expressions in ExprSupportedCore. Requires domain validity (e.g., log arguments must be positive).
Prove ∀ x ∈ I, c ≤ f(x) by core interval arithmetic. Requires domain validity (e.g., log arguments must be positive).
Prove ∀ x ∈ I, f(x) < c by core interval arithmetic. Requires domain validity (e.g., log arguments must be positive).
Prove ∀ x ∈ I, c < f(x) by core interval arithmetic. Requires domain validity (e.g., log arguments must be positive).
Extended versions (noncomputable, for reference) #
Prove f(x) ≤ c by extended interval arithmetic. NOTE: Cannot use native_decide due to noncomputability of exp.
Prove c ≤ f(x) by extended interval arithmetic.
Tactic Macros #
These macros provide an ergonomic interface for proving bounds.
They use the CORE (computable) evaluator, so native_decide works.
Usage #
example : ∀ x ∈ I01, Expr.eval (fun _ => x) exprXSq ≤ 1 := by
interval_le exprXSq exprXSq_supp I01 1
Note: For expressions containing exp, use manual proofs with expr_le_of_interval_hi
and explicit bound computation, as native_decide won't work.
Prove ∀ x ∈ I, f(x) ≤ c using core interval arithmetic.
Usage: interval_le e supp I c
Requires ExprSupportedCore e for native_decide to work.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Prove ∀ x ∈ I, c ≤ f(x) using core interval arithmetic.
Usage: interval_ge e supp I c
Equations
- One or more equations did not get rendered due to their size.
Instances For
Prove ∀ x ∈ I, f(x) < c using core interval arithmetic.
Usage: interval_lt e supp I c
Equations
- One or more equations did not get rendered due to their size.
Instances For
Prove ∀ x ∈ I, c < f(x) using core interval arithmetic.
Usage: interval_gt e supp I c
Equations
- One or more equations did not get rendered due to their size.
Instances For
Prove a pointwise bound f(x) ≤ c given x ∈ I.
Usage: interval_le_pt e supp I c x hx
Equations
- One or more equations did not get rendered due to their size.
Instances For
Prove a pointwise bound c ≤ f(x) given x ∈ I.
Usage: interval_ge_pt e supp I c x hx
Equations
- One or more equations did not get rendered due to their size.
Instances For
Extended interval tactics (noncomputable, for exp-containing expressions) #
These tactics work with ExprSupported (which includes exp) but cannot use
native_decide. They reduce the goal to an interval inequality that must be
proved by other means (linarith, norm_num, or manual computation).
Usage #
-- Reduces to goal: (evalInterval1 exprExp I01).hi ≤ 3
theorem exp_le_three_on_01 :
∀ x ∈ I01, Expr.eval (fun _ => x) exprExp ≤ (3 : ℚ) := by
interval_ext_le exprExp, exprExp_supp, I01, 3
-- Then prove the interval bound manually
sorry
Extended interval tactic for ≤ (supports exp).
Reduces ∀ x ∈ I, f(x) ≤ c to (evalInterval1 e I).hi ≤ c.
Usage: interval_ext_le e, supp, I, c
Equations
- One or more equations did not get rendered due to their size.
Instances For
Extended interval tactic for ≥ (supports exp).
Reduces ∀ x ∈ I, c ≤ f(x) to c ≤ (evalInterval1 e I).lo.
Usage: interval_ext_ge e, supp, I, c
Equations
- One or more equations did not get rendered due to their size.
Instances For
Extended interval tactic for < (supports exp).
Reduces ∀ x ∈ I, f(x) < c to (evalInterval1 e I).hi < c.
Usage: interval_ext_lt e, supp, I, c
Equations
- One or more equations did not get rendered due to their size.
Instances For
Extended interval tactic for > (supports exp).
Reduces ∀ x ∈ I, c < f(x) to c < (evalInterval1 e I).lo.
Usage: interval_ext_gt e, supp, I, c
Equations
- One or more equations did not get rendered due to their size.
Instances For
Extended pointwise tactic for ≤ (supports exp).
Reduces f(x) ≤ c (given x ∈ I) to (evalInterval1 e I).hi ≤ c.
Usage: interval_ext_le_pt e, supp, I, c, x, hx
Equations
- One or more equations did not get rendered due to their size.
Instances For
Extended pointwise tactic for ≥ (supports exp).
Reduces c ≤ f(x) (given x ∈ I) to c ≤ (evalInterval1 e I).lo.
Usage: interval_ext_ge_pt e, supp, I, c, x, hx
Equations
- One or more equations did not get rendered due to their size.