Documentation

CslibFrontier.Algorithms.WordRAM.Arborescence.Internal.ReducedCost

Edmonds §4 reduced exit costs and row-potential equivalence (internal) #

Pure table-level lemmas proving row-potential equivalence (RowPotEq) between unreduced edmondsTableAux costs and the reduced exit-cost contraction (contractReducedCostTable), plus weight magnitude bounds ([-M₀, (k + 1) * M₀]).

Edmonds §4 reduced exit costs and row-potential equivalence #

theorem Cslib.Algorithms.WordRAM.Arborescence.Internal.argMinFin_of_lt_iff {β : Type u_1} {γ : Type u_2} [LinearOrder β] [LinearOrder γ] {n : ℕ} (pred : Fin n → Bool) (f : Fin n → β) (g : Fin n → γ) (h : ∀ (x y : Fin n), pred x = true → pred y = true → (f x < f y ↔ g x < g y)) :
theorem Cslib.Algorithms.WordRAM.Arborescence.Internal.selectParents_feasible_spec {n : ℕ} (a : Lean.Arborescence.AdjTable n) (c : Lean.Arborescence.CostTable ℤ n) (r : Fin n) (hfeas : (Lean.Arborescence.selectParents a c r).feasible = true) :
let f := (Lean.Arborescence.selectParents a c r).parents; f[↑r] = r ∧ ∀ (v : Fin n), v ≠ r → a[↑v][↑f[↑v]] = true ∧ f[↑v] ≠ v ∧ ∀ (w : Fin n), a[↑v][↑w] = true → w ≠ v → c[↑v][↑f[↑v]] ≤ c[↑v][↑w]

Row-potential equivalence between an unreduced cost table cUnred and a reduced cost table cRed on active arcs of a.

For each target column w, selects a cycle vertex x minimizing reduced exit cost c[x][w] - c[x][f[x]] among active arcs a[x][w].

Contracted cost matrix storing reduced exit costs c[x][w] - c[x][f[x]] out of x0 and zeroing inactive cells.

theorem Cslib.Algorithms.WordRAM.Arborescence.Internal.getElem_contractReducedCostTable {n : ℕ} (a : Lean.Arborescence.AdjTable n) (c : Lean.Arborescence.CostTable ℤ n) (f : Lean.Arborescence.ParentTable n) (inCycle : Vector Bool n) (bEntry bExit : Vector (Option (Fin n)) n) (x0 u w : Fin n) :
(contractReducedCostTable a c f inCycle bEntry bExit x0)[↑u][↑w] = if inCycle[↑u] = true then if (u == x0) = true then if (!inCycle[↑w]) = true then match bExit[↑w] with | some x => c[↑x][↑w] - c[↑x][↑f[↑x]] | none => 0 else 0 else 0 else if inCycle[↑w] = true then if (w == x0) = true then match bEntry[↑u] with | some y => c[↑u][↑y] | none => 0 else 0 else if a[↑u][↑w] = true then c[↑u][↑w] else 0
theorem Cslib.Algorithms.WordRAM.Arborescence.Internal.reducedBestExitTable_eq_bestExitTable {n : ℕ} {a : Lean.Arborescence.AdjTable n} {cUnred cRed : Lean.Arborescence.CostTable ℤ n} {f : Lean.Arborescence.ParentTable n} {inCycle : Vector Bool n} (hpot : RowPotEq a cUnred cRed) (hact : ∀ (x : Fin n), inCycle[↑x] = true → a[↑x][↑f[↑x]] = true) :
reducedBestExitTable a cRed f inCycle = Lean.Arborescence.bestExitTable a cUnred inCycle (Lean.Arborescence.otherCycleCost cUnred f inCycle)
theorem Cslib.Algorithms.WordRAM.Arborescence.Internal.rowPotEq_contractReduced {n : ℕ} {a : Lean.Arborescence.AdjTable n} {cUnred cRed : Lean.Arborescence.CostTable ℤ n} {f : Lean.Arborescence.ParentTable n} {inCycle : Vector Bool n} {x0 r : Fin n} (hpot : RowPotEq a cUnred cRed) (hx0_in : inCycle[↑x0] = true) (hact : ∀ (x : Fin n), inCycle[↑x] = true → a[↑x][↑f[↑x]] = true) :
have other := Lean.Arborescence.otherCycleCost cUnred f inCycle; have bEntry := Lean.Arborescence.bestEntryTable a cRed inCycle; have bExit := reducedBestExitTable a cRed f inCycle; RowPotEq (Lean.Arborescence.contractAdjTable a inCycle bEntry bExit x0 r) (Lean.Arborescence.contractCostTable cUnred inCycle other bEntry bExit x0) (contractReducedCostTable a cRed f inCycle bEntry bExit x0)
theorem Cslib.Algorithms.WordRAM.Arborescence.Internal.contractReducedCostTable_bounds {n k M₀ : ℕ} {a : Lean.Arborescence.AdjTable n} {c : Lean.Arborescence.CostTable ℤ n} {f : Lean.Arborescence.ParentTable n} {inCycle : Vector Bool n} {bEntry : Vector (Option (Fin n)) n} {x0 : Fin n} (hbnd : ∀ (u w : Fin n), -↑M₀ ≤ c[↑u][↑w] ∧ c[↑u][↑w] ≤ (↑k + 1) * ↑M₀) (hopt : ∀ (x : Fin n), inCycle[↑x] = true → ∀ (w : Fin n), a[↑x][↑w] = true → w ≠ x → c[↑x][↑f[↑x]] ≤ c[↑x][↑w]) (u w : Fin n) :
have bExit := reducedBestExitTable a c f inCycle; have c' := contractReducedCostTable a c f inCycle bEntry bExit x0; -↑M₀ ≤ c'[↑u][↑w] ∧ c'[↑u][↑w] ≤ (↑k + 2) * ↑M₀
theorem Cslib.Algorithms.WordRAM.Arborescence.Internal.contractReducedCostTable_natAbs_le {n B_k : ℕ} (a : Lean.Arborescence.AdjTable n) (c : Lean.Arborescence.CostTable ℤ n) (f : Lean.Arborescence.ParentTable n) (inCycle : Vector Bool n) (bEntry bExit : Vector (Option (Fin n)) n) (x0 : Fin n) (hB : ∀ (u col : Fin n), c[↑u][↑col].natAbs ≤ B_k) (u col : Fin n) :
(contractReducedCostTable a c f inCycle bEntry bExit x0)[↑u][↑col].natAbs ≤ 2 * B_k