Documentation

Linglib.Core.Computability.Subregular.Language.Multitier

Multitier extensions of subregular classes #

The Boolean closure of tier-projected language families. For a class ๐’ž : Language ฮฑ โ†’ Prop, the multitier closure IsBTC ๐’ž closes under finite โŠ“/โŠ”/แถœ the languages that are preimages of a ๐’ž-language under some Boolean tier projection.

Main definitions #

Main results #

Implementation notes #

IsTierBased/IsBTC.Indist quantify over Bool tiers T : ฮฑ โ†’ Bool, avoiding an โˆƒ T, โˆƒ _ : DecidablePred T, โ€ฆ witness; the Prop-with-[DecidablePred] form used by tierProject/TSLGrammar converts via T x โ†” tier x = true.

Tier-based language families #

def Language.IsTierBased {ฮฑ : Type u_1} (๐’ž : Language ฮฑ โ†’ Prop) (L : Language ฮฑ) :

A language L is tier-based for class ๐’ž iff there is some Boolean tier predicate T : ฮฑ โ†’ Bool and some L' : Language ฮฑ with L' in ๐’ž such that L is the preimage of L' under projection by T: w โˆˆ L โ†” w.filter T โˆˆ L'.

The Bool tier shape is the existence-friendly form (no instance quantifier issues). For the Prop+DecidablePred form used by tierProject and TSLGrammar, convert via T x โ†” tier x = true.

Equations
  • Language.IsTierBased ๐’ž L = โˆƒ (T : ฮฑ โ†’ Bool) (L' : Language ฮฑ), L = {w : List ฮฑ | List.filter T w โˆˆ L'} โˆง ๐’ž L'
