Automatic Differentiation - Basic Definitions #
This file provides the core types and algebraic operations for forward-mode automatic differentiation using interval arithmetic.
Main definitions #
DualInterval- A pair of intervals representing (value, derivative)DualInterval.const- Constant dual (derivative is zero)DualInterval.varActive- Active variable (derivative is 1)DualInterval.varPassive- Passive variable (derivative is 0)DualInterval.add- Addition with sum ruleDualInterval.mul- Multiplication with product ruleDualInterval.neg- Negation
Dual number with interval components: represents (value, derivative)
- val : Core.IntervalRat
- der : Core.IntervalRat
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Default DualInterval for unsupported expression branches
Dual interval for a constant (derivative is zero)
Equations
Instances For
Dual interval for the constant π (derivative is zero)
Equations
Instances For
Dual interval for the variable we're differentiating with respect to
Equations
- LeanCert.Engine.DualInterval.varActive I = { val := I, der := LeanCert.Core.IntervalRat.singleton 1 }
Instances For
Dual interval for a passive variable
Equations
- LeanCert.Engine.DualInterval.varPassive I = { val := I, der := LeanCert.Core.IntervalRat.singleton 0 }
Instances For
Add two dual intervals
Instances For
Negate a dual interval
Instances For
Inverse of a dual interval (quotient rule: d(1/f) = -f'/f²) Uses invInterval for the value component. For intervals containing zero, returns wide bounds.
Equations
- d.inv = { val := LeanCert.Engine.invInterval d.val, der := (d.der.mul ((LeanCert.Engine.invInterval d.val).mul (LeanCert.Engine.invInterval d.val))).neg }