Block dominance by depth-first search #
Block dominance asks whether every walk from the entry to a target visits a candidate block. The executable query tests reachability after deleting the candidate's incident edges.
Main definitions #
Cslib.Algorithms.Lean.DFS.Dominatesexpresses dominance over walks, including both endpoints.Cslib.Algorithms.Lean.DFS.deleteVertexremoves the incident edges of a vertex.Cslib.Algorithms.Lean.DFS.dominatesBchecks a single dominance query by depth-first search.
Main results #
Cslib.Algorithms.Lean.DFS.dominates_iff_not_reachable_deletecharacterizes dominance by loss of reachability after deletion when the candidate differs from the entry.Cslib.Algorithms.Lean.DFS.dominatesB_eq_true_iffproves that the query agrees with the walk specification, including for unreachable targets.
References #
Every walk from entry to v contains d, counting both endpoints.
def Cslib.Algorithms.Lean.DFS.deleteVertex {V : Type u_1} (adj : V → List V) [DecidableEq V] (d u : V) :
List V
Delete all incident edges of d, keeping the original vertex type.
def Cslib.Algorithms.Lean.DFS.dominatesB {V : Type u_1} (adj : V → List V) [DecidableEq V] [Fintype V] (entry d v : V) :
Check dominance with one DFS, or immediately accept either endpoint.
theorem Cslib.Algorithms.Lean.DFS.dominates_iff_not_reachable_delete {V : Type u_1} {adj : V → List V} [DecidableEq V] {entry d v : V} (he : entry ≠ d) :
A candidate distinct from the entry dominates exactly when its deletion destroys reachability. This also covers targets already unreachable in the original graph.
@[simp]
theorem Cslib.Algorithms.Lean.DFS.dominatesB_eq_true_iff {V : Type u_1} {adj : V → List V} [DecidableEq V] [Fintype V] {entry d v : V} :
The executable query agrees with the all-walks specification on every target.