Documentation

CslibFrontier.Computability.Distributed.OrientedCycle.Graph

The oriented cycle as a SimpleGraph #

The undirected graph underlying the oriented n-cycle ZMod n is Mathlib's circulant graph with jump 1, OrientedCycle.graph n. For n = k + 1 it is SimpleGraph.cycleGraph (k + 1) (OrientedCycle.graph_succ_eq_cycleGraph); for n = 0 it is the two-way infinite path on ℤ. Away from the one-node cycle, whose only node is its own successor, IsProperColoring is exactly Mathlib's notion of a proper colouring of this graph (OrientedCycle.isProperColoring_iff_adj), so the colourings computed in this directory are SimpleGraph.Colorings.

Main definitions #

Main results #

@[reducible, inline]

The undirected graph of the oriented n-cycle: Mathlib's circulant graph on ZMod n with jump 1, in which u and v are adjacent iff u ≠ v and one is the successor of the other.

theorem Cslib.Distributed.OrientedCycle.graph_adj {n : ℕ} {u v : ZMod n} :
(graph n).Adj u v ↔ u ≠ v ∧ (u = v + 1 ∨ v = u + 1)

For n = k + 1 the graph of the oriented cycle is Mathlib's cycleGraph (k + 1) on Fin (k + 1) = ZMod (k + 1).

theorem Cslib.Distributed.OrientedCycle.self_ne_add_one {n : ℕ} (hn : n ≠ 1) (v : ZMod n) :
v ≠ v + 1

Away from the one-node cycle no node is its own successor.

theorem Cslib.Distributed.OrientedCycle.graph_adj_add_one {n : ℕ} (hn : n ≠ 1) (v : ZMod n) :
(graph n).Adj v (v + 1)
theorem Cslib.Distributed.OrientedCycle.isProperColoring_iff_adj {n : ℕ} (hn : n ≠ 1) {C : Type u_1} {c : ZMod n → C} :
IsProperColoring c ↔ ∀ (u v : ZMod n), (graph n).Adj u v → c u ≠ c v

For n ≠ 1, a colouring of the oriented cycle is proper iff adjacent nodes of its graph get different colours. On the one-node cycle no colouring is proper, while its graph has no edges.

def Cslib.Distributed.OrientedCycle.IsProperColoring.toColoring {n : ℕ} (hn : n ≠ 1) {C : Type u_1} {c : ZMod n → C} (hc : IsProperColoring c) :

A proper colouring of the oriented cycle as a colouring of its graph.

@[simp]
theorem Cslib.Distributed.OrientedCycle.IsProperColoring.toColoring_apply {n : ℕ} (hn : n ≠ 1) {C : Type u_1} {c : ZMod n → C} (hc : IsProperColoring c) (v : ZMod n) :
(toColoring hn hc) v = c v
theorem Cslib.Distributed.OrientedCycle.Algorithm.ColorsCycle.exists_coloring {S : Type u_1} {A : Algorithm ℕ S ℕ} {n t c : ℕ} (hn : n ≠ 1) (hA : A.ColorsCycle n t c) {x : ZMod n → ℕ} (hx : Function.Injective x) (hxn : ∀ (v : ZMod n), x v < n) :
∃ (C : (graph n).Coloring (Fin c)), ∀ (v : ZMod n), ↑(C v) = A.run x t v

An algorithm that properly c-colours every oriented n-cycle, n ≠ 1, in t rounds outputs a colouring of graph n with colours Fin c.