Skip to content
Rainbow docs menu

Reference · The Applied Higher-Order Functions catalogue

rainbow.algorithms.proofs.ahof.bisection

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

AHoF O12 worked bisection bracket search over exact rationals. Starting from the bracket [0, 1], the probe midpoint is 1/2; keeping the lower half narrows to [0, 1/2], whose probe midpoint is 1/4 -- the interval and probe both halve. Scope (measured by the kernel): this module has 4 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.bisection` prints this classification.

ahof-o12/first-midpoint

DefinitionSource, line 62

ahof-o12/first-midpoint :
  → ℚ≥0

ℚ≥0 = nnrat/NonnegativeRational

ahof-o12/lower-bracket

DefinitionSource, line 66

ahof-o12/lower-bracket :
  → data/Product ℚ≥0 ℚ≥0

ℚ≥0 = nnrat/NonnegativeRational

ahof-o12/second-midpoint

DefinitionSource, line 70

ahof-o12/second-midpoint :
  → ℚ≥0

ℚ≥0 = nnrat/NonnegativeRational

ahof-o12/first-midpoint-is-half

TheoremWorked exampleNo axiomsSource, line 79

ahof-o12/first-midpoint-is-half :
  → ahof-o12/first-midpoint = nnrat/half

= = nnrat/equivalent: equality of rational values

ahof-o12/narrows-to-lower-half

TheoremWorked exampleNo axiomsSource, line 86

ahof-o12/narrows-to-lower-half :
  → search/bisection-narrow data/true 0 1 = data/pair ℚ≥0 ℚ≥0 0 (search/bracket-midpoint 0 1)

0 = nnrat/zero1 = nnrat/one= = equality/Eqℚ≥0 = nnrat/NonnegativeRational

ahof-o12/second-midpoint-is-quarter

TheoremWorked exampleNo axiomsSource, line 97

ahof-o12/second-midpoint-is-quarter :
  → ahof-o12/second-midpoint = nnrat/quarter

= = nnrat/equivalent: equality of rational values

ahof-o12/bisection

TheoremWorked exampleNo axiomsSource, line 107

ahof-o12/bisection :
  → proposition/conjunction (ahof-o12/first-midpoint = nnrat/half) (conjunction)
  where conjunction := proposition/conjunction (search/bisection-narrow data/true 0 1 = data/pair ℚ≥0 ℚ≥0 0 (search/bracket-midpoint 0 1)) (ahof-o12/second-midpoint = nnrat/quarter)

0 = nnrat/zero1 = nnrat/one= = nnrat/equivalent: equality of rational valuesℚ≥0 = nnrat/NonnegativeRational