Draft — mutable and not usable as a dependency; its citation marks the draft state.

Lax3.ModelChecking

First-order model checking on nowhere dense classes in almost linear time

concepts/Lax3/ModelChecking.lean · lax-3

proven

Loading review…

Sign in with ORCID

Community review

Flags

Each flag is tied to a public ORCID identity and explains why this concept may be incorrect.

No flags have been submitted.

    Community review

    Flag this concept

    State precisely what appears incorrect. This explanation will be public under your ORCID name.

    No source line selected.

    Concept map

    Proven claimDefinitionThis conceptRelated conceptA → B: B builds on A

    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 11 if φ holds in the graph and 00 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

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

    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 ifif 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 Lax12.NowhereDenseLax12.NowhereDense verbatim — the endorsed shallow-minor form, not a restatement. The input predicate is Lax11.EncodesGraphLax11.EncodesGraph alone: no expression, no ordering, no promise beyond membership in the class. The time bound cannot be the Courcelle form c(x.length+1)c * (x.length + 1), since n(1+ε)n^(1+ε) has no elementary spelling over ℕ: the bound function T:ListNNT : List ℕ → ℕ is existentially quantified and pinned by the real-valued side condition (Tx:R)c((x.length:R)+1)(1+ε)(T x : ℝ) ≤ c * ((x.length : ℝ) + 1) ^ (1 + ε) — the same real-exponent idiom as Lax12's subpolynomial bounds, whose `^` is Real.rpowReal.rpow.

    The sentence ranges over plain first-order logic on graphs, FO0FO 0 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 cc and TT, as in the source; the class enters through the choice of cc and TT 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 xx at word length ww when c(x.length+v+1)2wc * (x.length + v + 1) ≤ 2 ^ w; here the requirement is c(x.length+v+1)22wc * (x.length + v + 1) ^ 2 ≤ 2 ^ w. Since the statement quantifies over every ww, the smallest admissible one is in scope, and under the Courcelle form that is 2w<2c(x+maxx+1)2 ^ w < 2 * c * (|x| + max x + 1) — a machine that can address only linearly many of its own cells, because Lax67's RAM has 2w2 ^ w cells and reduces every address modulo 2w2 ^ w. Squaring moves the smallest admissible word length from logx+O(1)log |x| + O(1) to 2logx+O(1)2 * log |x| + O(1): a constant factor in ww, 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 n(1+δ)n^(1+δ) 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 n(1+ε)n^(1+ε) 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 2^ 2 is written out rather than folded into cc.

    The exponent is 22 and not 1+δ1 + δ 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.

    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

    Loading discussion…