Skip to content
Rainbow docs menu

Reference · The Applied Higher-Order Functions catalogue

rainbow.algorithms.proofs.ahof.forward-mode-ad

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

AHoF O4 Forward-Mode Auto-Diff: propagate derivatives through a computation with dual numbers; the chain rule composes derivatives multiplicatively (f∘g)'=f'(g)·g': dual-derivative outer-deriv inner-deriv = outer-deriv * inner-deriv (over signed). Worked: 2 * 3 = 6. Values proved by signed cross-product equivalence. Proved native and axiom-free. Requires signed/multiply (from rainbow.math.rational.signed.multiply, chained), signed/from-nnrat, signed/equivalent. 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-mode-ad` prints this classification.

Depends onmath.rational.signed.multiply

fwd-ad/dual-derivative

DefinitionSource, line 46

fwd-ad/dual-derivative :
  (x₁ x₂ : ℚ)
  → ℚ

ℚ = signed/SignedRational

fwd-ad/chain-example

DefinitionSource, line 51

fwd-ad/chain-example :
  → ℚ

ℚ = signed/SignedRational

fwd-ad/identity-inner

DefinitionSource, line 55

fwd-ad/identity-inner :
  → ℚ

ℚ = signed/SignedRational

fwd-ad/dual-derivative-unfold

TheoremHolds by unfolding a definitionNo axiomsSource, line 61

fwd-ad/dual-derivative-unfold :
  (a b : ℚ)
  → fwd-ad/dual-derivative a b = a · b

= = equality/Eq· = signed/multiplyℚ = signed/SignedRational

fwd-ad/chain-example-is-6

TheoremWorked exampleNo axiomsSource, line 69

fwd-ad/chain-example-is-6 :
  → fwd-ad/chain-example = signed/from-nnrat 6

= = signed/equivalent: equality of rational values

fwd-ad/identity-inner-is-3

TheoremWorked exampleNo axiomsSource, line 74

fwd-ad/identity-inner-is-3 :
  → det-pg/unit-jacobian = signed/from-nnrat 3

= = signed/equivalent: equality of rational values