Documentation

CslibFrontier.Computability.Circuit.Frontier.Layouts.CappedCompression

Weight-capped compressions of multigraphs #

CslibFrontier/Computability/Circuit/Frontier/Layouts/Compression.lean compresses a multigraph of maximum degree d into connected blocks with at most d edges leaving each block, without bounding the size or weight of a block. When a partition of the quotient must also balance vertex weights—such as input reads in a 3-way tensor cut, or vertex and boundary counts in recursive carving bisections—blocks cannot be allowed to absorb a macroscopic fraction of the total weight.

CappedCompression G w d M adds a weight cap M on (B.map w).sum for a vertex weight w : V → ℕ. Merging terminates at a weight-saturated compression (Saturated): any two distinct blocks joined by an edge either have more than d edges leaving their union, or have combined weight strictly above M.

For budget d = 3, call a block heavy when its weight exceeds M / 2. At most 2 (∑ v, w v) / (M + 1) blocks are heavy, and every non-heavy block of quotient degree 1 or 2 must send every incident quotient edge to a heavy block (otherwise it could merge with its neighbour, since 2 + 3 - 2 = 3). Because each heavy block has quotient degree at most 3, at most 4 times as many blocks have quotient degree 1 or 2 as there are heavy blocks (Saturated.card_deg_one_two_mul_le). Together with the cycle-rank and minimum-degree-two Euler counts on connected blocks, this bounds the number of degree-three quotient blocks up to O((∑ w) / M).

Main definitions #

Main results #

structure Cslib.Circuits.Frontier.Multigraph.CappedCompression {V : Type u_1} {E : Type u_2} (G : Multigraph V E) (w : V → ℕ) (d M : ℕ) :
Type u_1

A weight-capped compression of G with vertex weights w, cut budget d, and block-weight cap M. Each block lists its vertices without duplicates, induces a connected subgraph, has at most d edges leaving it, and has total weight at most M.

def Cslib.Circuits.Frontier.Multigraph.CappedCompression.Saturated {V : Type u_1} {E : Type u_2} {G : Multigraph V E} {w : V → ℕ} {d M : ℕ} (c : G.CappedCompression w d M) :

A weight-capped compression is saturated when any two distinct blocks joined by an edge either exceed the cut budget d or exceed the weight cap M upon merging.

theorem Cslib.Circuits.Frontier.Multigraph.CappedCompression.exists_saturated {V : Type u_1} {E : Type u_2} {G : Multigraph V E} {w : V → ℕ} {d M : ℕ} [Finite V] [Finite E] (hG : G.MaxDegreeLE d) (hw : ∀ (v : V), w v ≤ M) :
∃ (c : G.CappedCompression w d M), c.Saturated

Merging terminates. Every finite multigraph of maximum degree d with vertex weights bounded by M admits a saturated weight-capped compression.

The quotient and block weights #

noncomputable def Cslib.Circuits.Frontier.Multigraph.CappedCompression.blockOf {V : Type u_1} {E : Type u_2} {G : Multigraph V E} {w : V → ℕ} {d M : ℕ} (c : G.CappedCompression w d M) (v : V) :
↥c.blocks

The block containing a vertex v.

theorem Cslib.Circuits.Frontier.Multigraph.CappedCompression.mem_blockOf {V : Type u_1} {E : Type u_2} {G : Multigraph V E} {w : V → ℕ} {d M : ℕ} (c : G.CappedCompression w d M) (v : V) :
v ∈ ↑(c.blockOf v)

Every vertex belongs to its assigned block.

theorem Cslib.Circuits.Frontier.Multigraph.CappedCompression.mem_iff_blockOf_eq {V : Type u_1} {E : Type u_2} {G : Multigraph V E} {w : V → ℕ} {d M : ℕ} (c : G.CappedCompression w d M) {v : V} {B : ↥c.blocks} :
v ∈ ↑B ↔ c.blockOf v = B

A vertex belongs to a block B if and only if c.blockOf v = B.

theorem Cslib.Circuits.Frontier.Multigraph.CappedCompression.card_blocks_le {V : Type u_1} {E : Type u_2} {G : Multigraph V E} {w : V → ℕ} {d M : ℕ} (c : G.CappedCompression w d M) [Finite V] :

There are at most as many blocks as vertices.

