Polynomial automata and Hadamard automata
Lax619925.PolynomialAutomata · concepts/Lax619925/PolynomialAutomata.lean · lax-619925
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Theorem
A polynomial automaton (paper appendix) is a weighted automaton whose configuration space is the vector space and whose letter actions are polynomial maps. It is the dual of the Hadamard automaton: here the configuration is a point and the final weight is a polynomial, whereas the Hadamard automaton's configuration is a polynomial and its final weight is a point. The main result (paper appendix) is that a series is recognisable by a polynomial automaton if and only if its reversal is Hadamard-recognisable: the duality swaps the configuration and the final weight, and the reversal accounts for the order in which the transitions are composed.
Concept map
Evidence
Each proof establishes this claim relative to its assumptions.
In the paper
- page 39 of this submission's paper
Lean source view on GitHub
| 1 | import Lax619925.Series |
| 2 | import Lax619925.Hadamard |
| 3 | import Mathlib.Data.Real.Basic |
| 4 | import Mathlib.Data.Fin.Basic |
| 5 | import Mathlib.Data.Fintype.Basic |
| 6 | import Mathlib.Algebra.MvPolynomial.Basic |
| 7 | import Mathlib.Algebra.MvPolynomial.Eval |
| 8 | |
| 9 | /-! |
| 10 | --- |
| 11 | title: Polynomial automata and Hadamard automata |
| 12 | type: theorem |
| 13 | --- |
| 14 | A *polynomial automaton* (paper appendix) is a weighted automaton whose |
| 15 | configuration space is the vector space `ℚ^k` and whose letter actions are |
| 16 | polynomial maps. It is the dual of the Hadamard automaton: here the |
| 17 | configuration is a *point* and the final weight is a *polynomial*, whereas the |
| 18 | Hadamard automaton's configuration is a *polynomial* and its final weight is a |
| 19 | *point*. The main result (paper appendix) is that a series is recognisable by a |
| 20 | polynomial automaton if and only if its reversal is Hadamard-recognisable: the |
| 21 | duality swaps the configuration and the final weight, and the reversal accounts |
| 22 | for the order in which the transitions are composed. |
| 23 | -/ |
| 24 | |
| 25 | namespace Lax619925.PolynomialAutomata |
| 26 | |
| 27 | open Lax619925.Series Lax619925.Hadamard |
| 28 | |
| 29 | /-- A *polynomial automaton* over `α`: a dimension `k ≥ 1`, an initial |
| 30 | configuration `qI : ℚ^k`, a final polynomial `F : ℚ[X_1, …, X_k]`, and a |
| 31 | transition `Δ` assigning to each letter `a` a polynomial map |
| 32 | `Δ_a : ℚ^k → ℚ^k` (a `k`-tuple of polynomials). The configuration space is |
| 33 | the vector space `ℚ^k`, and the letter action is `q · a = Δ_a(q)` (evaluate |
| 34 | the transition polynomials at the point `q`). -/ |
| 35 | structure PolynomialAutomaton (α : Type*) where |
| 36 | dim : ℕ |
| 37 | hdim : 0 < dim |
| 38 | qI : Fin dim → ℚ |
| 39 | F : MvPolynomial (Fin dim) ℚ |
| 40 | Δ : α → Fin dim → MvPolynomial (Fin dim) ℚ |
| 41 | |
| 42 | /-- The action of a letter `a` on a configuration `q`: `q · a = Δ_a(q)`, |
| 43 | evaluate the transition polynomials at the point `q`. -/ |
| 44 | noncomputable def PolynomialAutomaton.action {α : Type*} (A : PolynomialAutomaton α) |
| 45 | (q : Fin A.dim → ℚ) (a : α) : Fin A.dim → ℚ := |
| 46 | fun i => MvPolynomial.eval q (A.Δ a i) |
| 47 | |
| 48 | /-- The action of a word `w` on a configuration `q`: `q · w`, the letter actions |
| 49 | iterated left-to-right. -/ |
| 50 | noncomputable def PolynomialAutomaton.wordAction {α : Type*} (A : PolynomialAutomaton α) |
| 51 | (q : Fin A.dim → ℚ) (w : List α) : Fin A.dim → ℚ := |
| 52 | w.foldl (fun q a => A.action q a) q |
| 53 | |
| 54 | /-- The series recognised by the automaton at a configuration `q`: |
| 55 | `⟦A⟧_q (w) = F(q · w)`, the final polynomial `F` evaluated at the point |
| 56 | `q · w` reached after reading `w`. -/ |
| 57 | noncomputable def PolynomialAutomaton.sem {α : Type*} (A : PolynomialAutomaton α) |
| 58 | (q : Fin A.dim → ℚ) : Series α := |
| 59 | fun w => MvPolynomial.eval (A.wordAction q w) A.F |
| 60 | |
| 61 | /-- The series recognised by the automaton: the semantics at the initial |
| 62 | configuration `qI`. -/ |
| 63 | noncomputable def PolynomialAutomaton.recognised {α : Type*} (A : PolynomialAutomaton α) : Series α := |
| 64 | A.sem A.qI |
| 65 | |
| 66 | /-- A series is *polynomial-recognisable* if it is recognised by some polynomial |
| 67 | automaton. -/ |
| 68 | def IsPolynomialRecognisable (α : Type*) (f : Series α) : Prop := |
| 69 | ∃ A : PolynomialAutomaton α, A.recognised = f |
| 70 | |
| 71 | /-- A series is recognisable by a polynomial automaton if and only if its |
| 72 | reversal is Hadamard-recognisable (paper appendix). The duality swaps the |
| 73 | configuration (point ↔ polynomial) and the final weight (polynomial ↔ |
| 74 | point), and the reversal accounts for the order of composition of the |
| 75 | transitions. -/ |
| 76 | axiom PolynomialHadamardEquivalence (α : Type*) (f : Series α) : |
| 77 | IsPolynomialRecognisable α f ↔ IsHadamardRecognisable α (reversal α f) |
| 78 | |
| 79 | end Lax619925.PolynomialAutomata |
| 80 |
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments