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.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) :
theorem Cslib.Algorithms.WordRAM.Arborescence.Internal.not_inCycle_root {n : ℕ} (r : Fin n) (f : Lean.Arborescence.ParentTable n) {x0 : Fin n} (hfr : f[↑r] = r) (hx0 : Lean.Arborescence.findCycleTable r f = some x0) :
def Cslib.Algorithms.WordRAM.Arborescence.Internal.RowPotEq {n : ℕ} (a : Lean.Arborescence.AdjTable n) (cUnred cRed : Lean.Arborescence.CostTable ℤ n) :
Row-potential equivalence between an unreduced cost table cUnred and a reduced cost table
cRed on active arcs of a.
def Cslib.Algorithms.WordRAM.Arborescence.Internal.reducedBestExitTable {n : ℕ} (a : Lean.Arborescence.AdjTable n) (c : Lean.Arborescence.CostTable ℤ n) (f : Lean.Arborescence.ParentTable n) (inCycle : Vector Bool n) :
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].
def Cslib.Algorithms.WordRAM.Arborescence.Internal.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 : Fin n) :
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.selectParents_of_rowPotEq {n : ℕ} {a : Lean.Arborescence.AdjTable n} {cUnred cRed : Lean.Arborescence.CostTable ℤ n} (r : Fin n) (hpot : RowPotEq a cUnred cRed) :
theorem Cslib.Algorithms.WordRAM.Arborescence.Internal.bestEntryTable_of_rowPotEq {n : ℕ} {a : Lean.Arborescence.AdjTable n} {cUnred cRed : Lean.Arborescence.CostTable ℤ n} (inCycle : Vector Bool n) (hpot : RowPotEq a cUnred cRed) :
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) :
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) :