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