Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Exact face-incidence representation and coloring transport

Definition
FourColor_GraphBridge

by Minghui · Sep 26, 2026 · Mathlib c5ea003 (Lean v4.30.0)

four-color-theoremgraph-theory

Notation: D={0,…,n−1}D=\{0,\ldots,n-1\}D={0,…,n−1} is the dart set, n=∣D∣n = |D|n=∣D∣ its size, and p=νHp = \nu_Hp=νH​ is the node permutation. Write e,fe,fe,f for the edge and face permutations, with p(f(e(d)))=dp(f(e(d)))=dp(f(e(d)))=d. Edge, node and face counts E,N,FE,N,FE,N,F are numbers of permutation orbits, including singleton orbits. The component count CCC uses the equivalence generated by all three permutations. Planarity means the exact Euler equality E+N+F=n+2CE+N+F=n+2CE+N+F=n+2C, and connectedness means C=1C=1C=1.

A plain hypermap has a fixed-point-free involution eee. Cubic means every node orbit has size three; precubic means every node orbit has size at most three. Bridgeless means ddd and e(d)e(d)e(d) never lie in the same face orbit. A kkk-coloring is a map D→{0,…,k−1}D\to\{0,\ldots,k-1\}D→{0,…,k−1} constant on face orbits and different across each edge step. No requirement uses all available colors. The empty dart set has zero components, is planar, and is colorable, but is not connected.

An admissible hypermap is planar, bridgeless, plain and precubic. A minimal counterexample is a non-four-colorable admissible hypermap such that every admissible hypermap with fewer darts is four-colorable. Minimality includes all finite carriers through their enumeration by Fin⁡(m)\operatorname{Fin}(m)Fin(m); cubicity, connectedness and lower face-degree bounds are not assumed.

For a simple graph GGG on a vertex type VVV, a face representation supplies ρ:D→V\rho:D\to Vρ:D→V with d∼fd′  ⟺  ρ(d)=ρ(d′)d\sim_f d'\iff\rho(d)=\rho(d')d∼f​d′⟺ρ(d)=ρ(d′) and G(v,w)  ⟺  ∃d,ρ(d)=v∧ρ(e(d))=wG(v,w)\iff\exists d,\rho(d)=v\land\rho(e(d))=wG(v,w)⟺∃d,ρ(d)=v∧ρ(e(d))=w. Its image is precisely the nonisolated vertices. No planarity or finiteness of VVV is assumed in this interface. Structural Lean lemmas prove bridgelessness and coloring transport for k>0k>0k>0; geometry is the separate realization theorem. Formalization note: a source-derived graph/dual-hypermap interface, not a literal translation of the source's map-discretization definition.

Source: Georges Gonthier, A Computer-Checked Proof of the Four Colour Theorem (2005), https://www.microsoft.com/en-us/research/wp-content/uploads/2012/10/4colproof.pdf; Section 2, PDF p. 4, paragraph beginning 'Although the statement'; Section 5.6, PDF p. 48, discretization discussion (paragraph on PDF p. 48). Relevant displays are unnumbered. Pinned executable reference: https://github.com/rocq-community/fourcolor/blob/c1d6b1cd5288bea4b067aac13cdde3c18dffe018/theories/proof/discretize.v#L347; https://github.com/rocq-community/fourcolor/blob/c1d6b1cd5288bea4b067aac13cdde3c18dffe018/theories/proof/coloring.v#L135; https://github.com/rocq-community/fourcolor/blob/c1d6b1cd5288bea4b067aac13cdde3c18dffe018/theories/proof/geometry.v#L95.

Definition code
import Definitions.Def_FourColor_PlaneDrawing
import Definitions.Def_FourColor_Hypermap

/-!
# Graph vertices represented by hypermap faces

This is a Lean graph-to-dual-map interface, derived from Gonthier (2005), Section 2,
PDF p. 4 (the graph interpretation), Section 5.1, PDF p. 20 (Euler planarity), and
Section 5.6, PDF pp. 48–51 (discretization). It is not a literal restatement of the
Rocq theorem `discretize_to_hypermap`, whose input is a topological map.

