@[irreducible]
def
Nat.bisect
{start : Nat}
{stop : Nat}
{p : Nat → Bool}
(h : start < stop)
(hstart : p start = true)
(hstop : p stop = false)
:
Given natural numbers a < b
such that p a = true
and p b = false
, bisect
finds a natural
number a ≤ c < b
such that p c = true
and p (c+1) = false
.
Equations
- One or more equations did not get rendered due to their size.