Where the search records its leaves #
Two bookkeeping facts that the optimality argument needs, neither of which says anything about which leaf is best.
extract_nodup— the children of a node are pairwise distinct. A node's child list is a slice ofPart.lab, andPart.labis a permutation of the vertices, so no vertex is visited twice.dfsNode_paths— a call todfsNodeatpathonly ever records leaves belowpath. It is stated parametrically in a predicatePon paths: if everything the state already holds satisfiesP, and everything extendingpathsatisfiesP, then that is still true when the call returns. InstantiatingPdifferently at each use turns this one lemma into the running invariant "the incumbent's path does not go down a branch we have not explored yet".
The children of a node are distinct #
Prefixes of paths #
The search only records leaves of the subtree it is in #
Every leaf a state remembers — incumbent or first — has a path satisfying P.
Equations
- IsoGraph.Canon.StQ P st = ((∀ (l : IsoGraph.Canon.Leaf), st.best = some l → P l.path) ∧ ∀ (l : IsoGraph.Canon.Leaf), st.first = some l → P l.path)
Instances For
theorem
IsoGraph.Canon.dfsNode_paths
(n : ℕ)
(f : ℕ → ℕ → Bool)
(P : Array ℕ → Prop)
(fuel : ℕ)
(path : Array ℕ)
(invPath : Array UInt64)
(p : Part)
(st : St)
:
The leaves a node records lie below it. Anything the state already held keeps whatever property it had; anything added while the node runs has a path extending the node's.