Skip to content
Rainbow docs menu

Reference · The Applied Higher-Order Functions catalogue

rainbow.algorithms.proofs.ahof.complex-step

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

AHoF O3 Complex-Step Derivative (classical method: f'(x) ~ Im f(x + ih) / h, which avoids subtractive cancellation). This module does NOT model it: it has no complex numbers, no imaginary part, no perturbation and no step size. What is defined and proved is plain signed subtraction of two supplied values: derivative-estimate a b = a - b, unfolding to signed/subtract for all signed inputs (by reflexivity), with worked instances 4-1 = 3 (slope-example-is-3) and 2-2 = 0 (flat-example-is-0). Complex-step differentiation itself is classical and not proved here. Values 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.complex-step` prints this classification.

complex-step/derivative-estimate

DefinitionSource, line 50

complex-step/derivative-estimate :
  (x₁ x₂ : ℚ)
  → ℚ

ℚ = signed/SignedRational

complex-step/slope-example

DefinitionSource, line 55

complex-step/slope-example :
  → ℚ

ℚ = signed/SignedRational

complex-step/flat-example

DefinitionSource, line 59

complex-step/flat-example :
  → ℚ

ℚ = signed/SignedRational

complex-step/derivative-estimate-unfold

TheoremHolds by unfolding a definitionNo axiomsSource, line 65

complex-step/derivative-estimate-unfold :
  (a b : ℚ)
  → bfgs/gradient-change a b = a - b

- = signed/subtract= = equality/Eqℚ = signed/SignedRational

complex-step/slope-example-is-3

TheoremWorked exampleNo axiomsSource, line 73

complex-step/slope-example-is-3 :
  → bfgs/change-example = signed/from-nnrat 3

= = signed/equivalent: equality of rational values

complex-step/flat-example-is-0

TheoremWorked exampleNo axiomsSource, line 78

complex-step/flat-example-is-0 :
  → bfgs/no-change = signed/from-nnrat 0

= = signed/equivalent: equality of rational values