theorem Cslib.Circuits.Frontier.Multigraph.CappedCompression.disjoint_of_ne {V : Type u_1} {E : Type u_2} {G : Multigraph V E} {w : V → ℕ} {d M : ℕ} (c : G.CappedCompression w d M) {B B' : ↥c.blocks} (h : B ≠ B') :
Disjoint {v : V | v ∈ ↑B} {v : V | v ∈ ↑B'}

Distinct blocks are disjoint.

def Cslib.Circuits.Frontier.Multigraph.CappedCompression.blockWeight {V : Type u_1} {E : Type u_2} {G : Multigraph V E} {w : V → ℕ} {d M : ℕ} (c : G.CappedCompression w d M) (B : ↥c.blocks) :

The total w-weight of a block.

theorem Cslib.Circuits.Frontier.Multigraph.CappedCompression.blockWeight_le {V : Type u_1} {E : Type u_2} {G : Multigraph V E} {w : V → ℕ} {d M : ℕ} (c : G.CappedCompression w d M) (B : ↥c.blocks) :

Every block has blockWeight at most M.

theorem Cslib.Circuits.Frontier.Multigraph.CappedCompression.ncard_block_eq_length {V : Type u_1} {E : Type u_2} {G : Multigraph V E} {w : V → ℕ} {d M : ℕ} (c : G.CappedCompression w d M) (B : ↥c.blocks) :
{v : V | v ∈ ↑B}.ncard = (↑B).length

The cardinality of {v | v ∈ B.1} equals B.1.length.

theorem Cslib.Circuits.Frontier.Multigraph.CappedCompression.sum_blockWeight_eq {V : Type u_1} {E : Type u_2} {G : Multigraph V E} {w : V → ℕ} {d M : ℕ} (c : G.CappedCompression w d M) [Fintype V] [DecidableEq V] (S : Finset ↥c.blocks) :
∑ B ∈ S, c.blockWeight B = ∑ v : V with c.blockOf v ∈ S, w v

Summing blockWeight over a set of blocks equals summing w over the vertices in their preimage.

theorem Cslib.Circuits.Frontier.Multigraph.CappedCompression.sum_blockWeight_univ {V : Type u_1} {E : Type u_2} {G : Multigraph V E} {w : V → ℕ} {d M : ℕ} (c : G.CappedCompression w d M) [Fintype V] :
∑ B : ↥c.blocks, c.blockWeight B = ∑ v : V, w v

The block weights sum to the total vertex weight.

def Cslib.Circuits.Frontier.Multigraph.CappedCompression.external {V : Type u_1} {E : Type u_2} {G : Multigraph V E} {w : V → ℕ} {d M : ℕ} (c : G.CappedCompression w d M) :
Set E

The external edges: those between distinct blocks.

noncomputable def Cslib.Circuits.Frontier.Multigraph.CappedCompression.quotient {V : Type u_1} {E : Type u_2} {G : Multigraph V E} {w : V → ℕ} {d M : ℕ} (c : G.CappedCompression w d M) :

The quotient multigraph on c.blocks, whose edges are c.external.

@[simp]
theorem Cslib.Circuits.Frontier.Multigraph.CappedCompression.quotient_src {V : Type u_1} {E : Type u_2} {G : Multigraph V E} {w : V → ℕ} {d M : ℕ} (c : G.CappedCompression w d M) (e : ↑c.external) :
c.quotient.src e = c.blockOf (G.src ↑e)
@[simp]
theorem Cslib.Circuits.Frontier.Multigraph.CappedCompression.quotient_tgt {V : Type u_1} {E : Type u_2} {G : Multigraph V E} {w : V → ℕ} {d M : ℕ} (c : G.CappedCompression w d M) (e : ↑c.external) :
c.quotient.tgt e = c.blockOf (G.tgt ↑e)

The quotient multigraph is loopless.

theorem Cslib.Circuits.Frontier.Multigraph.CappedCompression.ncard_edgeCut_preimage {V : Type u_1} {E : Type u_2} {G : Multigraph V E} {w : V → ℕ} {d M : ℕ} (c : G.CappedCompression w d M) (T : Set ↥c.blocks) :

Cuts of unions of whole blocks equal the corresponding cuts in the quotient.

theorem Cslib.Circuits.Frontier.Multigraph.CappedCompression.ncard_crossEdges_preimage {V : Type u_1} {E : Type u_2} {G : Multigraph V E} {w : V → ℕ} {d M : ℕ} (c : G.CappedCompression w d M) [Finite E] {S T : Set ↥c.blocks} (hST : Disjoint S T) :

Pairs of disjoint block-unions have the same cross-edges in G as in c.quotient.

theorem Cslib.Circuits.Frontier.Multigraph.CappedCompression.ncard_incidenceSet_quotient {V : Type u_1} {E : Type u_2} {G : Multigraph V E} {w : V → ℕ} {d M : ℕ} (c : G.CappedCompression w d M) (B : ↥c.blocks) :

The degree of a block in the quotient is the number of edges leaving it in G.

Every block in the quotient has degree at most d.

theorem Cslib.Circuits.Frontier.Multigraph.CappedCompression.incidenceSet_quotient_nonempty {V : Type u_1} {E : Type u_2} {G : Multigraph V E} {w : V → ℕ} {d M : ℕ} (c : G.CappedCompression w d M) [Finite E] (hG : G.toSimpleGraph.Connected) (two : 1 < Nat.card ↥c.blocks) (B : ↥c.blocks) :

In a connected multigraph with at least two blocks, every block has positive degree in the quotient.

Euler and degree counts for budget three #

theorem Cslib.Circuits.Frontier.Multigraph.CappedCompression.Saturated.card_deg_one_two_mul_le {V : Type u_1} {E : Type u_2} {G : Multigraph V E} {w : V → ℕ} {M : ℕ} {c : G.CappedCompression w 3 M} [Fintype V] [Finite E] (hc : c.Saturated) :
(M / 2 + 1) * {B : ↥c.blocks | 1 ≤ (c.quotient.incidenceSet B).ncard ∧ (c.quotient.incidenceSet B).ncard ≤ 2}.card ≤ 4 * ∑ v : V, w v

Low-degree blocks are scarce. In a saturated budget-3 compression with weight cap M, every block of quotient degree 1 or 2 is either heavy (M / 2 < blockWeight B) or sends an external edge to a heavy block. Since each heavy block has quotient degree at most 3, (M / 2 + 1) * #{B | deg_Q(B) ∈ {1, 2}} ≤ 4 * ∑ v, w v.

theorem Cslib.Circuits.Frontier.Multigraph.CappedCompression.Saturated.mul_card_deg_one_two_le {V : Type u_1} {E : Type u_2} {G : Multigraph V E} {w : V → ℕ} {M : ℕ} {c : G.CappedCompression w 3 M} [Fintype V] [Finite E] (hc : c.Saturated) :
M * {B : ↥c.blocks | 1 ≤ (c.quotient.incidenceSet B).ncard ∧ (c.quotient.incidenceSet B).ncard ≤ 2}.card ≤ 8 * ∑ v : V, w v

Low-degree blocks are scarce, with the weight cap itself as the factor: M * #{B | deg_Q(B) ∈ {1, 2}} ≤ 8 * ∑ v, w v.

theorem Cslib.Circuits.Frontier.Multigraph.CappedCompression.card_deg_three_le_of_connected {V : Type u_1} {E : Type u_2} {G : Multigraph V E} {w : V → ℕ} {M : ℕ} {c : G.CappedCompression w 3 M} [Finite V] [Finite E] (hloop : G.Loopless) (hconn : G.toSimpleGraph.Connected) (two : 1 < Nat.card ↥c.blocks) :
{B : ↥c.blocks | (c.quotient.incidenceSet B).ncard = 3}.card ≤ 2 * G.cycleRank + {B : ↥c.blocks | (c.quotient.incidenceSet B).ncard = 1}.card

Degree-three count for connected subcubic multigraphs. When G is loopless, connected, and compressed into at least two blocks, #Q₃ ≤ 2 * G.cycleRank + #Q₁.

theorem Cslib.Circuits.Frontier.Multigraph.CappedCompression.card_deg_three_add_le_of_two_le_deg {V : Type u_1} {E : Type u_2} {G : Multigraph V E} {w : V → ℕ} {M : ℕ} {c : G.CappedCompression w 3 M} [Finite V] [Finite E] (hloop : G.Loopless) (hmin : ∀ (v : V), 2 ≤ (G.incidenceSet v).ncard) {b : ℕ} (hhand : 2 * Nat.card E + b = 3 * Nat.card V) :
{B : ↥c.blocks | (c.quotient.incidenceSet B).ncard = 3}.card + b ≤ Nat.card V + {B : ↥c.blocks | (c.quotient.incidenceSet B).ncard = 1}.card

Degree-three count under minimum degree two. When G is loopless with minimum degree at least 2 and 2 * |E| + b = 3 * |V| (for instance G = H.induce X inside a loopless cubic multigraph H with b = |H.edgeCut X| and greedy-flip minimum degree ≥ 2), #Q₃ + b ≤ |V| + #Q₁.