Skip to content
Rainbow docs menu

Reference · The Applied Higher-Order Functions catalogue

rainbow.algorithms.proofs.ahof.forward-difference

The Applied Higher-Order Functions cataloguesrc/rainbow/algorithms/proofs/ahof/forward_difference.clj3 definitions, 3 theorems

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

DefinitionSource, line 53

findiff/forward-difference :
  (x₁ x₂ : ℚ)
  → ℚ

ℚ = signed/SignedRational

findiff/slope-example

DefinitionSource, line 59

findiff/slope-example :
  → ℚ

ℚ = signed/SignedRational

findiff/flat-example

DefinitionSource, line 62

findiff/flat-example :
  → ℚ

ℚ = signed/SignedRational

findiff/forward-difference-unfold

TheoremHolds by unfolding a definitionNo axiomsSource, line 68

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

TheoremWorked exampleNo axiomsSource, line 78

findiff/slope-is-three :
  → bfgs/change-example = signed/from-nnrat 3

= = signed/equivalent: equality of rational values

findiff/flat-is-zero

TheoremWorked exampleNo axiomsSource, line 84

findiff/flat-is-zero :
  → findiff/flat-example = signed/from-nnrat 0

= = signed/equivalent: equality of rational values