Documentation

DescriptiveComplexity.SecondOrderNewExp

The expansion a bounded invention lives in #

DescriptiveComplexity.SigmaSONewExpDefinable guesses an extension A ⊕ Fin m with m ≤ 2 ^ Nat.card (Fin d → A) – as many invented values as the instance has d-ary relations. To read such a definition as one over an exponential expansion, the expansion has to be big enough to hold them, and it has to carry the instance too, since an expansion is all a sentence over it can see.

This file builds that expansion. It has two tags:

Its vocabulary is DescriptiveComplexity.newLang L: the relations of the instance, holding of original points exactly where they hold of the elements they name, and the marker old. What the expanded structure is, then, is the extended structure A ⊕ Fin (2 ^ nᵈ) with every invented value present; a sentence that wants fewer of them marks the ones it uses, which is a guess and so stays inside Σ₁.

The block #

@[reducible, inline]

The block whose assignments are the points of the expansion: one d-ary variable carrying an invented value and one unary variable carrying an original element.

Equations
Instances For
    Dependency graph

    The i-th d-ary variable: one coordinate of an invented value.

    Equations
    Instances For
      Dependency graph

      The unary variable: an original element.

      Equations
      Instances For
        Dependency graph

        The unary variable of the k-th copy.

        Equations
        Instances For
          Dependency graph

          The sentences #

          noncomputable def DescriptiveComplexity.eltAtom (L : FirstOrder.Language) (c d : ) {α : Type} (x : α) :
          (L.sum (powBlock c d).lang).Formula α

          The atom elt x, over the vocabulary of the block.

          Equations
          Instances For
            Dependency graph
            noncomputable def DescriptiveComplexity.eltAtomAt (L : FirstOrder.Language) (c d : ) {n : } (k : Fin n) {α : Type} (x : α) :
            (L.sum ((powBlock c d).replicate n).lang).Formula α

            The atom eltₖ x, over the vocabulary of n copies of the block.

            Equations
            Instances For
              Dependency graph
              noncomputable def DescriptiveComplexity.valAtom (L : FirstOrder.Language) (c d : ) (i : Fin c) {α : Type} (w : Fin dα) :
              (L.sum (powBlock c d).lang).Formula α

              The atom valᵢ w, over the vocabulary of the block.

              Equations
              Instances For
                Dependency graph

                elt holds of exactly one element.

                Equations
                Instances For
                  Dependency graph
                  Dependency graph

                  No coordinate of the invented value holds of anything.

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    Dependency graph
                    noncomputable def DescriptiveComplexity.powDom (L : FirstOrder.Language) (c d : ) :
                    Bool(L.sum (powBlock c d).lang).Sentence

                    The domain sentence of each tag: an original point names one element and invents nothing; a new point names no element.

                    Equations
                    Instances For
                      Dependency graph
                      noncomputable def DescriptiveComplexity.powRelSentence (L : FirstOrder.Language) (c d : ) {n : } :
                      (newLang L).Relations n(Fin nBool)(L.sum ((powBlock c d).replicate n).lang).Sentence

                      The defining sentence of each symbol: a relation of the instance holds of original points exactly when it holds of the elements they name, and never of a new point; old marks the original points.

                      Equations
                      Instances For
                        Dependency graph

                        The sentences, realized #

                        def DescriptiveComplexity.eltOf {c d : } {A : Type} (ρ : (powBlock c d).Assignment A) :
                        AProp

                        The unary variable, read off the assignment.

                        Equations
                        Instances For
                          Dependency graph
                          def DescriptiveComplexity.valOf {c d : } {A : Type} (ρ : (powBlock c d).Assignment A) :
                          Fin c(Fin dA)Prop

                          The d-ary variables, read off the assignment.

                          Equations
                          Instances For
                            Dependency graph
                            theorem DescriptiveComplexity.realize_eltAtom {L : FirstOrder.Language} {c d : } {A : Type} [L.Structure A] (ρ : (powBlock c d).Assignment A) {α : Type} (x : α) (v : αA) :
                            (eltAtom L c d x).Realize v eltOf ρ (v x)
                            Dependency graph
                            theorem DescriptiveComplexity.realize_valAtom {L : FirstOrder.Language} {c d : } {A : Type} [L.Structure A] (ρ : (powBlock c d).Assignment A) (i : Fin c) {α : Type} (w : Fin dα) (v : αA) :
                            (valAtom L c d i w).Realize v valOf ρ i fun (j : Fin d) => v (w j)
                            Dependency graph
                            theorem DescriptiveComplexity.realize_eltEmpty {L : FirstOrder.Language} {c d : } {A : Type} [L.Structure A] (ρ : (powBlock c d).Assignment A) :
                            A eltEmpty L c d ∀ (x : A), ¬eltOf ρ x
                            Dependency graph
                            theorem DescriptiveComplexity.realize_valEmpty {L : FirstOrder.Language} {c d : } {A : Type} [L.Structure A] (ρ : (powBlock c d).Assignment A) :
                            A valEmpty L c d ∀ (i : Fin c) (w : Fin dA), ¬valOf ρ i w
                            Dependency graph
                            Dependency graph

                            The expansion #

                            @[reducible]

                            The expansion: two tags, the instance's elements and its d-ary relations, over the extended vocabulary.

                            Reducible: its block and its vocabulary have to reduce for instance search, or the structure a domain sentence is read in is not the one the realization lemmas are stated at.

                            Equations
                            • One or more equations did not get rendered due to their size.
                            Instances For
                              Dependency graph

                              The points of the expansion #

                              Dependency graph
                              theorem DescriptiveComplexity.domHolds_false {L : FirstOrder.Language} [L.IsRelational] {c d : } {A : Type} [L.Structure A] (ρ : (powBlock c d).Assignment A) :
                              ExpExpansionFree.DomHolds (false, ρ) (∃! x : A, eltOf ρ x) ∀ (i : Fin c) (w : Fin dA), ¬valOf ρ i w
                              Dependency graph
                              Dependency graph
                              def DescriptiveComplexity.eltAssign {c d : } {A : Type} (x : A) :

                              The assignment naming an original element: its unary variable holds of that element alone, and it invents nothing.

                              Equations
                              Instances For
                                Dependency graph
                                def DescriptiveComplexity.valAssign {c d : } {A : Type} (S : Fin c(Fin dA)Prop) :

                                The assignment naming an invented value: its unary variable holds of nothing, and its d-ary ones are the value's coordinates.

                                Equations
                                Instances For
                                  Dependency graph
                                  @[simp]
                                  theorem DescriptiveComplexity.eltOf_eltAssign {c d : } {A : Type} (x y : A) :
                                  eltOf (eltAssign x) y y = x
                                  Dependency graph
                                  @[simp]
                                  theorem DescriptiveComplexity.valOf_eltAssign {c d : } {A : Type} (x : A) (i : Fin c) (w : Fin dA) :
                                  Dependency graph
                                  @[simp]
                                  theorem DescriptiveComplexity.eltOf_valAssign {c d : } {A : Type} (S : Fin c(Fin dA)Prop) (y : A) :
                                  Dependency graph
                                  @[simp]
                                  theorem DescriptiveComplexity.valOf_valAssign {c d : } {A : Type} (S : Fin c(Fin dA)Prop) (i : Fin c) (w : Fin dA) :
                                  valOf (valAssign S) i w S i w
                                  Dependency graph
                                  Dependency graph
                                  Dependency graph

                                  The points, counted #

                                  Dependency graph
                                  theorem DescriptiveComplexity.assign_false_ext {c d : } {A : Type} {ρ σ : (powBlock c d).Assignment A} (h : ∀ (x : A), eltOf ρ x eltOf σ x) :
                                  ρ none = σ none

                                  A unary variable is determined by what it holds of: its argument tuples are constant.

                                  Dependency graph

                                  The element an original point names.

                                  Equations
                                  Instances For
                                    Dependency graph
                                    Dependency graph
                                    Dependency graph

                                    An original point is the assignment naming its element.

                                    Dependency graph

                                    A new point is the assignment naming its value.

                                    Dependency graph
                                    def DescriptiveComplexity.powPoint {L : FirstOrder.Language} [L.IsRelational] {c d : } {A : Type} [L.Structure A] :
                                    A (Fin c(Fin dA)Prop)(powExpFree L c d).Map A

                                    The point of the expansion carried by an element or by a tuple of d-ary relations.

                                    Equations
                                    Instances For
                                      Dependency graph
                                      Dependency graph
                                      Dependency graph
                                      noncomputable def DescriptiveComplexity.powPointEquiv {L : FirstOrder.Language} [L.IsRelational] {c d : } {A : Type} [L.Structure A] :
                                      A (Fin c(Fin dA)Prop) (powExpFree L c d).Map A

                                      The points of the expansion are the instance's elements and its d-ary relations, so there are n + 2 ^ nᵈ of them: enough to hold any extension the bound of DescriptiveComplexity.SigmaSONewExpDefinable allows.

                                      Equations
                                      Instances For
                                        Dependency graph

                                        The defining sentences, realized #

                                        theorem DescriptiveComplexity.realize_eltAtomAt {L : FirstOrder.Language} {c d n : } {A : Type} [L.Structure A] (ρs : Fin n(powBlock c d).Assignment A) (k : Fin n) {α : Type} (x : α) (v : αA) :
                                        (eltAtomAt L c d k x).Realize v eltOf (ρs k) (v x)
                                        Dependency graph
                                        theorem DescriptiveComplexity.realize_powRelSentence_base {L : FirstOrder.Language} {c d n : } {A : Type} [L.Structure A] (ρs : Fin n(powBlock c d).Assignment A) (R : L.Relations n) (τ : Fin nBool) ( : ∀ (i : Fin n), τ i = false) :
                                        A powRelSentence L c d (Sum.inl R) τ ∃ (x : Fin nA), (∀ (i : Fin n), eltOf (ρs i) (x i)) FirstOrder.Language.Structure.RelMap R x

                                        A relation of the instance, at original points: it holds exactly when it holds of the elements they name.

                                        Dependency graph
                                        theorem DescriptiveComplexity.powRelSentence_base_eq_bot {L : FirstOrder.Language} {c d n : } (R : L.Relations n) (τ : Fin nBool) ( : ¬∀ (i : Fin n), τ i = false) :

                                        A relation of the instance never holds of an invented point.

                                        Dependency graph

                                        The marker old holds exactly of the original points.

                                        Dependency graph

                                        The expanded structure is the extended structure #

                                        @[instance_reducible]

                                        The extended structure over an arbitrary set of invented values: the relations of the instance hold of original elements only, and old marks them. DescriptiveComplexity.extStructure is the case N = Fin m.

                                        Equations
                                        Instances For
                                          Dependency graph
                                          theorem DescriptiveComplexity.relMap_extOn_base {L : FirstOrder.Language} [L.IsRelational] {A : Type} [L.Structure A] {N : Type} {k : } (R : L.Relations k) (x : Fin kA N) :
                                          Dependency graph
                                          Dependency graph
                                          noncomputable def DescriptiveComplexity.powExtEquiv {L : FirstOrder.Language} [L.IsRelational] {c d : } {A : Type} [L.Structure A] :
                                          (newLang L).Equiv (A (Fin c(Fin dA)Prop)) ((powExpFree L c d).Map A)

                                          The expanded structure is the extended one: the map sending an element to its original point and a d-ary relation to its new point is an isomorphism over DescriptiveComplexity.newLang.

                                          Equations
                                          Instances For
                                            Dependency graph

                                            The marked part of an extended universe #

                                            The original elements together with the marked invented values: a substructure, there being nothing to be closed under in a relational vocabulary.

                                            Equations
                                            Instances For
                                              Dependency graph
                                              def DescriptiveComplexity.usedPoint {A N : Type} (U : NProp) :
                                              A { y : N // U y }A N

                                              The inclusion of the extension by the marked values into the whole one.

                                              Equations
                                              Instances For
                                                Dependency graph
                                                theorem DescriptiveComplexity.usedPoint_mem {L : FirstOrder.Language} [L.IsRelational] {A N : Type} [L.Structure A] (U : NProp) (x : A { y : N // U y }) :
                                                Dependency graph
                                                theorem DescriptiveComplexity.usedPoint_isOld {A N : Type} (U : NProp) (x : A { y : N // U y }) :
                                                Dependency graph
                                                theorem DescriptiveComplexity.usedPoint_eq_inl {A N : Type} (U : NProp) (x : A { y : N // U y }) (a : A) :
                                                Dependency graph
                                                def DescriptiveComplexity.usedSubEquiv {L : FirstOrder.Language} [L.IsRelational] {A N : Type} [L.Structure A] (U : NProp) :
                                                (newLang L).Equiv (A { y : N // U y }) (usedSub U)

                                                The marked part is the extended universe over the marked values: the invented values a sentence uses are the ones it marks, and what it says of them it says of the extension by those alone.

                                                Equations
                                                • One or more equations did not get rendered due to their size.
                                                Instances For
                                                  Dependency graph

                                                  The sentence read over the expansion #

                                                  @[reducible, inline]

                                                  The unary marker a sentence over the expansion guesses: which invented values it uses.

                                                  Equations
                                                  Instances For
                                                    Dependency graph
                                                    @[reducible, inline]

                                                    The block guessed over the expansion: the kernel's own variables together with the marker.

                                                    Equations
                                                    Instances For
                                                      Dependency graph
                                                      @[reducible, inline]

                                                      The marker, as a symbol of the guessed vocabulary.

                                                      Equations
                                                      Instances For
                                                        Dependency graph
                                                        @[reducible, inline]

                                                        The marker, as a symbol over the extended vocabulary.

                                                        Equations
                                                        Instances For
                                                          Dependency graph
                                                          @[reducible, inline]

                                                          old, as a symbol over the same vocabulary.

                                                          Equations
                                                          Instances For
                                                            Dependency graph

                                                            Every original element is marked: the guess adds invented values to the instance, it does not take elements away.

                                                            Equations
                                                            • One or more equations did not get rendered due to their size.
                                                            Instances For
                                                              Dependency graph
                                                              Dependency graph

                                                              The sentence read over the expansion: mark the invented values it uses, mark every original element, and read the kernel among the marked ones.

                                                              Equations
                                                              • One or more equations did not get rendered due to their size.
                                                              Instances For
                                                                Dependency graph

                                                                The marked part, with the kernel's block #

                                                                @[instance_reducible]

                                                                The extended structure together with an assignment of the kernel's block.

                                                                Equations
                                                                Instances For
                                                                  Dependency graph
                                                                  def DescriptiveComplexity.usedRestrict {A N : Type} {B : SOBlock} (U : NProp) (ρ : B.Assignment (A N)) :
                                                                  B.Assignment (A { y : N // U y })

                                                                  The assignment of the kernel's block on the extension by the marked values, read off one on the whole extension.

                                                                  Equations
                                                                  Instances For
                                                                    Dependency graph
                                                                    def DescriptiveComplexity.usedSubB {L : FirstOrder.Language} [L.IsRelational] {A N : Type} [L.Structure A] {B : SOBlock} (U : NProp) (ρ : B.Assignment (A N)) :

                                                                    The marked part, as a substructure over the vocabulary the kernel is written in.

                                                                    Equations
                                                                    Instances For
                                                                      Dependency graph
                                                                      def DescriptiveComplexity.usedSubEquivB {L : FirstOrder.Language} [L.IsRelational] {A N : Type} [L.Structure A] {B : SOBlock} (U : NProp) (ρ : B.Assignment (A N)) :
                                                                      ((newLang L).sum B.lang).Equiv (A { y : N // U y }) (usedSubB U ρ)

                                                                      The marked part is the extension by the marked values, over the vocabulary the kernel is written in: the same identification as DescriptiveComplexity.usedSubEquiv, with the kernel's block riding along by restriction.

                                                                      Equations
                                                                      • One or more equations did not get rendered due to their size.
                                                                      Instances For
                                                                        Dependency graph

                                                                        The sentence over the expansion, realized #

                                                                        Dependency graph
                                                                        def DescriptiveComplexity.usedExtend {A N : Type} {B : SOBlock} (U : NProp) (ρ : B.Assignment (A { y : N // U y })) :
                                                                        B.Assignment (A N)

                                                                        The assignment on the whole extension reproducing one on the extension by the marked values: a tuple is related exactly when it is the image of a related tuple.

                                                                        Equations
                                                                        Instances For
                                                                          Dependency graph
                                                                          theorem DescriptiveComplexity.usedRestrict_usedExtend {A N : Type} {B : SOBlock} (U : NProp) (ρ : B.Assignment (A { y : N // U y })) :
                                                                          Dependency graph
                                                                          def DescriptiveComplexity.markerOf {A N : Type} {B : SOBlock} (ρ' : (usedBlock B).Assignment (A N)) :
                                                                          A NProp

                                                                          The marker, read off a guessed assignment.

                                                                          Equations
                                                                          Instances For
                                                                            Dependency graph
                                                                            Dependency graph

                                                                            The marker, as the relativization's guard reads it.

                                                                            Dependency graph
                                                                            theorem DescriptiveComplexity.realize_markerAtom {L : FirstOrder.Language} [L.IsRelational] {A N : Type} [L.Structure A] {B : SOBlock} (ρ' : (usedBlock B).Assignment (A N)) {α : Type} (x : α) (v : αA N) :
                                                                            ((markerHostSym L B).formula fun (x_1 : Fin 1) => FirstOrder.Language.var x).Realize v markerOf ρ' (v x)

                                                                            The atom mark x, realized.

                                                                            Dependency graph
                                                                            theorem DescriptiveComplexity.realize_oldUsedAtom {L : FirstOrder.Language} [L.IsRelational] {A N : Type} [L.Structure A] {B : SOBlock} (ρ' : (usedBlock B).Assignment (A N)) {α : Type} (x : α) (v : αA N) :
                                                                            ((oldUsedSym L B).formula fun (x_1 : Fin 1) => FirstOrder.Language.var x).Realize v IsOld (v x)

                                                                            The atom old x, realized.

                                                                            Dependency graph
                                                                            def DescriptiveComplexity.kernelOf {A N : Type} {B : SOBlock} (ρ' : (usedBlock B).Assignment (A N)) :
                                                                            B.Assignment (A N)

                                                                            The kernel's part of a guessed assignment.

                                                                            Equations
                                                                            Instances For
                                                                              Dependency graph
                                                                              def DescriptiveComplexity.usedJoin {A N : Type} {B : SOBlock} (U : NProp) (ρ : B.Assignment (A { y : N // U y })) :

                                                                              A guessed assignment, from its two parts.

                                                                              Equations
                                                                              Instances For
                                                                                Dependency graph
                                                                                @[simp]
                                                                                theorem DescriptiveComplexity.markOf_usedJoin {A N : Type} {B : SOBlock} (U : NProp) (ρ : B.Assignment (A { y : N // U y })) (x : A N) :
                                                                                markerOf (usedJoin U ρ) x Sum.elim (fun (x : A) => True) U x
                                                                                Dependency graph
                                                                                @[simp]
                                                                                theorem DescriptiveComplexity.blockOf_usedJoin {A N : Type} {B : SOBlock} (U : NProp) (ρ : B.Assignment (A { y : N // U y })) :
                                                                                Dependency graph
                                                                                theorem DescriptiveComplexity.realize_usedKernelHom {L : FirstOrder.Language} [L.IsRelational] {A : Type} [L.Structure A] {B : SOBlock} {N' : Type} (σ : (usedBlock B).Assignment (A N')) (φ : ((newLang L).sum B.lang).Sentence) :
                                                                                (A N') (usedKernelHom L B).onSentence φ (A N') φ

                                                                                The transported kernel says what the kernel says: the merged block is the kernel's own variables together with the marker, and the kernel reads only the former.

                                                                                Dependency graph
                                                                                theorem DescriptiveComplexity.realize_relativized {L : FirstOrder.Language} [L.IsRelational] {A N : Type} [L.Structure A] {B : SOBlock} (U : NProp) (ρ' : (usedBlock B).Assignment (A N)) (hU : ∀ (x : A N), Sum.elim (fun (x : A) => True) U x markerOf ρ' x) (φ : ((newLang L).sum B.lang).Sentence) :

                                                                                The relativized kernel says what the kernel says on the marked part.

                                                                                Dependency graph
                                                                                theorem DescriptiveComplexity.realize_oldMarked {L : FirstOrder.Language} [L.IsRelational] {A N : Type} [L.Structure A] {B : SOBlock} (ρ' : (usedBlock B).Assignment (A N)) :
                                                                                (A N) oldMarked L B ∀ (a : A), markerOf ρ' (Sum.inl a)
                                                                                Dependency graph
                                                                                theorem DescriptiveComplexity.sorealize_usedSentence {L : FirstOrder.Language} [L.IsRelational] {A N : Type} [L.Structure A] {B : SOBlock} (φ : ((newLang L).sum B.lang).Sentence) :
                                                                                SORealize (newLang L) (A N) [usedBlock B] (usedSentence L B φ) true ∃ (U : NProp), SORealize (newLang L) (A { y : N // U y }) [B] φ true

                                                                                The sentence over the expansion, realized: it holds exactly when the kernel holds over the extension by some set of invented values – the ones the marker names.

                                                                                Dependency graph

                                                                                Bounded invention is definability over the expansion #

                                                                                theorem DescriptiveComplexity.sumCongr_eq_inl {A N N' : Type} (e : N N') (x : A N) (a : A) :
                                                                                Dependency graph
                                                                                theorem DescriptiveComplexity.sumCongr_isOld {A N N' : Type} (e : N N') (x : A N) :
                                                                                Dependency graph
                                                                                def DescriptiveComplexity.extOnCongr {L : FirstOrder.Language} [L.IsRelational] {A N N' : Type} [L.Structure A] (e : N N') :
                                                                                (newLang L).Equiv (A N) (A N')

                                                                                Renaming the invented values: the extended structure depends on them only through their number.

                                                                                Equations
                                                                                Instances For
                                                                                  Dependency graph
                                                                                  theorem DescriptiveComplexity.card_pow {c : } (α : Type) [Finite α] :
                                                                                  Nat.card (Fin cαProp) = 2 ^ (c * Nat.card α)
                                                                                  Dependency graph

                                                                                  The problem the expansion decides: the kernel, read over the extension by the invented values a guess marks.

                                                                                  Equations
                                                                                  • One or more equations did not get rendered due to their size.
                                                                                  Instances For
                                                                                    Dependency graph
                                                                                    Dependency graph

                                                                                    Bounded invention is definability over the expansion: an ∃SO[new, exp c d] definition is an ∃SO definition over DescriptiveComplexity.powExpFree, which is ∃SO[new, exp c d] ⊆ NEXPTIME.

                                                                                    Dependency graph