`FaceRepresentation` records exact face and adjacency incidence. It does not assert
that a planar graph admits such a representation; that geometric existence theorem
is a separate milestone. Isolated vertices need no darts and receive a default color
when transporting a coloring. The transport proof requires at least one available color.
-/

namespace FourColor

universe u

/-- Hypermap faces represent graph vertices, and edge steps represent precisely graph edges.

Every nonisolated vertex is represented. Isolated vertices have no representative because
each dart supplies an edge step, and such a step must represent an adjacency.
-/
structure FaceRepresentation {V : Type u} (G : SimpleGraph V) {dartCount : ℕ}
    (H : Hypermap dartCount) where
  vertexOf : Fin dartCount → V
  sameFace_iff : ∀ x y, H.SameFace x y ↔ vertexOf x = vertexOf y
  adj_iff : ∀ v w, G.Adj v w ↔ ∃ x, vertexOf x = v ∧ vertexOf (H.edge x) = w

namespace FaceRepresentation

variable {V : Type u} {G : SimpleGraph V} {dartCount : ℕ} {H : Hypermap dartCount}

/-- An edge remaining in one face would represent a loop, which a simple graph cannot have. -/
theorem bridgeless (R : FaceRepresentation G H) : H.Bridgeless := by
  intro x hsame
  have hadj := (R.adj_iff (R.vertexOf x) (R.vertexOf (H.edge x))).2 ⟨x, rfl, rfl⟩
  exact G.ne_of_adj hadj ((R.sameFace_iff x (H.edge x)).1 hsame)

/-- Transfer a face coloring to graph vertices, assigning isolated vertices an arbitrary color. -/
theorem colorable (R : FaceRepresentation G H) {colorCount : ℕ} (hk : 0 < colorCount)
    (hc : H.Colorable colorCount) : G.Colorable colorCount := by
  classical
  obtain ⟨color, hface, hedge⟩ := hc
  let graphColor (v : V) : Fin colorCount :=
    if h : ∃ x, R.vertexOf x = v then color (Classical.choose h) else ⟨0, hk⟩
  have on_dart (x : Fin dartCount) : graphColor (R.vertexOf x) = color x := by
    have hx : ∃ y, R.vertexOf y = R.vertexOf x := ⟨x, rfl⟩
    dsimp only [graphColor]
    rw [dif_pos hx]
    exact hface _ _ ((R.sameFace_iff _ _).2 (Classical.choose_spec hx))
  refine ⟨SimpleGraph.Coloring.mk graphColor ?_⟩
  intro v w hadj
  obtain ⟨x, rfl, rfl⟩ := (R.adj_iff v w).1 hadj
  rw [on_dart x, on_dart (H.edge x)]
  exact (hedge x).symm

/-- Pull a graph coloring back along the face representation; no default color is needed. -/
theorem hypermapColorable (R : FaceRepresentation G H) {colorCount : ℕ}
    (hc : G.Colorable colorCount) : H.Colorable colorCount := by
  obtain ⟨color⟩ := hc
  refine ⟨fun x ↦ color (R.vertexOf x), ?_, ?_⟩
  · intro x y hsame
    exact congrArg color ((R.sameFace_iff x y).1 hsame)
  · intro x
    exact (color.valid ((R.adj_iff _ _).2 ⟨x, rfl, rfl⟩)).symm

/-- With an available color for isolated vertices, graph and hypermap colorability coincide. -/
theorem colorable_iff (R : FaceRepresentation G H) {colorCount : ℕ}
    (hk : 0 < colorCount) : H.Colorable colorCount ↔ G.Colorable colorCount :=
  ⟨R.colorable hk, R.hypermapColorable⟩

end FaceRepresentation

