Documentation

Complexitylib.Circuits.Frontier.Layouts.Compression

From cubic graphs to subcubic multigraphs #

This file proves LayoutBound.of_cubic: a layout bound for simple cubic graphs with coefficient c (CubicLayoutBound c) gives the layout bound for connected multigraphs of maximum degree three with coefficient 2c. Throughout, G has N vertices, M edges, and cycle rank β₁ = M - N + 1.

Compression. Partition the vertices of G into blocks, each listing its vertices in order, starting from single vertices. Two distinct blocks joined by an edge are merged when their union still has at most three edges leaving it, as happens when one of them has at most two edges leaving it or when two edges join them. The merged block lists the longer block first. A Compression records the invariants of this process:

Each merge loses a block, so merging ends in a final compression (exists_final).

The quotient. In a final compression two distinct blocks are joined by at most one edge, and if there are at least two blocks then exactly three edges leave each block: by connectivity, a block with fewer would merge with a neighbor. So the quotient, the graph on the blocks in which two blocks are adjacent when an edge joins them, is a simple cubic graph (isRegularOfDegree). Its h vertices span 3h/2 edges, which are the edges of G between blocks, and the counting invariant gives h + 2N ≤ 2M (card_add_two_mul_le). So the quotient has at most 2 β₁ vertices.

Expansion. Lay out G block by block, ordering the blocks by a layout of the quotient and each block by its list. A frontier consists of whole blocks followed by a prefix of one more block. The edges leaving the whole blocks are edges of the quotient crossing its frontier (ncard_cut_le), and at most 3 log₂ N + 3 edges leave the prefix (exists_layout).

The bound. Given η > 0, take the cubic bound with slack ξ = η/2. A quotient on h > N₀ vertices has a layout whose frontiers have at most (c + ξ) h + 2 ≤ (2c + η) β₁ + 2 edges, and a quotient on at most N₀ + 1 vertices has at most (N₀ + 1) N₀ / 2 edges. So every frontier of G has at most (2c + η) β₁ + 3 log₂ N + C edges, for a constant C, and 3 log₂ N ≤ η N + C' (exists_log_le_mul_add).

The compression structure, merging, quotient, and expansion also work at any boundary budget d. QuarticCompression supplies the terminal-core argument at degree four.

Main definitions #

Main results #

Preliminaries #

theorem Complexity.Frontier.Layout.exists_monotone {V : Type u_1} [Finite V] {α : Type u_3} [LinearOrder α] {f : V → α} (hf : Function.Injective f) :
∃ (π : Layout V), ∀ (v w : V), f v ≤ f w → π v ≤ π w

Listing the vertices in increasing order of an injective key gives a layout that is monotone in the key.

theorem Complexity.Frontier.exists_log_le_mul_add {ε : ℝ} (hε : 0 < ε) :
∃ (K : ℝ), ∀ (N : ℕ), ↑(Nat.log 2 N) ≤ ε * ↑N + K

log₂ N is at most ε N plus a constant.

theorem Complexity.Frontier.Multigraph.cut_union_subset {V : Type u_1} {E : Type u_2} (G : Multigraph V E) (S T : Set V) :
G.cut (S ∪ T) ⊆ G.cut S ∪ G.cut T

Cuts are subadditive.

theorem Complexity.Frontier.Multigraph.ncard_cut_union_add {V : Type u_1} {E : Type u_2} [Finite E] (G : Multigraph V E) {S T : Set V} (h : Disjoint S T) :
(G.cut (S ∪ T)).ncard + 2 * (G.cut S ∩ G.cut T).ncard = (G.cut S).ncard + (G.cut T).ncard

The cut of a disjoint union: the edges leaving both parts are counted twice on the right and not at all on the left.

theorem Complexity.Frontier.Multigraph.Connected.cut_nonempty {V : Type u_1} {E : Type u_2} {G : Multigraph V E} (hG : G.Connected) {S : Set V} {u v : V} (hu : u ∈ S) (hv : v ∉ S) :

