Locally Testable Languages (LT_k, LTT_{k,t}) #
A language L is locally k-testable when membership depends only on
which length-k factors occur in the boundary-augmented form of the input —
ignoring order and multiplicity @cite{rogers-pullum-2011} @cite{lambert-2022}.
The threshold-testable variant LTT_{k,t} relaxes "ignoring multiplicity"
to "saturating multiplicities at threshold t": LT counts only presence vs
absence (t = 1), LTT_{k,t} counts up to t and treats anything beyond as
"≥ t".
Both are property-based (extensional) classifications — there is no
canonical grammar, only an indistinguishability relation on strings:
w₁ ~_LT w₂ iff their k-factor sets coincide. L is LT_k iff it is
closed under ~_LT.
Main definitions #
factorSet k w— the set ofk-factors ofboundary k w.IsLocallyTestable k L— closure ofLunder equality offactorSet.factorCount k t f w— multiplicity offinboundary k w, capped att.IsLocallyThresholdTestable k t L— closure under equality offactorCount.
Inclusions #
The cast lemma IsStrictlyLocal k L → IsLocallyTestable k L lives at the
end of the file (the larger-class file holds the cast, mathlib-style).
The companion cast LT_k ⊆ LTT_{k,t} for t ≥ 1 lives inside the
DecidableEq-scoped section with IsLocallyThresholdTestable.
A language is locally k-testable iff strings with the same set of
k-factors are either both in L or both out.
Equations
- Core.Computability.Subregular.IsLocallyTestable k L = ∀ (w₁ w₂ : List α), Core.Computability.Subregular.factorSet k w₁ = Core.Computability.Subregular.factorSet k w₂ → (w₁ ∈ L ↔ w₂ ∈ L)
Instances For
SL_k ⊆ LT_k: every strictly-k-local language is locally
k-testable. The SL test ("every factor is permitted") trivially
depends only on the set of factors, not their order or multiplicity.
Saturated multiplicity: how many times factor f occurs in w's
boundary-augmented form, capped at threshold t. The cap is what makes
LTT a finite test even on infinite-input families.
Equations
- Core.Computability.Subregular.factorCount k t f w = min t (List.count f (Core.Computability.Subregular.kFactors k (Core.Computability.Subregular.boundary k w)))
Instances For
A language is locally (k,t)-threshold-testable iff strings with
the same t-saturated factor counts agree on membership. Specializing to
t = 1 recovers IsLocallyTestable (presence vs absence of each factor).
Equations
- One or more equations did not get rendered due to their size.
Instances For
LT_k ⊆ LTT_{k,t} for t ≥ 1. A factor occurs in w iff its
saturated count is positive, so closure under count-equivalence implies
closure under set-equivalence.