Documentation

Complexity.Logics.FirstOrder.ProjectionFormula

First-order projection formulas #

A projection chooses a constant or one signed input-relation bit using only numeric information. ProjectionFormula N L α separates the numeric language N from the input language L. Its internal nodes test formulas of N; its leaves are constants or input literals. Consequently neither the choice of input bit nor its polarity can depend on input-relation values.

The syntax is a decision-tree presentation of the mutually exclusive numeric cases in the definition of first-order projections Immerman and Landau, Definition 3.6. Numeric guards may contain quantifiers; quantifier-free interpretations with arbitrary Boolean combinations of input relations are not projections. The numeric vocabulary is a parameter: no interpretation of order or BIT, or machine resource bound, is implicit in this definition.

Main definitions #

Main results #

References #

inductive Cslib.Logic.FO.InputLiteral (L : FirstOrder.Language) (α : Type u_1) :
Type (max u_1 v)

A projection output is a constant or a single input-relation literal. Arguments are variables, so even the address of the input bit is independent of input relations.

Instances For
    def Cslib.Logic.FO.InputLiteral.Realize {L : FirstOrder.Language} {α : Type u_1} {M : Type u_3} [L.Structure M] :
    InputLiteral L α → (α → M) → Prop

    The truth value of a constant or input literal.

    Instances For
      theorem Cslib.Logic.FO.InputLiteral.realize_const {L : FirstOrder.Language} {α : Type u_1} {M : Type u_3} [L.Structure M] (b : Bool) (x : α → M) :
      theorem Cslib.Logic.FO.InputLiteral.realize_rel_false {L : FirstOrder.Language} {α : Type u_1} {M : Type u_3} [L.Structure M] {n : ℕ} (R : L.Relations n) (args : Fin n → α) (x : α → M) :
      (rel R args false).Realize x ↔ FirstOrder.Language.Structure.RelMap R fun (i : Fin n) => x (args i)
      theorem Cslib.Logic.FO.InputLiteral.realize_rel_true {L : FirstOrder.Language} {α : Type u_1} {M : Type u_3} [L.Structure M] {n : ℕ} (R : L.Relations n) (args : Fin n → α) (x : α → M) :
      (rel R args true).Realize x ↔ ¬FirstOrder.Language.Structure.RelMap R fun (i : Fin n) => x (args i)

      Negate a literal, keeping its input address unchanged.

      Instances For
        @[simp]
        theorem Cslib.Logic.FO.InputLiteral.realize_not {L : FirstOrder.Language} {α : Type u_1} {M : Type u_3} [L.Structure M] (l : InputLiteral L α) (x : α → M) :
        def Cslib.Logic.FO.InputLiteral.relabel {L : FirstOrder.Language} {α : Type u_1} {β : Type u_2} (f : α → β) :

        Rename the variables of an input literal.

        Instances For
          @[simp]
          theorem Cslib.Logic.FO.InputLiteral.realize_relabel {L : FirstOrder.Language} {α : Type u_1} {β : Type u_2} {M : Type u_3} [L.Structure M] (f : α → β) (l : InputLiteral L α) (x : β → M) :
          (relabel f l).Realize x ↔ l.Realize (x ∘ f)

          View an input literal as a formula.

          Instances For
            @[simp]
            theorem Cslib.Logic.FO.InputLiteral.realize_toFormula {L : FirstOrder.Language} {α : Type u_1} {M : Type u_3} [L.Structure M] (l : InputLiteral L α) (x : α → M) :
            inductive Cslib.Logic.FO.ProjectionFormula (N : FirstOrder.Language) (L : FirstOrder.Language) (α : Type u_1) :
            Type (max (max (max u u_1) v) v')

            A first-order projection formula: numeric tests may choose between input literals, but input values cannot occur in the tests. N and L are separate vocabularies.

            Instances For

              Translate numeric tests and input literals to the sum language.

              Instances For
                noncomputable def Cslib.Logic.FO.ProjectionFormula.select {N : FirstOrder.Language} {L : FirstOrder.Language} {α : Type u_1} {M : Type u_3} [N.Structure M] (x : α → M) :

                Choose the output literal using only the numeric structure and the variable assignment. There is deliberately no L.Structure M parameter.

                Instances For

                  The output of a projection is exactly one literal selected without inspecting the input relations. This statement holds for every interpretation of the input vocabulary.

                  A leaf is realized as its literal.

                  theorem Cslib.Logic.FO.ProjectionFormula.realize_toFormula_branch {N : FirstOrder.Language} {L : FirstOrder.Language} {α : Type u_1} {M : Type u_3} [N.Structure M] [L.Structure M] (guard : N.Formula α) (yes no : ProjectionFormula N L α) (x : α → M) :
                  (branch guard yes no).toFormula.Realize x ↔ guard.Realize x ∧ yes.toFormula.Realize x ∨ ¬guard.Realize x ∧ no.toFormula.Realize x

                  A branch is realized as its first or second subtree, as its numeric guard holds or not.

                  theorem Cslib.Logic.FO.ProjectionFormula.exists_literal {N : FirstOrder.Language} {L : FirstOrder.Language} {α : Type u_1} {M : Type u_3} [N.Structure M] (p : ProjectionFormula N L α) (x : α → M) :
                  ∃ (l : InputLiteral L α), ∀ (x_1 : L.Structure M), p.toFormula.Realize x ↔ l.Realize x

                  A single literal works for every interpretation of the input relations. The existential choice precedes the input structure: the selected literal cannot depend on input bits.

                  Negate the output, leaving all numeric tests unchanged.

                  Instances For
                    @[simp]
                    theorem Cslib.Logic.FO.ProjectionFormula.select_not {N : FirstOrder.Language} {L : FirstOrder.Language} {α : Type u_1} {M : Type u_3} [N.Structure M] (p : ProjectionFormula N L α) (x : α → M) :
                    select x p.not = (select x p).not

                    Rename every free variable in numeric tests and input literals.

                    Instances For
                      @[simp]
                      theorem Cslib.Logic.FO.ProjectionFormula.select_relabel {N : FirstOrder.Language} {L : FirstOrder.Language} {α : Type u_1} {β : Type u_2} {M : Type u_3} [N.Structure M] (f : α → β) (p : ProjectionFormula N L α) (x : β → M) :
                      theorem Cslib.Logic.FO.ProjectionFormula.realize_relabel {N : FirstOrder.Language} {L : FirstOrder.Language} {α : Type u_1} {β : Type u_2} {M : Type u_3} [N.Structure M] [L.Structure M] (f : α → β) (p : ProjectionFormula N L α) (x : β → M) :
                      def Cslib.Logic.FO.ProjectionFormula.subst {N : FirstOrder.Language} {L : FirstOrder.Language} {α : Type u_1} {β : Type u_2} {N' : FirstOrder.Language} {L' : FirstOrder.Language} (guard : N.Formula α → N'.Formula β) (literal : InputLiteral L α → ProjectionFormula N' L' β) :

                      Substitute numeric tests and input literals independently. In particular, replacing each input literal by a projection preserves the one-input-bit restriction.

                      Instances For
                        theorem Cslib.Logic.FO.ProjectionFormula.realize_subst {N : FirstOrder.Language} {L : FirstOrder.Language} {α : Type u_1} {β : Type u_2} {M : Type u_3} {N' : FirstOrder.Language} {L' : FirstOrder.Language} {M' : Type u_4} [N.Structure M] [L.Structure M] [N'.Structure M'] [L'.Structure M'] (guard : N.Formula α → N'.Formula β) (literal : InputLiteral L α → ProjectionFormula N' L' β) (x : α → M) (y : β → M') (hguard : ∀ (g : N.Formula α), (guard g).Realize y ↔ g.Realize x) (hliteral : ∀ (l : InputLiteral L α), (literal l).toFormula.Realize y ↔ l.Realize x) (p : ProjectionFormula N L α) :
                        (subst guard literal p).toFormula.Realize y ↔ p.toFormula.Realize x

                        Correct substitutions of numeric tests and input literals preserve truth. The source and target structures need not have the same universe or vocabulary.

                        All numeric tests are quantifier-free. The vocabulary is still a parameter; this property alone does not select the classical numeric vocabulary or exclude BIT.

                        Instances For
                          theorem Cslib.Logic.FO.ProjectionFormula.IsQF.branch {N : FirstOrder.Language} {L : FirstOrder.Language} {α : Type u_1} {guard : N.Formula α} {yes no : ProjectionFormula N L α} (hguard : FirstOrder.Language.BoundedFormula.IsQF guard) (hyes : yes.IsQF) (hno : no.IsQF) :

                          Quantifier-free numeric tests give a quantifier-free ordinary formula. Quantifier-freeness of an arbitrary ordinary formula does not ensure it is a projection: it can mix input bits.

                          theorem Cslib.Logic.FO.ProjectionFormula.IsQF.subst {N : FirstOrder.Language} {L : FirstOrder.Language} {α : Type u_1} {β : Type u_2} {N' : FirstOrder.Language} {L' : FirstOrder.Language} {p : ProjectionFormula N L α} (h : p.IsQF) (guard : N.Formula α → N'.Formula β) (literal : InputLiteral L α → ProjectionFormula N' L' β) (hguard : ∀ (g : N.Formula α), FirstOrder.Language.BoundedFormula.IsQF g → FirstOrder.Language.BoundedFormula.IsQF (guard g)) (hliteral : ∀ (l : InputLiteral L α), (literal l).IsQF) :
                          (ProjectionFormula.subst guard literal p).IsQF

                          The finitely many leaf occurrences of a projection formula. Distinct occurrences remain distinct even when they carry the same literal.

                          Instances For
                            @[instance_reducible]

                            The conjunction of numeric tests on the path to a leaf.

                            Instances For

                              The literal at a leaf occurrence.

                              Instances For
                                theorem Cslib.Logic.FO.ProjectionFormula.existsUnique_case {N : FirstOrder.Language} {L : FirstOrder.Language} {α : Type u_1} {M : Type u_3} [N.Structure M] (p : ProjectionFormula N L α) (x : α → M) :

                                The numeric cases form a partition, including on empty structures whenever an assignment of the free variables exists.

                                A projection is the disjunction of its mutually exclusive numeric cases, each conjoined with one constant or signed input literal.