The areas / V34. The tactics of Mathlib
Mathlib.Tactic.Order.Graph.Tarjan
14 declarations. Mathlib docs · Source
theorem Mathlib.Tactic.Order.Graph.TarjanState.mk.inj E1 #
∀ {toDFSState : Mathlib.Tactic.Order.Graph.DFSState} {id lowlink : Std.HashMap ℕ ℕ} {stack : Array ℕ}
{onStack : Std.HashSet ℕ} {time : ℕ} {toDFSState_1 : Mathlib.Tactic.Order.Graph.DFSState}
{id_1 lowlink_1 : Std.HashMap ℕ ℕ} {stack_1 : Array ℕ} {onStack_1 : Std.HashSet ℕ} {time_1 : ℕ},
{ toDFSState := toDFSState, id := id, lowlink := lowlink, stack := stack, onStack := onStack, time := time } =
{ toDFSState := toDFSState_1, id := id_1, lowlink := lowlink_1, stack := stack_1, onStack := onStack_1,
time := time_1 } →
toDFSState = toDFSState_1 ∧ id = id_1 ∧ lowlink = lowlink_1 ∧ stack = stack_1 ∧ onStack = onStack_1 ∧ time = time_1
def Mathlib.Tactic.Order.Graph.TarjanState.ctorIdx E1 #
Mathlib.Tactic.Order.Graph.TarjanState → ℕ
theorem Mathlib.Tactic.Order.Graph.TarjanState.mk.injEq E0 #
∀ (toDFSState : Mathlib.Tactic.Order.Graph.DFSState) (id lowlink : Std.HashMap ℕ ℕ) (stack : Array ℕ)
(onStack : Std.HashSet ℕ) (time : ℕ) (toDFSState_1 : Mathlib.Tactic.Order.Graph.DFSState)
(id_1 lowlink_1 : Std.HashMap ℕ ℕ) (stack_1 : Array ℕ) (onStack_1 : Std.HashSet ℕ) (time_1 : ℕ),
({ toDFSState := toDFSState, id := id, lowlink := lowlink, stack := stack, onStack := onStack, time := time } =
{ toDFSState := toDFSState_1, id := id_1, lowlink := lowlink_1, stack := stack_1, onStack := onStack_1,
time := time_1 }) =
(toDFSState = toDFSState_1 ∧
id = id_1 ∧ lowlink = lowlink_1 ∧ stack = stack_1 ∧ onStack = onStack_1 ∧ time = time_1)
structure Mathlib.Tactic.Order.Graph.TarjanState E1 #
Type
State for Tarjan's algorithm.
abbrev Mathlib.Tactic.Order.Graph.TarjanState.toDFSState E1 #
Mathlib.Tactic.Order.Graph.TarjanState → Mathlib.Tactic.Order.Graph.DFSState
ctor Mathlib.Tactic.Order.Graph.TarjanState.mk E0 #
Mathlib.Tactic.Order.Graph.DFSState →
Std.HashMap ℕ ℕ → Std.HashMap ℕ ℕ → Array ℕ → Std.HashSet ℕ → ℕ → Mathlib.Tactic.Order.Graph.TarjanState
abbrev Mathlib.Tactic.Order.Graph.TarjanState.id E1 #
Mathlib.Tactic.Order.Graph.TarjanState → Std.HashMap ℕ ℕ
id[v] is the index of the vertex v in the DFS traversal.
abbrev Mathlib.Tactic.Order.Graph.TarjanState.lowlink E1 #
Mathlib.Tactic.Order.Graph.TarjanState → Std.HashMap ℕ ℕ
lowlink[v] is the smallest index of any node on the stack that is reachable from v
through v's DFS subtree.
abbrev Mathlib.Tactic.Order.Graph.TarjanState.stack E1 #
Mathlib.Tactic.Order.Graph.TarjanState → Array ℕ
The stack of visited vertices used in Tarjan's algorithm.
abbrev Mathlib.Tactic.Order.Graph.TarjanState.onStack E1 #
Mathlib.Tactic.Order.Graph.TarjanState → Std.HashSet ℕ
onStack.contains v iff v is in stack. The structure is used to check it efficiently.
abbrev Mathlib.Tactic.Order.Graph.TarjanState.time E1 #
Mathlib.Tactic.Order.Graph.TarjanState → ℕ
A time counter that increments each time the algorithm visits an unvisited vertex.
opaque Mathlib.Tactic.Order.Graph.tarjanDFS E1 #
Mathlib.Tactic.Order.Graph → ℕ → StateM Mathlib.Tactic.Order.Graph.TarjanState Unit
The Tarjan's algorithm. See Wikipedia.
def Mathlib.Tactic.Order.Graph.findSCCsImp E1 #
Mathlib.Tactic.Order.Graph → StateM Mathlib.Tactic.Order.Graph.TarjanState Unit
Implementation of findSCCs in the StateM TarjanState monad.
def Mathlib.Tactic.Order.Graph.findSCCs E1 #
Mathlib.Tactic.Order.Graph → Std.HashMap ℕ ℕ
Finds the strongly connected components of the graph g. Returns a hashmap where the value at
key v represents the SCC number containing vertex v. The numbering of SCCs is arbitrary.