end FourColor
Source
Georges Gonthier, A Computer-Checked Proof of the Four Colour Theorem (2005), https://www.microsoft.com/en-us/research/wp-content/uploads/2012/10/4colproof.pdf; Section 2, PDF p. 4, paragraph beginning 'Although the statement'; Section 5.6, PDF p. 48, discretization discussion (paragraph on PDF p. 48). Relevant displays are unnumbered. Pinned executable reference: https://github.com/rocq-community/fourcolor/blob/c1d6b1cd5288bea4b067aac13cdde3c18dffe018/theories/proof/discretize.v#L347; https://github.com/rocq-community/fourcolor/blob/c1d6b1cd5288bea4b067aac13cdde3c18dffe018/theories/proof/coloring.v#L135; https://github.com/rocq-community/fourcolor/blob/c1d6b1cd5288bea4b067aac13cdde3c18dffe018/theories/proof/geometry.v#L95.
Read-back

What the Lean code literally says, in plain math · gpt-6

FaceRepresentation. Let VVV be a type in an arbitrary universe, with no finiteness or nonemptiness assumption, and let GGG be a simple graph on VVV, with symmetric irreflexive adjacency relation ∼G\sim_G∼G​. Let n∈Nn\in\mathbb Nn∈N, Dn={0,…,n−1}D_n=\{0,\ldots,n-1\}Dn​={0,…,n−1} (empty if n=0n=0n=0), and let H=(e,ν,ϕ)H=(e,\nu,\phi)H=(e,ν,ϕ) be three permutations of DnD_nDn​ with ν(ϕ(e(x)))=x\nu(\phi(e(x)))=xν(ϕ(e(x)))=x for every x∈Dnx\in D_nx∈Dn​. A representation consists of a function r:Dn→Vr:D_n\to Vr:Dn​→V with (∃j∈Z, ϕj(x)=y)  ⟺  r(x)=r(y)(\exists j\in\mathbb Z,\ \phi^j(x)=y)\iff r(x)=r(y)(∃j∈Z, ϕj(x)=y)⟺r(x)=r(y) for all x,y∈Dnx,y\in D_nx,y∈Dn​, and v∼Gw  ⟺  ∃x∈Dn, r(x)=v ∧ r(e(x))=wv\sim_G w\iff\exists x\in D_n,\ r(x)=v\ \wedge\ r(e(x))=wv∼G​w⟺∃x∈Dn​, r(x)=v ∧ r(e(x))=w for all v,w∈Vv,w\in Vv,w∈V, using inverse powers for negative jjj. No surjectivity of rrr is required; vertices outside its image are isolated. There is no condition on cycle counts, an involution, or node arities. For n=0n=0n=0, such a representation exists exactly when GGG has no adjacent pair, even if VVV is nonempty or infinite.

FaceRepresentation.bridgeless. Let VVV be a type in an arbitrary universe, with no finiteness or nonemptiness assumption, and let GGG be a simple graph on VVV, with symmetric irreflexive adjacency relation ∼G\sim_G∼G​. Let n∈Nn\in\mathbb Nn∈N, Dn={0,…,n−1}D_n=\{0,\ldots,n-1\}Dn​={0,…,n−1} (empty if n=0n=0n=0), and let H=(e,ν,ϕ)H=(e,\nu,\phi)H=(e,ν,ϕ) be three permutations of DnD_nDn​ with ν(ϕ(e(x)))=x\nu(\phi(e(x)))=xν(ϕ(e(x)))=x for every x∈Dnx\in D_nx∈Dn​. A representation consists of a function r:Dn→Vr:D_n\to Vr:Dn​→V with (∃j∈Z, ϕj(x)=y)  ⟺  r(x)=r(y)(\exists j\in\mathbb Z,\ \phi^j(x)=y)\iff r(x)=r(y)(∃j∈Z, ϕj(x)=y)⟺r(x)=r(y) for all x,y∈Dnx,y\in D_nx,y∈Dn​, and v∼Gw  ⟺  ∃x∈Dn, r(x)=v ∧ r(e(x))=wv\sim_G w\iff\exists x\in D_n,\ r(x)=v\ \wedge\ r(e(x))=wv∼G​w⟺∃x∈Dn​, r(x)=v ∧ r(e(x))=w for all v,w∈Vv,w\in Vv,w∈V, using inverse powers for negative jjj. Given any such representation, the conclusion is ∀x∈Dn, ¬∃j∈Z, ϕj(x)=e(x)\forall x\in D_n,\ \neg\exists j\in\mathbb Z,\ \phi^j(x)=e(x)∀x∈Dn​, ¬∃j∈Z, ϕj(x)=e(x): no dart shares a face cycle with its edge image. For n=0n=0n=0, the represented graph has no edges and the conclusion is vacuous.

