FinEnum index-bridge lemmas for Word-RAM Chu–Liu/Edmonds (internal) #
Bridges connecting canonical Fin n edmonds / edmondsOut / optimumBranchingParent
solutions on finite graphs to materialized Table algorithms and explicit n + 1 super-root
tables.
theorem Cslib.Algorithms.WordRAM.Arborescence.Internal.edmonds_fin_map_eq {n : ℕ} (G : Digraph (Fin n)) [DecidableRel G.Adj] (c : Fin n → Fin n → ℤ) (r : Fin n) :
Option.map (fun (f : Fin n → Fin n) => List.map (fun (v : Fin n) => ↑(f v)) (List.finRange n))
(Lean.Arborescence.edmonds G c r) = Option.map (fun (p : Lean.Arborescence.ParentTable n) => List.map (fun (v : Fin n) => ↑p[↑v]) (List.finRange n))
(Lean.Arborescence.edmondsTableAux r n (Lean.Arborescence.initAdjTable n fun (u w : Fin n) => decide (G.Adj u w))
(Lean.Arborescence.initCostTable n c))
theorem Cslib.Algorithms.WordRAM.Arborescence.Internal.edmondsOut_fin_map_eq {n : ℕ} (G : Digraph (Fin n)) [DecidableRel G.Adj] (c : Fin n → Fin n → ℤ) (r : Fin n) :
Option.map (fun (f : Fin n → Fin n) => List.map (fun (v : Fin n) => ↑(f v)) (List.finRange n))
(Lean.Arborescence.edmondsOut G c r) = Option.map (fun (p : Lean.Arborescence.ParentTable n) => List.map (fun (v : Fin n) => ↑p[↑v]) (List.finRange n))
(Lean.Arborescence.edmondsTableAux r n (Lean.Arborescence.initAdjTable n fun (u w : Fin n) => decide (G.Adj w u))
(Lean.Arborescence.initCostTable n fun (u w : Fin n) => c w u))
def Cslib.Algorithms.WordRAM.Arborescence.Internal.superRootAdjFin {n : ℕ} (G : Digraph (Fin n)) [DecidableRel G.Adj] :
Lean.Arborescence.AdjTable (n + 1)
Adjacency matrix of the (n + 1)-vertex super-root reduction digraph (reversed arcs plus
arcs from every x < n to super-root n).
def Cslib.Algorithms.WordRAM.Arborescence.Internal.superRootCostFin {n : ℕ} (wt : Fin n → Fin n → ℤ) :
Negated reversed cost matrix of the (n + 1)-vertex super-root reduction digraph (0 on
super-root arcs).
theorem Cslib.Algorithms.WordRAM.Arborescence.Internal.optimumBranchingParent_fin_eq {n : ℕ} (G : Digraph (Fin n)) [DecidableRel G.Adj] (wt : Fin n → Fin n → ℤ) :
∃ (p : Lean.Arborescence.ParentTable (n + 1)),
Lean.Arborescence.edmondsTableAux (Fin.last n) (n + 1) (superRootAdjFin G) (superRootCostFin wt) = some p ∧ ∀ (v : Fin n), ↑(Lean.Arborescence.optimumBranchingParent G wt v) = if ↑p[↑v] < n then ↑p[↑v] else ↑v