Word models #
The model-theoretic representation underlying logical characterizations of subregular
functions: a string viewed as a finite labeled linear order. A word model is the
relational signature ⟨D, L, R⟩ — a domain D of positions, unary labels L, and the
binary immediate-successor relation R; general precedence is the (FO-definable) transitive
closure of successor and is not part of the quantifier-free fragment.
The carrier is List α itself: a string is its word model. This is deliberately where
mathlib stops — it has strings (List/FreeMonoid) and automata (DFA, MyhillNerode)
but no model-theoretic word structure — and it keeps the logic layer directly composable
with Subregular's string functions (Subregular.IsInputStrictlyLocal, SFST).
Main definitions #
Subregular.Logic.WordModel— a string overα, viewed as⟨D, label, succ⟩.WordModel.label?— the unary label (symbol) at a position,noneoff the edge.WordModel.Mem— domain membership of a position.WordModel.succ?/WordModel.pred?— successor/predecessor as partial functions.
Implementation notes #
Positions are ℕ indices; a position is in-domain iff below length. Successor and
predecessor are partial functions (Option ℕ) rather than relations — this is what lets
the quantifier-free term language (Logic/QFLogic.lean) reach a bounded neighbourhood via
succ/pred chains without quantifiers, the syntactic source of strict locality.
A word model: a string over α, viewed model-theoretically as a finite linear
order of positions carrying unary labels and an immediate-successor relation.
Equations
- Subregular.Logic.WordModel α = List α
Instances For
Equations
- w.instDecidableMem n = n.decLt (List.length w)