TCSLib

141 Connectivity

141.1 Connectivity

Definition 141.1 A vertex cut: a proper subset \(S\) whose deletion leaves \(G\) disconnected
#

\(V'\) is a Finset V, and "\(G - V'\) is disconnected" is \(\lnot \) (G.induce (↑S)\(^{c}\)).Connected. The conjunct ↑S \(\subset \) Set.univ records that a vertex cut is a proper subset: without it \(S = V\) would qualify vacuously, since Mathlib’s Connected is false on the empty induced graph.

A \(k\)-vertex cut is the pair G.IsVertexCut S \(\land \) S.card = k; that is exactly what vertexConnectivity minimises over.

Definition 141.2 An edge cut: a set of edges of \(G\) whose deletion leaves \(G\) disconnected
#

Rather than carry the book’s \([S, \bar{S}]\) presentation, the definition is taken in its operative form — a set of edges whose removal disconnects \(G\): ↑F \(\subseteq \) G.edgeSet \(\land \) \(\lnot \) (G.deleteEdges ↑F).Connected.

The two agree on what is minimised: every \([S, \bar{S}]\) disconnects \(G\), and every disconnecting edge set contains one (take \(S\) a component of \(G - F\)). Since edgeConnectivity only ever asks for the minimum size, the coarser form is equivalent for all purposes in this chapter.

Definition 141.3 Vertex connectivity \(\kappa (G)\)
#

The book’s case split is on "\(G\) has a pair of distinct nonadjacent vertices"; the Lean split is on the equivalent "\(G\) has a vertex cut at all", which is the condition the two branches actually need. So some cut exists \(\Rightarrow \) \(\kappa \) = sInf {S.card | G.IsVertexCut S}; no cut exists (the complete graphs) \(\Rightarrow \) \(\kappa = \nu - 1\).

sInf on \(\mathbb {N}\) is Mathlib’s Nat.sInf, with sInf \(\emptyset \) = 0; the \(if\) guard means that fallback is never reached here. Natural subtraction makes \(\nu - 1 = 0\) when \(V\) is empty, matching "trivial \(\Rightarrow \) \(\kappa = 0\)".

