Reference · The Applied Higher-Order Functions catalogue
rainbow.algorithms.proofs.ahof.forward-difference
AHoF O1 Forward Difference: approximate a derivative by the forward finite difference (f(x+h) - f(x)) / h. With unit step h = 1 the estimate is the signed difference of the two evaluations: forward-difference f-plus f-base = f-plus - f-base (over signed rationals). For f(x) = x^2 sampled at x = 1, h = 1: f(2) - f(1) = 4 - 1 = 3; a flat sample gives slope 0. Values are proved by signed cross-product equivalence. Proved native and axiom-free. Requires signed/subtract, signed/from-nnrat, signed/equivalent (all in the D63 checkpoint). Scope (measured by the kernel): this module has 2 worked instances (statements about specific values) and 1 definitional unfoldings (true by unfolding a definition). None of its theorems is a guarantee about the algorithm for all inputs; `lein verify rainbow.algorithms.proofs.ahof.forward-difference` prints this classification.
findiff/forward-difference
findiff/forward-difference : (x₁ x₂ : ℚ) → ℚ
ℚ = signed/SignedRational
findiff/slope-example
findiff/slope-example : → ℚ
ℚ = signed/SignedRational
findiff/flat-example
findiff/flat-example : → ℚ
ℚ = signed/SignedRational
findiff/forward-difference-unfold
findiff/forward-difference-unfold : (f-plus f-base : ℚ) → dfp/step-vector f-plus f-base = f-plus - f-base
- = signed/subtract= = equality/Eqℚ = signed/SignedRational
findiff/slope-is-three
findiff/slope-is-three : → bfgs/change-example = signed/from-nnrat 3
= = signed/equivalent: equality of rational values
findiff/flat-is-zero
findiff/flat-is-zero : → findiff/flat-example = signed/from-nnrat 0
= = signed/equivalent: equality of rational values