Exact face-incidence representation and coloring transport
DefinitionFourColor_GraphBridgeNotation: is the dart set, its size, and is the node permutation. Write for the edge and face permutations, with . Edge, node and face counts are numbers of permutation orbits, including singleton orbits. The component count uses the equivalence generated by all three permutations. Planarity means the exact Euler equality , and connectedness means .
A plain hypermap has a fixed-point-free involution . Cubic means every node orbit has size three; precubic means every node orbit has size at most three. Bridgeless means and never lie in the same face orbit. A -coloring is a map 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 ; cubicity, connectedness and lower face-degree bounds are not assumed.
For a simple graph on a vertex type , a face representation supplies with and . Its image is precisely the nonisolated vertices. No planarity or finiteness of is assumed in this interface. Structural Lean lemmas prove bridgelessness and coloring transport for ; 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.
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
Read-back
What the Lean code literally says, in plain math · gpt-6
FaceRepresentation. Let be a type in an arbitrary universe, with no finiteness or nonemptiness assumption, and let be a simple graph on , with symmetric irreflexive adjacency relation . Let , (empty if ), and let be three permutations of with for every . A representation consists of a function with for all , and for all , using inverse powers for negative . No surjectivity of is required; vertices outside its image are isolated. There is no condition on cycle counts, an involution, or node arities. For , such a representation exists exactly when has no adjacent pair, even if is nonempty or infinite.
FaceRepresentation.bridgeless. Let be a type in an arbitrary universe, with no finiteness or nonemptiness assumption, and let be a simple graph on , with symmetric irreflexive adjacency relation . Let , (empty if ), and let be three permutations of with for every . A representation consists of a function with for all , and for all , using inverse powers for negative . Given any such representation, the conclusion is : no dart shares a face cycle with its edge image. For , the represented graph has no edges and the conclusion is vacuous.
FaceRepresentation.colorable. Let be a type in an arbitrary universe, with no finiteness or nonemptiness assumption, and let be a simple graph on , with symmetric irreflexive adjacency relation . Let , (empty if ), and let be three permutations of with for every . A representation consists of a function with for all , and for all , using inverse powers for negative . For , a dart coloring is a function constant on each -cycle and satisfying for every . A graph coloring is a function with whenever . Neither coloring must use every color. For every , given a representation and a dart coloring, the conclusion is the existence of a graph coloring. If , the represented graph is edgeless and may have arbitrarily many isolated vertices; the strict requirement remains in force.
FaceRepresentation.hypermapColorable. Let be a type in an arbitrary universe, with no finiteness or nonemptiness assumption, and let be a simple graph on , with symmetric irreflexive adjacency relation . Let , (empty if ), and let be three permutations of with for every . A representation consists of a function with for all , and for all , using inverse powers for negative . For , a dart coloring is a function constant on each -cycle and satisfying for every . A graph coloring is a function with whenever . Neither coloring must use every color. For every , given a representation and a graph coloring, the conclusion is the existence of a dart coloring. There is no positivity requirement on . If , the graph-coloring hypothesis forces to be empty and the representation function then forces to be empty. Empty domains admit empty colorings.
FaceRepresentation.colorable_iff. Let be a type in an arbitrary universe, with no finiteness or nonemptiness assumption, and let be a simple graph on , with symmetric irreflexive adjacency relation . Let , (empty if ), and let be three permutations of with for every . A representation consists of a function with for all , and for all , using inverse powers for negative . For , a dart coloring is a function constant on each -cycle and satisfying for every . A graph coloring is a function with whenever . Neither coloring must use every color. Given a representation and , existence of a dart coloring is equivalent to existence of a graph coloring. Empty dart and vertex sets are included. This assertion imposes and supplies no equivalence for .
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.