Lax132576.LengthPreservingTyping
Length preservation through a typing of the states
concepts/Lax132576/LengthPreservingTyping.lean · lax-132576
No public endorsements yet.
Loading review…
Sign in with ORCIDConcept map
In the paper
- page 67 of the paper of lax-157538, Transducers
Theorem
Fix an automaton with output computing a function , all of whose states are productive. A typing is a function such that every run from an initial state to a state satisfies
The function is length preserving if and only if a typing exists and maps every accepting state to zero (Claim B.4.4 of Transducers). If no typing exists, two runs reach the same state with different length differences and the function cannot be length preserving; if a typing exists but some accepting state has nonzero type, a run reaching it witnesses the same.
Lean source view on GitHub
| 1 | import Lax765601.ElementaryProperties |
| 2 | import Lax132576.RationalRelations |
| 3 | |
| 4 | /-! |
| 5 | --- |
| 6 | title: Length preservation through a typing of the states |
| 7 | type: theorem |
| 8 | --- |
| 9 | Fix an automaton with output computing a function , all of whose states are |
| 10 | productive. A *typing* is a function such that every |
| 11 | run from an initial state to a state satisfies |
| 12 | |
| 13 | The function is length preserving if and only if a typing exists and maps |
| 14 | every accepting state to zero (Claim B.4.4 of *Transducers*). If no typing |
| 15 | exists, two runs reach the same state with different length differences and |
| 16 | the function cannot be length preserving; if a typing exists but some accepting |
| 17 | state has nonzero type, a run reaching it witnesses the same. |
| 18 | |
| 19 | # Formalization notes |
| 20 | |
| 21 | The automaton `M` computes `f` in the sense that its relation is the graph of |
| 22 | `f`; productivity of all states is a hypothesis, as the book assumes |
| 23 | implicitly. Runs are paths from an initial state, and the typing condition is |
| 24 | stated for all of them. |
| 25 | -/ |
| 26 | |
| 27 | namespace Lax132576.LengthPreservingTyping |
| 28 | |
| 29 | open Lax765601.ElementaryProperties Lax132576.LabelledAutomata Lax132576.RationalRelations |
| 30 | |
| 31 | /-- A function computed by an automaton with output with productive states is length |
| 32 | preserving if and only if the automaton has a typing vanishing on the accepting |
| 33 | states. -/ |
| 34 | axiom lengthPreserving_iff_typing {A B Q : Type} (M : NFAO A B Q) |
| 35 | (hprod : ∀ q, M.Productive q) {f : List A → List B} (hM : ∀ w v, M.rel w v ↔ v = f w) : |
| 36 | LengthPreserving f ↔ |
| 37 | ∃ τ : Q → ℤ, |
| 38 | (∀ q ∈ M.init, ∀ ts p, M.Path q ts p → |
| 39 | ((NFAO.outputOf ts).length : ℤ) = (LabAut.inputOf ts).length + τ p) ∧ |
| 40 | ∀ p ∈ M.final, τ p = 0 |
| 41 | |
| 42 | end Lax132576.LengthPreservingTyping |
| 43 |
Formalization notes
The automaton computes in the sense that its relation is the graph of ; productivity of all states is a hypothesis, as the book assumes implicitly. Runs are paths from an initial state, and the typing condition is stated for all of them.
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