Documentation

CslibFrontier.Computability.Circuit.NNF.Negation.UpperBound

A linear d-DNNF for f_G #

[ArenasBroadrickLiewVanDenBroeck2026, Proposition 5.1], upper bound. For a cubic graph with a proper 3-edge-colouring on n vertices, f_G (CubicEdgeColoring.someButNotAllColors) is computed by a d-DNNF with at most 150 n + 50 nodes (CubicEdgeColoring.exists_dDNNF).

The proof follows the paper. f_G(x) holds exactly when G_x contains colour 0 but not 1, or 1 but not 2, or 2 but not 0, three mutually exclusive conditions; their d-DNNFs are joined by two deterministic ∨ gates. For colours α and β, the edges of these two colours form disjoint alternating cycles. Reading each cycle in order and remembering the bits of its first and of the previous vertex, together with whether an edge of colour α, resp. β, with both ends true has been seen, is a read-once branching program with 16 states (CubicEdgeColoring.cycleProgram), whose d-DNNF has linear size (Cslib.BranchingPrograms.ReadOnceProgram.toNNF).

The cycles. With σ = β ∘ α (each colour acting as the involution M.mate), the cycle through x is x, α x, σ x, α σ x, …, σ^(p-1) x, α σ^(p-1) x for the period p of x under σ (CubicEdgeColoring.cycleBlock). Its vertices are distinct because σ^k y = α y is impossible: reflecting along the cycle would give a fixed point of α or of β (CubicEdgeColoring.iterate_ne_mate). Every edge of colour α or β at a vertex of the cycle joins two cyclically consecutive vertices of it, and the cycles through distinct vertices partition the graph (CubicEdgeColoring.exists_isCycleCover).

Main definitions #

Main results #

References #

Cyclically consecutive pairs #

def Cslib.CubicEdgeColoring.cyclePairsTail {V : Type u_1} (v₀ : V) :
V → List V → List (V × V)

The consecutive pairs of u :: l, followed by the pair from the last vertex back to v₀.

The cyclically consecutive pairs of a list: each vertex with the next, and the last with the first.

theorem Cslib.CubicEdgeColoring.mem_of_mem_cyclePairsTail {V : Type u_1} {v₀ u : V} {l : List V} {p : V × V} :
p ∈ cyclePairsTail v₀ u l → (p.1 = u ∨ p.1 ∈ l) ∧ (p.2 = v₀ ∨ p.2 ∈ l)
theorem Cslib.CubicEdgeColoring.mem_of_mem_cyclePairs {V : Type u_1} {l : List V} {p : V × V} (h : p ∈ cyclePairs l) :
p.1 ∈ l ∧ p.2 ∈ l
theorem Cslib.CubicEdgeColoring.getElem_mem_cyclePairsTail {V : Type u_1} (v₀ u : V) (l : List V) (j : ℕ) (hj : j + 1 < l.length) :
(l[j], l[j + 1]) ∈ cyclePairsTail v₀ u l
theorem Cslib.CubicEdgeColoring.head_mem_cyclePairsTail {V : Type u_1} (v₀ u v : V) (l : List V) :
(u, v) ∈ cyclePairsTail v₀ u (v :: l)
theorem Cslib.CubicEdgeColoring.last_mem_cyclePairsTail {V : Type u_1} (v₀ u : V) (l : List V) (hl : l ≠ []) :
(l.getLast hl, v₀) ∈ cyclePairsTail v₀ u l
theorem Cslib.CubicEdgeColoring.getElem_mem_cyclePairs {V : Type u_1} {l : List V} {j : ℕ} (hj : j + 1 < l.length) :

Each vertex of a list of at least two vertices and the next are cyclically consecutive.

The last vertex of a list and the first are cyclically consecutive.

Reading a cycle cover #

@[reducible, inline]

The labels of the cycle automaton: whether a cycle starts here, whether the previous vertex is joined to this one by an edge of colour α and of colour β, and the same for this vertex and the first vertex of its cycle, if it closes the cycle.

def Cslib.CubicEdgeColoring.pairLabel {V : Type u_1} [DecidableEq V] (M : CubicEdgeColoring V) (α β : Fin 3) (u w : V) :

Whether u is joined to w by an edge of colour α, and by one of colour β.

def Cslib.CubicEdgeColoring.cycleItemsTail {V : Type u_1} [DecidableEq V] (M : CubicEdgeColoring V) (α β : Fin 3) (v₀ : V) :
V → List V → List (V × CycleLabel)

The labelled inputs for l read after u, in a cycle starting at v₀.

The labelled inputs for reading the cycle l.

