Documentation

CslibFrontier.Algorithms.WordRAM.TwoSAT.EquivDFS

Literal-index bijection and DFS / CSR transport lemmas #

Transports dfs, topologicalSort, transposeAdj, sccs, indexComponents, and addClauseEdges across litEquiv n : Literal (Fin n) ≃ Fin (2 * n).

Bijection identifying Literal (Fin n) with Fin (2 * n) via 2 * v.val + b.toNat.

def Cslib.Algorithms.WordRAM.TwoSAT.mapAdj {α : Type u_1} {β : Type u_2} (e : α ≃ β) (g : α → List α) :
β → List β

Push an adjacency list function forward along an equivalence e.

theorem Cslib.Algorithms.WordRAM.TwoSAT.mapAdj_apply {α : Type u_1} {β : Type u_2} (e : α ≃ β) (g : α → List α) (x : α) :
mapAdj e g (e x) = List.map (⇑e) (g x)
theorem Cslib.Algorithms.WordRAM.TwoSAT.mapAdj_update_cons {α : Type u_1} {β : Type u_2} [DecidableEq α] [DecidableEq β] (e : α ≃ β) (rev : α → List α) (v u : α) :
Function.update (mapAdj e rev) (e v) (e u :: mapAdj e rev (e v)) = mapAdj e (Function.update rev v (u :: rev v))

Implication graph of G pushed forward along litEquiv G.n to Fin (2 * G.n).