Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Definitions for Linear programs for entanglement and key distribution in the quantum internet

Definition
QAlgorithms_Papers_Independent_Intakethird100_P35

by Gohan · Nov 1, 2026 · Mathlib 0df444a (Lean v4.33.1)

prove2quantum

The objects the formalized statements of Linear programs for entanglement and key distribution in the quantum internet (arXiv:1809.03120) are stated in. Each was checked against the paper by a blind read-back and a moderator.

  • EdgeGraph: PDF pp.11,17: finite labelled undirected edges, with arbitrary endpoint ordering. Parallel edges are needed for the rounded multigraph. IsSimple is imposed on G'.
  • IsSimple: PDF p.17: G' has one edge per unordered adjacent pair.
  • Flow: PDF pp.11--12: two nonnegative oriented flows per physical undirected edge.
  • netSourceOutflow: PDF p.12, (9): net outgoing flow, counting each labelled edge once.
  • SingleFeasible: PDF p.12, (10): the full feasible single-pair LP, including nonnegativity.
  • singlePairFlowValue: PDF p.12, (10): optimum of the actual flow LP. On the theorem domain the feasible set contains zero, is compact, and the objective is bounded; the supremum is an attained maximum, including at c=0.
  • ConcurrentFeasible: PDF pp.13--14, (18),(20): every commodity and both orientations share c(e).
  • totalValue: PDF p.13, (18), and p.24, (91)--(93): maximum SUM of net source flows.
  • worstValue: PDF p.14, (20), and p.23, (83)--(86): one jointly feasible flow family, with a common slack value bounded by every commodity's net source flow.
  • SimpleEdgePath: PDF p.19, (54): ALL simple directed paths in the undirected graph. The length is bounded by n-1, hence this is a genuinely finite, computed type. Edge labels and vertex order are retained; no free list of paths is supplied.
  • pathCount: PDF pp.20,26--27: finite cardinality of the complete path type.
  • copyGraph: PDF pp.15,17: replace each edge by L(e) individually labelled unit copies.
  • Packing: PDF pp.20,26--28: a SINGLE concurrent packing in the physical multigraph. The disjointness condition ranges across commodities as well as within them. Each path carries actual copy labels, not just an aggregate edge-load bound.
  • roundedCopies: PDF pp.20,26--27: nonnegative real capacities are floored AFTER scaling.
  • maxPathCount: PDF p.26: Lemma 2 uses the maximum, allowing every path count to be zero.
  • sumPathCount: PDF p.27: Lemma 3 uses the SUM, in contrast to Lemma 2.
  • TerminalPair: PDF p.15: one representative per UNORDERED pair of distinct terminals.
  • ConnectivityFeasible: PDF pp.15,30, (32)--(36),(146)--(150): independent full edge budgets for each connectivity test, with a common lower slack. These tests are not concurrent commodities and their loads are NOT summed over terminal pairs.
  • connectivityValue: PDF pp.15,30, (32),(146): the connectivity LP's actual optimized slack.
  • cutCapacity: PDF p.12, (13): cut sum, each undirected edge counted once.
  • SteinerCut: PDF p.15, (29): the finite nonempty collection of cuts separating S.
  • steinerValue: PDF pp.15,30, (29),(145): minimum of computed Steiner cut sums. For |S|>=2 the domain is finite nonempty, so no totalized empty infimum is used.
  • LPRow: PDF p.16: a stored linear constraint, in equality or <= form.
  • FiniteLP: PDF p.16: an LP stores its actual coefficient rows and linear objective.
  • coefficientRow: Store a linear expression by evaluating it on coordinate unit vectors. All callers below are explicitly homogeneous linear combinations.
  • indexedRows: Enumerate one row for each element of a computed finite index type.
  • LPVariable: Common coordinates: oriented commodity flows, directed usage frequencies, and one slack. For the single and total programs the slack is fixed at zero.
  • lpFlow: Read an oriented flow coordinate from the common LP vector.
  • lpFrequency: Read a directed-channel usage frequency.
  • lpSlack: Read the common slack coordinate.
  • lpCapacity: PDF p.12, (11): sum directed weighted frequencies with the same undirected edge. D labels actual orientations; missing orientations contribute no summand.
  • optimizedLP: PDF pp.12--16, (12),(19),(21),(37): complete explicit constraint arrays. independent=true uses a full capacity copy for every pair, as (34) requires. Otherwise all commodities share the same physical edge budget. Endpoint conservation rows are 0=0; fixing the unused slack to zero in the single/total programs adds only a redundant coordinate. Both choices preserve exactly the source's feasible flows and objective values.
  • descriptionSize: Dense coefficient storage: one scalar per matrix entry, right-hand-side entry, and objective entry. No bit complexity or exact-real solver is asserted.
Definition code
import Mathlib

/-!
Bauml--Azuma--Kato--Elkouss, arXiv:1809.03120v3.
Standalone graph statements, PDF pp.15--16,20,26--28,30.
Operational network statements and source defects are deferred individually.
All new definitions are paper-local. No operational capacity is defined by a flow.
Compilation is pending the batch mechanical handoff.
-/

noncomputable section

namespace QAlgorithms.Papers.Independent.Intakethird100.P35

open scoped BigOperators

attribute [local instance] Classical.propDecidable Classical.decEq

/-- PDF pp.11,17: finite labelled undirected edges, with arbitrary endpoint ordering.
Parallel edges are needed for the rounded multigraph. IsSimple is imposed on G'. -/
structure EdgeGraph (n : ℕ) (E : Type) where
  left : E → Fin n
  right : E → Fin n
  separated : ∀ e, left e ≠ right e

/-- PDF p.17: G' has one edge per unordered adjacent pair. -/
def IsSimple {n : ℕ} {E : Type} (G : EdgeGraph n E) : Prop :=
  ∀ e f, ((G.left e = G.left f ∧ G.right e = G.right f) ∨
    (G.left e = G.right f ∧ G.right e = G.left f)) → e = f

/-- PDF pp.11--12: two nonnegative oriented flows per physical undirected edge. -/
abbrev Flow (E : Type) := E → Bool → ℝ

/-- PDF p.12, (9): net outgoing flow, counting each labelled edge once. -/
def netSourceOutflow {n : ℕ} {E : Type} [Fintype E]
    (G : EdgeGraph n E) (f : Flow E) (v : Fin n) : ℝ :=
  ∑ e, ((if G.left e = v then f e false - f e true else 0) +
    (if G.right e = v then f e true - f e false else 0))

/-- PDF p.12, (10): the full feasible single-pair LP, including nonnegativity. -/
def SingleFeasible {n : ℕ} {E : Type} [Fintype E]
    (G : EdgeGraph n E) (c : E → ℝ) (s t : Fin n) (f : Flow E) : Prop :=
  (∀ e b, 0 ≤ f e b) ∧ (∀ e, f e false + f e true ≤ c e) ∧
    ∀ v, v ≠ s → v ≠ t → netSourceOutflow G f v = 0

/-- PDF p.12, (10): optimum of the actual flow LP.
On the theorem domain the feasible set contains zero, is compact, and the
objective is bounded; the supremum is an attained maximum, including at c=0. -/
def singlePairFlowValue {n : ℕ} {E : Type} [Fintype E]
    (G : EdgeGraph n E) (c : E → ℝ) (s t : Fin n) : ℝ :=
  sSup {z | ∃ f, SingleFeasible G c s t f ∧ z = netSourceOutflow G f s}

/-- PDF pp.13--14, (18),(20): every commodity and both orientations share c(e). -/
def ConcurrentFeasible {n r : ℕ} {E : Type} [Fintype E]
    (G : EdgeGraph n E) (c : E → ℝ) (s t : Fin r → Fin n)
    (f : Fin r → Flow E) : Prop :=
  (∀ i e b, 0 ≤ f i e b) ∧
    (∀ e, ∑ i, (f i e false + f i e true) ≤ c e) ∧
    ∀ i v, v ≠ s i → v ≠ t i → netSourceOutflow G (f i) v = 0

/-- PDF p.13, (18), and p.24, (91)--(93): maximum SUM of net source flows. -/
def totalValue {n r : ℕ} {E : Type} [Fintype E]
    (G : EdgeGraph n E) (c : E → ℝ) (s t : Fin r → Fin n) : ℝ :=
  sSup {z | ∃ f, ConcurrentFeasible G c s t f ∧
    z = ∑ i, netSourceOutflow G (f i) (s i)}

