Documentation

CslibFrontier.Logics.FirstOrder.Operator.TransitiveClosure

First-order logic with tuple transitive closure #

The operator of width k binds two k-tuples in one formula body and is applied to two k-tuples of terms. Its interpretation is the reflexive transitive closure of the relation defined by the body. Free parameters are held fixed along the path, and bodies may contain nested closure operators. Width zero is allowed: there is one empty tuple, even on an empty domain, and its reflexive reachability always holds.

Main definitions #

Main results #

This file provides logical syntax and semantics, not a complexity-class capture theorem.

References #

def Cslib.Logic.FO.TC.pair {A : Type u_1} {k : ℕ} (xs ys : Fin k → A) :
Fin (2 * k) → A

Concatenate equal-length tuples, with the resulting arity written as 2 * k.

Instances For
    def Cslib.Logic.FO.TC.left {A : Type u_1} {k : ℕ} (xs : Fin (2 * k) → A) :
    Fin k → A

    The source tuple of a closure application.

    Instances For
      def Cslib.Logic.FO.TC.right {A : Type u_1} {k : ℕ} (xs : Fin (2 * k) → A) :
      Fin k → A

      The target tuple of a closure application.

      Instances For
        @[simp]
        theorem Cslib.Logic.FO.TC.left_pair {A : Type u_1} {k : ℕ} (xs ys : Fin k → A) :
        left (pair xs ys) = xs

        Concatenation preserves the source tuple.

        @[simp]
        theorem Cslib.Logic.FO.TC.right_pair {A : Type u_1} {k : ℕ} (xs ys : Fin k → A) :
        right (pair xs ys) = ys

        Concatenation preserves the target tuple.

        @[simp]
        theorem Cslib.Logic.FO.TC.pair_left_right {A : Type u_1} {k : ℕ} (xs : Fin (2 * k) → A) :
        pair (left xs) (right xs) = xs

        A closure tuple is the concatenation of its source and target tuples.

        Tuple closure binds two tuples and no relation variables.

        Instances For

          Closure is positive in its single body and imposes no local relation constraints.

          Instances For

            Interpret closure as reflexive reachability between endpoint tuples.

            Instances For

              Enlarging the body relation preserves all paths.

              def Cslib.Logic.FO.TC.tc {L : FirstOrder.Language} {Γ : List ℕ} {α : Type w} {k : ℕ} (body : Operator.Formula L shape Γ (α ⊕ Fin (2 * k))) (args : Fin (2 * k) → L.Term α) :

              Apply tuple closure to a body with two locally bound endpoint tuples.

              Instances For
                @[simp]
                theorem Cslib.Logic.FO.TC.wellFormed_tc {L : FirstOrder.Language} {Γ : List ℕ} {α : Type w} {k : ℕ} (body : Operator.Formula L shape Γ (α ⊕ Fin (2 * k))) (args : Fin (2 * k) → L.Term α) :

                Closure adds no formation condition beyond those already present in its body.

                @[simp]
                theorem Cslib.Logic.FO.TC.realize_tc {L : FirstOrder.Language} {Γ : List ℕ} {α : Type w} {M : Type z} [L.Structure M] {k : ℕ} (body : Operator.Formula L shape Γ (α ⊕ Fin (2 * k))) (args : Fin (2 * k) → L.Term α) (ρ : Operator.RelEnv Γ M) (v : α → M) :
                Operator.Formula.Realize interpretation (tc body args) (fun {k : ℕ} => ρ) v ↔ Relation.ReflTransGen (fun (xs ys : Fin k → M) => Operator.Formula.Realize interpretation body (fun {k : ℕ} => ρ) (Sum.elim v (pair xs ys))) (fun (i : Fin k) => FirstOrder.Language.Term.realize v (left args i)) fun (i : Fin k) => FirstOrder.Language.Term.realize v (right args i)

                Closure holds exactly when a finite path connects the evaluated endpoint tuples.

                theorem Cslib.Logic.FO.TC.realize_tc_pair {L : FirstOrder.Language} {Γ : List ℕ} {α : Type w} {M : Type z} [L.Structure M] {k : ℕ} (body : Operator.Formula L shape Γ (α ⊕ Fin (2 * k))) (xs ys : Fin k → L.Term α) (ρ : Operator.RelEnv Γ M) (v : α → M) :
                Operator.Formula.Realize interpretation (tc body (pair xs ys)) (fun {k : ℕ} => ρ) v ↔ Relation.ReflTransGen (fun (us vs : Fin k → M) => Operator.Formula.Realize interpretation body (fun {k : ℕ} => ρ) (Sum.elim v (pair us vs))) (fun (i : Fin k) => FirstOrder.Language.Term.realize v (xs i)) fun (i : Fin k) => FirstOrder.Language.Term.realize v (ys i)

                Applying closure to concatenated endpoint terms realizes ordinary tuple reachability.

                theorem Cslib.Logic.FO.TC.realize_tc_refl {L : FirstOrder.Language} {Γ : List ℕ} {α : Type w} {M : Type z} [L.Structure M] {k : ℕ} (body : Operator.Formula L shape Γ (α ⊕ Fin (2 * k))) (xs : Fin k → L.Term α) (ρ : Operator.RelEnv Γ M) (v : α → M) :
                Operator.Formula.Realize interpretation (tc body (pair xs xs)) (fun {k : ℕ} => ρ) v

                The empty path makes every tuple reachable from itself.

                theorem Cslib.Logic.FO.TC.realize_tc_of_body {L : FirstOrder.Language} {Γ : List ℕ} {α : Type w} {M : Type z} [L.Structure M] {k : ℕ} (body : Operator.Formula L shape Γ (α ⊕ Fin (2 * k))) (xs ys : Fin k → L.Term α) (ρ : Operator.RelEnv Γ M) (v : α → M) (h : Operator.Formula.Realize interpretation body (fun {k : ℕ} => ρ) (Sum.elim v (pair (fun (i : Fin k) => FirstOrder.Language.Term.realize v (xs i)) fun (i : Fin k) => FirstOrder.Language.Term.realize v (ys i)))) :
                Operator.Formula.Realize interpretation (tc body (pair xs ys)) (fun {k : ℕ} => ρ) v

                Every edge defined by the body is a closure path of length one.

                theorem Cslib.Logic.FO.TC.realize_tc_trans {L : FirstOrder.Language} {Γ : List ℕ} {α : Type w} {M : Type z} [L.Structure M] {k : ℕ} (body : Operator.Formula L shape Γ (α ⊕ Fin (2 * k))) (xs ys zs : Fin k → L.Term α) (ρ : Operator.RelEnv Γ M) (v : α → M) (hxy : Operator.Formula.Realize interpretation (tc body (pair xs ys)) (fun {k : ℕ} => ρ) v) (hyz : Operator.Formula.Realize interpretation (tc body (pair ys zs)) (fun {k : ℕ} => ρ) v) :
                Operator.Formula.Realize interpretation (tc body (pair xs zs)) (fun {k : ℕ} => ρ) v

                Paths with a common intermediate tuple compose.