TorchLean API

FloatLib.Numerics.Enclosure.Comparison.Proof

Correctness and termination of enclosure comparison #

Containment proves the ordering at every successful search. Endpoint convergence proves that the search terminates whenever the target differs from the boundary. Irrationality is one convenient sufficient condition when the boundaries are rational.

theorem FloatLib.Numerics.Enclosure.Comparison.compare_eq_real (intervals : RationalInterval) (boundary : ) (terminates : ∃ (n : ), Separates (intervals n) boundary) (x : ) (contains : ∀ (n : ), (intervals n).Contains x) :
compare intervals boundary terminates = cmp x boundary

Every accepted comparison agrees with the enclosed real value.

theorem FloatLib.Numerics.Enclosure.Comparison.exists_separating {intervals : RationalInterval} {x : } (boundary : ) (hne : x boundary) (hlo : Filter.Tendsto (fun (n : ) => (intervals n).lo) Filter.atTop (nhds x)) (hhi : Filter.Tendsto (fun (n : ) => (intervals n).hi) Filter.atTop (nhds x)) :
∃ (n : ), Separates (intervals n) boundary

Converging endpoints eventually exclude every boundary different from their limit.

theorem FloatLib.Numerics.Enclosure.Comparison.exists_separating_of_irrational {intervals : RationalInterval} {x : } (hx : Irrational x) (boundary : ) (hlo : Filter.Tendsto (fun (n : ) => (intervals n).lo) Filter.atTop (nhds x)) (hhi : Filter.Tendsto (fun (n : ) => (intervals n).hi) Filter.atTop (nhds x)) :
∃ (n : ), Separates (intervals n) boundary

An irrational limit cannot equal a rational comparison boundary.