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

Lax979537.FixedPointSemantics

Semantics and definability in FO(LFP)

concepts/Lax979537/FixedPointSemantics.lean · lax-979537

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.

    Definition and theorem

    First-order operations have their usual semantics. A fixed-point body, with its parameters held fixed, defines an operator on kk-ary relations; the fixed-point formula tests membership of its argument tuple in the least fixed point of that operator. Positivity of an admissible body implies monotonicity; this is an explicit proof obligation.

    A query is FO(LFP)-definable if one admissible formula defines it on every finite ordered structure and every assignment to its free variables. The formula is chosen once for the query, independently of the structure.

    Lean source view on GitHub

    1import Lax979537.FixedPointSyntax
    2import Lax979537.LeastFixedPoints
    3
    4/-!
    5---
    6title: Semantics and definability in FO(LFP)
    7type: definition and theorem
    8---
    9First-order operations have their usual semantics. A fixed-point body,
    10with its parameters held fixed, defines an operator on kk-ary relations;
    11the fixed-point formula tests membership of its argument tuple in the least
    12fixed point of that operator. Positivity of an admissible body implies
    13monotonicity; this is an explicit proof obligation.
    14
    15A query is FO(LFP)-definable if one admissible formula defines it on every
    16finite ordered structure and every assignment to its free variables.
    17The formula is chosen once for the query, independently of the structure.
    18-/
    19
    20namespace Lax979537.FixedPointSemantics
    21
    22open Lax979537.OrderedStructures Lax979537.FixedPointSyntax
    23open Lax979537.LeastFixedPoints
    24
    25abbrev RelationEnv (n : Nat) (ρ : List Nat) :=
    26 (r : Fin ρ.length) → Set (Fin (ρ.get r) → Fin n)
    27
    28def extend {n k : Nat} {ρ : List Nat} (R : Set (Fin k → Fin n))
    29 (η : RelationEnv n ρ) : RelationEnv n (k :: ρ) :=
    30 Fin.cons R η
    31
    32def eval {σ : Vocabulary} {m : Nat} {ρ : List Nat}
    33 (φ : RawFormula σ m ρ) (A : OrderedStructure σ)
    34 (v : Fin m → Fin A.size) (η : RelationEnv A.size ρ) : Prop :=
    35 match φ with
    36 | .truth => True
    37 | .equal x y => v x = v y
    38 | .less x y => v x < v y
    39 | .relation r args => A.relation r (v ∘ args) = true
    40 | .variable r args => η r (v ∘ args)
    41 | .neg ψ => ¬ eval ψ A v η
    42 | .conj ψ χ => eval ψ A v η ∧ eval χ A v η
    43 | .exists' ψ => ∃ a, eval ψ A (Fin.cons a v) η
    44 | .lfp _ body args =>
    45 leastFixedPoint (fun R => {a | eval body A (Fin.append a v) (extend R η)})
    46 (v ∘ args)
    47
    48def bodyOperator {σ : Vocabulary} {m k : Nat} {ρ : List Nat}
    49 (body : RawFormula σ (k + m) (k :: ρ)) (A : OrderedStructure σ)
    50 (v : Fin m → Fin A.size) (η : RelationEnv A.size ρ) :
    51 Set (Fin k → Fin A.size) → Set (Fin k → Fin A.size) :=
    52 fun R => {a | eval body A (Fin.append a v) (extend R η)}
    53
    54axiom positiveBodyMonotone {σ : Vocabulary} {m k : Nat} {ρ : List Nat}
    55 (body : RawFormula σ (k + m) (k :: ρ))
    56 (hbody : body.Admissible) (hpositive : body.positiveAt 0 true)
    57 (A : OrderedStructure σ) (v : Fin m → Fin A.size)
    58 (η : RelationEnv A.size ρ) : Monotone (bodyOperator body A v η)
    59
    60def Satisfies {σ : Vocabulary} {k : Nat} (A : PointedStructure σ k)
    61 (φ : Formula σ k) : Prop :=
    62 eval φ.val A.structureValue A.tuple (fun r => Fin.elim0 r)
    63
    64def Definable {σ : Vocabulary} {k : Nat} (Q : Query σ k) : Prop :=
    65 ∃ φ : Formula σ k, ∀ A, Q A ↔ Satisfies A φ
    66
    67end Lax979537.FixedPointSemantics
    68
    Show Proof

    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…