/-- PDF p.14, (20), and p.23, (83)--(86): one jointly feasible flow family,
with a common slack value bounded by every commodity's net source flow. -/
def worstValue {n r : ℕ} {E : Type} [Fintype E]
    (G : EdgeGraph n E) (c : E → ℝ) (s t : Fin r → Fin n) : ℝ :=
  sSup {z | ∃ f, ConcurrentFeasible G c s t f ∧
    ∀ i, z ≤ netSourceOutflow G (f i) (s i)}

/-- PDF p.19, (54): ALL simple directed paths in the undirected graph.
The length is bounded by n-1, hence this is a genuinely finite, computed type.
Edge labels and vertex order are retained; no free list of paths is supplied. -/
abbrev SimpleEdgePath {n : ℕ} {E : Type} (G : EdgeGraph n E) (s t : Fin n) :=
  Σ l : Fin n,
    {p : (Fin (l.val + 1) → Fin n) × (Fin l.val → E) //
      Function.Injective p.1 ∧ p.1 0 = s ∧ p.1 (Fin.last l.val) = t ∧
      ∀ i : Fin l.val,
        (G.left (p.2 i) = p.1 i.castSucc ∧ G.right (p.2 i) = p.1 i.succ) ∨
        (G.right (p.2 i) = p.1 i.castSucc ∧ G.left (p.2 i) = p.1 i.succ)}

/-- PDF pp.20,26--27: finite cardinality of the complete path type. -/
def pathCount {n : ℕ} {E : Type} [Fintype E]
    (G : EdgeGraph n E) (s t : Fin n) : ℕ :=
  Fintype.card (SimpleEdgePath G s t)

/-- PDF pp.15,17: replace each edge by L(e) individually labelled unit copies. -/
def copyGraph {n : ℕ} {E : Type} (G : EdgeGraph n E) (L : E → ℕ) :
    EdgeGraph n (Σ e : E, Fin (L e)) where
  left e := G.left e.1
  right e := G.right e.1
  separated e := G.separated e.1

/-- PDF pp.20,26--28: a SINGLE concurrent packing in the physical multigraph.
The disjointness condition ranges across commodities as well as within them.
Each path carries actual copy labels, not just an aggregate edge-load bound. -/
structure Packing {n r : ℕ} {E : Type} (G : EdgeGraph n E) (L : E → ℕ)
    (s t : Fin r → Fin n) where
  count : Fin r → ℕ
  path : (i : Σ j : Fin r, Fin (count j)) → SimpleEdgePath (copyGraph G L) (s i.1) (t i.1)
  disjoint : ∀ i j, i ≠ j → ∀ a : Fin (path i).1.val, ∀ b : Fin (path j).1.val,
    (path i).2.val.2 a ≠ (path j).2.val.2 b

/-- PDF pp.20,26--27: nonnegative real capacities are floored AFTER scaling. -/
def roundedCopies {E : Type} (c : E → ℝ) (m k N : ℕ) (e : E) : ℕ :=
  ⌊((m * k * N : ℕ) : ℝ) * c e⌋₊

/-- PDF p.26: Lemma 2 uses the maximum, allowing every path count to be zero. -/
def maxPathCount {n r : ℕ} {E : Type} [Fintype E]
    (G : EdgeGraph n E) (s t : Fin r → Fin n) : ℕ :=
  Finset.univ.sup (fun i => pathCount G (s i) (t i))

/-- PDF p.27: Lemma 3 uses the SUM, in contrast to Lemma 2. -/
def sumPathCount {n r : ℕ} {E : Type} [Fintype E]
    (G : EdgeGraph n E) (s t : Fin r → Fin n) : ℕ :=
  ∑ i, pathCount G (s i) (t i)

