Documentation

CslibFrontier.Foundations.Combinatorics.Expander.Bipartite

Vertex expansion of bipartite graphs #

A bipartite graph between left vertices ι and right vertices κ is a decidable relation G : ι → κ → Prop, with the neighbourhoods Finset.bipartiteAbove / Finset.bipartiteBelow and the double-counting lemmas of Mathlib. A set S of left vertices has neighbours N(S) (Cslib.Bipartite.neighbors) and unique neighbours U(S) (Cslib.Bipartite.uniqueNeighbors), the right vertices adjacent to exactly one vertex of S [GuruswamiRudraSudan2025, Definitions 11.2.1 and 11.3.3]. The graph is a vertex expander for sets of size at most k with factor α (Cslib.Bipartite.IsVertexExpander) when every such S has α |S| ≤ |N(S)|; this is the (n, m, c, γ, α) bipartite expander of [GuruswamiRudraSudan2025, Definition 11.2.2] with k = γ n, except that we only require left degrees at most c (Cslib.Bipartite.IsLeftBounded) rather than exactly c.

The unique-neighbour lemma (Cslib.Bipartite.IsVertexExpander.le_card_uniqueNeighbors): if left degrees are at most c, then (2 α - c) |S| ≤ |U(S)| for |S| ≤ k. For a lossless expander α = c (1 - ε) this is |U(S)| ≥ c (1 - 2 ε) |S| [GuruswamiRudraSudan2025, Lemma 11.3.4] [GuruswamiSharma2010, Lemma 3]. It drives the distance and decoding analysis of expander codes [SS96] in CslibFrontier.Foundations.Data.Code.ExpanderCode.

Main definitions #

Main results #

References #

def Cslib.Bipartite.neighbors {ι : Type u_1} {κ : Type u_2} [Fintype κ] (G : ι → κ → Prop) [(i : ι) → (j : κ) → Decidable (G i j)] (S : Finset ι) :

The neighbours N(S) of a set S of left vertices: the right vertices adjacent to some vertex of S.

def Cslib.Bipartite.uniqueNeighbors {ι : Type u_1} {κ : Type u_2} [Fintype κ] (G : ι → κ → Prop) [(i : ι) → (j : κ) → Decidable (G i j)] (S : Finset ι) :

The unique neighbours U(S) of a set S of left vertices: the right vertices adjacent to exactly one vertex of S [GuruswamiRudraSudan2025, Definition 11.3.3].

def Cslib.Bipartite.IsLeftBounded {ι : Type u_1} {κ : Type u_2} [Fintype κ] (G : ι → κ → Prop) [(i : ι) → (j : κ) → Decidable (G i j)] (c : ℕ) :

Every left vertex has at most c neighbours.

def Cslib.Bipartite.IsBiregular {ι : Type u_1} {κ : Type u_2} [Fintype κ] (G : ι → κ → Prop) [(i : ι) → (j : κ) → Decidable (G i j)] [Fintype ι] (c d : ℕ) :

The graph is (c, d)-biregular: every left vertex has exactly c neighbours and every right vertex exactly d.

def Cslib.Bipartite.IsVertexExpander {ι : Type u_1} {κ : Type u_2} [Fintype κ] (G : ι → κ → Prop) [(i : ι) → (j : κ) → Decidable (G i j)] (k : ℕ) (α : ℝ) :

Vertex expansion [GuruswamiRudraSudan2025, Definition 11.2.2]: every set S of at most k left vertices has at least α |S| neighbours.

@[simp]
theorem Cslib.Bipartite.mem_neighbors {ι : Type u_1} {κ : Type u_2} [Fintype κ] {G : ι → κ → Prop} [(i : ι) → (j : κ) → Decidable (G i j)] {S : Finset ι} {j : κ} :
j ∈ neighbors G S ↔ ∃ i ∈ S, G i j
theorem Cslib.Bipartite.mem_uniqueNeighbors {ι : Type u_1} {κ : Type u_2} [Fintype κ] {G : ι → κ → Prop} [(i : ι) → (j : κ) → Decidable (G i j)] {S : Finset ι} {j : κ} :
theorem Cslib.Bipartite.uniqueNeighbors_subset_neighbors {ι : Type u_1} {κ : Type u_2} [Fintype κ] {G : ι → κ → Prop} [(i : ι) → (j : κ) → Decidable (G i j)] (S : Finset ι) :

Unique neighbours are neighbours.

theorem Cslib.Bipartite.IsBiregular.isLeftBounded {ι : Type u_1} {κ : Type u_2} [Fintype κ] {G : ι → κ → Prop} [(i : ι) → (j : κ) → Decidable (G i j)] [Fintype ι] {c d : ℕ} (hG : IsBiregular G c d) :

A (c, d)-biregular graph has left degrees at most c.

theorem Cslib.Bipartite.card_neighbors_le {ι : Type u_1} {κ : Type u_2} [Fintype κ] {G : ι → κ → Prop} [(i : ι) → (j : κ) → Decidable (G i j)] {c : ℕ} (hG : IsLeftBounded G c) (S : Finset ι) :
(neighbors G S).card ≤ c * S.card

If left degrees are at most c, a set S has at most c |S| neighbours.

theorem Cslib.Bipartite.sum_card_bipartiteBelow_neighbors_le {ι : Type u_1} {κ : Type u_2} [Fintype κ] {G : ι → κ → Prop} [(i : ι) → (j : κ) → Decidable (G i j)] {c : ℕ} (hG : IsLeftBounded G c) (S : Finset ι) :
∑ j ∈ neighbors G S, (Finset.bipartiteBelow G S j).card ≤ c * S.card

The edges leaving S, counted at their right endpoints in N(S): at most c |S|.

theorem Cslib.Bipartite.two_mul_card_neighbors_le {ι : Type u_1} {κ : Type u_2} [Fintype κ] {G : ι → κ → Prop} [(i : ι) → (j : κ) → Decidable (G i j)] {c : ℕ} (hG : IsLeftBounded G c) (S : Finset ι) :

Double counting the edges between S and N(S): a neighbour that is not unique receives at least two edges, so 2 |N(S)| ≤ |U(S)| + c |S|.

theorem Cslib.Bipartite.IsVertexExpander.le_card_uniqueNeighbors {ι : Type u_1} {κ : Type u_2} [Fintype κ] {G : ι → κ → Prop} [(i : ι) → (j : κ) → Decidable (G i j)] {c k : ℕ} {α : ℝ} (hG : IsLeftBounded G c) (hE : IsVertexExpander G k α) {S : Finset ι} (hS : S.card ≤ k) :
(2 * α - ↑c) * ↑S.card ≤ ↑(uniqueNeighbors G S).card

The unique-neighbour lemma [GuruswamiRudraSudan2025, Lemma 11.3.4] [GuruswamiSharma2010, Lemma 3]. If left degrees are at most c and sets of at most k left vertices expand by α, then every such set S has at least (2 α - c) |S| unique neighbours. With α = c (1 - ε) this is the source's |U(S)| ≥ c (1 - 2 ε) |S|; the source assumes c-left-regularity, which we weaken to left degrees at most c.

theorem Cslib.Bipartite.IsBiregular.card_mul_eq {ι : Type u_1} {κ : Type u_2} [Fintype κ] {G : ι → κ → Prop} [(i : ι) → (j : κ) → Decidable (G i j)] [Fintype ι] {c d : ℕ} (hG : IsBiregular G c d) :

A (c, d)-biregular graph with n left and m right vertices has n c = m d edges.