FaceRepresentation.colorable. Let VVV be a type in an arbitrary universe, with no finiteness or nonemptiness assumption, and let GGG be a simple graph on VVV, with symmetric irreflexive adjacency relation ∼G\sim_G∼G​. Let n∈Nn\in\mathbb Nn∈N, Dn={0,…,n−1}D_n=\{0,\ldots,n-1\}Dn​={0,…,n−1} (empty if n=0n=0n=0), and let H=(e,ν,ϕ)H=(e,\nu,\phi)H=(e,ν,ϕ) be three permutations of DnD_nDn​ with ν(ϕ(e(x)))=x\nu(\phi(e(x)))=xν(ϕ(e(x)))=x for every x∈Dnx\in D_nx∈Dn​. A representation consists of a function r:Dn→Vr:D_n\to Vr:Dn​→V with (∃j∈Z, ϕj(x)=y)  ⟺  r(x)=r(y)(\exists j\in\mathbb Z,\ \phi^j(x)=y)\iff r(x)=r(y)(∃j∈Z, ϕj(x)=y)⟺r(x)=r(y) for all x,y∈Dnx,y\in D_nx,y∈Dn​, and v∼Gw  ⟺  ∃x∈Dn, r(x)=v ∧ r(e(x))=wv\sim_G w\iff\exists x\in D_n,\ r(x)=v\ \wedge\ r(e(x))=wv∼G​w⟺∃x∈Dn​, r(x)=v ∧ r(e(x))=w for all v,w∈Vv,w\in Vv,w∈V, using inverse powers for negative jjj. For k∈Nk\in\mathbb Nk∈N, a dart coloring is a function c:Dn→{0,…,k−1}c:D_n\to\{0,\ldots,k-1\}c:Dn​→{0,…,k−1} constant on each ϕ\phiϕ-cycle and satisfying c(e(x))≠c(x)c(e(x))\ne c(x)c(e(x))=c(x) for every xxx. A graph coloring is a function b:V→{0,…,k−1}b:V\to\{0,\ldots,k-1\}b:V→{0,…,k−1} with b(v)≠b(w)b(v)\ne b(w)b(v)=b(w) whenever v∼Gwv\sim_G wv∼G​w. Neither coloring must use every color. For every k>0k>0k>0, given a representation and a dart coloring, the conclusion is the existence of a graph coloring. If n=0n=0n=0, the represented graph is edgeless and may have arbitrarily many isolated vertices; the strict requirement k>0k>0k>0 remains in force.