/-- PDF p.15: one representative per UNORDERED pair of distinct terminals. -/
abbrev TerminalPair {n : ℕ} (S : Finset (Fin n)) :=
  {p : Fin n × Fin n // p.1 ∈ S ∧ p.2 ∈ S ∧ p.1 < p.2}

/-- PDF pp.15,30, (32)--(36),(146)--(150): independent full edge budgets
for each connectivity test, with a common lower slack. These tests are not
concurrent commodities and their loads are NOT summed over terminal pairs. -/
def ConnectivityFeasible {n : ℕ} {E : Type} [Fintype E]
    (G : EdgeGraph n E) (c : E → ℝ) (S : Finset (Fin n))
    (z : ℝ) (f : TerminalPair S → Flow E) : Prop :=
  ∀ p, SingleFeasible G c p.val.1 p.val.2 (f p) ∧
    z ≤ netSourceOutflow G (f p) p.val.1

/-- PDF pp.15,30, (32),(146): the connectivity LP's actual optimized slack. -/
def connectivityValue {n : ℕ} {E : Type} [Fintype E]
    (G : EdgeGraph n E) (c : E → ℝ) (S : Finset (Fin n)) : ℝ :=
  sSup {z | ∃ f, ConnectivityFeasible G c S z f}

/-- PDF p.12, (13): cut sum, each undirected edge counted once. -/
def cutCapacity {n : ℕ} {E : Type} [Fintype E]
    (G : EdgeGraph n E) (c : E → ℝ) (A : Finset (Fin n)) : ℝ :=
  ∑ e, if (G.left e ∈ A ∧ G.right e ∉ A) ∨
    (G.right e ∈ A ∧ G.left e ∉ A) then c e else 0

/-- PDF p.15, (29): the finite nonempty collection of cuts separating S. -/
def SteinerCut {n : ℕ} (S A : Finset (Fin n)) : Prop :=
  ∃ s ∈ S, ∃ t ∈ S, s ∈ A ∧ t ∉ A

/-- PDF pp.15,30, (29),(145): minimum of computed Steiner cut sums.
For |S|>=2 the domain is finite nonempty, so no totalized empty infimum is used. -/
def steinerValue {n : ℕ} {E : Type} [Fintype E]
    (G : EdgeGraph n E) (c : E → ℝ) (S : Finset (Fin n)) : ℝ :=
  sInf {z | ∃ A, SteinerCut S A ∧ z = cutCapacity G c A}

/-- Zero oriented flow has zero net netSourceOutflow, including an empty edge type. -/
example {n : ℕ} {E : Type} [Fintype E] (G : EdgeGraph n E) (v : Fin n) :
    netSourceOutflow G (fun _ _ => 0) v = 0 := by
  simp [netSourceOutflow]

/-- Zero capacities give zero rounded copies, including the N=0 boundary. -/
example {E : Type} (m k N : ℕ) (e : E) :
    roundedCopies (fun _ => 0) m k N e = 0 := by
  simp [roundedCopies]

/-- A cut containing every vertex has capacity zero. -/
example {n : ℕ} {E : Type} [Fintype E] (G : EdgeGraph n E) (c : E → ℝ) :
    cutCapacity G c Finset.univ = 0 := by
  simp [cutCapacity]

/-- PDF p.16: a stored linear constraint, in equality or <= form. -/
structure LPRow (X : Type) where
  coefficient : X → ℝ
  rhs : ℝ
  equality : Bool

/-- PDF p.16: an LP stores its actual coefficient rows and linear objective. -/
structure FiniteLP (X : Type) where
  rows : List (LPRow X)
  objective : X → ℝ

/-- Store a linear expression by evaluating it on coordinate unit vectors.
All callers below are explicitly homogeneous linear combinations. -/
def coefficientRow {X : Type} (l : (X → ℝ) → ℝ) (rhs : ℝ)
    (equality : Bool) : LPRow X :=
  ⟨fun j => l (Pi.single j 1), rhs, equality⟩

/-- Enumerate one row for each element of a computed finite index type. -/
def indexedRows {I X : Type} [Fintype I] (f : I → LPRow X) : List (LPRow X) :=
  Finset.univ.toList.map f

/-- Common coordinates: oriented commodity flows, directed usage frequencies,
and one slack. For the single and total programs the slack is fixed at zero. -/
abbrev LPVariable (I E D : Type) := ((I × E × Bool) ⊕ D) ⊕ Unit

/-- Read an oriented flow coordinate from the common LP vector. -/
def lpFlow {I E D : Type} (x : LPVariable I E D → ℝ) (i : I) : Flow E :=
  fun e b => x (Sum.inl (Sum.inl (i, e, b)))

/-- Read a directed-channel usage frequency. -/
def lpFrequency {I E D : Type} (x : LPVariable I E D → ℝ) (d : D) : ℝ :=
  x (Sum.inl (Sum.inr d))

/-- Read the common slack coordinate. -/
def lpSlack {I E D : Type} (x : LPVariable I E D → ℝ) : ℝ :=
  x (Sum.inr ())

/-- PDF p.12, (11): sum directed weighted frequencies with the same undirected
edge. D labels actual orientations; missing orientations contribute no summand. -/
def lpCapacity {I E D : Type} [Fintype D]
    (edgeOf : D → E) (C : D → ℝ) (x : LPVariable I E D → ℝ) (e : E) : ℝ :=
  ∑ d, if edgeOf d = e then C d * lpFrequency x d else 0

/-- PDF pp.12--16, (12),(19),(21),(37): complete explicit constraint arrays.
independent=true uses a full capacity copy for every pair, as (34) requires.
Otherwise all commodities share the same physical edge budget.
Endpoint conservation rows are 0=0; fixing the unused slack to zero in the
single/total programs adds only a redundant coordinate. Both choices preserve
exactly the source's feasible flows and objective values. -/
def optimizedLP {n : ℕ} {I E D : Type} [Fintype I] [Fintype E] [Fintype D]
    (G : EdgeGraph n E) (s t : I → Fin n) (edgeOf : D → E) (C : D → ℝ)
    (independent hasSlack : Bool) : FiniteLP (LPVariable I E D) where
  rows :=
    indexedRows (fun j : I × E × Bool => coefficientRow
      (fun x => -lpFlow x j.1 j.2.1 j.2.2) 0 false) ++
    indexedRows (fun d : D => coefficientRow (fun x => -lpFrequency x d) 0 false) ++
    indexedRows (fun d : D => coefficientRow (fun x => lpFrequency x d) 1 false) ++
    [coefficientRow (fun x => ∑ d, lpFrequency x d) 1 true] ++
    indexedRows (fun j : I × Fin n => coefficientRow
      (fun x => if j.2 ≠ s j.1 ∧ j.2 ≠ t j.1 then
        netSourceOutflow G (lpFlow x j.1) j.2 else 0) 0 true) ++
    (if independent then
      indexedRows (fun j : I × E => coefficientRow
        (fun x => lpFlow x j.1 j.2 false + lpFlow x j.1 j.2 true -
          lpCapacity edgeOf C x j.2) 0 false)
    else
      indexedRows (fun e : E => coefficientRow
        (fun x => (∑ i, (lpFlow x i e false + lpFlow x i e true)) -
          lpCapacity edgeOf C x e) 0 false)) ++
    (if hasSlack then
      indexedRows (fun i : I => coefficientRow
        (fun x => lpSlack x - netSourceOutflow G (lpFlow x i) (s i)) 0 false)
    else [coefficientRow (fun x => lpSlack x) 0 true])
  objective := fun j =>
    let x := Pi.single j 1
    if hasSlack then lpSlack x else ∑ i, netSourceOutflow G (lpFlow x i) (s i)

/-- Dense coefficient storage: one scalar per matrix entry, right-hand-side
entry, and objective entry. No bit complexity or exact-real solver is asserted. -/
def descriptionSize {X : Type} [Fintype X] (P : FiniteLP X) : ℕ :=
  Fintype.card X * (P.rows.length + 1) + P.rows.length

/-- Extracting coefficients retains a one-coordinate homogeneous expression. -/
example (a : ℝ) (j : Fin 1) :
    (coefficientRow (fun x : Fin 1 → ℝ => a * x j) 0 false).coefficient j = a := by
  simp [coefficientRow]

end QAlgorithms.Papers.Independent.Intakethird100.P35
Source
Linear programs for entanglement and key distribution in the quantum internet, arXiv:1809.03120v3, https://arxiv.org/abs/1809.03120v3
Read-back

What the Lean code literally says, in plain math · gpt-6.1-sol

QAlgorithms.Papers.Independent.Intakethird100.P35.ConcurrentFeasible

For any natural numbers n,rn,rn,r, any type EEE equipped with a finite enumeration, any graph with distinct endpoints ℓ(e),r(e)∈{0,…,n−1}\ell(e),r(e)\in\{0,\ldots,n-1\}ℓ(e),r(e)∈{0,…,n−1}, any capacity function c:E→Rc:E\to\mathbb Rc:E→R, any functions s,t:{0,…,r−1}→{0,…,n−1}s,t:\{0,\ldots,r-1\}\to\{0,\ldots,n-1\}s,t:{0,…,r−1}→{0,…,n−1}, and any family of real functions fi:E×{false,true}→Rf_i:E\times\{\mathrm{false},\mathrm{true}\}\to\mathbb Rfi​:E×{false,true}→R, write fi,e0=fi(e,false)f_{i,e}^0=f_i(e,\mathrm{false})fi,e0​=fi​(e,false) and fi,e1=fi(e,true)f_{i,e}^1=f_i(e,\mathrm{true})fi,e1​=fi​(e,true). This predicate requires

fi,e0≥0,fi,e1≥0(i<r, e∈E),∑i=0r−1(fi,e0+fi,e1)≤c(e)(e∈E),∑e∈E(1{ℓ(e)=v}(fi,e0−fi,e1)+1{r(e)=v}(fi,e1−fi,e0))=0(i<r, v≠s(i), v≠t(i)).\begin{gathered} f_{i,e}^0\ge0,\quad f_{i,e}^1\ge0\qquad(i<r,\ e\in E),\\ \sum_{i=0}^{r-1}(f_{i,e}^0+f_{i,e}^1)\le c(e)\qquad(e\in E),\\ \sum_{e\in E}\left( \mathbf 1_{\{\ell(e)=v\}}(f_{i,e}^0-f_{i,e}^1) +\mathbf 1_{\{r(e)=v\}}(f_{i,e}^1-f_{i,e}^0) \right)=0 \quad(i<r,\ v\ne s(i),\ v\ne t(i)). \end{gathered}fi,e0​≥0,fi,e1​≥0(i<r, e∈E),i=0∑r−1​(fi,e0​+fi,e1​)≤c(e)(e∈E),e∈E∑​(1{ℓ(e)=v}​(fi,e0​−fi,e1​)+1{r(e)=v}​(fi,e1​−fi,e0​))=0(i<r, v=s(i), v=t(i)).​

There are no distinctness requirements on terminals within or between pairs, and no sign requirements on terminal net outflows. Any negative edge capacity makes feasibility impossible. When r=0r=0r=0, the predicate reduces to 0≤c(e)0\le c(e)0≤c(e) for every edge. Empty edge sets are allowed; when n=0n=0n=0, the terminal functions can exist only if r=0r=0r=0, and the graph also forces EEE to be empty.

QAlgorithms.Papers.Independent.Intakethird100.P35.ConnectivityFeasible

For a natural number nnn, a type EEE equipped with a finite enumeration, a graph GGG with distinct endpoints ℓ(e),ρ(e)∈V={0,…,n−1}\ell(e),\rho(e)\in V=\{0,\ldots,n-1\}ℓ(e),ρ(e)∈V={0,…,n−1} for each edge, any real capacity function c:E→Rc:E\to\mathbb Rc:E→R, a finite terminal set S⊆VS\subseteq VS⊆V, a real number zzz, and a family of real-valued functions fu,v:E×{0,1}→Rf^{u,v}:E\times\{0,1\}\to\mathbb Rfu,v:E×{0,1}→R indexed by u,v∈Su,v\in Su,v∈S with u<vu<vu<v, feasibility means that every such pair satisfies all of the following: fu,v(e,b)≥0f^{u,v}(e,b)\ge0fu,v(e,b)≥0 for every edge and both direction indices; fu,v(e,0)+fu,v(e,1)≤c(e)f^{u,v}(e,0)+f^{u,v}(e,1)\le c(e)fu,v(e,0)+fu,v(e,1)≤c(e) for every edge; Δfu,v(w)=0\Delta_{f^{u,v}}(w)=0Δfu,v​(w)=0 at every vertex www different from both uuu and vvv; and z≤Δfu,v(u)z\le\Delta_{f^{u,v}}(u)z≤Δfu,v​(u), where Δh(w)=∑e∈E(1ℓ(e)=w(h(e,0)−h(e,1))+1ρ(e)=w(h(e,1)−h(e,0)))\Delta_h(w)=\sum_{e\in E}\bigl(\mathbf1_{\ell(e)=w}(h(e,0)-h(e,1))+\mathbf1_{\rho(e)=w}(h(e,1)-h(e,0))\bigr)Δh​(w)=∑e∈E​(1ℓ(e)=w​(h(e,0)−h(e,1))+1ρ(e)=w​(h(e,1)−h(e,0))). Each pair has its own full capacity bound; capacities are not summed across pairs. There is no assumption that ccc or zzz is nonnegative. If SSS has fewer than two elements, the condition is vacuous for every real zzz. If there is at least one terminal pair and some edge has negative capacity, the required nonnegative flow values cannot satisfy that edge’s capacity bound.

QAlgorithms.Papers.Independent.Intakethird100.P35.EdgeGraph

For any natural number nnn, including 000, and any type EEE, an element of this structure consists of two functions ℓ,r:E→{0,…,n−1}\ell,r:E\to\{0,\ldots,n-1\}ℓ,r:E→{0,…,n−1}, together with the requirement that ℓ(e)≠r(e)\ell(e)\ne r(e)ℓ(e)=r(e) for every e∈Ee\in Ee∈E. Thus each edge label has two distinct, ordered endpoints. The type EEE need not be finite, and distinct edge labels may have the same endpoints. If n=0n=0n=0, such a structure can exist only when EEE is empty.

QAlgorithms.Papers.Independent.Intakethird100.P35.FiniteLP

For any type XXX, a FiniteLP(X)\mathrm{FiniteLP}(X)FiniteLP(X) consists of a finite ordered list of rows, each row containing a coefficient function X→RX\to\mathbb RX→R, a real right-hand side, and a Boolean equality flag, together with an objective coefficient function o:X→Ro:X\to\mathbb Ro:X→R. The row list may be empty or contain repeated rows; XXX itself need not be finite or nonempty. This structure supplies no definition of feasibility, optimization direction, or attained optimum.

QAlgorithms.Papers.Independent.Intakethird100.P35.Flow

For any type EEE, a flow is simply a function f:E×{false,true}→Rf:E\times\{\mathrm{false},\mathrm{true}\}\to\mathbb Rf:E×{false,true}→R, assigning two real numbers to each edge label. There are no nonnegativity, capacity, or conservation conditions in this definition. If EEE is empty, there is exactly one such function.

QAlgorithms.Papers.Independent.Intakethird100.P35.IsSimple

For any natural number nnn, any type EEE, and any graph GGG specified by endpoint functions ℓ,r:E→{0,…,n−1}\ell,r:E\to\{0,\ldots,n-1\}ℓ,r:E→{0,…,n−1} satisfying ℓ(e)≠r(e)\ell(e)\ne r(e)ℓ(e)=r(e), this predicate means that for all e,f∈Ee,f\in Ee,f∈E,

((ℓ(e)=ℓ(f)∧r(e)=r(f))∨(ℓ(e)=r(f)∧r(e)=ℓ(f)))  ⟹  e=f.\bigl((\ell(e)=\ell(f)\land r(e)=r(f))\lor (\ell(e)=r(f)\land r(e)=\ell(f))\bigr)\implies e=f.((ℓ(e)=ℓ(f)∧r(e)=r(f))∨(ℓ(e)=r(f)∧r(e)=ℓ(f)))⟹e=f.

In other words, two edge labels with the same endpoints, in either order, must be equal. No finiteness assumption is imposed on EEE; when EEE is empty, the condition holds vacuously.

QAlgorithms.Papers.Independent.Intakethird100.P35.LPRow

For any type XXX, an LPRow(X)\mathrm{LPRow}(X)LPRow(X) consists of a function a:X→Ra:X\to\mathbb Ra:X→R called its coefficient function, a real number bbb called its right-hand side, and a Boolean value ε\varepsilonε called its equality flag. The type XXX need not be finite or nonempty, and no restrictions on the coefficients or right-hand side, or interpretation of the Boolean flag as a constraint, are included in this structure.

QAlgorithms.Papers.Independent.Intakethird100.P35.LPVariable

For arbitrary types I,E,DI,E,DI,E,D, this abbreviation denotes the disjoint union

((I×E×{0,1})⊔D)⊔{∗},\bigl((I\times E\times\{0,1\})\sqcup D\bigr)\sqcup\{\ast\},((I×E×{0,1})⊔D)⊔{∗},

where 0,10,10,1 represent the Boolean values false and true. Thus its elements have exactly three distinct tagged forms: a triple (i,a,b)(i,a,b)(i,a,b), an element d∈Dd\in Dd∈D, or the single additional element ∗\ast∗; the tags keep these forms distinct even if the underlying types overlap. No finiteness or nonemptiness assumptions are imposed on I,E,DI,E,DI,E,D, and the additional element ∗\ast∗ is always present.

QAlgorithms.Papers.Independent.Intakethird100.P35.Packing

For natural numbers n,rn,rn,r, an arbitrary edge type EEE, a graph GGG assigning each edge eee distinct endpoints ℓ(e),ρ(e)∈V={0,…,n−1}\ell(e),\rho(e)\in V=\{0,\ldots,n-1\}ℓ(e),ρ(e)∈V={0,…,n−1}, a function L:E→NL:E\to\mathbb NL:E→N, and terminal maps s,t:{0,…,r−1}→Vs,t:\{0,\ldots,r-1\}\to Vs,t:{0,…,r−1}→V, a packing consists of a natural number qiq_iqi​ for each terminal index iii and a path for each indexed occurrence (i,j)(i,j)(i,j) with 0≤j<qi0\le j<q_i0≤j<qi​. The available edges are the labeled copies (e,a)(e,a)(e,a) with e∈Ee\in Ee∈E and 0≤a<L(e)0\le a<L(e)0≤a<L(e); every copy has endpoints ℓ(e),ρ(e)\ell(e),\rho(e)ℓ(e),ρ(e). Each selected path has a length ddd with 0≤d<n0\le d<n0≤d<n, an injective vertex sequence v0,…,vdv_0,\ldots,v_dv0​,…,vd​ with v0=siv_0=s_iv0​=si​ and vd=tiv_d=t_ivd​=ti​, and a sequence of ddd copied edges, each joining its consecutive vertices in either orientation. For any two distinct indexed occurrences, every copied edge used by one path must differ from every copied edge used by the other, including when both paths belong to the same terminal index. Vertices may be shared between paths, and different copies of the same original edge are distinct edges. Counts may all be zero. A path of length zero is permitted exactly when its terminals coincide; such paths use no edges, so the disjointness requirement does not restrict how many are selected. If r=0r=0r=0, there are no counts or selected paths; if n=0n=0n=0, the terminal maps can exist only when r=0r=0r=0.

QAlgorithms.Papers.Independent.Intakethird100.P35.SimpleEdgePath

For any natural number nnn, any type EEE, any graph with distinct endpoints ℓ(e),r(e)∈{0,…,n−1}\ell(e),r(e)\in\{0,\ldots,n-1\}ℓ(e),r(e)∈{0,…,n−1}, and any vertices s,ts,ts,t, this type consists of the following data: a natural number l<nl<nl<n, a vertex sequence v0,…,vlv_0,\ldots,v_lv0​,…,vl​, and an edge-label sequence e0,…,el−1e_0,\ldots,e_{l-1}e0​,…,el−1​, such that all vjv_jvj​ are pairwise distinct, v0=sv_0=sv0​=s, vl=tv_l=tvl​=t, and, for each 0≤j<l0\le j<l0≤j<l,

(ℓ(ej)=vj∧r(ej)=vj+1)∨(r(ej)=vj∧ℓ(ej)=vj+1).(\ell(e_j)=v_j\land r(e_j)=v_{j+1}) \lor (r(e_j)=v_j\land \ell(e_j)=v_{j+1}).(ℓ(ej​)=vj​∧r(ej​)=vj+1​)∨(r(ej​)=vj​∧ℓ(ej​)=vj+1​).

Thus traversal may use either order of an edge’s endpoints, and the chosen edge labels are part of the data. No finiteness assumption is made on EEE. Length 000 is allowed: it gives the single-vertex path exactly when s=ts=ts=t; injectivity excludes all positive-length paths when s=ts=ts=t. Supplying s,ts,ts,t requires n>0n>0n>0.

QAlgorithms.Papers.Independent.Intakethird100.P35.SingleFeasible

For any natural number nnn, any type EEE equipped with a finite enumeration, any graph with distinct endpoints ℓ(e),r(e)∈{0,…,n−1}\ell(e),r(e)\in\{0,\ldots,n-1\}ℓ(e),r(e)∈{0,…,n−1} for every e∈Ee\in Ee∈E, any real capacity function c:E→Rc:E\to\mathbb Rc:E→R, any vertices s,ts,ts,t, and any function f:E×{false,true}→Rf:E\times\{\mathrm{false},\mathrm{true}\}\to\mathbb Rf:E×{false,true}→R, write fe0=f(e,false)f_e^0=f(e,\mathrm{false})fe0​=f(e,false) and fe1=f(e,true)f_e^1=f(e,\mathrm{true})fe1​=f(e,true). This predicate requires all three conditions:

fe0≥0,fe1≥0(e∈E),fe0+fe1≤c(e)(e∈E),∑e∈E(1{ℓ(e)=v}(fe0−fe1)+1{r(e)=v}(fe1−fe0))=0(v≠s, v≠t).\begin{gathered} f_e^0\ge0,\quad f_e^1\ge0\qquad(e\in E),\\ f_e^0+f_e^1\le c(e)\qquad(e\in E),\\ \sum_{e\in E}\left( \mathbf 1_{\{\ell(e)=v\}}(f_e^0-f_e^1) +\mathbf 1_{\{r(e)=v\}}(f_e^1-f_e^0) \right)=0\qquad(v\ne s,\ v\ne t). \end{gathered}fe0​≥0,fe1​≥0(e∈E),fe0​+fe1​≤c(e)(e∈E),e∈E∑​(1{ℓ(e)=v}​(fe0​−fe1​)+1{r(e)=v}​(fe1​−fe0​))=0(v=s, v=t).​

The vertices s,ts,ts,t are not required to be distinct, and no sign condition is imposed on their net outflows. A negative capacity on any edge makes the predicate impossible to satisfy. Empty edge sets are allowed, with every displayed sum equal to 000; supplying s,ts,ts,t requires n>0n>0n>0.

QAlgorithms.Papers.Independent.Intakethird100.P35.SteinerCut

For any natural number nnn and finite subsets S,A⊆{0,…,n−1}S,A\subseteq\{0,\ldots,n-1\}S,A⊆{0,…,n−1}, the stated property means that there exist s,t∈Ss,t\in Ss,t∈S such that s∈As\in As∈A and t∉At\notin At∈/A. Equivalently, AAA contains at least one terminal and excludes at least one terminal. The two witnesses are necessarily distinct, but no order between them is required, and no restriction is placed on the membership of vertices outside SSS. The property is false when SSS has fewer than two elements, when AAA is empty, or when AAA is the whole vertex set; in particular, it is always false when n=0n=0n=0.

QAlgorithms.Papers.Independent.Intakethird100.P35.TerminalPair

For any natural number nnn and finite subset SSS of V={0,…,n−1}V=\{0,\ldots,n-1\}V={0,…,n−1}, this is the type of ordered pairs (u,v)(u,v)(u,v) such that u∈Su\in Su∈S, v∈Sv\in Sv∈S, and u<vu<vu<v in the usual order on vertex indices. Thus each pair consists of two distinct terminals, recorded with the smaller one first. The type is empty when SSS has fewer than two elements, including when n=0n=0n=0.

QAlgorithms.Papers.Independent.Intakethird100.P35.coefficientRow

For any type XXX, any function l:(X→R)→Rl:(X\to\mathbb R)\to\mathbb Rl:(X→R)→R, any real number bbb, and any Boolean ε\varepsilonε, this definition produces a row with right-hand side bbb, equality flag ε\varepsilonε, and coefficient at j∈Xj\in Xj∈X equal to l(δj)l(\delta_j)l(δj​), where δj:X→R\delta_j:X\to\mathbb Rδj​:X→R is 111 at jjj and 000 at every other element. No finiteness or nonemptiness assumption is made on XXX, and no linearity assumption is made on lll: the definition only evaluates lll on these individual coordinate functions.

QAlgorithms.Papers.Independent.Intakethird100.P35.connectivityValue

For a natural number nnn, a type EEE equipped with a finite enumeration, a graph GGG assigning each edge distinct endpoints ℓ(e),ρ(e)∈V={0,…,n−1}\ell(e),\rho(e)\in V=\{0,\ldots,n-1\}ℓ(e),ρ(e)∈V={0,…,n−1}, any function c:E→Rc:E\to\mathbb Rc:E→R, and a finite terminal set S⊆VS\subseteq VS⊆V, the defined real number is sup⁡{z∈R:there exists a family (fu,v)u,v∈S, u<v satisfying the following conditions}\sup\{z\in\mathbb R:\text{there exists a family }(f^{u,v})_{u,v\in S,\ u<v}\text{ satisfying the following conditions}\}sup{z∈R:there exists a family (fu,v)u,v∈S, u<v​ satisfying the following conditions}. Each fu,vf^{u,v}fu,v assigns a nonnegative real number to every edge and each of two direction indices, satisfies fu,v(e,0)+fu,v(e,1)≤c(e)f^{u,v}(e,0)+f^{u,v}(e,1)\le c(e)fu,v(e,0)+fu,v(e,1)≤c(e) separately for every edge, has Δfu,v(w)=0\Delta_{f^{u,v}}(w)=0Δfu,v​(w)=0 whenever w≠u,vw\ne u,vw=u,v, and has Δfu,v(u)≥z\Delta_{f^{u,v}}(u)\ge zΔfu,v​(u)≥z, where Δh(w)=∑e∈E(1ℓ(e)=w(h(e,0)−h(e,1))+1ρ(e)=w(h(e,1)−h(e,0)))\Delta_h(w)=\sum_{e\in E}\bigl(\mathbf1_{\ell(e)=w}(h(e,0)-h(e,1))+\mathbf1_{\rho(e)=w}(h(e,1)-h(e,0))\bigr)Δh​(w)=∑e∈E​(1ℓ(e)=w​(h(e,0)−h(e,1))+1ρ(e)=w​(h(e,1)−h(e,0))). Different terminal pairs do not share their capacity bounds. This uses the total real supremum operation, which returns 000 for an empty set or a set unbounded above. In particular, when ∣S∣<2|S|<2∣S∣<2, every real zzz qualifies vacuously and the defined value is 000; when ∣S∣≥2|S|\ge2∣S∣≥2 and some capacity is negative, no zzz qualifies and the value is also 000.

QAlgorithms.Papers.Independent.Intakethird100.P35.copyGraph

For any natural number nnn, any type EEE, any graph GGG with endpoint functions ℓ,r:E→{0,…,n−1}\ell,r:E\to\{0,\ldots,n-1\}ℓ,r:E→{0,…,n−1} satisfying ℓ(e)≠r(e)\ell(e)\ne r(e)ℓ(e)=r(e), and any function L:E→NL:E\to\mathbb NL:E→N, the defined graph has the same vertex set and edge-label type

{(e,j):e∈E, 0≤j<L(e)}.\{(e,j):e\in E,\ 0\le j<L(e)\}.{(e,j):e∈E, 0≤j<L(e)}.

The left and right endpoints of (e,j)(e,j)(e,j) are respectively ℓ(e)\ell(e)ℓ(e) and r(e)r(e)r(e), and their inequality is inherited from GGG. An edge with L(e)=0L(e)=0L(e)=0 contributes no labels, while an edge with positive L(e)L(e)L(e) contributes that many distinct labels sharing its endpoints. Neither EEE nor the resulting edge type is required to be finite. If n=0n=0n=0, the supplied graph forces EEE, and hence the resulting edge type, to be empty.

QAlgorithms.Papers.Independent.Intakethird100.P35.cutCapacity

For a natural number nnn, a type EEE equipped with a finite enumeration, a graph GGG assigning each edge distinct endpoints ℓ(e),ρ(e)∈V={0,…,n−1}\ell(e),\rho(e)\in V=\{0,\ldots,n-1\}ℓ(e),ρ(e)∈V={0,…,n−1}, any real-valued function c:E→Rc:E\to\mathbb Rc:E→R, and a finite subset A⊆VA\subseteq VA⊆V, the cut capacity is ∑e∈Ec(e)1∣{ℓ(e),ρ(e)}∩A∣=1\sum_{e\in E}c(e)\mathbf1_{\lvert\{\ell(e),\rho(e)\}\cap A\rvert=1}∑e∈E​c(e)1∣{ℓ(e),ρ(e)}∩A∣=1​: each edge contributes its capacity exactly when one endpoint belongs to AAA and the other does not, and otherwise contributes zero. The edge’s orientation does not affect this condition, and distinct parallel edge labels are counted separately. Capacities need not be nonnegative, so the sum can be negative. It is 000 when EEE is empty, when AAA is empty, or when A=VA=VA=V. If n=0n=0n=0, the existence of the endpoint maps forces EEE to be empty.

QAlgorithms.Papers.Independent.Intakethird100.P35.descriptionSize

For any finite type XXX, equipped with a finite enumeration, and any finite linear-program description PPP consisting of a list of rows and an objective function X→RX\to\mathbb RX→R, define its description size to be

∣X∣(m+1)+m,|X|(m+1)+m,∣X∣(m+1)+m,

where mmm is the length of its row list. Each row consists of a coefficient function X→RX\to\mathbb RX→R, a real right-hand side, and a Boolean equality flag. The formula counts every listed row, including repeated or zero rows, and applies also when XXX or the row list is empty; it does not depend on the values of the coefficients, right-hand sides, equality flags, or objective.

QAlgorithms.Papers.Independent.Intakethird100.P35.indexedRows

For any types I,XI,XI,X, with a specified finite enumeration of III, and any function fff assigning to each i∈Ii\in Ii∈I a row consisting of coefficients X→RX\to\mathbb RX→R, a real right-hand side, and a Boolean equality flag, this definition returns the list obtained by listing every element of III once and applying fff in that enumeration order. Its length is ∣I∣|I|∣I∣; it is empty when III is empty, and equal rows can appear repeatedly when distinct indices have the same image. No finiteness assumption is made on XXX.

QAlgorithms.Papers.Independent.Intakethird100.P35.lpCapacity

For arbitrary types I,E,DI,E,DI,E,D, with a specified finite enumeration of DDD, a function a:D→Ea:D\to Ea:D→E, real values CdC_dCd​, a real assignment xxx on ((I×E×{0,1})⊔D)⊔{∗}\bigl((I\times E\times\{0,1\})\sqcup D\bigr)\sqcup\{\ast\}((I×E×{0,1})⊔D)⊔{∗}, and an element e∈Ee\in Ee∈E, this definition returns

∑d∈D{Cd x(d),a(d)=e,0,a(d)≠e,\sum_{d\in D} \begin{cases} C_d\,x(d),&a(d)=e,\\ 0,&a(d)\ne e, \end{cases}d∈D∑​{Cd​x(d),0,​a(d)=e,a(d)=e,​

where x(d)x(d)x(d) is the tagged DDD-coordinate. Neither CdC_dCd​ nor x(d)x(d)x(d) is required to be nonnegative, aaa need not be injective or surjective, and I,EI,EI,E need not be finite. The value is zero if DDD is empty or no ddd maps to eee.

QAlgorithms.Papers.Independent.Intakethird100.P35.lpFlow

For arbitrary types I,E,DI,E,DI,E,D, a real assignment xxx on the tagged disjoint union ((I×E×{0,1})⊔D)⊔{∗}\bigl((I\times E\times\{0,1\})\sqcup D\bigr)\sqcup\{\ast\}((I×E×{0,1})⊔D)⊔{∗}, and an element i∈Ii\in Ii∈I, this definition returns the function fi:E×{0,1}→Rf_i:E\times\{0,1\}\to\mathbb Rfi​:E×{0,1}→R given by fi(a,b)=x(i,a,b)f_i(a,b)=x(i,a,b)fi​(a,b)=x(i,a,b), using the tagged triple coordinate of xxx. There are no sign, capacity, or conservation requirements on this function and no finiteness assumptions on the types; when EEE is empty, the returned function has empty domain.

QAlgorithms.Papers.Independent.Intakethird100.P35.lpFrequency

For arbitrary types I,E,DI,E,DI,E,D, a real assignment xxx on ((I×E×{0,1})⊔D)⊔{∗}\bigl((I\times E\times\{0,1\})\sqcup D\bigr)\sqcup\{\ast\}((I×E×{0,1})⊔D)⊔{∗}, and an element d∈Dd\in Dd∈D, this definition returns x(d)x(d)x(d) at the tagged DDD-coordinate. It imposes no nonnegativity, upper bound, or normalization requirement, and the types need not be finite.

QAlgorithms.Papers.Independent.Intakethird100.P35.lpSlack

For arbitrary types I,E,DI,E,DI,E,D and a real assignment xxx on ((I×E×{0,1})⊔D)⊔{∗}\bigl((I\times E\times\{0,1\})\sqcup D\bigr)\sqcup\{\ast\}((I×E×{0,1})⊔D)⊔{∗}, this definition returns the coordinate x(∗)x(\ast)x(∗) at the single additional element. This is an unrestricted real number; no finiteness or nonemptiness assumptions on I,E,DI,E,DI,E,D are required.

QAlgorithms.Papers.Independent.Intakethird100.P35.maxPathCount

For natural numbers n,rn,rn,r, a type EEE equipped with a finite enumeration of all its elements, a graph GGG assigning each edge distinct endpoints in V={0,…,n−1}V=\{0,\ldots,n-1\}V={0,…,n−1}, and terminal maps s,t:{0,…,r−1}→Vs,t:\{0,\ldots,r-1\}\to Vs,t:{0,…,r−1}→V, let pip_ipi​ be the number of the following paths from sis_isi​ to tit_iti​: choose a length ddd with 0≤d<n0\le d<n0≤d<n, an injective vertex sequence v0,…,vdv_0,\ldots,v_dv0​,…,vd​ beginning at sis_isi​ and ending at tit_iti​, and an edge sequence e0,…,ed−1e_0,\ldots,e_{d-1}e0​,…,ed−1​ such that each eje_jej​ joins vjv_jvj​ and vj+1v_{j+1}vj+1​ in either orientation. Different edge labels give different paths even when their endpoints agree. The defined value is max⁡ipi\max_i p_imaxi​pi​, with value 000 when r=0r=0r=0. A disconnected pair has count 000, while coincident terminals have exactly the length-zero path. No simplicity assumption on GGG is imposed. The case n=0n=0n=0 is included whenever the terminal maps exist, which requires r=0r=0r=0.

QAlgorithms.Papers.Independent.Intakethird100.P35.netSourceOutflow

For any natural number nnn, any type EEE equipped with a finite enumeration, any graph with endpoint functions ℓ,r:E→{0,…,n−1}\ell,r:E\to\{0,\ldots,n-1\}ℓ,r:E→{0,…,n−1} satisfying ℓ(e)≠r(e)\ell(e)\ne r(e)ℓ(e)=r(e), any function f:E×{false,true}→Rf:E\times\{\mathrm{false},\mathrm{true}\}\to\mathbb Rf:E×{false,true}→R, and any vertex v∈{0,…,n−1}v\in\{0,\ldots,n-1\}v∈{0,…,n−1}, write fe0=f(e,false)f_e^0=f(e,\mathrm{false})fe0​=f(e,false) and fe1=f(e,true)f_e^1=f(e,\mathrm{true})fe1​=f(e,true). The defined real number is

∑e∈E(1{ℓ(e)=v}(fe0−fe1)+1{r(e)=v}(fe1−fe0)),\sum_{e\in E}\left( \mathbf 1_{\{\ell(e)=v\}}(f_e^0-f_e^1) +\mathbf 1_{\{r(e)=v\}}(f_e^1-f_e^0) \right),e∈E∑​(1{ℓ(e)=v}​(fe0​−fe1​)+1{r(e)=v}​(fe1​−fe0​)),

where each indicator is 111 when its condition holds and 000 otherwise. The values of fff may be arbitrary real numbers. If EEE is empty, the sum is 000; if n=0n=0n=0, there is no vertex vvv to supply.

QAlgorithms.Papers.Independent.Intakethird100.P35.optimizedLP

For any natural number nnn, types I,E,DI,E,DI,E,D with specified finite enumerations, a graph GGG whose edges a∈Ea\in Ea∈E have distinct endpoints L(a),R(a)∈{0,…,n−1}L(a),R(a)\in\{0,\ldots,n-1\}L(a),R(a)∈{0,…,n−1}, functions s,t:I→{0,…,n−1}s,t:I\to\{0,\ldots,n-1\}s,t:I→{0,…,n−1}, a function a:D→Ea:D\to Ea:D→E, real values CdC_dCd​, and Booleans α,β\alpha,\betaα,β corresponding respectively to independent and hasSlack, this definition constructs a row list and an objective coefficient function on

X=((I×E×{0,1})⊔D)⊔{∗}.X=\bigl((I\times E\times\{0,1\})\sqcup D\bigr)\sqcup\{\ast\}.X=((I×E×{0,1})⊔D)⊔{∗}.

For any assignment x:X→Rx:X\to\mathbb Rx:X→R, write fi(e,b)=x(i,e,b)f_i(e,b)=x(i,e,b)fi​(e,b)=x(i,e,b), yd=x(d)y_d=x(d)yd​=x(d), σ=x(∗)\sigma=x(\ast)σ=x(∗), and define

Ux(e)=∑d∈D1a(d)=eCdyd,Dix(v)=∑e∈E(1L(e)=v(fi(e,0)−fi(e,1))+1R(e)=v(fi(e,1)−fi(e,0))).U_x(e)=\sum_{d\in D}\mathbf1_{a(d)=e}C_dy_d,\qquad D_i^x(v)=\sum_{e\in E}\left( \mathbf1_{L(e)=v}(f_i(e,0)-f_i(e,1)) +\mathbf1_{R(e)=v}(f_i(e,1)-f_i(e,0)) \right).Ux​(e)=d∈D∑​1a(d)=e​Cd​yd​,Dix​(v)=e∈E∑​(1L(e)=v​(fi​(e,0)−fi​(e,1))+1R(e)=v​(fi​(e,1)−fi​(e,0))).

For a real-valued function FFF of assignments, let R(F,b,ε)R(F,b,\varepsilon)R(F,b,ε) denote the stored row with coefficient F(δj)F(\delta_j)F(δj​) at coordinate j∈Xj\in Xj∈X, right-hand side bbb, and Boolean equality flag ε\varepsilonε, where δj\delta_jδj​ is 111 at jjj and 000 elsewhere. The row list concatenates the following blocks in exactly this order, enumerating every index once within each block: R(−fi(e,b),0,false)R(-f_i(e,b),0,\mathrm{false})R(−fi​(e,b),0,false) for every (i,e,b)(i,e,b)(i,e,b); R(−yd,0,false)R(-y_d,0,\mathrm{false})R(−yd​,0,false) for every ddd; R(yd,1,false)R(y_d,1,\mathrm{false})R(yd​,1,false) for every ddd; the single row R(∑dyd,1,true)R(\sum_dy_d,1,\mathrm{true})R(∑d​yd​,1,true); R(Fi,v,0,true)R(F_{i,v},0,\mathrm{true})R(Fi,v​,0,true) for every (i,v)(i,v)(i,v), where Fi,v(x)=Dix(v)F_{i,v}(x)=D_i^x(v)Fi,v​(x)=Dix​(v) if v≠siv\ne s_iv=si​ and v≠tiv\ne t_iv=ti​, and Fi,v(x)=0F_{i,v}(x)=0Fi,v​(x)=0 otherwise; then, if α\alphaα is true, R(fi(e,0)+fi(e,1)−Ux(e),0,false)R(f_i(e,0)+f_i(e,1)-U_x(e),0,\mathrm{false})R(fi​(e,0)+fi​(e,1)−Ux​(e),0,false) for every (i,e)(i,e)(i,e), or, if α\alphaα is false, R(∑i(fi(e,0)+fi(e,1))−Ux(e),0,false)R(\sum_i(f_i(e,0)+f_i(e,1))-U_x(e),0,\mathrm{false})R(∑i​(fi​(e,0)+fi​(e,1))−Ux​(e),0,false) for every eee; finally, if β\betaβ is true, R(σ−Dix(si),0,false)R(\sigma-D_i^x(s_i),0,\mathrm{false})R(σ−Dix​(si​),0,false) for every iii, or, if β\betaβ is false, the single row R(σ,0,true)R(\sigma,0,\mathrm{true})R(σ,0,true). Its objective coefficient at jjj is δj(∗)\delta_j(\ast)δj​(∗) when β\betaβ is true and ∑iDiδj(si)\sum_iD_i^{\delta_j}(s_i)∑i​Diδj​​(si​) when β\betaβ is false. These are stored coefficients and flags; the definition itself specifies no feasibility relation or optimization direction. There is no simplicity assumption on GGG, no requirement that si≠tis_i\ne t_isi​=ti​, and no sign requirement on CdC_dCd​. Empty index types are allowed whenever the supplied functions exist: empty indexed blocks disappear and empty sums are zero; in particular, if DDD is empty, the normalization block remains a row with every coefficient zero, right-hand side 111, and equality flag true.

QAlgorithms.Papers.Independent.Intakethird100.P35.pathCount

For any natural number nnn, any type EEE equipped with a finite enumeration, any graph with distinct endpoints ℓ(e),r(e)∈{0,…,n−1}\ell(e),r(e)\in\{0,\ldots,n-1\}ℓ(e),r(e)∈{0,…,n−1}, and any vertices s,ts,ts,t, the defined natural number is the cardinality of the finite collection of all data consisting of a length l<nl<nl<n, pairwise distinct vertices v0,…,vlv_0,\ldots,v_lv0​,…,vl​ with v0=sv_0=sv0​=s and vl=tv_l=tvl​=t, and edge labels e0,…,el−1e_0,\ldots,e_{l-1}e0​,…,el−1​ such that each eje_jej​ has endpoints vj,vj+1v_j,v_{j+1}vj​,vj+1​ in either order. Different choices of edge labels count separately even when their endpoint sequences agree. Length 000 is included, so the count is 111 when s=ts=ts=t; when EEE is empty and s≠ts\ne ts=t, it is 000. Supplying the terminal vertices excludes n=0n=0n=0.

QAlgorithms.Papers.Independent.Intakethird100.P35.roundedCopies

For any type EEE, any function c:E→Rc:E\to\mathbb Rc:E→R, natural numbers m,k,Nm,k,Nm,k,N, and edge e∈Ee\in Ee∈E, the number of rounded copies is ⌊(mkN)c(e)⌋N\lfloor (mkN)c(e)\rfloor_{\mathbb N}⌊(mkN)c(e)⌋N​, where the natural-number product mkNmkNmkN is converted to a real number before multiplication by c(e)c(e)c(e), and ⌊x⌋N\lfloor x\rfloor_{\mathbb N}⌊x⌋N​ is the greatest natural number at most xxx when x≥0x\ge0x≥0, and is 000 when x<0x<0x<0. No finiteness assumption on EEE or nonnegativity assumption on ccc is imposed. In particular, the result is 000 if any of m,k,Nm,k,Nm,k,N is zero, or if c(e)≤0c(e)\le0c(e)≤0.

QAlgorithms.Papers.Independent.Intakethird100.P35.singlePairFlowValue

For any natural number nnn, any type EEE equipped with a finite enumeration, any graph with distinct endpoints ℓ(e),r(e)∈{0,…,n−1}\ell(e),r(e)\in\{0,\ldots,n-1\}ℓ(e),r(e)∈{0,…,n−1}, any function c:E→Rc:E\to\mathbb Rc:E→R, and any vertices s,ts,ts,t, define, for a function f:E×{false,true}→Rf:E\times\{\mathrm{false},\mathrm{true}\}\to\mathbb Rf:E×{false,true}→R,

Df(v)=∑e∈E(1{ℓ(e)=v}(f(e,false)−f(e,true))+1{r(e)=v}(f(e,true)−f(e,false))).D_f(v)=\sum_{e\in E}\left( \mathbf 1_{\{\ell(e)=v\}}\bigl(f(e,\mathrm{false})-f(e,\mathrm{true})\bigr) +\mathbf 1_{\{r(e)=v\}}\bigl(f(e,\mathrm{true})-f(e,\mathrm{false})\bigr) \right).Df​(v)=e∈E∑​(1{ℓ(e)=v}​(f(e,false)−f(e,true))+1{r(e)=v}​(f(e,true)−f(e,false))).

The defined value is the real supremum of the set of numbers Df(s)D_f(s)Df​(s) obtained from functions fff satisfying f(e,b)≥0f(e,b)\ge0f(e,b)≥0 for every edge and Boolean bbb, f(e,false)+f(e,true)≤c(e)f(e,\mathrm{false})+f(e,\mathrm{true})\le c(e)f(e,false)+f(e,true)≤c(e) for every edge, and Df(v)=0D_f(v)=0Df​(v)=0 whenever v≠sv\ne sv=s and v≠tv\ne tv=t. The vertices s,ts,ts,t may coincide. Capacities need not be nonnegative; if any capacity is negative, the set is empty, whose real supremum here is 000. If EEE is empty, the value is 000. Supplying s,ts,ts,t excludes n=0n=0n=0.

QAlgorithms.Papers.Independent.Intakethird100.P35.steinerValue

For a natural number nnn, a type EEE equipped with a finite enumeration, a graph GGG assigning each edge distinct endpoints ℓ(e),ρ(e)∈V={0,…,n−1}\ell(e),\rho(e)\in V=\{0,\ldots,n-1\}ℓ(e),ρ(e)∈V={0,…,n−1}, any real-valued capacity function c:E→Rc:E\to\mathbb Rc:E→R, and a finite terminal set S⊆VS\subseteq VS⊆V, the defined value is the real infimum of all numbers ∑e∈Ec(e)1exactly one of ℓ(e),ρ(e) belongs to A\sum_{e\in E}c(e)\mathbf1_{\text{exactly one of }\ell(e),\rho(e)\text{ belongs to }A}∑e∈E​c(e)1exactly one of ℓ(e),ρ(e) belongs to A​ as AAA ranges over subsets of VVV for which there exist s,t∈Ss,t\in Ss,t∈S with s∈As\in As∈A and t∉At\notin At∈/A. Thus, when ∣S∣≥2|S|\ge2∣S∣≥2, it is the minimum of this finite, nonempty collection of cut sums. Every crossing edge label is counted separately, and capacities may be negative. When ∣S∣<2|S|<2∣S∣<2, there are no qualifying subsets, and the total real infimum of the empty set is 000; this includes n=0n=0n=0.

QAlgorithms.Papers.Independent.Intakethird100.P35.sumPathCount

For natural numbers n,rn,rn,r, a type EEE equipped with a finite enumeration of all its elements, a graph GGG assigning each edge distinct endpoints in V={0,…,n−1}V=\{0,\ldots,n-1\}V={0,…,n−1}, and terminal maps s,t:{0,…,r−1}→Vs,t:\{0,\ldots,r-1\}\to Vs,t:{0,…,r−1}→V, the defined value is ∑i=0r−1pi\sum_{i=0}^{r-1}p_i∑i=0r−1​pi​. Here pip_ipi​ counts all choices of a length ddd with 0≤d<n0\le d<n0≤d<n, an injective vertex sequence v0,…,vdv_0,\ldots,v_dv0​,…,vd​ with endpoints si,tis_i,t_isi​,ti​, and an edge sequence e0,…,ed−1e_0,\ldots,e_{d-1}e0​,…,ed−1​ in which each edge joins the corresponding consecutive vertices in either orientation. Paths using different edge labels are counted separately even if those edges have identical endpoints. A disconnected pair contributes 000, and coincident terminals contribute the single length-zero path. No simplicity assumption is imposed, and repeated terminal pairs at different indices are counted repeatedly. If r=0r=0r=0, the sum is 000; n=0n=0n=0 is allowed when the terminal maps exist, necessarily with r=0r=0r=0.

QAlgorithms.Papers.Independent.Intakethird100.P35.totalValue

For any natural numbers n,rn,rn,r, any type EEE equipped with a finite enumeration, any graph with distinct endpoints ℓ(e),r(e)∈{0,…,n−1}\ell(e),r(e)\in\{0,\ldots,n-1\}ℓ(e),r(e)∈{0,…,n−1}, any function c:E→Rc:E\to\mathbb Rc:E→R, and any terminal functions s,t:{0,…,r−1}→{0,…,n−1}s,t:\{0,\ldots,r-1\}\to\{0,\ldots,n-1\}s,t:{0,…,r−1}→{0,…,n−1}, define

Dfi(v)=∑e∈E(1{ℓ(e)=v}(fi(e,false)−fi(e,true))+1{r(e)=v}(fi(e,true)−fi(e,false))).D_{f_i}(v)=\sum_{e\in E}\left( \mathbf 1_{\{\ell(e)=v\}}\bigl(f_i(e,\mathrm{false})-f_i(e,\mathrm{true})\bigr) +\mathbf 1_{\{r(e)=v\}}\bigl(f_i(e,\mathrm{true})-f_i(e,\mathrm{false})\bigr) \right).Dfi​​(v)=e∈E∑​(1{ℓ(e)=v}​(fi​(e,false)−fi​(e,true))+1{r(e)=v}​(fi​(e,true)−fi​(e,false))).

The defined value is the real supremum of all numbers ∑i=0r−1Dfi(s(i))\sum_{i=0}^{r-1}D_{f_i}(s(i))∑i=0r−1​Dfi​​(s(i)) arising from families fi:E×{false,true}→Rf_i:E\times\{\mathrm{false},\mathrm{true}\}\to\mathbb Rfi​:E×{false,true}→R such that every fi(e,b)≥0f_i(e,b)\ge0fi​(e,b)≥0, every edge satisfies ∑i=0r−1(fi(e,false)+fi(e,true))≤c(e)\sum_{i=0}^{r-1}(f_i(e,\mathrm{false})+f_i(e,\mathrm{true}))\le c(e)∑i=0r−1​(fi​(e,false)+fi​(e,true))≤c(e), and Dfi(v)=0D_{f_i}(v)=0Dfi​​(v)=0 whenever v≠s(i)v\ne s(i)v=s(i) and v≠t(i)v\ne t(i)v=t(i). Terminal vertices may coincide, and their net outflows need not be nonnegative. Negative edge capacities make the set empty, whose real supremum here is 000. The value is also 000 when r=0r=0r=0 or EEE is empty. If n=0n=0n=0, the supplied graph and terminal functions require EEE to be empty and r=0r=0r=0.

QAlgorithms.Papers.Independent.Intakethird100.P35.worstValue

For any natural numbers n,rn,rn,r, any type EEE equipped with a finite enumeration, any graph with distinct endpoints ℓ(e),r(e)∈{0,…,n−1}\ell(e),r(e)\in\{0,\ldots,n-1\}ℓ(e),r(e)∈{0,…,n−1}, any function c:E→Rc:E\to\mathbb Rc:E→R, and any terminal functions s,t:{0,…,r−1}→{0,…,n−1}s,t:\{0,\ldots,r-1\}\to\{0,\ldots,n-1\}s,t:{0,…,r−1}→{0,…,n−1}, define

Dfi(v)=∑e∈E(1{ℓ(e)=v}(fi(e,false)−fi(e,true))+1{r(e)=v}(fi(e,true)−fi(e,false))).D_{f_i}(v)=\sum_{e\in E}\left( \mathbf 1_{\{\ell(e)=v\}}\bigl(f_i(e,\mathrm{false})-f_i(e,\mathrm{true})\bigr) +\mathbf 1_{\{r(e)=v\}}\bigl(f_i(e,\mathrm{true})-f_i(e,\mathrm{false})\bigr) \right).Dfi​​(v)=e∈E∑​(1{ℓ(e)=v}​(fi​(e,false)−fi​(e,true))+1{r(e)=v}​(fi​(e,true)−fi​(e,false))).

The defined value is the real supremum of the set of z∈Rz\in\mathbb Rz∈R for which there exists a family fi:E×{false,true}→Rf_i:E\times\{\mathrm{false},\mathrm{true}\}\to\mathbb Rfi​:E×{false,true}→R satisfying fi(e,b)≥0f_i(e,b)\ge0fi​(e,b)≥0 for every i,e,bi,e,bi,e,b, ∑i=0r−1(fi(e,false)+fi(e,true))≤c(e)\sum_{i=0}^{r-1}(f_i(e,\mathrm{false})+f_i(e,\mathrm{true}))\le c(e)∑i=0r−1​(fi​(e,false)+fi​(e,true))≤c(e) for every edge, Dfi(v)=0D_{f_i}(v)=0Dfi​​(v)=0 whenever v≠s(i)v\ne s(i)v=s(i) and v≠t(i)v\ne t(i)v=t(i), and z≤Dfi(s(i))z\le D_{f_i}(s(i))z≤Dfi​​(s(i)) for every i<ri<ri<r. Terminals may coincide, and no nonnegativity condition is imposed on zzz. Any negative edge capacity makes this set empty. When r=0r=0r=0 and all capacities are nonnegative, the conditions on zzz are vacuous, so the set is all of R\mathbb RR; the real supremum operation used here returns 000 for both empty sets and sets unbounded above. Consequently the value is 000 when r=0r=0r=0, and it is also 000 when EEE is empty. If n=0n=0n=0, the supplied graph and terminal functions require EEE to be empty and r=0r=0r=0.

Human review
  • Endorsed by Shuze Chen · Nov 1, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Gohan · Nov 1, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me