Lax314295.LogicPrecomputation
Precomputing the answers of MSO formulas by a rational function
concepts/Lax314295/LogicPrecomputation.lean · lax-314295
No public endorsements yet.
Loading review…
Sign in with ORCIDConcept map
In the paper
- page 128 of the paper of lax-157538, Transducers
Theorem
For a finite set of mso formulas with one or two free first-order variables there is a letter-to-letter rational function such that each formula with one free variable corresponds to a set of letters — exactly when the letter of at position is in — and each formula with two free variables corresponds to a regular language — for , exactly when the infix of from to belongs to (Lemma C.4.10 of Transducers). The function decorates every position with the states, on the prefix and on the suffix, of the automata of Lemma C.4.2 for the formulas.
Lean source view on GitHub
| 1 | import Lax765601.ElementaryProperties |
| 2 | import Lax132576.RationalFunctions |
| 3 | import Lax314295.MSOLogic |
| 4 | |
| 5 | /-! |
| 6 | --- |
| 7 | title: Precomputing the answers of MSO formulas by a rational function |
| 8 | type: theorem |
| 9 | --- |
| 10 | For a finite set of mso formulas with one or two free first-order variables |
| 11 | there is a letter-to-letter rational function such that each |
| 12 | formula with one free variable corresponds to a set of letters |
| 13 | — exactly when the letter of at |
| 14 | position is in — and each formula with two free |
| 15 | variables corresponds to a regular language — for |
| 16 | , exactly when the infix of from |
| 17 | to belongs to (Lemma C.4.10 of *Transducers*). The function |
| 18 | decorates every position with the states, on the prefix and on the suffix, of |
| 19 | the automata of Lemma C.4.2 for the formulas. |
| 20 | |
| 21 | # Formalization notes |
| 22 | |
| 23 | The formulas with one free variable use the variable `0`; those with two use |
| 24 | `0` and `1`, evaluated at `x ≤ y`. The infix from `x` to `y` is |
| 25 | `((f w).drop x).take (y - x + 1)`. The alphabet is assumed finite. |
| 26 | -/ |
| 27 | |
| 28 | namespace Lax314295.LogicPrecomputation |
| 29 | |
| 30 | open Lax765601.ElementaryProperties Lax132576.RationalFunctions Lax314295.MSOLogic |
| 31 | |
| 32 | /-- The answers of finitely many mso formulas with one or two free variables are |
| 33 | read off a letter-to-letter rational function: as letters, respectively as regular |
| 34 | languages of infixes. -/ |
| 35 | axiom exists_rational_precomputation {A : Type} [Finite A] |
| 36 | (Φ₁ Φ₂ : Set (MSO A)) (hΦ₁ : Φ₁.Finite) (hΦ₂ : Φ₂.Finite) : |
| 37 | ∃ (C : Type) (_ : Finite C) (f : List A → List C), |
| 38 | IsRationalFun f ∧ LengthPreserving f ∧ |
| 39 | (∀ φ ∈ Φ₁, ∃ F : Set C, ∀ (w : List A) (x : ℕ), x < w.length → |
| 40 | (MSO.Sat w (fun _ => x) (fun _ => ∅) φ ↔ ∃ c ∈ F, (f w)[x]? = some c)) ∧ |
| 41 | (∀ φ ∈ Φ₂, ∃ L : Language C, L.IsRegular ∧ ∀ (w : List A) (x y : ℕ), |
| 42 | x ≤ y → y < w.length → |
| 43 | (MSO.Sat w (fun i => if i = 0 then x else y) (fun _ => ∅) φ ↔ |
| 44 | ((f w).drop x).take (y - x + 1) ∈ L)) |
| 45 | |
| 46 | end Lax314295.LogicPrecomputation |
| 47 |
Formalization notes
The formulas with one free variable use the variable ; those with two use and , evaluated at . The infix from to is . The alphabet is assumed finite.
Used by
none
From Mathlib
none
Community review
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above; your ORCID profile must share a public name.
0 comments