Definition 141.4 Edge connectivity \(\kappa '(G)\): the minimum size of an edge cut (sInf \(\emptyset \) = 0)
#

\(\kappa \)’ = sInf {F.card | G.IsEdgeCut F}, with no \(if\) guard: the book’s special case "\(G\) trivial \(\Rightarrow \) \(\kappa ' = 0\)" is already delivered by Nat.sInf \(\emptyset \) = 0, since a trivial graph is connected and so admits no edge cut at all. That convention is used directly in edgeConnectivity_le_minDegree.

Definition 141.5 \(G\) is \(k\)-connected
#

A literal abbreviation for k \(\le \) G.vertexConnectivity.

Definition 141.6 \(G\) is \(k\)-edge-connected
#

A literal abbreviation for k \(\le \) G.edgeConnectivity.

Definition 141.7 \(v\) is a cut vertex: \(G\) is connected but deleting \(v\) disconnects it
#

A SimpleGraph is loopless by construction, so the second (component-counting) characterisation is the usable one and is what is taken as the definition here. Specialising it to a connected \(G\) — where \(\omega (G) = 1\) — turns \(\omega (G - v) \gt \omega (G)\) into "\(G - v\) is disconnected", giving G.Connected \(\land \) \(\lnot \) (G.induce {v}\(^{c}\)).Connected.

Folding G.Connected into the definition is what makes IsBlock below read as the book’s "connected graph that has no cut vertices".

Definition 141.8 A block: connected with no cut vertex
#

Only the first sentence is formalised: G.Connected \(\land \) \(\forall \) v, \(\lnot \) G.IsCutVertex v, i.e. "\(G\) is a block". The relative notion "a block of \(G\)" (a maximal such subgraph) and the decomposition "every graph is the union of its blocks" are not defined in this file — nothing in chapter 3 as formalised here needs them.

The second sentence is a theorem, proved below as block_three_vertices_two_connected.

Definition 141.9 Two \(u\)–\(v\) walks are internally disjoint if they share no internal vertex
#

Specialised to a family of two \(u\)–\(v\) walks. "\(x\) is an internal vertex of \(p\)" is x \(\in \) p.support \(\land \) x \(\ne \) u \(\land \) x \(\ne \) v, so "no \(x\) is internal to both" becomes

\(\forall \) x, x \(\in \) p.support \(\to \) x \(\in \) q.support \(\to \) x = u \(\lor \) x = v.

! Note this does not forbid \(p = q\). For adjacent \(u, v\) the single edge satisfies it with \(p = q\), its only vertices being the two endpoints. Theorem 3.2 as stated therefore cannot yield a cycle, which is why Corollary 3.2.1 is derived from the edge-disjointness-carrying strengthening exists_two_internally_disjoint_paths_of_two_connected rather than from two_connected_iff_two_internally_disjoint_paths directly.

Definition 141.10 A finite family of \(u\)–\(v\) walks, pairwise internally disjoint (family form, for Menger)
#

The family form needed to state Menger: a Finset of \(u\)–\(v\) walks that is pairwise internally disjoint. "At least \(k\) paths" is then a cardinality condition on that Finset.

Menger itself is deliberately not stated in this file — the book defers its proof to chapter 11, so it lives in Networks.lean (menger_vertex_graph, menger_edge_graph). This definition exists so that chapter 11 can refer back to a chapter-3 notion.

Definition 141.11 Edge subdivision: replace \(e = uv\) by a length-2 path through a new vertex
#

Subdivision grows the vertex set by one, so unlike edge deletion it *changes the carrier type*: V \(\oplus \) Unit, with Sum.inr () the new midpoint. Adjacency: inl x ~ inl y iff G.Adj x y and \(s(x, y) \ne e\) — the old edges, minus \(e\); inl x ~ inr _ iff \(x \in e\) — the two new half-edges; inr _ ~ inr _ never — no loop at the midpoint.

Corollary 3.2.2 only, via the book’s remark that *"the class of blocks with at least three vertices is closed under the operation of subdivision"*. That closure property is itself unproved here, which is the main obstacle to block_edges_on_common_cycle.

Theorem 141.12 edgeConnectivity_le_minDegree

, second inequality: \(\kappa ' \le \delta \).

If \(G\) is trivial then \(\kappa ' = 0 \le \delta \). Otherwise take \(v\) with \(d(v) = \delta \); the \(\delta \) edges incident with \(v\) form an edge cut, since deleting them isolates \(v\). Hence \(\kappa ' \le d(v) = \delta \).

Theorem 141.13 Helper for Theorem 3.1: \(\kappa \le \nu - 1\) always

A vertex cut is by definition a proper subset of \(V\), so it omits some vertex and therefore has at most \(\nu - 1\) elements; and in the no-vertex-cut case \(\kappa \) is defined to be \(\nu - 1\). Either way \(\kappa \le \nu - 1\).

Theorem 141.14 Core of the block criterion: a connected graph on at least three vertices with no cut vertex has \(\kappa \dots \)

A minimum vertex cut cannot have size \(0\) — that would make \(G\) disconnected, contradicting hconn — nor size \(1\), since that would exhibit a cut vertex, contradicting hnocut. And if no vertex cut exists at all then \(\kappa = \nu - 1 \ge 3 - 1 = 2\).

Theorem 141.15 Base case of Theorem 3.1’s induction: \(\kappa ' = 0\) forces \(\kappa = 0\)

The book’s one-liner has to be unwound through Nat.sInf_eq_zero, which splits \(\kappa ' = 0\) into two cases rather than one: \(0\) is attained — \(\emptyset \) is an edge cut, i.e. \(G\) is disconnected outright; or the set being minimised is empty* — no edge cut exists at all, which forces \(V\) to be a subsingleton, since otherwise deleting every edge leaves \(\bot \), and \(\bot \) on a nontrivial \(V\) is disconnected.

These are exactly the book’s "disconnected" and "trivial". Disconnected gives \(\emptyset \) as a vertex cut, so \(\kappa = 0\); subsingleton gives \(\kappa = \nu - 1 = 0\).

Theorem 141.16 Successor step, part 1: from a minimum edge cut of size \(k + 1\), deleting one of its edges drops the edge…

Indices are shifted by one to stay in \(\mathbb {N}\): the book’s \(\kappa '(G) = k\) with \(\kappa '(H) = k - 1\) is stated here as \(\kappa '(G) = k + 1\) with \(\kappa '(G - e) = k\), which avoids truncated subtraction entirely.

Take \(F\) realising \(\kappa '(G) = k + 1\); it is nonempty, so pick \(e \in F\). Then \(F \ {e}\) is an edge cut of \(G - e\) of size \(k\), giving \(\kappa '(G - e) \le k\); and \(\kappa '(G - e) \ge k\), because a smaller cut of \(G - e\) together with \(e\) would be a cut of \(G\) of size \(\lt k + 1\), contradicting minimality.

Theorem 141.17 Successor step, part 2: deleting a single edge drops \(\kappa \) by at most one

This is the heart of the induction, isolated as a standalone inequality \(\kappa (G) \le \kappa (G - e) + 1\) so that vertexConnectivity_le_edgeConnectivity becomes a three-line calc. Writing \(H = G - e\), the book’s case analysis is: \(H\) has a complete spanning subgraph \(\Rightarrow \) so does \(G\), and \(\kappa (G) = \kappa (H)\); otherwise take \(S\) a vertex cut of \(H\) with \(|S| = \kappa (H)\), and split: \(G - S\) already disconnected \(\Rightarrow \) \(S\) is a vertex cut of \(G\), so \(\kappa (G) \le |S|\); \(G - S\) connected \(\Rightarrow \) \(e\) is a cut edge (bridge) of \(G - S\), and then \(\nu (G - S) = 2\) \(\Rightarrow \) \(\kappa (G) \le \nu (G) - 1 = |S| + 1\), by vertexConnectivity_le_card_pred; \(\nu (G - S) \ge 3\) \(\Rightarrow \) by Exercise 2.3.1(a) \(G - S\) has a cut vertex \(w\), and \(S \cup {w}\) is a vertex cut of \(G\), so \(\kappa (G) \le |S| + 1\).

Every branch lands at \(\kappa (G) \le \kappa (H) + 1\), which is the statement.

Theorem 141.18 exists_isVertexCut_singleton_of_isBridge

, used by vertexConnectivity_le_deleteEdge_succ.

Only part (a) is needed. Since \(G\) is connected, \(\omega (G) = 1\), so the conclusion \(\omega (G - v) \gt \omega (G)\) is "\(G - v\) is disconnected" — i.e. \(\exists \) w, G.IsVertexCut {w}.

The book leaves this as an exercise, so there is no book proof to quote; the argument below is the standard one.

Theorem 141.19 vertexConnectivity_le_edgeConnectivity

, first inequality: \(\kappa \le \kappa '\).

Induction on \(\kappa '\). Base \(\kappa ' = 0\): \(G\) is trivial or disconnected, so \(\kappa = 0\). Step: given \(\kappa '(G) = k + 1\), pick \(e\) in a minimum edge cut; then \(\kappa '(G - e) = k\), so \(\kappa (G - e) \le k\) by the induction hypothesis, and \(\kappa (G) \le \kappa (G - e) + 1 \le k + 1 = \kappa '(G)\).

The entire four-way case analysis of the book’s second paragraph has been factored out into vertexConnectivity_le_deleteEdge_succ, so what remains here is exactly the induction skeleton.

Theorem 141.20 whitney_inequalities

(Whitney). The full chain \(\kappa \le \kappa ' \le \delta \).

The conjunction of the two halves proved just above, packaged as the book states it. See vertexConnectivity_le_edgeConnectivity for the \(\kappa \le \kappa '\) proof and edgeConnectivity_le_minDegree for \(\kappa ' \le \delta \).

Theorem 141.21 Reachable induce of support subset

Transfer of a walk into an induced subgraph: a walk all of whose vertices lie in \(s\) witnesses reachability inside G.induce s.

Theorem 141.22 exists_two_internally_disjoint_paths_of_two_connected

, strengthened to carry the edge-disjointness that Corollary 3.2.1 needs.

InternallyDisjoint p q as defined in this file does not forbid \(p = q\): for adjacent \(u, v\) the single edge satisfies it with \(p = q\), since its only vertices are the two endpoints. So Theorem 3.2 as stated cannot yield a cycle, and the book’s one-line derivation of Corollary 3.2.1 does not go through. Adding p.edges.Disjoint q.edges to the conclusion repairs this; the book gets it for free because its \(d(u,v) = 1\) case produces a genuine cycle via theorem 2.3, not merely two paths.

Theorem 141.23 two_connected_iff_two_internally_disjoint_paths

(Whitney, 1932).

(\(\Rightarrow \)) is discharged by forgetting the extra edge-disjointness conjunct supplied by the strengthened form.

(\(\Leftarrow \)) unpacks the book’s "clearly". Two steps: \(G\) is connected — the hypothesis hands back a path between any two distinct vertices, and Reachable.refl covers \(a = b\); \(G\) has no cut vertex — if \(w\) were one, \(G - w\) would be disconnected, giving \(a, b\) unreachable in \(G - w\). Both supplied paths \(p, q\) must then pass through \(w\) (else reachable_induce_of_support_subset would transport them into \(G - w\)). So \(w\) is a common internal vertex of \(p\) and \(q\), and InternallyDisjoint forces \(w = a\) or \(w = b\) — contradicting that \(a, b\) live in \({w}^{c}\). Then two_le_vertexConnectivity_of_no_cutVertex converts "no cut vertex" into \(\kappa \ge 2\), which is where \(\nu \ge 3\) is consumed.

Theorem 141.24 two_connected_vertices_on_common_cycle

Travel out along one path and back along the other; because the two paths meet only at the endpoints, the round trip repeats no vertex, so it is a cycle.

! The book’s "immediately" does not transfer directly. As noted on InternallyDisjoint, this file’s predicate permits \(p = q\), so two_connected_iff_two_internally_disjoint_paths alone would let both paths be the same single edge and p.append q.reverse would not be a cycle. The proof must therefore go through the strengthened exists_two_internally_disjoint_paths_of_two_connected, whose extra p.edges.Disjoint q.edges rules that degenerate case out.

Theorem 141.25 block_edges_on_common_cycle

The standard device of turning an edge into a vertex, upgrading "any two vertices lie on a common cycle" to "any two edges do".

Theorem 141.26 Every block with \(\nu \ge 3\) is 2-connected

A block is connected and has no cut vertex, so no single vertex forms a vertex cut; with at least three vertices this means the smallest vertex cut has size at least \(2\), i.e. \(\kappa (G) \ge 2\).

\(\nu \ge 3\) is needed to exclude the degenerate blocks \(K_{1}\) and \(K_{2}\), which have no cut vertex either but whose connectivity is \(0\) and \(1\) respectively.

This is the bridge that lets Corollary 3.2.2 draw on Theorem 3.2.

Definition 141.27 The Harary graph \(H_{m,n}\) on vertex set ZMod n (a circulant)
#

Arrange \(n\) stations in a circle and link each to its \(r\) nearest neighbours on each side, adding long-range links across the circle when \(m\) is odd. The carrier is ZMod n, which makes the book’s "addition taken modulo \(n\)" literal.

The three cases are a single \(if\)-cascade on \(m \% 2\) and \(n \% 2\); Case 1 is the base and Cases 2–3 are \(\sqcup \) with an extra chord relation.

Theorem 141.28 hararyGraph_isConnectivity

(Harary, 1962).

The book proves only the even case; the odd case is exercise 3.3.1, so a full Lean proof of the statement as given must supply it.

Note the two "clearly"/"without loss of generality" steps carry real weight in Lean: the WLOG needs \(|V' \cap S| + |V' \cap T| \le |V'| + 2 \lt 2r + 2\), and the "sequence of distinct vertices ... difference at most \(r\)" is a greedy construction requiring an explicit induction on the arc.

Theorem 141.29 Edge count / optimality: \(H_{m,n}\) has \(\lceil mn/2\rceil \) edges
#

The book’s \({x}\) is the ceiling \(\lceil x\rceil \), so \({mn/2}\) is written as the natural-number division \((m * n + 1) / 2\).

Only \(\varepsilon (H_{m,n}) = \lceil mn/2\rceil \) is formalised. The optimality conclusions \(f(m,n) = \lceil mn/2\rceil \) and \(g(m,n) = \lceil mn/2\rceil \) are not stated in this file, since \(f\) and \(g\) (least edge counts over all \(m\)-connected graphs) are not defined here.

Theorem 141.30 edgeCard_ge_of_kEdgeConnected

a \(k\)-edge-connected graph satisfies \(k\nu \le 2\varepsilon \).

Stated multiplicatively as \(k\nu \le 2\varepsilon \) to stay in the natural numbers and avoid division.

By Theorem 3.1, \(k \le \kappa ' \le \delta \), so every vertex has degree at least \(k\). Summing over all \(\nu \) vertices gives \(\sum _v d(v) \ge k\nu \), and handshaking (Theorem 1.1) says that sum equals \(2\varepsilon \). Hence \(2\varepsilon \ge k\nu \).

A network that survives any \(k\) link failures must give every station at least \(k\) links, so it cannot be sparse — this is exactly the lower bound \(f(m, n) \ge \lceil mn/2\rceil \) of (3.1), which §3.3 shows the Harary graphs attain.

Theorem 141.31 vertexConnectivity_eq_minDegree_of_delta_ge

a simple graph with \(\delta \ge \nu - 2\) has \(\kappa = \delta \).

The hypothesis says every vertex is non-adjacent to at most one other vertex, so the graph is complete or very nearly so. Theorem 3.1 already gives \(\kappa \le \delta \), so only \(\kappa \ge \delta \) needs proving: any set of fewer than \(\delta \) vertices fails to disconnect such a dense graph, because any two surviving vertices are either adjacent outright or share a common surviving neighbour.

Part (b) shows the bound is tight — one step less density (\(\delta = \nu - 3\)) already allows \(\kappa \lt \delta \).

Theorem 141.32 vertexConn_eq_edgeConn_of_threeRegular

a simple 3-regular graph has \(\kappa = \kappa '\).

Theorem 3.1 gives \(\kappa \le \kappa ' \le \delta = 3\), so both parameters lie in \({0, 1, 2, 3}\) and only \(\kappa ' \le \kappa \) needs argument. Given a minimum vertex cut \(S\) of size \(\kappa \), one converts it into an edge cut of the same size by choosing, for each \(v \in S\), a single suitable incident edge — possible precisely because every vertex of a cubic graph has just three neighbours, so the local structure around a cut vertex is tightly constrained.

Cubic graphs are the smallest interesting regular case, and this exercise records that for them the vertex and edge measures of reliability agree — unlike the general situation, where figure 3.2 has \(\kappa = 2 \lt \kappa ' = 3\).

Theorem 141.33 two_edge_connected_iff_two_edge_disjoint_paths

2-edge-connected \(\iff \) two edge-disjoint paths between any two vertices.

The edge analogue of Whitney’s Theorem 3.2, with "internally disjoint" weakened to "edge-disjoint" and vertex cuts replaced by edge cuts.

Edge-disjoint is genuinely weaker than internally disjoint: the two routes may pass through common intermediate stations, as long as they never use the same link.