Lax132576.MealyDecidable
Deciding whether a rational function is a Mealy machine
concepts/Lax132576/MealyDecidable.lean · lax-132576
No public endorsements yet.
Loading review…
Sign in with ORCIDConcept map
In the paper
- page 66 of the paper of lax-157538, Transducers
Theorem
One can decide whether a given rational function is computed by a Mealy machine (Theorem B.4.2 of Transducers). By Theorem B.4.1 it suffices to check the three properties of a Mealy function: continuity is automatic for a rational function, length preservation is decided by Lemma B.4.3, and after Lemma B.4.5 has put the automaton in a form where every transition reads and writes one letter, prefix preservation fails exactly when two transitions with the same input letter and different output letters start in states reachable by a common input string.
Lean source view on GitHub
| 1 | import Lax765601.MealyMachine |
| 2 | import Lax132576.TransducerCodes |
| 3 | |
| 4 | /-! |
| 5 | --- |
| 6 | title: Deciding whether a rational function is a Mealy machine |
| 7 | type: theorem |
| 8 | --- |
| 9 | One can decide whether a given rational function is computed by a Mealy |
| 10 | machine (Theorem B.4.2 of *Transducers*). By Theorem B.4.1 it suffices to check |
| 11 | the three properties of a Mealy function: continuity is automatic for a |
| 12 | rational function, length preservation is decided by Lemma B.4.3, and after |
| 13 | Lemma B.4.5 has put the automaton in a form where every transition reads and |
| 14 | writes one letter, prefix preservation fails exactly when two transitions with |
| 15 | the same input letter and different output letters start in states reachable |
| 16 | by a common input string. |
| 17 | |
| 18 | # Formalization notes |
| 19 | |
| 20 | The function is given by a functional code, and the decided property is that |
| 21 | some function computed by a Mealy machine agrees with the coded relation on |
| 22 | the code words: a code reads only the letters of its alphabet, so the |
| 23 | comparison is relativised to `CodeWord c` — without the relativisation the |
| 24 | property would be false for every code and the statement empty. The proof |
| 25 | reduces prefix preservation to the equality of two rational functions, decided |
| 26 | by Theorem B.3.4. |
| 27 | -/ |
| 28 | |
| 29 | namespace Lax132576.MealyDecidable |
| 30 | |
| 31 | open Lax765601.MealyMachine Lax132576.TransducerCodes |
| 32 | |
| 33 | /-- Whether a coded rational function is computed by a Mealy machine is decidable. |
| 34 | -/ |
| 35 | axiom decidable_isMealy : |
| 36 | DecidableUnderPromise CodeFunctional |
| 37 | (fun c => ∃ f : List ℕ → List ℕ, |
| 38 | (∀ w, CodeWord c w → ∀ v, (codeRel c w v ↔ v = f w)) ∧ IsMealy f) |
| 39 | |
| 40 | end Lax132576.MealyDecidable |
| 41 |
Formalization notes
The function is given by a functional code, and the decided property is that some function computed by a Mealy machine agrees with the coded relation on the code words: a code reads only the letters of its alphabet, so the comparison is relativised to — without the relativisation the property would be false for every code and the statement empty. The proof reduces prefix preservation to the equality of two rational functions, decided by Theorem B.3.4.
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