Instances For
    theorem Language.IsTierBased.of_class {ฮฑ : Type u_1} {๐’ž : Language ฮฑ โ†’ Prop} {L : Language ฮฑ} (h : ๐’ž L) :
    IsTierBased ๐’ž L

    Class injection: every ๐’ž-language is tier-based for ๐’ž via the universal-true tier (no symbols erased). The witness is T = fun _ => true and L' = L.

    theorem Language.IsTierBased.mono {ฮฑ : Type u_1} {๐’ž ๐’Ÿ : Language ฮฑ โ†’ Prop} {L : Language ฮฑ} (h : โˆ€ (L : Language ฮฑ), ๐’ž L โ†’ ๐’Ÿ L) (hL : IsTierBased ๐’ž L) :
    IsTierBased ๐’Ÿ L

    Monotonicity in the base class.

    Multitier (Boolean tier-projected) closure #

    def Language.IsBTC {ฮฑ : Type u_1} (๐’ž : Language ฮฑ โ†’ Prop) (L : Language ฮฑ) :

    The multitier closure of a class ๐’ž: the Boolean subalgebra of Language ฮฑ generated by the tier-projected family IsTierBased ๐’ž.

    Equations
    Instances For
      theorem Language.IsBTC.base {ฮฑ : Type u_1} {๐’ž : Language ฮฑ โ†’ Prop} {L : Language ฮฑ} (h : IsTierBased ๐’ž L) :
      IsBTC ๐’ž L

      Base-class injection: a tier-based language lies in the closure.

      theorem Language.IsBTC.inter {ฮฑ : Type u_1} {๐’ž : Language ฮฑ โ†’ Prop} {Lโ‚ Lโ‚‚ : Language ฮฑ} (hโ‚ : IsBTC ๐’ž Lโ‚) (hโ‚‚ : IsBTC ๐’ž Lโ‚‚) :
      IsBTC ๐’ž (Lโ‚ โŠ“ Lโ‚‚)

      Closure under intersection.

      theorem Language.IsBTC.union {ฮฑ : Type u_1} {๐’ž : Language ฮฑ โ†’ Prop} {Lโ‚ Lโ‚‚ : Language ฮฑ} (hโ‚ : IsBTC ๐’ž Lโ‚) (hโ‚‚ : IsBTC ๐’ž Lโ‚‚) :
      IsBTC ๐’ž (Lโ‚ โŠ” Lโ‚‚)

      Closure under union.

      theorem Language.IsBTC.compl {ฮฑ : Type u_1} {๐’ž : Language ฮฑ โ†’ Prop} {L : Language ฮฑ} (h : IsBTC ๐’ž L) :
      IsBTC ๐’ž Lแถœ

      Closure under complement.

      theorem Language.IsBTC.of_class {ฮฑ : Type u_1} {๐’ž : Language ฮฑ โ†’ Prop} {L : Language ฮฑ} (h : ๐’ž L) :
      IsBTC ๐’ž L

      Class injection into the multitier closure: every ๐’ž-language is in IsBTC ๐’ž, via the universal tier.

      theorem Language.IsBTC.of_tierBased {ฮฑ : Type u_1} {๐’ž : Language ฮฑ โ†’ Prop} {L : Language ฮฑ} (h : IsTierBased ๐’ž L) :
      IsBTC ๐’ž L

      Tier-based injection into the multitier closure: every tier-based-for-๐’ž language is in IsBTC ๐’ž.

      theorem Language.IsBTC.mono {ฮฑ : Type u_1} {๐’ž ๐’Ÿ : Language ฮฑ โ†’ Prop} {L : Language ฮฑ} (h : โˆ€ (L : Language ฮฑ), ๐’ž L โ†’ ๐’Ÿ L) (hL : IsBTC ๐’ž L) :
      IsBTC ๐’Ÿ L

      Monotonicity of multitier closure in the base class.

      Specializations #

      One line each. Closure under intersection, union, and complement comes from IsBTC.inter/union/compl; class injection from IsBTC.of_class.

      def Language.IsBTSL {ฮฑ : Type u_1} (k : โ„•) :
      Language ฮฑ โ†’ Prop

      Multitier strictly local (BTSL): Boolean closure of tier-projected SL_k languages.

      Equations
      Instances For
        def Language.IsBTSP {ฮฑ : Type u_1} (k : โ„•) :
        Language ฮฑ โ†’ Prop

        Multitier strictly piecewise (BTSP): Boolean closure of tier-projected SP_k languages.

        Equations
        Instances For
          def Language.IsBTD {ฮฑ : Type u_1} (k : โ„•) :
          Language ฮฑ โ†’ Prop

          Multitier definite (BTD): Boolean closure of tier-projected D_k languages.

          Equations
          Instances For
            def Language.IsBTK {ฮฑ : Type u_1} (k : โ„•) :
            Language ฮฑ โ†’ Prop

            Multitier reverse definite (BTK): Boolean closure of tier-projected RD_k languages.

            Equations
            Instances For
              def Language.IsBTLI {ฮฑ : Type u_1} (k : โ„•) :
              Language ฮฑ โ†’ Prop

              Multitier generalized definite (BTLI): Boolean closure of tier-projected โ„’โ„_k languages.

              Equations
              Instances For
                def Language.IsBTN {ฮฑ : Type u_1} :
                Language ฮฑ โ†’ Prop

                Multitier finite-or-cofinite (BTN): Boolean closure of tier-projected co/finite languages.

                Equations
                Instances For

                  Cross-class inclusions #

                  Class containment lifts through the multitier construction: if ๐’ž โІ ๐’Ÿ pointwise, then IsBTC ๐’ž โІ IsBTC ๐’Ÿ. Specializing the D_k โІ โ„’โ„_k and RD_k โІ โ„’โ„_k inclusions yields BTD โІ BTLI and BTK โІ BTLI.

                  theorem Language.IsBTD.toIsBTLI {ฮฑ : Type u_1} {L : Language ฮฑ} {k : โ„•} (h : IsBTD k L) :
                  IsBTLI k L

                  D_k โІ โ„’โ„_k lifts to BTD_k โІ BTLI_k.

                  theorem Language.IsBTK.toIsBTLI {ฮฑ : Type u_1} {L : Language ฮฑ} {k : โ„•} (h : IsBTK k L) :
                  IsBTLI k L

                  RD_k โІ โ„’โ„_k lifts to BTK_k โІ BTLI_k.

                  TSL โІ multitier SL #

                  theorem Language.IsTierStrictlyLocal.toIsBTSL {ฮฑ : Type u_1} {L : Language ฮฑ} {k : โ„•} (h : IsTierStrictlyLocal k L) :
                  IsBTSL k L

                  TSL_k โ†’ BTSL_k: every tier-based strictly local language is in the multitier closure of strictly local languages. A TSLGrammar witness presents its language as the preimage of an SL language under the tier projection, hence IsTierBased (Language.IsStrictlyLocal ยท k), hence in the closure via IsBTC.base.

                  Indistinguishability framework for refuting IsBTC membership #

                  Standard technique for L โˆ‰ IsBTC ๐’ž: exhibit two words wโ‚, wโ‚‚ that are ๐’ž-tier-indistinguishable (every ๐’ž-language under every Bool tier projection assigns them the same membership) but differ in L-membership. The IsGeneralizedDefinite k specialization โ€” sharing length-k prefix-and-suffix on every tier projection (indist_isGenDef_of_tierAffixes) โ€” is the common case.

                  def Language.IsBTC.Indist {ฮฑ : Type u_1} (๐’ž : Language ฮฑ โ†’ Prop) (wโ‚ wโ‚‚ : List ฮฑ) :

                  Two words are ๐’ž-tier-indistinguishable iff under every Bool tier projection, every ๐’ž-language assigns them the same membership.

                  Equations
                  • Language.IsBTC.Indist ๐’ž wโ‚ wโ‚‚ = โˆ€ (T : ฮฑ โ†’ Bool) (L' : Language ฮฑ), ๐’ž L' โ†’ (List.filter T wโ‚ โˆˆ L' โ†” List.filter T wโ‚‚ โˆˆ L')
                  Instances For
                    theorem Language.IsBTC.Indist.refl {ฮฑ : Type u_1} (๐’ž : Language ฮฑ โ†’ Prop) (w : List ฮฑ) :
                    Indist ๐’ž w w
                    theorem Language.IsBTC.Indist.symm {ฮฑ : Type u_1} {๐’ž : Language ฮฑ โ†’ Prop} {wโ‚ wโ‚‚ : List ฮฑ} (h : Indist ๐’ž wโ‚ wโ‚‚) :
                    Indist ๐’ž wโ‚‚ wโ‚
                    theorem Language.IsBTC.Indist.trans {ฮฑ : Type u_1} {๐’ž : Language ฮฑ โ†’ Prop} {wโ‚ wโ‚‚ wโ‚ƒ : List ฮฑ} (hโ‚ : Indist ๐’ž wโ‚ wโ‚‚) (hโ‚‚ : Indist ๐’ž wโ‚‚ wโ‚ƒ) :
                    Indist ๐’ž wโ‚ wโ‚ƒ
                    theorem Language.IsBTC.mem_iff_of_indist {ฮฑ : Type u_1} {๐’ž : Language ฮฑ โ†’ Prop} {L : Language ฮฑ} {wโ‚ wโ‚‚ : List ฮฑ} (hL : IsBTC ๐’ž L) (hindist : Indist ๐’ž wโ‚ wโ‚‚) :
                    wโ‚ โˆˆ L โ†” wโ‚‚ โˆˆ L

                    Tier-indistinguishability transports through the Boolean closure: wโ‚ and wโ‚‚ ๐’ž-tier-indistinguishable implies same membership in every IsBTC ๐’ž-language. Induction on the closure: mem is the defining property of Indist; bot/sup/compl lift via Iff.rfl/or_congr/not_congr.

                    theorem Language.not_isBTC_of_indist {ฮฑ : Type u_1} {๐’ž : Language ฮฑ โ†’ Prop} {L : Language ฮฑ} {wโ‚ wโ‚‚ : List ฮฑ} (h_indist : IsBTC.Indist ๐’ž wโ‚ wโ‚‚) (h_wโ‚ : wโ‚ โˆˆ L) (h_wโ‚‚ : wโ‚‚ โˆ‰ L) :
                    ยฌIsBTC ๐’ž L

                    Refutation lemma: if wโ‚ โˆˆ L and wโ‚‚ โˆ‰ L but wโ‚ and wโ‚‚ are ๐’ž-tier-indistinguishable, then L โˆ‰ IsBTC ๐’ž.

                    theorem Language.IsBTC.indist_isGenDef_of_tierAffixes {ฮฑ : Type u_1} {k : โ„•} {wโ‚ wโ‚‚ : List ฮฑ} (h : โˆ€ (T : ฮฑ โ†’ Bool), Subregular.Edge.left.takeAt k (List.filter T wโ‚) = Subregular.Edge.left.takeAt k (List.filter T wโ‚‚) โˆง Subregular.Edge.right.takeAt k (List.filter T wโ‚) = Subregular.Edge.right.takeAt k (List.filter T wโ‚‚)) :
                    Indist (fun (x : Language ฮฑ) => x.IsGeneralizedDefinite k) wโ‚ wโ‚‚

                    Shared length-k prefix-and-suffix on every Bool-tier projection implies IsBTC.Indist (Language.IsGeneralizedDefinite ยท k) โ€” the standard specialization for refuting IsBTLI k membership, reducing it to a Bool-tier-parameterised pair of affix equalities.