While this submission is a draft, it cannot be used by other submissions.

Finite relational vocabularies and structures

Lax512892.RelationalStructures · concepts/Lax512892/RelationalStructures.lean · lax-512892

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

    A finite relational vocabulary consists of finitely many relation symbols, each with a specified finite arity, and finitely many constant symbols. A structure interprets every relation symbol as a relation of the corresponding arity and every constant symbol as an element of its carrier.

    This is the notion of relational vocabulary used in the stated version of Gaifman's theorem. Function symbols of positive arity are deliberately absent. The theorem will quantify over finite carrier types, while the definitions in this file make sense over any carrier type.

    Concept map
    1 concept; 3 descendants hidden
    100%
    Open claimDefinitionThis conceptRelated conceptA → B: B builds on A

    Lean source view on GitHub

    1import Mathlib.Data.Fin.Tuple.Basic
    2
    3/-!
    4---
    5title: Finite relational vocabularies and structures
    6type: definition
    7---
    8A finite relational vocabulary consists of finitely many relation symbols, each
    9with a specified finite arity, and finitely many constant symbols. A structure
    10interprets every relation symbol as a relation of the corresponding arity and
    11every constant symbol as an element of its carrier.
    12
    13This is the notion of relational vocabulary used in the stated version of
    14Gaifman's theorem. Function symbols of positive arity are deliberately absent.
    15The theorem will quantify over finite carrier types, while the definitions in
    16this file make sense over any carrier type.
    17
    18# Formalization notes
    19
    20The relation symbols are positions in `relationArities`; the entry at a position
    21is that symbol's arity. Thus finiteness is built into the type of a vocabulary,
    22rather than imposed by a typeclass side condition. Constants are represented by
    23`Fin constantCount`. A structure on an empty carrier can exist exactly when the
    24vocabulary has no constants, matching the usual convention.
    25-/
    26
    27namespace Lax512892.RelationalStructures
    28
    29/-- A finite relational vocabulary: a finite list of relation arities and a
    30finite number of constant symbols. -/
    31structure Vocabulary where
    32 /-- One arity for each relation symbol. -/
    33 relationArities : List ℕ
    34 /-- The number of constant symbols. -/
    35 constantCount : ℕ
    36
    37namespace Vocabulary
    38
    39/-- The finite type of relation symbols of `σ`. -/
    40abbrev Relation (σ : Vocabulary) := Fin σ.relationArities.length
    41
    42/-- The arity of a relation symbol. -/
    43def arity (σ : Vocabulary) (R : σ.Relation) : ℕ :=
    44 σ.relationArities.get R
    45
    46/-- The finite type of constant symbols of `σ`. -/
    47abbrev Constant (σ : Vocabulary) := Fin σ.constantCount
    48
    49end Vocabulary
    50
    51/-- An interpretation of the relational vocabulary `σ` on the carrier `M`. -/
    52structure Structure (σ : Vocabulary) (M : Type*) where
    53 /-- Interpretation of every relation symbol as a relation of its arity. -/
    54 relation : (R : σ.Relation) → (Fin (σ.arity R) → M) → Prop
    55 /-- Interpretation of every constant symbol. -/
    56 constant : σ.Constant → M
    57
    58end Lax512892.RelationalStructures
    59
    Formalization notes

    The relation symbols are positions in relationAritiesrelationArities; the entry at a position is that symbol's arity. Thus finiteness is built into the type of a vocabulary, rather than imposed by a typeclass side condition. Constants are represented by FinconstantCountFin constantCount. A structure on an empty carrier can exist exactly when the vocabulary has no constants, matching the usual convention.

    Builds on

    none

    Used by
    From Mathlib

    Discussion

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

    Loading discussion…