Subregular Languages — Boundaries and k-Factors #
Common infrastructure for the subregular hierarchy @cite{lambert-2022}
@cite{heinz-rogers-2010} @cite{rogers-pullum-2011}: boundary augmentation
of strings, contiguous k-factors with boundary padding, and the
factor-membership predicate that all of StrictlyLocal, LocallyTestable,
and their tier-relativized variants build on.
Why Option α for boundaries #
The canonical subregular convention extends the alphabet with edge markers
⋊ (left) and ⋉ (right) and studies k-factors of ⋊ᵏ⁻¹ · w · ⋉ᵏ⁻¹.
Mathlib's idiomatic way to extend an alphabet by one fresh symbol is
Option α: none is the new boundary, some a an original symbol. Two
distinct edges are unnecessary — boundary symbols only appear at fixed
positions by construction.
Main definitions #
A boundary-augmented string: an alphabet symbol or the boundary marker
none. Lambert's ⋊ and ⋉ collapse to the single none symbol here, since
edges only appear at fixed positions by construction.
Equations
- Core.Computability.Subregular.Augmented α = List (Option α)
Instances For
Boundary-augment a string with k - 1 boundary markers on each side.
For k ≤ 1 no padding is added (no k-factor can span the edge).
Equations
- Core.Computability.Subregular.boundary k w = List.replicate (k - 1) none ++ List.map some w ++ List.replicate (k - 1) none
Instances For
The contiguous length-k infixes of xs. Built by enumerating suffixes
and taking each one's length-k prefix; suffixes shorter than k are
filtered out.
Equations
- Core.Computability.Subregular.kFactors k xs = List.map (fun (x : List β) => List.take k x) (List.filter (fun (x : List β) => decide (k ≤ x.length)) xs.tails)
Instances For
Every member of kFactors k xs has length exactly k.
A k-factor of xs is a contiguous infix of xs. The witness is a
prefix (take) of a suffix (tails), and prefix-of-suffix is infix.
Equations
- Core.Computability.Subregular.instDecidableMemListKFactorsOfDecidableEq k f xs = id inferInstance
The 2-factors of a :: b :: rest are [a, b] followed by the 2-factors
of b :: rest. Specialization of kFactors to k = 2 for the inductive
step in chain-based characterizations of SL_2 and TSL_2 languages.
An empty list has no 2-factors.
A singleton list has no 2-factors.
A relation on Option α is boundary-vacuous when the boundary marker
none satisfies it on either side: R none u and R u none always hold.
Equivalently, only (some a, some b) pairs can witness a violation.
Boundary-vacuity captures the property of subregular constraints that hold
trivially at string edges — the OCP relation, the no-clash relation, the
no-lapse relation all share this shape. The chain-membership of a
boundary-padded augmented string is then equivalent to the chain-membership
of the unpadded core (isChain_boundary_two_iff).
- none_left (u : Option α) : R none u
- none_right (u : Option α) : R u none
Instances For
Prepending none to a list preserves chain-membership for any
boundary-vacuous relation.
Appending [none] to a list preserves chain-membership for any
boundary-vacuous relation.
The 2-boundary padding [none] · _ · [none] preserves chain-membership
for any boundary-vacuous relation.
Generic List.IsChain helpers #
Alphabet-generic facts about List.IsChain that mathlib does not currently
expose; the natural home is Mathlib.Data.List.Chain once they pay for
themselves across more consumers (a future MTSL formalisation will combine
per-tier IsChain witnesses via List.IsChain.and).
Any list is a chain for the universal-true relation. The trivial
case of IsChain for a relation that places no constraint on adjacent
elements.
Two IsChain witnesses on the same list combine into a chain for the
conjunction relation. The companion of mathlib's List.IsChain.imp.