Documentation

DescriptiveComplexity.SecondOrderNewBddPull

A bounded extension lives inside the instance's own tuples #

DescriptiveComplexity.SigmaSONewBddDefinable guesses an extension A ⊕ Fin m with m ≤ Nat.card (Fin d → A). That bound is exactly what it takes for the extension to be definable inside A: there are as many invented values as d-tuples, so the invented values can be taken to be d-tuples, guessed as one d-ary relation.

This file builds the interpretation that says so, in the shape DescriptiveComplexity.SecondOrderNewPull established for the other direction:

The defining formulas say the rest: a relation of the base vocabulary holds of interpreted points when they are all original and it holds of the elements on their diagonals; old marks the false-tagged points; and a relation variable of the guessed block is read off the pulled variable selected by the tags, as in DescriptiveComplexity.SOBlock.pull.

What comes out is DescriptiveComplexity.sorealize_bddPull – the kernel holds over some bounded extension exactly when its pullback holds over the instance – and from it DescriptiveComplexity.sigmaSONewBddDefinable_iff_sigmaSODefinable: ∃SO[new, d] = NP. Read beside DescriptiveComplexity.SecondOrderNewPull, which pulls the unbounded logic through an interpretation without ever eliminating the invention, this is what the bound is for: an interpretation cannot invent, so the values have to come from the instance, and the bound is exactly the promise that they can.

The guessed block #

@[reducible, inline]

