Documentation

CslibFrontier.Foundations.Combinatorics.SimpleGraph.RelatesInSteps

Walks of a simple graph as steps of its adjacency relation #

A walk of length n from u to v in a simple graph is a chain of n steps of the adjacency relation (SimpleGraph.exists_walk_length_eq_iff_relatesInSteps). Hence the extended distance SimpleGraph.edist is at most n exactly when v is reached from u within n steps (SimpleGraph.edist_le_iff_relatesWithinSteps). This connects Mathlib's graph metric to the step-counted reachability Relation.RelatesWithinSteps that bounded connectivity uses.

Main results #

theorem SimpleGraph.exists_walk_length_eq_iff_relatesInSteps {V : Type u_1} {G : SimpleGraph V} {u v : V} {n : ℕ} :
(∃ (p : G.Walk u v), p.length = n) ↔ Relation.RelatesInSteps G.Adj u v n

Walks are chains of adjacency steps: there is a walk of length n from u to v exactly when v is reached from u in n steps of the adjacency relation.

theorem SimpleGraph.edist_le_iff_relatesWithinSteps {V : Type u_1} {G : SimpleGraph V} {u v : V} {n : ℕ} :

The distance is at most n exactly when v is reached from u within n steps of the adjacency relation.