theorem Cslib.CubicEdgeColoring.map_fst_cycleItemsTail {V : Type u_1} [DecidableEq V] (M : CubicEdgeColoring V) (α β : Fin 3) (v₀ u : V) (l : List V) :
List.map Prod.fst (M.cycleItemsTail α β v₀ u l) = l

The transition of the cycle automaton on the state (first bit, previous bit, α seen, β seen).

The cycle program reading a list of cycles: it accepts when some cyclically consecutive pair joined by an edge of colour α has both bits true and none joined by colour β does.

def Cslib.CubicEdgeColoring.cycleOrder {V : Type u_1} [DecidableEq V] (M : CubicEdgeColoring V) (α β : Fin 3) (blocks : List (List V)) :
Fin (List.flatMap (M.cycleItems α β) blocks).length → V

The order in which the cycle program reads the vertices.

The run of the cycle program on a list of labelled vertices.

@[simp]
theorem Cslib.CubicEdgeColoring.cycleRun_nil {V : Type u_1} (x : V → Bool) (q : Bool × Bool × Bool × Bool) :
cycleRun x [] q = q
@[simp]
theorem Cslib.CubicEdgeColoring.cycleRun_cons {V : Type u_1} (x : V → Bool) (a : V × CycleLabel) (l : List (V × CycleLabel)) (q : Bool × Bool × Bool × Bool) :
cycleRun x (a :: l) q = cycleRun x l (cycleStep a.2 q (x a.1))
theorem Cslib.CubicEdgeColoring.cycleRun_append {V : Type u_1} (x : V → Bool) (l l' : List (V × CycleLabel)) (q : Bool × Bool × Bool × Bool) :
cycleRun x (l ++ l') q = cycleRun x l' (cycleRun x l q)
def Cslib.CubicEdgeColoring.pairHas {V : Type u_1} [DecidableEq V] (M : CubicEdgeColoring V) (γ : Fin 3) (x : V → Bool) (p : V × V) :

A cyclically consecutive pair joined by an edge of colour γ, with both bits true.

theorem Cslib.CubicEdgeColoring.runList_cycleItemsTail {V : Type u_1} [DecidableEq V] (M : CubicEdgeColoring V) (α β : Fin 3) (x : V → Bool) (v₀ u : V) (l : List V) (s d : Bool) :
∃ (p' : Bool), cycleRun x (M.cycleItemsTail α β v₀ u l) (x v₀, x u, s, d) = (x v₀, p', s || (cyclePairsTail v₀ u l).any (M.pairHas α x), d || (cyclePairsTail v₀ u l).any (M.pairHas β x))
theorem Cslib.CubicEdgeColoring.runList_cycleItems {V : Type u_1} [DecidableEq V] (M : CubicEdgeColoring V) (α β : Fin 3) (x : V → Bool) (l : List V) (f p s d : Bool) :
∃ (f' : Bool) (p' : Bool), cycleRun x (M.cycleItems α β l) (f, p, s, d) = (f', p', s || (cyclePairs l).any (M.pairHas α x), d || (cyclePairs l).any (M.pairHas β x))
theorem Cslib.CubicEdgeColoring.runList_flatMap_cycleItems {V : Type u_1} [DecidableEq V] (M : CubicEdgeColoring V) (α β : Fin 3) (x : V → Bool) (blocks : List (List V)) (f p s d : Bool) :
∃ (f' : Bool) (p' : Bool), cycleRun x (List.flatMap (M.cycleItems α β) blocks) (f, p, s, d) = (f', p', s || (List.flatMap cyclePairs blocks).any (M.pairHas α x), d || (List.flatMap cyclePairs blocks).any (M.pairHas β x))
theorem Cslib.CubicEdgeColoring.eval_cycleProgram {V : Type u_1} [DecidableEq V] (M : CubicEdgeColoring V) (α β : Fin 3) (blocks : List (List V)) (x : V → Bool) :
(M.cycleProgram α β blocks).eval (x ∘ M.cycleOrder α β blocks) = ((List.flatMap cyclePairs blocks).any (M.pairHas α x) && !(List.flatMap cyclePairs blocks).any (M.pairHas β x))

The cycle program accepts exactly when some cyclically consecutive pair of a block is joined by an edge of colour α with both bits true, and none by an edge of colour β.

structure Cslib.CubicEdgeColoring.IsCycleCover {V : Type u_1} (M : CubicEdgeColoring V) (α β : Fin 3) (blocks : List (List V)) :

A cycle cover for the colours α and β: lists of vertices that together list every vertex exactly once, such that every edge of colour α or β at a listed vertex joins cyclically consecutive vertices of its list.

theorem Cslib.CubicEdgeColoring.IsCycleCover.any_pairHas_iff {V : Type u_1} [DecidableEq V] {M : CubicEdgeColoring V} {α β : Fin 3} {blocks : List (List V)} (h : M.IsCycleCover α β blocks) (x : V → Bool) {γ : Fin 3} (hγ : γ = α ∨ γ = β) :
(List.flatMap cyclePairs blocks).any (M.pairHas γ x) = true ↔ M.HasColor x γ
theorem Cslib.CubicEdgeColoring.IsCycleCover.eval_cycleProgram {V : Type u_1} [DecidableEq V] {M : CubicEdgeColoring V} {α β : Fin 3} {blocks : List (List V)} (h : M.IsCycleCover α β blocks) (x : V → Bool) :
(M.cycleProgram α β blocks).eval (x ∘ M.cycleOrder α β blocks) = true ↔ M.HasColor x α ∧ ¬M.HasColor x β

On a cycle cover, the cycle automaton decides whether G_x contains colour α but not colour β.

Alternating cycles #

def Cslib.CubicEdgeColoring.cycleStepMap {V : Type u_1} (M : CubicEdgeColoring V) (α β : Fin 3) (v : V) :
V

One step along the alternating cycle: an edge of colour α, then one of colour β.

theorem Cslib.CubicEdgeColoring.mate_mate_iterate {V : Type u_1} {M : CubicEdgeColoring V} {α β : Fin 3} (x : V) (i : ℕ) :
M.mate β (M.mate α ((M.cycleStepMap α β)^[i] x)) = (M.cycleStepMap α β)^[i + 1] x
theorem Cslib.CubicEdgeColoring.mate_iterate_succ {V : Type u_1} {M : CubicEdgeColoring V} {α β : Fin 3} (x : V) (i : ℕ) :
M.mate β ((M.cycleStepMap α β)^[i + 1] x) = M.mate α ((M.cycleStepMap α β)^[i] x)
theorem Cslib.CubicEdgeColoring.iterate_ne_mate {V : Type u_1} {M : CubicEdgeColoring V} {α β : Fin 3} (k : ℕ) (y : V) :
(M.cycleStepMap α β)^[k] y ≠ M.mate α y

No shortcut across a cycle: σ^k y = α y is impossible. Reflecting along the cycle gives σ^(k-m) y = α σ^m y for m ≤ k, which for m = k/2 makes a vertex a fixed point of α or of β.

theorem Cslib.CubicEdgeColoring.iterate_ne_mate_iterate {V : Type u_1} {M : CubicEdgeColoring V} {α β : Fin 3} (x : V) (i i' : ℕ) :
(M.cycleStepMap α β)^[i] x ≠ M.mate α ((M.cycleStepMap α β)^[i'] x)
noncomputable def Cslib.CubicEdgeColoring.cyclePeriod {V : Type u_1} (M : CubicEdgeColoring V) (α β : Fin 3) (x : V) :

The period of x along the alternating cycle.

theorem Cslib.CubicEdgeColoring.cyclePeriod_pos {V : Type u_1} {M : CubicEdgeColoring V} {α β : Fin 3} [Finite V] (x : V) :
0 < M.cyclePeriod α β x
theorem Cslib.CubicEdgeColoring.iterate_cyclePeriod {V : Type u_1} {M : CubicEdgeColoring V} {α β : Fin 3} (x : V) :
(M.cycleStepMap α β)^[M.cyclePeriod α β x] x = x
def Cslib.CubicEdgeColoring.cycleVertex {V : Type u_1} (M : CubicEdgeColoring V) (α β : Fin 3) (x : V) (j : ℕ) :
V

The j-th vertex of the alternating cycle through x: σ^i x for j = 2i and α σ^i x for j = 2i + 1.

theorem Cslib.CubicEdgeColoring.cycleVertex_even {V : Type u_1} {M : CubicEdgeColoring V} {α β : Fin 3} (x : V) (i : ℕ) :
M.cycleVertex α β x (2 * i) = (M.cycleStepMap α β)^[i] x
theorem Cslib.CubicEdgeColoring.cycleVertex_odd {V : Type u_1} {M : CubicEdgeColoring V} {α β : Fin 3} (x : V) (i : ℕ) :
M.cycleVertex α β x (2 * i + 1) = M.mate α ((M.cycleStepMap α β)^[i] x)
noncomputable def Cslib.CubicEdgeColoring.cycleBlock {V : Type u_1} (M : CubicEdgeColoring V) (α β : Fin 3) (x : V) :

The alternating cycle through x: x, α x, σ x, α σ x, …, σ^(p-1) x, α σ^(p-1) x.

theorem Cslib.CubicEdgeColoring.length_cycleBlock {V : Type u_1} {M : CubicEdgeColoring V} {α β : Fin 3} (x : V) :
(M.cycleBlock α β x).length = 2 * M.cyclePeriod α β x
theorem Cslib.CubicEdgeColoring.getElem_cycleBlock {V : Type u_1} {M : CubicEdgeColoring V} {α β : Fin 3} (x : V) (j : ℕ) (hj : j < (M.cycleBlock α β x).length) :
(M.cycleBlock α β x)[j] = M.cycleVertex α β x j
theorem Cslib.CubicEdgeColoring.mem_cycleBlock {V : Type u_1} {M : CubicEdgeColoring V} {α β : Fin 3} {x v : V} :
v ∈ M.cycleBlock α β x ↔ ∃ j < 2 * M.cyclePeriod α β x, M.cycleVertex α β x j = v
theorem Cslib.CubicEdgeColoring.self_mem_cycleBlock {V : Type u_1} {M : CubicEdgeColoring V} {α β : Fin 3} [Finite V] (x : V) :
x ∈ M.cycleBlock α β x
theorem Cslib.CubicEdgeColoring.nodup_cycleBlock {V : Type u_1} {M : CubicEdgeColoring V} {α β : Fin 3} (x : V) :
(M.cycleBlock α β x).Nodup

The alternating cycle lists distinct vertices.

theorem Cslib.CubicEdgeColoring.cycleBlock_pairs {V : Type u_1} {M : CubicEdgeColoring V} {α β : Fin 3} [Finite V] (x v : V) :
v ∈ M.cycleBlock α β x → ∀ (γ : Fin 3), γ = α ∨ γ = β → ∃ p ∈ cyclePairs (M.cycleBlock α β x), M.mate γ p.1 = p.2 ∧ (p = (v, M.mate γ v) ∨ p = (M.mate γ v, v))

Edges along the cycle. Every edge of colour α or β at a vertex of the alternating cycle joins two cyclically consecutive vertices of it.

theorem Cslib.CubicEdgeColoring.mate_mem_cycleBlock {V : Type u_1} {M : CubicEdgeColoring V} {α β : Fin 3} [Finite V] {x v : V} (hv : v ∈ M.cycleBlock α β x) {γ : Fin 3} (hγ : γ = α ∨ γ = β) :
M.mate γ v ∈ M.cycleBlock α β x
theorem Cslib.CubicEdgeColoring.exists_isCycleCover_of_closed {V : Type u_1} {M : CubicEdgeColoring V} {α β : Fin 3} [Finite V] (W : Finset V) :
(∀ v ∈ W, M.mate α v ∈ W ∧ M.mate β v ∈ W) → ∃ (blocks : List (List V)), blocks.flatten.Nodup ∧ (∀ (v : V), v ∈ blocks.flatten ↔ v ∈ W) ∧ ∀ b ∈ blocks, ∀ v ∈ b, ∀ (γ : Fin 3), γ = α ∨ γ = β → ∃ p ∈ cyclePairs b, M.mate γ p.1 = p.2 ∧ (p = (v, M.mate γ v) ∨ p = (M.mate γ v, v))

Alternating cycle covers exist: the alternating cycles through the vertices of a set closed under both colours partition it.

theorem Cslib.CubicEdgeColoring.exists_isCycleCover {V : Type u_1} (M : CubicEdgeColoring V) (α β : Fin 3) [Finite V] :
∃ (blocks : List (List V)), M.IsCycleCover α β blocks

Alternating cycle covers exist for every pair of colours.

Proposition 5.1 #

f_G splits into three mutually exclusive conditions on the colours.

noncomputable def Cslib.CubicEdgeColoring.cover {V : Type u_1} {M : CubicEdgeColoring V} [Fintype V] (α β : Fin 3) :

The chosen alternating cycle cover for the colours α and β.

The d-DNNF deciding "colour α but not colour β", from the cycle program on the chosen cover.

theorem Cslib.CubicEdgeColoring.toFun_colorDNNF {V : Type u_1} [DecidableEq V] {M : CubicEdgeColoring V} [Fintype V] (α β : Fin 3) (x : V → Bool) :
(colorDNNF α β).toFun x = true ↔ M.HasColor x α ∧ ¬M.HasColor x β
theorem Cslib.CubicEdgeColoring.exists_dDNNF {V : Type u_1} [DecidableEq V] {M : CubicEdgeColoring V} [Fintype V] :
∃ (N : Type) (x : Fintype N) (D : Circuits.NNF V N), D.IsDecomposable ∧ D.IsDeterministic ∧ (∀ (x : V → Bool), D.toFun x = M.someButNotAllColors x) ∧ D.size ≤ 150 * Fintype.card V + 50

[ArenasBroadrickLiewVanDenBroeck2026, Proposition 5.1], upper bound. For a cubic graph with a proper 3-edge-colouring on n vertices, f_G is computed by a d-DNNF with at most 150 n + 50 nodes.