FaceRepresentation.hypermapColorable. Let VVV be a type in an arbitrary universe, with no finiteness or nonemptiness assumption, and let GGG be a simple graph on VVV, with symmetric irreflexive adjacency relation ∼G\sim_G∼G​. Let n∈Nn\in\mathbb Nn∈N, Dn={0,…,n−1}D_n=\{0,\ldots,n-1\}Dn​={0,…,n−1} (empty if n=0n=0n=0), and let H=(e,ν,ϕ)H=(e,\nu,\phi)H=(e,ν,ϕ) be three permutations of DnD_nDn​ with ν(ϕ(e(x)))=x\nu(\phi(e(x)))=xν(ϕ(e(x)))=x for every x∈Dnx\in D_nx∈Dn​. A representation consists of a function r:Dn→Vr:D_n\to Vr:Dn​→V with (∃j∈Z, ϕj(x)=y)  ⟺  r(x)=r(y)(\exists j\in\mathbb Z,\ \phi^j(x)=y)\iff r(x)=r(y)(∃j∈Z, ϕj(x)=y)⟺r(x)=r(y) for all x,y∈Dnx,y\in D_nx,y∈Dn​, and v∼Gw  ⟺  ∃x∈Dn, r(x)=v ∧ r(e(x))=wv\sim_G w\iff\exists x\in D_n,\ r(x)=v\ \wedge\ r(e(x))=wv∼G​w⟺∃x∈Dn​, r(x)=v ∧ r(e(x))=w for all v,w∈Vv,w\in Vv,w∈V, using inverse powers for negative jjj. For k∈Nk\in\mathbb Nk∈N, a dart coloring is a function c:Dn→{0,…,k−1}c:D_n\to\{0,\ldots,k-1\}c:Dn​→{0,…,k−1} constant on each ϕ\phiϕ-cycle and satisfying c(e(x))≠c(x)c(e(x))\ne c(x)c(e(x))=c(x) for every xxx. A graph coloring is a function b:V→{0,…,k−1}b:V\to\{0,\ldots,k-1\}b:V→{0,…,k−1} with b(v)≠b(w)b(v)\ne b(w)b(v)=b(w) whenever v∼Gwv\sim_G wv∼G​w. Neither coloring must use every color. For every k∈Nk\in\mathbb Nk∈N, given a representation and a graph coloring, the conclusion is the existence of a dart coloring. There is no positivity requirement on kkk. If k=0k=0k=0, the graph-coloring hypothesis forces VVV to be empty and the representation function then forces DnD_nDn​ to be empty. Empty domains admit empty colorings.

FaceRepresentation.colorable_iff. Let VVV be a type in an arbitrary universe, with no finiteness or nonemptiness assumption, and let GGG be a simple graph on VVV, with symmetric irreflexive adjacency relation ∼G\sim_G∼G​. Let n∈Nn\in\mathbb Nn∈N, Dn={0,…,n−1}D_n=\{0,\ldots,n-1\}Dn​={0,…,n−1} (empty if n=0n=0n=0), and let H=(e,ν,ϕ)H=(e,\nu,\phi)H=(e,ν,ϕ) be three permutations of DnD_nDn​ with ν(ϕ(e(x)))=x\nu(\phi(e(x)))=xν(ϕ(e(x)))=x for every x∈Dnx\in D_nx∈Dn​. A representation consists of a function r:Dn→Vr:D_n\to Vr:Dn​→V with (∃j∈Z, ϕj(x)=y)  ⟺  r(x)=r(y)(\exists j\in\mathbb Z,\ \phi^j(x)=y)\iff r(x)=r(y)(∃j∈Z, ϕj(x)=y)⟺r(x)=r(y) for all x,y∈Dnx,y\in D_nx,y∈Dn​, and v∼Gw  ⟺  ∃x∈Dn, r(x)=v ∧ r(e(x))=wv\sim_G w\iff\exists x\in D_n,\ r(x)=v\ \wedge\ r(e(x))=wv∼G​w⟺∃x∈Dn​, r(x)=v ∧ r(e(x))=w for all v,w∈Vv,w\in Vv,w∈V, using inverse powers for negative jjj. For k∈Nk\in\mathbb Nk∈N, a dart coloring is a function c:Dn→{0,…,k−1}c:D_n\to\{0,\ldots,k-1\}c:Dn​→{0,…,k−1} constant on each ϕ\phiϕ-cycle and satisfying c(e(x))≠c(x)c(e(x))\ne c(x)c(e(x))=c(x) for every xxx. A graph coloring is a function b:V→{0,…,k−1}b:V\to\{0,\ldots,k-1\}b:V→{0,…,k−1} with b(v)≠b(w)b(v)\ne b(w)b(v)=b(w) whenever v∼Gwv\sim_G wv∼G​w. Neither coloring must use every color. Given a representation and k>0k>0k>0, existence of a dart coloring is equivalent to existence of a graph coloring. Empty dart and vertex sets are included. This assertion imposes k>0k>0k>0 and supplies no equivalence for k=0k=0k=0.

Human review
  • Endorsed by Shuze Chen · Sep 27, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Minghui · Sep 27, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me