Lax916827.RegularConditional
Regular functions are closed under conditionals over regular languages
concepts/Lax916827/RegularConditional.lean · lax-916827
No public endorsements yet.
Loading review…
Sign in with ORCIDConcept map
In the paper
- page 98 of the paper of lax-157538, Transducers
Theorem
If are regular and is regular, then the conditional function
is regular (Lemma C.2.10 of Transducers, third item): a rational function marks the input with its membership in , and the marked sum of Claim C.2.11 applies or according to the mark.
Lean source view on GitHub
| 1 | import Mathlib.Computability.DFA |
| 2 | import Lax916827.RegularFunctions |
| 3 | |
| 4 | /-! |
| 5 | --- |
| 6 | title: Regular functions are closed under conditionals over regular languages |
| 7 | type: theorem |
| 8 | --- |
| 9 | If are regular and is regular, then the |
| 10 | conditional function |
| 11 | |
| 12 | is regular (Lemma C.2.10 of *Transducers*, third item): a rational function |
| 13 | marks the input with its membership in , and the marked sum of Claim C.2.11 |
| 14 | applies or according to the mark. |
| 15 | |
| 16 | # Formalization notes |
| 17 | |
| 18 | The conditional needs a decision of `w ∈ L`; the statement uses classical |
| 19 | decidability, since no computational content is claimed for the function. Both |
| 20 | alphabets are assumed finite, as in the book. |
| 21 | -/ |
| 22 | |
| 23 | namespace Lax916827.RegularConditional |
| 24 | |
| 25 | open Lax916827.RegularFunctions |
| 26 | |
| 27 | open scoped Classical in |
| 28 | /-- The conditional of two regular functions over a regular language is regular. -/ |
| 29 | axiom isRegularFun_ite {A B : Type} [Finite A] [Finite B] {f g : List A → List B} |
| 30 | (hf : IsRegularFun f) (hg : IsRegularFun g) (L : Language A) (hL : L.IsRegular) : |
| 31 | IsRegularFun (fun w => if w ∈ L then f w else g w) |
| 32 | |
| 33 | end Lax916827.RegularConditional |
| 34 |
Formalization notes
The conditional needs a decision of ; the statement uses classical decidability, since no computational content is claimed for the function. Both alphabets are assumed finite, as in the book.
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