In a connected multigraph, some edge leaves every set of vertices other than the empty set and the whole vertex set.

Compressions #

structure Complexity.Frontier.Multigraph.Compression {V : Type u_1} {E : Type u_2} (G : Multigraph V E) (d : ℕ := 3) :
Type u_1

A compression of G: a partition of its vertices into blocks, each listing its vertices in order, with the invariants maintained by merging. A block B is identified with its vertex set {v | v ∈ B}.

Instances For
    theorem Complexity.Frontier.Multigraph.Compression.exists_merge {V : Type u_1} {E : Type u_2} {G : Multigraph V E} {d : ℕ} (c : G.Compression d) [Finite E] {B B' : List V} (hB : B ∈ c.blocks) (hB' : B' ∈ c.blocks) (hne : B ≠ B') (hjoin : (G.cut {v : V | v ∈ B} ∩ G.cut {v : V | v ∈ B'}).Nonempty) (hcut : (G.cut ({v : V | v ∈ B} ∪ {v : V | v ∈ B'})).ncard ≤ d) :
    ∃ (c' : G.Compression d), c'.blocks.card < c.blocks.card

    Merging. Two distinct blocks joined by an edge, whose union has at most d edges leaving it, may be replaced by their union, listing the longer block first.

    The initial compression: every vertex is a block of its own.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      def Complexity.Frontier.Multigraph.Compression.Final {V : Type u_1} {E : Type u_2} {G : Multigraph V E} {d : ℕ} (c : G.Compression d) :

      The quotient properties needed for expansion: adjacent blocks are joined by only one edge, and at least three edges leave each nonisolated block. In degree three these characterize a terminal compression.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        theorem Complexity.Frontier.Multigraph.Compression.exists_final {V : Type u_1} {E : Type u_2} {G : Multigraph V E} [Finite V] [Finite E] (hG : G.MaxDegreeLE 3) :
        ∃ (c : G.Compression), c.Final

        Merging terminates. Every multigraph of maximum degree three has a final compression: one with fewest blocks.

        The quotient #

        noncomputable def Complexity.Frontier.Multigraph.Compression.blockOf {V : Type u_1} {E : Type u_2} {G : Multigraph V E} {d : ℕ} (c : G.Compression d) (v : V) :
        ↥c.blocks

        The block containing a vertex.

        Equations
        Instances For
          theorem Complexity.Frontier.Multigraph.Compression.mem_iff_blockOf_eq {V : Type u_1} {E : Type u_2} {G : Multigraph V E} {d : ℕ} (c : G.Compression d) {v : V} {B : ↥c.blocks} :
          v ∈ ↑B ↔ c.blockOf v = B
          noncomputable def Complexity.Frontier.Multigraph.Compression.ends {V : Type u_1} {E : Type u_2} {G : Multigraph V E} {d : ℕ} (c : G.Compression d) (e : E) :

          The blocks at the two ends of an edge.

          Equations
          Instances For

            The quotient of a compression: the simple graph on the blocks in which two distinct blocks are adjacent when an edge joins them.

            Equations
            Instances For
              theorem Complexity.Frontier.Multigraph.Compression.ends_mem_edgeSet {V : Type u_1} {E : Type u_2} {G : Multigraph V E} {d : ℕ} (c : G.Compression d) {e : E} :
              theorem Complexity.Frontier.Multigraph.Compression.edgeSet_quotient {V : Type u_1} {E : Type u_2} {G : Multigraph V E} {d : ℕ} (c : G.Compression d) :
              c.quotient.edgeSet = c.ends '' {e : E | c.blockOf (G.src e) ≠ c.blockOf (G.tgt e)}

              The edges of the quotient are the ends of the edges of G between distinct blocks.

              theorem Complexity.Frontier.Multigraph.Compression.injOn_ends {V : Type u_1} {E : Type u_2} {G : Multigraph V E} {d : ℕ} (c : G.Compression d) [Finite E] (hc : c.Final) :
              Set.InjOn c.ends {e : E | c.blockOf (G.src e) ≠ c.blockOf (G.tgt e)}

              In a final compression, an edge between two distinct blocks is determined by its ends.

              theorem Complexity.Frontier.Multigraph.Compression.ncard_cut_eq_three {V : Type u_1} {E : Type u_2} {G : Multigraph V E} (c : G.Compression) (hc : c.Final) (hG : G.Connected) (two : 2 ≤ (c.blocks 3).card) (B : ↥(c.blocks 3)) :
              (G.cut {v : V | v ∈ ↑B}).ncard = 3

              In a final compression of a connected multigraph with at least two blocks, exactly three edges leave every block.

              theorem Complexity.Frontier.Multigraph.Compression.degree_eq_cut {V : Type u_1} {E : Type u_2} {G : Multigraph V E} {d : ℕ} (c : G.Compression d) [Finite E] (hc : c.Final) [c.quotient.LocallyFinite] (B : ↥c.blocks) :
              c.quotient.degree B = (G.cut {v : V | v ∈ ↑B}).ncard

              In a final compression, the quotient degree equals the block's boundary size.

              The quotient of a final cubic compression is regular.

              theorem Complexity.Frontier.Multigraph.Compression.card_add_two_mul_le {V : Type u_1} {E : Type u_2} {G : Multigraph V E} (c : G.Compression) [Finite E] (hc : c.Final) (hG : G.Connected) (two : 2 ≤ (c.blocks 3).card) :

              The size of the quotient. A final compression of a connected multigraph with N vertices and M edges into h ≥ 2 blocks has h + 2N ≤ 2M.

              theorem Complexity.Frontier.Multigraph.Compression.ncard_cut_le {V : Type u_1} {E : Type u_2} {G : Multigraph V E} {d : ℕ} (c : G.Compression d) [Finite E] (hc : c.Final) [Fintype ↑c.quotient.edgeSet] (T : Finset ↥c.blocks) :

              The cut of a union of whole blocks embeds in the quotient's cut.

              Expansion #

              noncomputable def Complexity.Frontier.Multigraph.Compression.idx {V : Type u_1} {E : Type u_2} {G : Multigraph V E} {d : ℕ} (c : G.Compression d) [DecidableEq V] (v : V) :

              The position of a vertex in its block.

              Equations
              Instances For
                theorem Complexity.Frontier.Multigraph.Compression.ncard_cut_take_le {V : Type u_1} {E : Type u_2} {G : Multigraph V E} {d : ℕ} (c : G.Compression d) [Finite V] [DecidableEq V] (B : ↥c.blocks) (r : ℕ) :
                (G.cut {v : V | c.blockOf v = B ∧ c.idx v < r}).ncard ≤ d * Nat.log 2 (Nat.card V) + d

                At most d log₂ N + d edges leave the first r vertices of a block.

                theorem Complexity.Frontier.Multigraph.Compression.exists_layout {V : Type u_1} {E : Type u_2} {G : Multigraph V E} {d : ℕ} (c : G.Compression d) [Finite V] [Finite E] (hc : c.Final) [Fintype ↑c.quotient.edgeSet] {key : ↥c.blocks → ℕ} (hkey : Function.Injective key) {X : ℝ} (hX : ∀ (q : ℕ), ↑(c.quotient.crossingFinset {B : ↥c.blocks | key B < q}).card ≤ X) :
                ∃ (π : Layout V), ∀ (t : ℕ), ↑(G.cut (π.initial t)).ncard ≤ X + ↑d * ↑(Nat.log 2 (Nat.card V)) + ↑d

                Expansion. Lay out the vertices block by block, ordering the blocks by an injective key and each block by its list. If at most X edges of the quotient cross each prefix of the key, at most X + d log₂ N + d edges cross each frontier of the layout.

                The layout bound #

                From cubic graphs to subcubic multigraphs. A cubic layout bound with coefficient c gives the layout bound for maximum degree three with coefficient 2c.