Documentation

DescriptiveComplexity.Counting.Digits.Tower

Towers of inductions: first-order strata and sweep strata #

The definability layer of the normal form of FP (DescriptiveComplexity.Counting.Digits). The digits of a quantitative term are computed by a tower of inflationary inductions, each reading the converged relations of the ones below as if they were relations of the instance; a tower is one induction, by stratification (DescriptiveComplexity.StepDef.stratify). Two kinds of stratum are all the construction uses, and both are stated over an arbitrary vocabulary M – in a tower, the base vocabulary expanded by the relations already computed:

DescriptiveComplexity.StepDef.Ext is the bookkeeping of a tower: an induction extends another when it computes, among others, the same relations.

Tuples in blocks #

def DescriptiveComplexity.Digits.j3 {A : Type} {a q ℓ : ℕ} (w : Fin a → A) (i : Fin q → A) (p : Fin ℓ → A) :
Fin (a + q + ℓ) → A

Parameters, then an index, then a position.

Equations
Instances For
    Dependency graph
    def DescriptiveComplexity.Digits.g2 {a q : ℕ} :
    Fin a ⊕ Fin q → Fin (a + q)

    The variables of a formula about parameters and an index, as arguments of a relation.

    Equations
    Instances For
      Dependency graph
      def DescriptiveComplexity.Digits.g3 {a q ℓ : ℕ} :
      (Fin a ⊕ Fin q) ⊕ Fin ℓ → Fin (a + q + ℓ)

      The variables of a formula about parameters, an index and a position, as arguments of a relation.

      Equations
      Instances For
        Dependency graph

        First-order strata #

        @[reducible]
        noncomputable def DescriptiveComplexity.Digits.foStratum {M : FirstOrder.Language} (J : Type) [Finite J] (ar : J → ℕ) (ψ : (j : J) → M.Formula (Fin (ar j))) :

        A first-order stratum: a family of relations, each defined by a formula of the vocabulary.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          Dependency graph
          theorem DescriptiveComplexity.Digits.inflLimit_foStratum {M : FirstOrder.Language} {A : Type} [M.Structure A] (J : Type) [Finite J] (ar : J → ℕ) (ψ : (j : J) → M.Formula (Fin (ar j))) (j : J) (x : Fin (ar j) → A) :
          (foStratum J ar ψ).inflLimit A j x ↔ (ψ j).Realize x

          The limit of a first-order stratum is what its formulas say.

          Dependency graph

          Sweep strata #

          @[reducible]

          The block of a sweep: the relation row (parameters, index, position) and the relation done (parameters, index).

          Equations
          Instances For
            Dependency graph
            @[reducible, inline]
            abbrev DescriptiveComplexity.Digits.rowSym (M : FirstOrder.Language) (a q ℓ : ℕ) :
            (M.sum (sweepBlock a q ℓ).lang).Relations (a + q + ℓ)

            The symbol of the rows.

            Equations
            Instances For
              Dependency graph
              @[reducible, inline]

              The symbol of the marker.

              Equations
              Instances For
                Dependency graph
                def DescriptiveComplexity.Digits.doneAt {M : FirstOrder.Language} {a q : ℕ} (ℓ : ℕ) {γ : Type} (ws : Fin a → γ) (is : Fin q → γ) :
                (M.sum (sweepBlock a q ℓ).lang).Formula γ

                “The row of this index is done.”

                Equations
                Instances For
                  Dependency graph
                  def DescriptiveComplexity.Digits.rowAt {M : FirstOrder.Language} {a q ℓ : ℕ} {γ : Type} (ws : Fin a → γ) (is : Fin q → γ) (ps : Fin ℓ → γ) :
                  (M.sum (sweepBlock a q ℓ).lang).Formula γ

                  “This position is in the row of this index.”

                  Equations
                  Instances For
                    Dependency graph
                    noncomputable def DescriptiveComplexity.Digits.readyF {M : FirstOrder.Language} {a q : ℕ} (ℓ : ℕ) (bot : M.Formula (Fin q)) (cov : M.Formula (Fin q ⊕ Fin q)) :
                    (M.sum (sweepBlock a q ℓ).lang).Formula (Fin a ⊕ Fin q)

                    “The row of this index may be written”: the index is the first one, or the row of the index it covers is done.

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      Dependency graph
                      @[reducible]
                      noncomputable def DescriptiveComplexity.Digits.sweep {M : FirstOrder.Language} {a q ℓ : ℕ} (bot : M.Formula (Fin q)) (cov : M.Formula (Fin q ⊕ Fin q)) (Θ : (M.sum (sweepBlock a q ℓ).lang).Formula ((Fin a ⊕ Fin q) ⊕ Fin ℓ)) :

                      A sweep stratum: rows indexed by the tuples of a linear order given by its least element (bot) and its covers (cov), each row defined by the formula Θ – about parameters, an index and a position – which may read the rows before it.

                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For
                        Dependency graph
                        theorem DescriptiveComplexity.Digits.inflLimit_sweep {M : FirstOrder.Language} {a q ℓ : ℕ} {A : Type} [M.Structure A] {Idx : Type} [LinearOrder Idx] [Finite Idx] (ix : (Fin q → A) ≃ Idx) (bot : M.Formula (Fin q)) (cov : M.Formula (Fin q ⊕ Fin q)) (Θ : (M.sum (sweepBlock a q ℓ).lang).Formula ((Fin a ⊕ Fin q) ⊕ Fin ℓ)) (hbot : ∀ (i : Fin q → A), bot.Realize i ↔ ∀ (c : Idx), ix i ≤ c) (hcov : ∀ (i₀ i : Fin q → A), cov.Realize (Sum.elim i₀ i) ↔ ix i₀ ⋖ ix i) (Φ : (Fin a → A) → Idx → (Idx → (Fin ℓ → A) → Prop) → (Fin ℓ → A) → Prop) (T : (Fin a → A) → Idx → (Fin ℓ → A) → Prop) (hΦ : ∀ (w : Fin a → A) (i : Idx) (R : Idx → (Fin ℓ → A) → Prop), (∀ i' < i, R i' = T w i') → Φ w i R = T w i) (hΘ : ∀ (ρ : (sweepBlock a q ℓ).Assignment A) (w : Fin a → A) (i : Fin q → A) (p : Fin ℓ → A), Θ.Realize (Sum.elim (Sum.elim w i) p) ↔ Φ w (ix i) (fun (i' : Idx) (p' : Fin ℓ → A) => ρ true (j3 w (ix.symm i') p')) p) (w : Fin a → A) (i : Fin q → A) (p : Fin ℓ → A) :
                        (sweep bot cov Θ).inflLimit A true (j3 w i p) ↔ T w (ix i) p

                        The limit of a sweep stratum is the family of its rows. The index tuples are read as the elements of a finite linear order through ix; the formula Θ realizes a condition Φ on the rows, which determines the row of an index from the rows before it.

                        Dependency graph

                        Extensions #

                        An induction extends another when it computes, among others, the same relations: a map of the relation variables, preserving the arities and the limits.

                        Instances For
                          Dependency graph

                          Every induction extends itself.

                          Equations
                          Instances For
                            Dependency graph

                            Extensions compose.

                            Equations
                            Instances For
                              Dependency graph

                              Adding a stratum extends an induction.

                              Equations
                              Instances For
                                Dependency graph

                                The symbol of a relation variable, in an extension.

                                Equations
                                Instances For
                                  Dependency graph
                                  def DescriptiveComplexity.StepDef.Computes {K : FirstOrder.Language} (e : StepDef (K.sum FirstOrder.Language.order)) {r : ℕ} (j : e.B.lang.Relations r) (R : (A : Type) → [K.Structure A] → [LinearOrder A] → (Fin r → A) → Prop) :

                                  The relation variable j of the induction e computes the relation R of ordered structures.

                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  Instances For
                                    Dependency graph
                                    theorem DescriptiveComplexity.StepDef.Computes.ext {K : FirstOrder.Language} {e e' : StepDef (K.sum FirstOrder.Language.order)} {r : ℕ} {j : e.B.lang.Relations r} {R : (A : Type) → [K.Structure A] → [LinearOrder A] → (Fin r → A) → Prop} (h : e.Computes j R) (x : e.Ext e') :
                                    e'.Computes (x.sym j) R
                                    Dependency graph

                                    The relations of a new stratum, in the stratified induction: their limits are those of the stratum, over the structure expanded by the limit of the induction below.

                                    Dependency graph