op869_oriented_blocks_three_colorable
A graph made from bipartite blocks is three-colorable when each block belongs to a vertex of a three-colored owner graph, each used block points to at most one differently colored owner, and every cross-edge leaves the designated side toward the block with that target owner.
Statement
theorem op869_oriented_blocks_three_colorable {X V B : Type} (G : SimpleGraph X) (φ : V → Fin 3) (owner : B → V) (target : B → Option V) (selected : B → Bool) (block : X → B) (side : X → Bool) (howner : ∀ b v, target b = some v → φ v ≠ φ (owner b)) (hinner : ∀ x y, G.Adj x y → block x = block y → side x ≠ side y) (hcross : ∀ x y, G.Adj x y → block x ≠ block y → (target (block x) = some (owner (block y)) ∧ side x = selected (block x)) ∨ (target (block y) = some (owner (block x)) ∧ side y = selected (block y))) : G.Colorable 3
- Source
- arXiv:2610.41516 Lemma 2.5, offline three-colorability step.
- Verified
- 18 Nov 2026
- Axioms
Classical.choiceQuot.soundpropext- Built on 1
- op869_orient_three_color_blocksFor each bipartite block with a three-colored owner and at most one three-colored target of a different color, its two sides can be…
The proof, explained
The proof constructs an explicit 3-coloring of the graph by coloring the two sides of each bipartite block with two distinct colors chosen from the three available colors, avoiding the color of the block's owner vertex. When a block points to a target owner, its designated side is assigned that target owner's color. Adjacent vertices within the same block receive different colors because they lie on opposite sides, while adjacent vertices in different blocks cannot clash because one endpoint takes the other block owner's color, which the second endpoint is guaranteed to avoid.
Define a candidate 3-coloring col on X by assigning distinct colors to the two sides of each bipartite block.
Using the helper lemma op869_orient_three_color_blocks, each block b is assigned a pair of distinct colors left b and right b in Fin 3 such that neither equals φ (owner b), and whenever b has a target owner v, the designated side selected b receives color φ v. The vertex coloring col x is then defined to be left (block x) if side x is true, and right (block x) otherwise.
uses
op869_orient_three_color_blocksclassical obtain ⟨left, right, hlocal⟩ := op869_orient_three_color_blocks φ owner target selected howner let col : X → Fin 3 := fun x => if side x then left (block x) else right (block x)
Every vertex receives a color distinct from that of its block's owner: col x ≠ φ (owner (block x)).
For any vertex x, whether side x is true or false, col x evaluates to either left (block x) or right (block x). By construction of the block coloring, both of these colors differ from φ (owner (block x)).
have havoid : ∀ x, col x ≠ φ (owner (block x)) := by intro x cases hx : side x <;> simp [col, hx, (hlocal (block x)).1, (hlocal (block x)).2.1]
If a block targets an owner vertex v, vertices on its designated side receive color φ v.
By the specification of op869_orient_three_color_blocks, the color assigned to the block's designated side (selected (block x)) is φ v. Thus, if side x = selected (block x), col x evaluates directly to φ v.
have hselected : ∀ x v, target (block x) = some v → side x = selected (block x) → col x = φ v := by intro x v ht hs have h := (hlocal (block x)).2.2.2 v ht simpa [col, hs] using h
It suffices to show that any two adjacent vertices in G receive different colors.
Applying SimpleGraph.Coloring.mk, the candidate assignment col forms a valid 3-coloring of G provided that col x ≠ col y for every edge between x and y.
uses
SimpleGraph.Coloring.mkrefine ⟨SimpleGraph.Coloring.mk col ?_⟩ intro x y hxy
Adjacent vertices in the same block have distinct colors.
When x and y belong to the same block, the bipartite assumption hinner ensures they lie on opposite sides of the block (side x ≠ side y). Consequently, one vertex receives left (block x) and the other receives right (block x). Since left and right are distinct for each block (using Ne.symm to swap the inequality if needed), col x ≠ col y.
uses
Ne.symmby_cases hb : block x = block y · have hs := hinner x y hxy hb cases hx : side x <;> cases hy : side y <;> simp_all [col, (hlocal (block y)).2.2.1, Ne.symm (hlocal (block y)).2.2.1]
Adjacent vertices in different blocks have distinct colors.
When x and y belong to different blocks, hypothesis hcross provides that the edge is oriented: one endpoint lies on its block's designated side and targets the owner of the other block. If x targets the owner of y from its designated side, then col x = φ (owner (block y)). If col x = col y, then y would have the color of its own block's owner, contradicting the fact that every vertex avoids its owner's color. The symmetric case where y targets the owner of x is identical.
· rcases hcross x y hxy hb with ⟨ht, hs⟩ | ⟨ht, hs⟩ · have he := hselected x (owner (block y)) ht hs exact fun h => havoid y (h.symm.trans he) · have he := hselected y (owner (block x)) ht hs exact fun h => havoid x (h.trans he)
op869_orient_three_color_blocks- For any 3-coloring of owners and block target function where targets differ in color from block owners, each block can be assigned two distinct colors avoiding its owner's color, such that its designated side receives the target owner's color.
SimpleGraph.Coloring.mk- Constructs a proper graph coloring from a coloring function and a proof that adjacent vertices receive different colors.
Ne.symm- Inequality is symmetric: if a ≠ b, then b ≠ a.
Written by a model (gemini-3.8-flash) from the Lean proof and the goal states Lean reported at each step. Lean verified the proof; this explanation is a reading aid and is not itself machine-checked.
Lean source view module on GitHub
Choose a tactic — a marked line — to see the goals Lean had before and after it, as in Lean’s infoview. Step with ← → or j k.
/-- The offline three-coloring invariant for the fold-simulation block construction. -/theorem op869_oriented_blocks_three_colorable {X V B : Type} (G : SimpleGraph X) (φ : V → Fin 3) (owner : B → V) (target : B → Option V) (selected : B → Bool) (block : X → B) (side : X → Bool) (howner : ∀ b v, target b = some v → φ v ≠ φ (owner b)) (hinner : ∀ x y, G.Adj x y → block x = block y → side x ≠ side y) (hcross : ∀ x y, G.Adj x y → block x ≠ block y → (target (block x) = some (owner (block y)) ∧ side x = selected (block x)) ∨ (target (block y) = some (owner (block x)) ∧ side y = selected (block y))) : G.Colorable 3 := by classical obtain ⟨left, right, hlocal⟩ := op869_orient_three_color_blocks φ owner target selected howner let col : X → Fin 3 := fun x => if side x then left (block x) else right (block x) have havoid : ∀ x, col x ≠ φ (owner (block x)) := by intro x cases hx : side x <;> simp [col, hx, (hlocal (block x)).1, (hlocal (block x)).2.1] have hselected : ∀ x v, target (block x) = some v → side x = selected (block x) → col x = φ v := by intro x v ht hs have h := (hlocal (block x)).2.2.2 v ht simpa [col, hs] using h refine ⟨SimpleGraph.Coloring.mk col ?_⟩ intro x y hxy by_cases hb : block x = block y · have hs := hinner x y hxy hb cases hx : side x <;> cases hy : side y <;> simp_all [col, (hlocal (block y)).2.2.1, Ne.symm (hlocal (block y)).2.2.1] · rcases hcross x y hxy hb with ⟨ht, hs⟩ | ⟨ht, hs⟩ · have he := hselected x (owner (block y)) ht hs exact fun h => havoid y (h.symm.trans he) · have he := hselected y (owner (block x)) ht hs exact fun h => havoid x (h.trans he)