Euler's Formula for Planar Graphs

lean4-proofgraph-theoryvisualization
VE+F=2V - E + F = 2

Statement

For any connected planar graph embedded in the plane with VV vertices, EE edges, and FF faces (including the unbounded outer face):

VE+F=2V - E + F = 2

This is the Euler characteristic of the sphere, and it holds for any planar embedding of any connected planar graph.

Visualization

K4K_4 embedded in the plane with 4 vertices, 6 edges, and 4 faces:

      1
     /|\
    / | \
   /  |  \
  2---+---3
   \  |  /
    \ | /
     \|/
      4

V = 4  (vertices: 1, 2, 3, 4)
E = 6  (edges: 12, 13, 14, 23, 24, 34)
F = 4  (faces: △123, △124, △134, △234, outer = △234)

Wait — K4K_4 drawn as above yields exactly 4 faces: three triangular inner faces and one outer (unbounded) face:

ItemCount
Vertices VV4
Edges EE6
Faces FF4
VE+FV - E + F46+4=24 - 6 + 4 = \mathbf{2}

Contrast with K5K_5 (V=5,E=10V=5, E=10): any planar embedding would require F=25+10=7F = 2 - 5 + 10 = 7, but since every face has 3\ge 3 edges and each edge borders 2\le 2 faces, we'd need 2E3F2E \ge 3F, i.e. 202120 \ge 21 — contradiction, so K5K_5 is not planar (Kuratowski).

Proof Sketch

  1. Base case: A tree on nn vertices has n1n-1 edges and 1 face (the outer), giving n(n1)+1=2n - (n-1) + 1 = 2.
  2. Inductive step: If GG is not a tree, it has a cycle, hence an edge ee interior to some face. Remove ee: this merges two faces into one, so FF decreases by 1 and EE decreases by 1, leaving VE+FV - E + F unchanged. Repeat until a spanning tree remains.
  3. By induction, every connected planar graph satisfies VE+F=2V - E + F = 2.

Connections

Euler's formula is the topological foundation for the non-planarity of Pythagorean TriplesPythagorean Triplesa=m2n2,  b=2mn,  c=m2+n2a = m^2 - n^2,\; b = 2mn,\; c = m^2 + n^2Complete parametrisation of all integer solutions to a² + b² = c²Read more →-style obstructions (K5K_5 and K3,3K_{3,3} by Kuratowski). It connects to the Handshake LemmaHandshake LemmavVdeg(v)=2E\sum_{v \in V} \deg(v) = 2|E|The sum of all vertex degrees in a finite graph equals twice the number of edges.Read more → via the face-edge incidence count (2E3F2E \ge 3F for triangle-free planar graphs). The Euler characteristic also appears in <a class="concept-link" data-concept="Cayley's Formula (nn2n^{n-2} trees)">Cayley's Formula (nn2n^{n-2} trees) via spanning trees of planar graphs.

Lean4 Proof

-- Mathlib does not yet have the full planar graph Euler formula.
-- We verify the K₄ instance directly: V=4, E=6, F=4, V−E+F=2.

theorem euler_K4 : (4 : Int) - 6 + 4 = 2 := by decide