The incumbent never gets worse #
The search keeps one leaf, St.best, and replaces it only when it finds a better one. This file
makes that precise: whatever the search ends up holding is at least as good as anything it held
on the way.
There is one place where the incumbent is dropped rather than improved — pruneNode, when the
node's invariant path already beats the incumbent's. That is still monotone, but only because of
Progress.lean: the node is then guaranteed to come back with a leaf of its own subtree
(dfsNode_best, dfsNode_reach), and every leaf of that subtree beats what was dropped
(pruneNode_cleared). dfsNode_mono_cleared packages the two, and dfsNode_prune_shift — that
clearing the incumbent does not change what the node does next — is what lets it be applied to the
whole dfsNode call rather than to its innards.
The comparison used throughout is compare k k' ≠ .gt on leafKeys, the same order BestKey
is stated with.
Order helpers #
Domination #
k is no better than the leaf the state holds.
Equations
- IsoGraph.Canon.Dom st k = ∃ (l : IsoGraph.Canon.Leaf), st.best = some l ∧ compare k (IsoGraph.Canon.leafKey l.invPath l.cert) ≠ Ordering.gt
Instances For
The incumbent never gets worse.
Equations
- IsoGraph.Canon.BestMono st st' = ∀ (l : IsoGraph.Canon.Leaf), st.best = some l → IsoGraph.Canon.Dom st' (IsoGraph.Canon.leafKey l.invPath l.cert)
Instances For
leafUpdate improves the incumbent #
pruneNode only discards a dominated incumbent #
When pruneNode throws the incumbent away, every leaf below the node beats it.
Discarding the incumbent at a node does not change what the node does next.
The clearing case of monotonicity: if the node throws the incumbent away, the leaf it comes back with is one from below the node, and every such leaf beats what was thrown away.