Documentation

CslibFrontier.Foundations.Combinatorics.SimpleGraph.BallPath

Balls that are paths #

A map φ : ℤ → V is a ball path of radius r over the parameter interval [lo, hi] (SimpleGraph.IsBallPath G r lo hi φ, with -r ≤ lo ≤ 0 ≤ hi ≤ r) when it is injective on [lo, hi], two of its points are adjacent exactly when their parameters are consecutive, and every neighbour of a point with parameter strictly between -r and r is again a point of the path. The closed ball {x | G.edist (φ 0) x ≤ k} of every radius k ≤ r is then the image of the parameters of absolute value at most k (SimpleGraph.IsBallPath.edist_le_iff); for k = r it is the image of [lo, hi]. So the radius-r ball around φ 0 induces a path on hi - lo + 1 vertices with φ 0 at position -lo.

The radius-r balls of the cycle graph cycleGraph N with N ≥ 2r + 2 are ball paths over [-r, r] (SimpleGraph.exists_isBallPath_cycleGraph). Around vertex j of the path graph pathGraph N, the radius-r ball is a ball path over [-min r j, min r (N - 1 - j)] (SimpleGraph.exists_isBallPath_pathGraph). The bound N ≥ 2r + 2 is needed: in cycleGraph 3 the radius-1 ball is the whole triangle, which is not a path. Distances in pathGraph N are differences of indices (SimpleGraph.edist_pathGraph).

These descriptions are the cycle-graph distance computations behind Hanf-locality proofs that connectivity, acyclicity and being a tree are not first-order definable, and the path-graph distances behind Gaifman-locality proofs that transitive closure and reachability are not.

Main definitions #

Main results #

structure SimpleGraph.IsBallPath {V : Type u_1} (G : SimpleGraph V) (r : ℕ) (lo hi : ℤ) (φ : ℤ → V) :

φ parametrizes the radius-r ball around φ 0 in G as a path over [lo, hi]: it is injective there, adjacency is consecutiveness of parameters, and the neighbours of interior points (parameter strictly between -r and r) stay on the path.

  • neg_le_lo : -↑r ≤ lo

    The left end is at most r steps from the center.

  • lo_nonpos : lo ≤ 0

    The left end is not right of the center.

  • hi_nonneg : 0 ≤ hi

    The right end is not left of the center.

  • hi_le : hi ≤ ↑r

    The right end is at most r steps from the center.

  • injOn : Set.InjOn φ (Set.Icc lo hi)

    Distinct parameters give distinct vertices.

  • adj_iff ⦃s t : ℤ⦄ : s ∈ Set.Icc lo hi → t ∈ Set.Icc lo hi → (G.Adj (φ s) (φ t) ↔ s + 1 = t ∨ t + 1 = s)

    Two points are adjacent exactly when their parameters are consecutive.

  • exists_of_adj ⦃s : ℤ⦄ : s ∈ Set.Icc lo hi → -↑r < s → s < ↑r → ∀ ⦃y : V⦄, G.Adj (φ s) y → ∃ t ∈ Set.Icc lo hi, y = φ t

    Every neighbour of an interior point is a point of the path.

theorem SimpleGraph.IsBallPath.edist_le {V : Type u_1} {G : SimpleGraph V} {r : ℕ} {lo hi : ℤ} {φ : ℤ → V} (hφ : G.IsBallPath r lo hi φ) {s : ℤ} (hs : s ∈ Set.Icc lo hi) {k : ℕ} (hk : -↑k ≤ s ∧ s ≤ ↑k) :
G.edist (φ 0) (φ s) ≤ ↑k

The point of a ball path at parameter s is within distance |s| of the center.

theorem SimpleGraph.IsBallPath.edist_le_iff {V : Type u_1} {G : SimpleGraph V} {r : ℕ} {lo hi : ℤ} {φ : ℤ → V} (hφ : G.IsBallPath r lo hi φ) {k : ℕ} (hk : k ≤ r) {x : V} :
G.edist (φ 0) x ≤ ↑k ↔ ∃ s ∈ Set.Icc lo hi, (-↑k ≤ s ∧ s ≤ ↑k) ∧ x = φ s

The closed ball of radius k ≤ r around the center φ 0 of a ball path is the image of the parameters of absolute value at most k.

theorem SimpleGraph.IsBallPath.edist_le_radius_iff {V : Type u_1} {G : SimpleGraph V} {r : ℕ} {lo hi : ℤ} {φ : ℤ → V} (hφ : G.IsBallPath r lo hi φ) {x : V} :
G.edist (φ 0) x ≤ ↑r ↔ ∃ s ∈ Set.Icc lo hi, x = φ s

The closed ball of radius r around the center φ 0 of a ball path is the image of [lo, hi].

theorem SimpleGraph.IsBallPath.sumInl {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W} {r : ℕ} {lo hi : ℤ} {φ : ℤ → V} (hφ : G.IsBallPath r lo hi φ) :
(G ⊕g H).IsBallPath r lo hi (Sum.inl ∘ φ)

A ball path of G is a ball path of G ⊕g H through Sum.inl.

theorem SimpleGraph.IsBallPath.sumInr {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W} {r : ℕ} {lo hi : ℤ} {ψ : ℤ → W} (hψ : H.IsBallPath r lo hi ψ) :
(G ⊕g H).IsBallPath r lo hi (Sum.inr ∘ ψ)

A ball path of H is a ball path of G ⊕g H through Sum.inr.

theorem SimpleGraph.exists_isBallPath_cycleGraph {N r : ℕ} (hN : 2 * r + 2 ≤ N) (c : Fin N) :
∃ (φ : ℤ → Fin N), φ 0 = c ∧ (cycleGraph N).IsBallPath r (-↑r) (↑r) φ

Balls in cycle graphs. Around every vertex c of the cycle graph on N ≥ 2r + 2 vertices, the radius-r ball is the path c - r, …, c + r on 2r + 1 vertices.

theorem SimpleGraph.exists_isBallPath_pathGraph {N r : ℕ} (j : Fin N) {lo hi : ℤ} (hlo : lo = -↑(min r ↑j)) (hhi : hi = ↑(min r (N - 1 - ↑j))) :
∃ (φ : ℤ → Fin N), φ 0 = j ∧ (pathGraph N).IsBallPath r lo hi φ

Balls in path graphs. Around vertex j of the path graph on N vertices, the radius-r ball is the path from j - min r j to j + min r (N - 1 - j).

theorem SimpleGraph.edist_pathGraph {N : ℕ} (i j : Fin N) :
(pathGraph N).edist i j = ↑(↑j - ↑i + (↑i - ↑j))

Distances in path graphs. The distance between i and j in pathGraph N is |j - i|, written (j - i) + (i - j) in truncated subtraction.

def SimpleGraph.Hom.sumFold {V : Type u_1} (G : SimpleGraph V) :
G ⊕g G →g G

The fold homomorphism from G ⊕g G onto G, identifying the two copies.

@[simp]
theorem SimpleGraph.Hom.sumFold_apply {V : Type u_1} (G : SimpleGraph V) (x : V ⊕ V) :

Evaluating SimpleGraph.Hom.sumFold at a vertex.

theorem SimpleGraph.edist_sum_inl {V : Type u_1} {W : Type u_2} (G : SimpleGraph V) (H : SimpleGraph W) (x y : V) :
(G ⊕g H).edist (Sum.inl x) (Sum.inl y) = G.edist x y

Extended distances in G ⊕g H between vertices of the left copy agree with distances in G.