Lax3.ModelChecking
First-order model checking on nowhere dense classes in almost linear time
concepts/Lax3/ModelChecking.lean · lax-3
No public endorsements yet.
Loading review…
Sign in with ORCIDConcept map
Evidence
Each proof establishes this claim relative to its assumptions.
Theorem
Deciding a first-order sentence is fixed-parameter tractable on every nowhere dense class of graphs, in almost linear time on a word random access machine: for every nowhere dense class, every sentence φ and every ε > 0 there are one program, one constant c and one time bound T with T(x) ≤ c · (|x| + 1)^(1+ε), such that at every word length w, on every member of the class given in compressed sparse row form as a word x each of whose entries v satisfies c(|x| + v + 1)² ≤ 2^w, the program halts within T(x) steps and writes if φ holds in the graph and if it does not.
This is the theorem of Grohe, Kreutzer and Siebertz (JACM 2017), with the algorithm realized on the word RAM of Lax67. Nowhere denseness is the exact limit of this kind of tractability on monotone classes, and the input is the graph alone: unlike the Courcelle theorem of Lax11, which is handed a k-expression alongside the graph, every auxiliary object the algorithm consumes — orderings, neighborhood covers, splitter moves, distance profiles — is computed from the input. That computation is the main algorithmic weight of the theorem.
Lean source view on GitHub
| 1 | import Lax3.FirstOrder |
| 2 | import Lax12.NowhereDenseClasses |
| 3 | import Lax67.RamComputes |
| 4 | import Lax11.GraphEncoding |
| 5 | import Mathlib.Analysis.SpecialFunctions.Pow.Real |
| 6 | |
| 7 | /-! |
| 8 | --- |
| 9 | title: First-order model checking on nowhere dense classes in almost linear time |
| 10 | type: theorem |
| 11 | --- |
| 12 | Deciding a first-order sentence is fixed-parameter tractable on every |
| 13 | nowhere dense class of graphs, in almost linear time on a word random |
| 14 | access machine: for every nowhere dense class, every sentence φ and |
| 15 | every ε > 0 there are one program, one constant *c* and one time bound |
| 16 | *T* with *T*(x) ≤ *c* · (|x| + 1)^(1+ε), such that at every word |
| 17 | length *w*, on every member of the class given in compressed sparse |
| 18 | row form as a word *x* each of whose entries *v* satisfies |
| 19 | *c*(|x| + *v* + 1)² ≤ 2^*w*, the program halts within *T*(x) steps and |
| 20 | writes `1` if φ holds in the graph and `0` if it does not. |
| 21 | |
| 22 | This is the theorem of Grohe, Kreutzer and Siebertz (JACM 2017), with |
| 23 | the algorithm realized on the word RAM of Lax67. Nowhere denseness is |
| 24 | the exact limit of this kind of tractability on monotone classes, and |
| 25 | the input is the graph *alone*: unlike the Courcelle theorem of Lax11, |
| 26 | which is handed a k-expression alongside the graph, every auxiliary |
| 27 | object the algorithm consumes — orderings, neighborhood covers, |
| 28 | splitter moves, distance profiles — is computed from the input. That |
| 29 | computation is the main algorithmic weight of the theorem. |
| 30 | |
| 31 | # Formalization notes |
| 32 | |
| 33 | The statement follows the house pattern of Lax11's Courcelle axiom: |
| 34 | program and constant after the class data, the sentence and ε; before |
| 35 | the graph and the word length; inputs restricted to encodings whose |
| 36 | entries fit the word length; output by a classical `if` on |
| 37 | satisfaction. The differences are the ones the theorem is about — and |
| 38 | one of them is that side condition, which is *squared* here; see the |
| 39 | deviation recorded below. The hypothesis is |
| 40 | `Lax12.NowhereDense` verbatim — the endorsed shallow-minor form, not a |
| 41 | restatement. The input predicate is `Lax11.EncodesGraph` alone: no |
| 42 | expression, no ordering, no promise beyond membership in the class. |
| 43 | The time bound cannot be the Courcelle form `c * (x.length + 1)`, |
| 44 | since `n^(1+ε)` has no elementary spelling over ℕ: the bound function |
| 45 | `T : List ℕ → ℕ` is existentially quantified and pinned by the |
| 46 | real-valued side condition `(T x : ℝ) ≤ c * ((x.length : ℝ) + 1) ^ |
| 47 | (1 + ε)` — the same real-exponent idiom as Lax12's subpolynomial |
| 48 | bounds, whose `^` is `Real.rpow`. |
| 49 | |
| 50 | The sentence ranges over plain first-order logic on graphs, `FO 0` of |
| 51 | this submission — adjacency and equality, no colors: colors and |
| 52 | distance atoms are working machinery of the proof, and surfacing them |
| 53 | in the headline would weaken it (a statement over colored graphs |
| 54 | follows by the standard encoding of colors as input, and the distance |
| 55 | logic's headline role is played by the locality theorem concept). The |
| 56 | parameter dependence f(φ, ε, C) of the fixed-parameter claim lives in |
| 57 | the existential `c` and `T`, as in the source; the class enters |
| 58 | through the choice of `c` and `T` only, the program depending on |
| 59 | finitely many of its excluded-minor thresholds. |
| 60 | |
| 61 | **Deviation, deliberate: the word-length side condition is squared.** |
| 62 | Lax11's Courcelle axiom admits an encoding `x` at word length `w` when |
| 63 | `c * (x.length + v + 1) ≤ 2 ^ w`; here the requirement is |
| 64 | `c * (x.length + v + 1) ^ 2 ≤ 2 ^ w`. Since the statement quantifies |
| 65 | over *every* `w`, the smallest admissible one is in scope, and under |
| 66 | the Courcelle form that is `2 ^ w < 2 * c * (|x| + max x + 1)` — a |
| 67 | machine that can address only linearly many of its own cells, because |
| 68 | Lax67's RAM has `2 ^ w` cells and reduces every address modulo `2 ^ w`. |
| 69 | Squaring moves the smallest admissible word length from |
| 70 | `log |x| + O(1)` to `2 * log |x| + O(1)`: a constant factor in `w`, and |
| 71 | a quadratic factor in addressable memory. |
| 72 | |
| 73 | This is a genuine weakening — the program is excused from the narrowest |
| 74 | word lengths — and it is recorded rather than hidden for that reason. |
| 75 | It is made because the algorithm this submission formalizes computes, |
| 76 | at every node of its recursion, a sparse neighborhood cover whose |
| 77 | cluster family has `n^(1+δ)` total size, and the augmentation chain |
| 78 | behind that cover's degree bound is superlinear in the same way. Under |
| 79 | the linear form no such algorithm can be written down at all, whatever |
| 80 | its running time, so the side condition would be deciding a question |
| 81 | about machines that the theorem is not about. |
| 82 | |
| 83 | Two things the deviation does *not* do. It does not change the time |
| 84 | bound, which is still `n^(1+ε)` for every ε > 0; and it does not touch |
| 85 | Lax11, whose axiom keeps the linear form — the Courcelle algorithm runs |
| 86 | in linear space and has no need of this. If a later revision makes the |
| 87 | cover streaming rather than materialized, so that the whole algorithm |
| 88 | runs in linear space, the linear side condition can be restored and the |
| 89 | statement strengthened; that possibility is why `^ 2` is written out |
| 90 | rather than folded into `c`. |
| 91 | |
| 92 | The exponent is `2` and not `1 + δ` because δ = ε/(ℓ+1) depends on the |
| 93 | class and on ε, and a side condition that varied with them would make |
| 94 | the admissible input set vary with the parameter — the fixed exponent |
| 95 | covers every δ ≤ 1 uniformly and keeps the input predicate a property |
| 96 | of the encoding alone. |
| 97 | -/ |
| 98 | |
| 99 | namespace Lax3.ModelChecking |
| 100 | |
| 101 | open Lax3.FirstOrder |
| 102 | open Lax12.GraphClasses Lax12.NowhereDenseClasses |
| 103 | open Lax67.Ram Lax67.RamComputes |
| 104 | open Lax11.GraphEncoding |
| 105 | |
| 106 | open Classical in |
| 107 | /-- **First-order model checking on nowhere dense classes** (Grohe– |
| 108 | Kreutzer–Siebertz): for every nowhere dense class, sentence and |
| 109 | ε > 0, there are a program, a constant `c` and a time bound `T` with |
| 110 | `T x ≤ c * (|x| + 1) ^ (1 + ε)`, such that at every word length `w`, |
| 111 | on every member of the class in compressed sparse row form as a word |
| 112 | `x` each of whose entries `v` satisfies `c * (x.length + v + 1) ^ 2 ≤ |
| 113 | 2 ^ w`, the program halts within `T x` steps, having written `1` if |
| 114 | the sentence holds in the graph and `0` otherwise. -/ |
| 115 | axiom exists_almostLinearTime_program_modelChecking : |
| 116 | ∀ (C : GraphClass), NowhereDense C → |
| 117 | ∀ (φ : FO 0) (ε : ℝ), 0 < ε → |
| 118 | ∃ (p : Program) (c : ℕ) (T : List ℕ → ℕ), |
| 119 | (∀ x : List ℕ, (T x : ℝ) ≤ c * ((x.length : ℝ) + 1) ^ (1 + ε)) ∧ |
| 120 | ∀ (n : ℕ) (G : SimpleGraph (Fin n)) (w : ℕ), C n G → |
| 121 | ComputesInTime w p |
| 122 | {x | EncodesGraph x n G ∧ ∀ v ∈ x, c * (x.length + v + 1) ^ 2 ≤ 2 ^ w} |
| 123 | (fun _ => if Sat G Fin.elim0 φ then [1] else [0]) |
| 124 | T |
| 125 | |
| 126 | end Lax3.ModelChecking |
| 127 |
Formalization notes
The statement follows the house pattern of Lax11's Courcelle axiom: program and constant after the class data, the sentence and ε; before the graph and the word length; inputs restricted to encodings whose entries fit the word length; output by a classical on satisfaction. The differences are the ones the theorem is about — and one of them is that side condition, which is squared here; see the deviation recorded below. The hypothesis is verbatim — the endorsed shallow-minor form, not a restatement. The input predicate is alone: no expression, no ordering, no promise beyond membership in the class. The time bound cannot be the Courcelle form , since has no elementary spelling over ℕ: the bound function is existentially quantified and pinned by the real-valued side condition — the same real-exponent idiom as Lax12's subpolynomial bounds, whose `^` is .
The sentence ranges over plain first-order logic on graphs, of this submission — adjacency and equality, no colors: colors and distance atoms are working machinery of the proof, and surfacing them in the headline would weaken it (a statement over colored graphs follows by the standard encoding of colors as input, and the distance logic's headline role is played by the locality theorem concept). The parameter dependence f(φ, ε, C) of the fixed-parameter claim lives in the existential and , as in the source; the class enters through the choice of and only, the program depending on finitely many of its excluded-minor thresholds.
Deviation, deliberate: the word-length side condition is squared. Lax11's Courcelle axiom admits an encoding at word length when ; here the requirement is . Since the statement quantifies over every , the smallest admissible one is in scope, and under the Courcelle form that is — a machine that can address only linearly many of its own cells, because Lax67's RAM has cells and reduces every address modulo . Squaring moves the smallest admissible word length from to : a constant factor in , and a quadratic factor in addressable memory.
This is a genuine weakening — the program is excused from the narrowest word lengths — and it is recorded rather than hidden for that reason. It is made because the algorithm this submission formalizes computes, at every node of its recursion, a sparse neighborhood cover whose cluster family has total size, and the augmentation chain behind that cover's degree bound is superlinear in the same way. Under the linear form no such algorithm can be written down at all, whatever its running time, so the side condition would be deciding a question about machines that the theorem is not about.
Two things the deviation does not do. It does not change the time bound, which is still for every ε > 0; and it does not touch Lax11, whose axiom keeps the linear form — the Courcelle algorithm runs in linear space and has no need of this. If a later revision makes the cover streaming rather than materialized, so that the whole algorithm runs in linear space, the linear side condition can be restored and the statement strengthened; that possibility is why is written out rather than folded into .
The exponent is and not because δ = ε/(ℓ+1) depends on the class and on ε, and a side condition that varied with them would make the admissible input set vary with the parameter — the fixed exponent covers every δ ≤ 1 uniformly and keeps the input predicate a property of the encoding alone.
Used by
none
From Mathlib
Community review
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above; your ORCID profile must share a public name.
0 comments