Gaifman graph, distances, balls and induced substructures

Lax185574.GaifmanGraph · concepts/Lax185574/GaifmanGraph.lean · lax-185574

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.

    Natural Language Statement

    Definition

    The Gaifman graph of a relational structure A with domain V has vertex set V. Two distinct elements are adjacent if they occur together in some tuple of some relation of A. For a structure with unary and binary relations, these are the pairs uv such that (u, v) or (v, u) lies in a binary relation. The distance dist^A(u, v) is the distance in the Gaifman graph, and Ball^A_r(ā) is the set of elements at distance at most r from some entry of the tuple ā.

    For a set B of elements of a relational structure A, the induced substructure A[B] has domain B, and each relation of A is restricted to B. The paper uses A[B] without defining it.

    Concept map
    1 concept
    100%
    DefinitionThis conceptDescendants are omitted for concepts with more than 10 descendants.

    In the paper

    • page 14 of this submission's paper

    Lean source view on GitHub

    1import Mathlib.ModelTheory.Basic
    2import Mathlib.Combinatorics.SimpleGraph.Walk.Basic
    3
    4/-!
    5---
    6title: Gaifman graph, distances, balls and induced substructures
    7type: definition
    8---
    9The *Gaifman graph* of a relational structure A with domain V has
    10vertex set V. Two distinct elements are adjacent if they occur together
    11in some tuple of some relation of A. For a structure with unary and
    12binary relations, these are the pairs uv such that (u, v) or (v, u) lies
    13in a binary relation. The distance dist^A(u, v) is the distance in the
    14Gaifman graph, and Ball^A_r(ā) is the set of elements at distance at
    15most r from some entry of the tuple ā.
    16
    17For a set B of elements of a relational structure A, the *induced
    18substructure* A[B] has domain B, and each relation of A is restricted
    19to B. The paper uses A[B] without defining it.
    20
    21# Formalization notes
    22
    23"At distance at most r" is witnessed by a walk of length at most r, as
    24in `Lax3.ColoredGraphs`. Elements in different components are therefore
    25at infinite distance. The induced substructure is defined for relational
    26languages, where every subset is closed under the (absent) functions.
    27Its domain is the subtype of `B`.
    28-/
    29
    30namespace Lax185574.GaifmanGraph
    31
    32open FirstOrder FirstOrder.Language
    33
    34universe u v z
    35
    36variable {L : Language.{u, v}} {V : Type z} [L.Structure V]
    37
    38variable (L) in
    39/-- The Gaifman graph: distinct elements are adjacent if they occur
    40together in a tuple of some relation. -/
    41def gaifmanGraph : SimpleGraph V :=
    42 SimpleGraph.fromRel fun a b =>
    43 ∃ (l : ℕ) (R : L.Relations l) (x : Fin l → V),
    44 Structure.RelMap R x ∧ a ∈ Set.range x ∧ b ∈ Set.range x
    45
    46/-- The vertices `u` and `v` of the graph `G` are within distance `d`:
    47some walk from `u` to `v` has length at most `d`. -/
    48def WithinDist {W : Type*} (G : SimpleGraph W) (d : ℕ) (u v : W) : Prop :=
    49 ∃ p : G.Walk u v, p.length ≤ d
    50
    51variable (L) in
    52/-- `Ball^A_r(ā)`: the elements within distance `r` of some entry of the
    53tuple `a` in the Gaifman graph. -/
    54def ball (r : ℕ) {k : ℕ} (a : Fin k → V) : Set V :=
    55 {b | ∃ i, WithinDist (gaifmanGraph L (V := V)) r (a i) b}
    56
    57/-- The induced substructure `A[B]` of a relational structure: the
    58relations of `A`, restricted to `B`. -/
    59@[implicit_reducible]
    60def induced [L.IsRelational] (B : Set V) : L.Structure B where
    61 funMap f := isEmptyElim f
    62 RelMap R x := Structure.RelMap R (fun i => (x i : V))
    63
    64end Lax185574.GaifmanGraph
    65
    Formalization notes

    "At distance at most r" is witnessed by a walk of length at most r, as in Lax3.ColoredGraphsLax3.ColoredGraphs. Elements in different components are therefore at infinite distance. The induced substructure is defined for relational languages, where every subset is closed under the (absent) functions. Its domain is the subtype of BB.

    Discussion

    Ask a question or add context. Endorsements and structured flags are kept in the review panel above.

    Loading discussion…