Documentation

CslibFrontier.Algorithms.Lean.DFS.Dominance

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 #

Main results #

References #

def Cslib.Algorithms.Lean.DFS.Dominates {V : Type u_1} (adj : V → List V) (entry d v : V) :

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) :

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) :
Dominates adj entry d v ↔ ¬Relation.ReflTransGen (Edge (deleteVertex adj d)) entry v

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} :
dominatesB adj entry d v = true ↔ Dominates adj entry d v

The executable query agrees with the all-walks specification on every target.