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

Lax3.ColoredGraphs

Colored graphs and walk distance

concepts/Lax3/ColoredGraphs.lean · lax-3

definition

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

    Definition

    An L-colored graph on n vertices is a graph on the vertex set {0, …, n − 1} together with L distinguished sets of vertices, its color classes. The two halves are passed side by side rather than bundled into a single object: a statement about colored graphs takes a SimpleGraph(Finn)SimpleGraph (Fin n) and a ColoringnLColoring n L as separate arguments.

    Two vertices are within distance d of each other if some walk between them has length at most d, and the ball of radius r around a vertex is the set of vertices within distance r of it. This is the metric the logic of this submission measures with: its distance atoms and its local quantifiers are all radius bounds in this sense.

    Colored graphs are the structures the first-order logic of this submission is interpreted in. The source theorem (arXiv:2606.23180) states its locality theorem over arbitrary finite relational signatures; fixing the signature to one binary symmetric relation plus finitely many unary predicates is a genuine specialization, and it is stated here as one. It is also the full strength that model checking on a class of graphs consumes: the Gaifman graph of a colored graph is the graph itself, every structure the algorithm builds along the way is the input graph with edges deleted and colors added, and no step ever leaves this signature. The same move is made by the MSO concept of submission Lax11, which pins its logic to MSO₁ rather than claiming a version of second-order quantification it does not formalize.

    Lean source view on GitHub

    1import Mathlib.Combinatorics.SimpleGraph.Walk.Basic
    2
    3/-!
    4---
    5title: Colored graphs and walk distance
    6type: definition
    7---
    8An *L*-colored graph on *n* vertices is a graph on the vertex set
    9{0, …, *n* − 1} together with *L* distinguished sets of vertices, its
    10color classes. The two halves are passed side by side rather than
    11bundled into a single object: a statement about colored graphs takes a
    12`SimpleGraph (Fin n)` and a `Coloring n L` as separate arguments.
    13
    14Two vertices are within distance *d* of each other if some walk between
    15them has length at most *d*, and the ball of radius *r* around a vertex
    16is the set of vertices within distance *r* of it. This is the metric the
    17logic of this submission measures with: its distance atoms and its local
    18quantifiers are all radius bounds in this sense.
    19
    20Colored graphs are the structures the first-order logic of this
    21submission is interpreted in. The source theorem (arXiv:2606.23180)
    22states its locality theorem over arbitrary finite relational signatures;
    23fixing the signature to one binary symmetric relation plus finitely many
    24unary predicates is a genuine specialization, and it is stated here as
    25one. It is also the full strength that model checking on a class of
    26*graphs* consumes: the Gaifman graph of a colored graph is the graph
    27itself, every structure the algorithm builds along the way is the input
    28graph with edges deleted and colors added, and no step ever leaves this
    29signature. The same move is made by the MSO concept of submission Lax11,
    30which pins its logic to MSO₁ rather than claiming a version of
    31second-order quantification it does not formalize.
    32
    33# Formalization notes
    34
    35A colored graph is a pair of arguments, not a structure. Bundling would
    36force a coercion at every one of the many places where the graph changes
    37and the coloring does not (deleting the edges incident to a vertex set)
    38or the coloring changes and the graph does not (recording distance
    39profiles as new colors), and the concepts of the submissions this one
    40builds on already pass their data unbundled — the set environments of
    41Lax11's MSO satisfaction, the graph classes of Lax12. Colors are `Set`s
    42of vertices rather than a predicate `Fin L → Fin n → Prop` for the same
    43reason Lax12 states its vertex sets as `Set`s: the two are definitionally
    44interchangeable and the `Set` form composes with the existing library of
    45`Set.ncard` cardinality lemmas.
    46
    47Only finite structures are considered: the vertex type is `Fin n` and
    48the color index type is `Fin L` throughout. The source's scatter values
    49may in principle be infinite; over finite structures that case
    50degenerates and is not carried.
    51
    52Distance is a predicate on walks, `WithinDist`, and not mathlib's
    53`SimpleGraph.dist` or `SimpleGraph.edist`. Two vertices are within
    54distance `d` exactly when some walk between them has length at most `d`,
    55which needs no connectivity hypothesis, no `ℕ∞` arithmetic and no
    56decidability instance, and — the deciding reason — it is verbatim the
    57vocabulary of the sparsity concepts this submission consumes: Lax12's
    58`DistIndependent` says that every walk between two distinct members of a
    59set is longer than `r`, so its negation and `WithinDist` are the same
    60statement. A translation layer between two notions of distance at that
    61interface would be pure friction.
    62
    63For the same reason, neither `DistIndependent` nor `deleteVerts` is
    64restated here. Both are Lax12 concepts, already endorsed, and this
    65submission uses them as they stand: `deleteVerts G S` — the graph with
    66every edge incident to `S` removed and the vertex type unchanged — is
    67exactly the isolation move this submission's splitter game and its
    68rewriting step perform.
    69
    70`WithinDist` and `ball` are stated for an arbitrary vertex type, as
    71Lax12 states `DistIndependent` and `deleteVerts`, since both are
    72pointwise notions and the proofs consuming them pass through
    73intermediate carriers. Only `Coloring`, which fixes the two index
    74ranges, is tied to `Fin`.
    75-/
    76
    77namespace Lax3.ColoredGraphs
    78
    79/-- A coloring of the vertices `Fin n` by `L` colors: one set of
    80vertices per color. Colors need be neither disjoint nor covering, so a
    81vertex may carry any set of colors. -/
    82abbrev Coloring (n L : ℕ) : Type := Fin L → Set (Fin n)
    83
    84/-- The vertices `u` and `v` are within distance `d` in `G`: some walk
    85from `u` to `v` has length at most `d`. -/
    86def WithinDist {V : Type*} (G : SimpleGraph V) (d : ℕ) (u v : V) : Prop :=
    87 ∃ w : G.Walk u v, w.length ≤ d
    88
    89/-- The ball of radius `r` around `v` in `G`: the vertices within
    90distance `r` of `v`. -/
    91def ball {V : Type*} (G : SimpleGraph V) (r : ℕ) (v : V) : Set V :=
    92 {u | WithinDist G r v u}
    93
    94end Lax3.ColoredGraphs
    95

    Formalization notes

    A colored graph is a pair of arguments, not a structure. Bundling would force a coercion at every one of the many places where the graph changes and the coloring does not (deleting the edges incident to a vertex set) or the coloring changes and the graph does not (recording distance profiles as new colors), and the concepts of the submissions this one builds on already pass their data unbundled — the set environments of Lax11's MSO satisfaction, the graph classes of Lax12. Colors are SetSets of vertices rather than a predicate FinLFinnPropFin L → Fin n → Prop for the same reason Lax12 states its vertex sets as SetSets: the two are definitionally interchangeable and the SetSet form composes with the existing library of Set.ncardSet.ncard cardinality lemmas.

    Only finite structures are considered: the vertex type is FinnFin n and the color index type is FinLFin L throughout. The source's scatter values may in principle be infinite; over finite structures that case degenerates and is not carried.

    Distance is a predicate on walks, WithinDistWithinDist, and not mathlib's SimpleGraph.distSimpleGraph.dist or SimpleGraph.edistSimpleGraph.edist. Two vertices are within distance dd exactly when some walk between them has length at most dd, which needs no connectivity hypothesis, no Nℕ∞ arithmetic and no decidability instance, and — the deciding reason — it is verbatim the vocabulary of the sparsity concepts this submission consumes: Lax12's DistIndependentDistIndependent says that every walk between two distinct members of a set is longer than rr, so its negation and WithinDistWithinDist are the same statement. A translation layer between two notions of distance at that interface would be pure friction.

    For the same reason, neither DistIndependentDistIndependent nor deleteVertsdeleteVerts is restated here. Both are Lax12 concepts, already endorsed, and this submission uses them as they stand: deleteVertsGSdeleteVerts G S — the graph with every edge incident to SS removed and the vertex type unchanged — is exactly the isolation move this submission's splitter game and its rewriting step perform.

    WithinDistWithinDist and ballball are stated for an arbitrary vertex type, as Lax12 states DistIndependentDistIndependent and deleteVertsdeleteVerts, since both are pointwise notions and the proofs consuming them pass through intermediate carriers. Only ColoringColoring, which fixes the two index ranges, is tied to FinFin.

    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…