Areas Mathematical logic Second-order logic and extensions of first-order logic Example
Three-colorability in existential monadic second-order logic
Builds on Monadic second-order logicK-colourable graphGraphFagin's theorem
Example
To color a graph with three colors is to choose three sets of vertices, one for each color. So a quantifier over sets of vertices can say that a coloring exists.
A graph is a structure with a symmetric and irreflexive edge relation . It is 3-colorable when there is a map with for every edge . The existential monadic second-order sentence is this: We show that a graph satisfies if and only if it is 3-colorable.
- Let be a proper coloring with the colors . Put , and .
- Every vertex has a color, so every vertex lies in , or , and the first conjunct holds.
- If , then . So and do not lie in the same one of the three sets, and the second conjunct holds.
- Conversely, let satisfy the matrix of . The sets can overlap, so we put if , if , and otherwise.
- By the first conjunct, a vertex with lies in . So each vertex lies in the set that matches its color.
- If and , then and lie in the same set by step 5, and this contradicts the second conjunct. So is proper.
Remarks
Two small graphs
The 5-cycle has the vertices and the edges . We try these sets: Check: the edges join to , to , to , to and to . So no edge stays inside one set. The complete graph fails . Each of its four vertices lies in one of three sets. So two of them share a set by the pigeonhole principle, and these two vertices are adjacent.
Where the sentence sits
The sentence has the form with first-order, so it is in existential MSO (EMSO). It quantifies only over sets of vertices, not over sets of edges, so it is an sentence.
More colors, and the cost of checking
For colors we use set variables and the same two conjuncts. For the sentence defines the bipartite graphs. A program decides 2-colorability in polynomial time, but 3-colorability is NP-complete. So the evaluation of one fixed EMSO sentence on finite graphs can already be NP-complete. This agrees with Fagin's theorem: existential second-order logic defines exactly the properties in NP. On graphs of bounded treewidth, Courcelle's theorem decides in linear time.
Going deeper
For a student
We check on the wheel . It has a 5-cycle and a center that is joined to all five.
- In a proper coloring, the center is adjacent to every other vertex, so its color appears nowhere else. Say the center has color .
- Then the 5-cycle uses only the colors and , so the colors must alternate along it.
- Going around from vertex , the vertices get one color and the vertices get the other.
- Then the edge joins two vertices of the same color. So has no proper 3-coloring, and fails .
Check: a cycle with an odd number of vertices has no 2-coloring, and is odd. The typical use of the sentence is to show that a graph property is in NP, or to apply Courcelle's theorem to it. Watch out: do not require in a proof that , and are disjoint when the sentence does not say so. Our sentence allows overlaps, and step 4 of the example removes them.
Reading path
To understand this page from the ground up, read these 48 pages in order. The foundations come first.
- Arity concept
- Boolean function concept
- Cartesian product concept
- First-order variable concept
- Function concept
- Graph concept
- K-colourable graph concept
- Power set concept
- Proposition concept
- Regular language concept
- Set concept
- String concept
- Tuple concept
- Turing machine concept
- Signature concept
- Logical connective definition
- Conjunction definition
- Disjunction definition
- Material implication definition
- Principle of bivalence concept
- Predicate concept
- Predicate definition
- Structure concept
- Biconditional definition
- Term concept
- Negation concept
- Negation definition
- Atomic formula concept
- Truth table concept
- Material implication concept
- Conjunction concept
- Disjunction concept
- Tautology concept
- Biconditional concept
- Universal quantifier concept
- Logical connective concept
- Existential quantifier concept
- Well-formed formula concept
- Propositional calculus concept
- Satisfaction concept
- First-order logic concept
- Free and bound variables concept
- Sentence concept
- Second-order logic definition
- Second-order logic concept
- Monadic second-order logic concept
- Fagin's theorem statement
- Three-colorability in existential monadic second-order logic example
Further reading
About this page
| Tag | EHH5XEB6BG |
|---|---|
| URI | m2://EHH5XEB6BG |
| Kind | example |
| Writing | W0 stub |
| MSC | 03B16, 03C13, 05C15, 68Q19 |
| Instance of | Monadic second-order logic |
| Part of | Second-order logic and extensions of first-order logic |
| Uses | Monadic second-order logic, K-colourable graph, Graph, Fagin's theorem |
| Changed | 23 November 2026, first written 17 November 2026 |
Markdown · JSON · Edit on GitHub
What this page needs for W1
- an inventory row: the row of the inventory that the node accounts for (0 of 1)
The writing levels say how complete the text of a page is. They do not measure its truth.
History
Each change to this page, from its provenance log. A change by an agent names its run.
| Date | Change | Field | By |
|---|---|---|---|
| 2026-11-17 | add | the whole node | tamnd |
| 2026-11-23 | change | the section Example | tamnd |
| 2026-11-23 | change | the explanation L1 | tamnd |
| 2026-11-23 | change | the explanation L2 | tamnd |
| 2026-11-23 | change | the section Remarks | tamnd |
| 2026-11-23 | change | the field name | tamnd |
What links here
No page links to this page yet.