Skip to content
Rainbow docs menu

Reference · The Applied Higher-Order Functions catalogue

rainbow.algorithms.proofs.ahof.newton

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

AHoF O26 worked Newton's method: the general descent skeleton with a Hessian-inverse step size, on the quadratic f(x) = x^2. The gradient is 2x, the Hessian is the constant 2, and the step size is 1 / 2 (exact rational reciprocal). From x = 2 the single Newton step is 2 - (1/2)(2*2) = 0: Newton reaches the minimum of a quadratic in one step, unlike fixed-rate gradient descent. The result is proved by signed cross-product equivalence. Scope (measured by the kernel): this module has 3 worked instances (statements about specific values). None of its theorems is a guarantee about the algorithm for all inputs; `lein verify rainbow.algorithms.proofs.ahof.newton` prints this classification.

ahof-o26/hessian

DefinitionSource, line 81

ahof-o26/hessian :
  (x₁ : ℚ)
  → ℚ≥0

ℚ = signed/SignedRationalℚ≥0 = nnrat/NonnegativeRational

ahof-o26/direction

DefinitionSource, line 87

ahof-o26/direction :
  (x₁ : ℚ)
  → ℚ

ℚ = signed/SignedRational

ahof-o26/step-size

DefinitionSource, line 93

ahof-o26/step-size :
  (x₁ : ℚ)
  → ℚ≥0

ℚ = signed/SignedRationalℚ≥0 = nnrat/NonnegativeRational

ahof-o26/update

DefinitionSource, line 100

ahof-o26/update :
  (x₁ : ℚ) (x₂ : ℚ≥0) (x₃ : ℚ)
  → ℚ

ℚ = signed/SignedRationalℚ≥0 = nnrat/NonnegativeRational

ahof-o26/initial

DefinitionSource, line 107

ahof-o26/initial :
  → ℚ

ℚ = signed/SignedRational

ahof-o26/trajectory

DefinitionSource, line 111

ahof-o26/trajectory :
  (x₁ : ℕ)
  → ℚ

ℕ = data/Natℚ = signed/SignedRational

ahof-o26/reaches-minimum-in-one-step

TheoremWorked exampleNo axiomsSource, line 124

ahof-o26/reaches-minimum-in-one-step :
  → optimization/general-descent-iterate ahof-o26/direction ahof-o26/step-size ahof-o31/update 1 ahof-o31/initial = signed/from-nnrat 0

0 = nnrat/zero= = signed/equivalent: equality of rational values

ahof-o26/newton-recurrence

TheoremWorked exampleNo axiomsSource, line 142

ahof-o26/newton-recurrence :
  → proposition/conjunction (iterate₁ = ahof-o31/initial) (iterate = (fun x₂ => fun previous => step previous) 0 ahof-o31/initial)
  where iterate := optimization/general-descent-iterate ahof-o26/direction ahof-o26/step-size ahof-o31/update 1 ahof-o31/initial
  where iterate₁ := optimization/general-descent-iterate ahof-o26/direction ahof-o26/step-size ahof-o31/update 0 ahof-o31/initial
  where step := optimization/general-descent-step ahof-o26/direction ahof-o26/step-size ahof-o31/update

= = equality/Eq

ahof-o26/newton

TheoremWorked exampleNo axiomsSource, line 142

ahof-o26/newton :
  → proposition/conjunction (iterate = signed/from-nnrat 0) (proposition/conjunction (iterate₁ = ahof-o31/initial) (iterate = (fun x₄ => fun previous => step previous) 0 ahof-o31/initial))
  where iterate := optimization/general-descent-iterate ahof-o26/direction ahof-o26/step-size ahof-o31/update 1 ahof-o31/initial
  where iterate₁ := optimization/general-descent-iterate ahof-o26/direction ahof-o26/step-size ahof-o31/update 0 ahof-o31/initial
  where step := optimization/general-descent-step ahof-o26/direction ahof-o26/step-size ahof-o31/update

0 = nnrat/zero= = equality/Eq