The block guessed on the instance: the set of invented values, as a d-ary relation, together with the pullback of the kernel's block through the two-tag interpretation.

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

    The invented-values variable of the guessed block.

    Equations
    Instances For
      Dependency graph
      def DescriptiveComplexity.bddPullSym (d : ) (B : SOBlock) {k : } (r : B.lang.Relations k) (τ : Fin kBool) :
      (bddBlock d B).lang.Relations (B.arity r * d)

      The pulled relation variable selected by a tuple of tags.

      Equations
      Instances For
        Dependency graph

        The two vocabularies #

        @[reducible, inline]

        The vocabulary the pulled-back kernel is written in: the instance's own, together with the guessed relation variables.

        Equations
        Instances For
          Dependency graph
          @[reducible, inline]

          The vocabulary the kernel is written in: the extended vocabulary together with the block's relation variables.

          Equations
          Instances For
            Dependency graph

            The interpretation #

            @[reducible, inline]

            The invented-values variable, as a symbol of the host vocabulary.

            Equations
            Instances For
              Dependency graph
              @[reducible, inline]
              abbrev DescriptiveComplexity.bddBlockHostSym (L : FirstOrder.Language) (d : ) (B : SOBlock) {k : } (r : B.lang.Relations k) (τ : Fin kBool) :
              (bddHost L d B).Relations (B.arity r * d)

              A pulled relation variable, as a symbol of the host vocabulary.

              Equations
              Instances For
                Dependency graph
                noncomputable def DescriptiveComplexity.bddDom (L : FirstOrder.Language) (d : ) [NeZero d] (B : SOBlock) :
                Bool(bddHost L d B).Formula (Fin d)

                The domain formula: an original point is a diagonal tuple, so that each element of the instance is one point; an invented point is a tuple the guessed relation holds of.

                Equations
                Instances For
                  Dependency graph
                  noncomputable def DescriptiveComplexity.bddRelF (L : FirstOrder.Language) (d : ) [NeZero d] (B : SOBlock) {k : } :
                  (bddTarget L B).Relations k(Fin kBool)(bddHost L d B).Formula (Fin k × Fin d)

                  The defining formulas: a symbol of the instance's vocabulary holds of interpreted points exactly when they are all original and it holds of the elements their diagonals carry, and never of an invented point; old marks the original points; a relation variable of the block is read off the pulled variable selected by the tags.

                  Equations
                  Instances For
                    Dependency graph

                    The extended universe, interpreted in the instance: two tags and dimension d, the original elements on the diagonal and the invented values wherever the guessed relation puts them.

                    Equations
                    Instances For
                      Dependency graph

                      Realization in the host structure #

                      def DescriptiveComplexity.newSet {A : Type} {d : } {B : SOBlock} (ρ : (bddBlock d B).Assignment A) :
                      (Fin dA)Prop

                      The invented values, as the instance's own tuples: the d-tuples the guessed variable holds of. Their number is what the bound of DescriptiveComplexity.SigmaSONewBddDefinable allows.

                      Equations
                      Instances For
                        Dependency graph
                        @[instance_reducible]
                        noncomputable def DescriptiveComplexity.bddHostStruc {L : FirstOrder.Language} {d : } {B : SOBlock} (A : Type) [L.Structure A] (ρ : (bddBlock d B).Assignment A) :
                        (bddHost L d B).Structure A

                        The host structure: the instance, expanded by the guessed relation variables.

                        Equations
                        Instances For
                          Dependency graph
                          theorem DescriptiveComplexity.realize_bddDom_false {L : FirstOrder.Language} {d : } [NeZero d] {B : SOBlock} {A : Type} [L.Structure A] {ρ : (bddBlock d B).Assignment A} (w : Fin dA) :
                          (bddDom L d B false).Realize w ∀ (j : Fin d), w j = w 0
                          Dependency graph
                          theorem DescriptiveComplexity.realize_bddDom_true {L : FirstOrder.Language} {d : } [NeZero d] {B : SOBlock} {A : Type} [L.Structure A] {ρ : (bddBlock d B).Assignment A} (w : Fin dA) :
                          (bddDom L d B true).Realize w newSet ρ w
                          Dependency graph

                          The extended universe as tagged tuples #

                          def DescriptiveComplexity.bddPoint {d : } {A : Type} {m : } (e : Fin mFin dA) :
                          A Fin mBool × (Fin dA)

                          The tagged tuple representing a point of the extended universe: an original element on its diagonal, an invented value where the embedding puts it.

                          Equations
                          Instances For
                            Dependency graph
                            @[simp]
                            theorem DescriptiveComplexity.bddPoint_inl {d : } {A : Type} {m : } (e : Fin mFin dA) (a : A) :
                            bddPoint e (Sum.inl a) = (false, fun (x : Fin d) => a)
                            Dependency graph
                            @[simp]
                            theorem DescriptiveComplexity.bddPoint_inr {d : } {A : Type} {m : } (e : Fin mFin dA) (i : Fin m) :
                            Dependency graph
                            Dependency graph
                            theorem DescriptiveComplexity.bddPoint_mem_dom {L : FirstOrder.Language} {d : } [NeZero d] {B : SOBlock} {A : Type} [L.Structure A] {m : } (ρ : (bddBlock d B).Assignment A) {e : Fin mFin dA} (he : ∀ (i : Fin m), newSet ρ (e i)) (x : A Fin m) :
                            (bddDom L d B (bddPoint e x).1).Realize (bddPoint e x).2
                            Dependency graph
                            theorem DescriptiveComplexity.bddPoint_surjective {L : FirstOrder.Language} {d : } [NeZero d] {B : SOBlock} {A : Type} [L.Structure A] {m : } (ρ : (bddBlock d B).Assignment A) {e : Fin mFin dA} (hN : ∀ (v : Fin dA), newSet ρ v ∃ (i : Fin m), e i = v) (t : Bool) (w : Fin dA) :
                            (bddDom L d B t).Realize w∃ (x : A Fin m), bddPoint e x = (t, w)
                            Dependency graph
                            def DescriptiveComplexity.bddTargetAssign {d : } {B : SOBlock} {A : Type} {m : } (e : Fin mFin dA) (ρ : (bddBlock d B).Assignment A) :

                            The assignment of the kernel's block on the extended universe, read off a guessed assignment on the instance: the pulled variable selected by the tags of the arguments, at their coordinates.

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

                              The defining formulas, realized #

                              theorem DescriptiveComplexity.realize_bddRelF_base {L : FirstOrder.Language} {d : } [NeZero d] {B : SOBlock} {A : Type} [L.Structure A] (ρ : (bddBlock d B).Assignment A) {k : } (R : L.Relations k) (a : Fin kA) (w : Fin k × Fin dA) (hw : ∀ (i : Fin k) (j : Fin d), w (i, j) = a i) :

                              A base symbol at original points: the relation of the instance, at the elements the diagonals carry.

                              Dependency graph
                              theorem DescriptiveComplexity.bddRelF_base_eq_bot {L : FirstOrder.Language} {d : } [NeZero d] {B : SOBlock} {k : } (R : L.Relations k) (τ : Fin kBool) (h : ¬∀ (i : Fin k), τ i = false) :
                              bddRelF L d B (Sum.inl (Sum.inl R)) τ =

                              A base symbol never holds of an invented point.

                              Dependency graph
                              theorem DescriptiveComplexity.realize_bddRelF_old {L : FirstOrder.Language} {d : } [NeZero d] {B : SOBlock} {A : Type} [L.Structure A] (ρ : (bddBlock d B).Assignment A) (τ : Fin 1Bool) (w : Fin 1 × Fin dA) :

                              The marker old holds exactly of the original points.

                              Dependency graph
                              theorem DescriptiveComplexity.realize_bddRelF_block {L : FirstOrder.Language} {d : } [NeZero d] {B : SOBlock} {A : Type} [L.Structure A] (ρ : (bddBlock d B).Assignment A) {k : } (r : B.lang.Relations k) (τ : Fin kBool) (w : Fin k × Fin dA) :
                              (bddRelF L d B (Sum.inr r) τ).Realize w ρ (Sum.inr r, fun (j : Fin (B.arity r)) => τ (Fin.cast j)) fun (mm : Fin ((bddBlock d B).arity (Sum.inr r, fun (j : Fin (B.arity r)) => τ (Fin.cast j)))) => w (Fin.cast (finProdFinEquiv.symm mm).1, (finProdFinEquiv.symm mm).2)

                              A relation variable of the block is read off the pulled variable selected by the tags.

                              Dependency graph

                              The interpreted universe is the extended universe #

                              noncomputable def DescriptiveComplexity.bddTargetEquiv {L : FirstOrder.Language} [L.IsRelational] {d : } [NeZero d] {B : SOBlock} {A : Type} [L.Structure A] {m : } (e : Fin mFin dA) (he : Function.Injective e) (ρ : (bddBlock d B).Assignment A) (hN : ∀ (v : Fin dA), newSet ρ v ∃ (i : Fin m), e i = v) :
                              (bddTarget L B).Equiv (A Fin m) ((bddInterp L d B).MapRel A)

                              The interpreted structure is the extended structure: the map sending a point of A ⊕ Fin m to its tagged tuple is an isomorphism over the extended vocabulary, the block being interpreted by DescriptiveComplexity.bddTargetAssign.

                              Equations
                              Instances For
                                Dependency graph

                                The guess, read back #

                                noncomputable def DescriptiveComplexity.bddBack {d : } [NeZero d] {A : Type} {m : } (e : Fin mFin dA) :
                                Bool(Fin dA)A Fin m

                                The point a tag and a tuple name: an original element on a diagonal, the invented value the embedding puts there. Off the embedding's image the value is junk, which no formula reaches – the domain formula rules those tuples out.

                                Equations
                                Instances For
                                  Dependency graph
                                  theorem DescriptiveComplexity.bddBack_bddPoint {d : } [NeZero d] {A : Type} {m : } {e : Fin mFin dA} (he : Function.Injective e) (x : A Fin m) :
                                  bddBack e (bddPoint e x).1 (bddPoint e x).2 = x
                                  Dependency graph
                                  noncomputable def DescriptiveComplexity.bddSourceAssign {d : } [NeZero d] {B : SOBlock} {A : Type} {m : } (e : Fin mFin dA) (σ : B.Assignment (A Fin m)) :

                                  The guessed assignment on the instance, read off an assignment on the extended universe: the invented values are the embedding's image, and a pulled variable holds where the original one holds of the points its tags and coordinates name.

                                  Equations
                                  Instances For
                                    Dependency graph
                                    theorem DescriptiveComplexity.newSet_bddSourceAssign {d : } [NeZero d] {B : SOBlock} {A : Type} {m : } (e : Fin mFin dA) (σ : B.Assignment (A Fin m)) (v : Fin dA) :
                                    newSet (bddSourceAssign e σ) v ∃ (i : Fin m), e i = v
                                    Dependency graph
                                    theorem DescriptiveComplexity.bddTargetAssign_bddSourceAssign {d : } [NeZero d] {B : SOBlock} {A : Type} {m : } {e : Fin mFin dA} (he : Function.Injective e) (σ : B.Assignment (A Fin m)) :

                                    The two assignment transfers are inverse, in the direction an existential block needs: what the instance guesses is read back as what was guessed on the extended universe.

                                    Dependency graph

                                    The kernel, pulled onto the instance #

                                    theorem DescriptiveComplexity.realize_bddTransfer {L : FirstOrder.Language} [L.IsRelational] {d : } [NeZero d] {B : SOBlock} {A : Type} [L.Structure A] {m : } {e : Fin mFin dA} (he : Function.Injective e) (ρ : (bddBlock d B).Assignment A) (hN : ∀ (v : Fin dA), newSet ρ v ∃ (i : Fin m), e i = v) (σ : B.Assignment (A Fin m)) ( : bddTargetAssign e ρ = σ) (φ : (bddTarget L B).Sentence) :
                                    (A Fin m) φ (bddInterp L d B).MapRel A φ

                                    Sentence transfer: what the kernel says in the extended universe, it says in the interpreted one.

                                    Dependency graph
                                    theorem DescriptiveComplexity.sorealize_bddPull {L : FirstOrder.Language} [L.IsRelational] {d : } [NeZero d] {B : SOBlock} (φ : (bddTarget L B).Sentence) (A : Type) [L.Structure A] [Finite A] :
                                    (∃ mNat.card (Fin dA), SORealize (newLang L) (A Fin m) [B] φ true) SORealize L A [bddBlock d B] ((bddInterp L d B).pullRelSentence φ) true

                                    A bounded extension is a guess on the instance: the kernel holds in A ⊕ Fin m for some m below the number of d-tuples exactly when its pullback through DescriptiveComplexity.bddInterp holds in A itself. The bound is what makes the forward direction possible – there have to be enough tuples to embed the invented values in – and the guessed relation is what makes the backward one, every d-ary relation cutting out at most that many.

                                    Dependency graph

                                    ∃SO[new, d] ⊆ Σ₁: bounded value invention is existential second-order logic over the instance itself. The invented values are taken to be d-tuples, guessed as one more relation variable, and the kernel is pulled back through the two-tag interpretation. With DescriptiveComplexity.SigmaSODefinable.toNewBdd this is ∃SO[new, d] = NP.

                                    Dependency graph

                                    ∃SO[new, d] = NP, for a positive dimension: bounding the invented values by the instance's d-tuples hands the search space back to the instance, which is what the parameter was for.

                                    Dependency graph