File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import Mathlib.Computability.EpsilonNFA
22import Mathlib.Computability.Language
3+ import Mathlib.Computability.RegularExpressions
34
45open Classical Computability
56
@@ -608,3 +609,28 @@ theorem IsRegular.singleton {a : α} : IsRegular ({ [a] }) := by
608609 exact DFA.accepts_char
609610
610611end Language
612+
613+ namespace RegularExpressions
614+
615+ theorem IsRegular.matches (P : RegularExpression α) : Language.IsRegular (P.matches') := by
616+ induction P with
617+ | zero =>
618+ simp
619+ exact Language.IsRegular.zero
620+ | epsilon =>
621+ simp
622+ exact Language.IsRegular.one
623+ | char =>
624+ simp
625+ exact Language.IsRegular.singleton
626+ | plus _ _ ih₁ ih₂ =>
627+ simp
628+ exact Language.IsRegular.add ih₁ ih₂
629+ | comp _ _ ih₁ ih₂ =>
630+ simp
631+ exact Language.IsRegular.mul ih₁ ih₂
632+ | star _ ih =>
633+ simp
634+ exact Language.IsRegular.kstar ih
635+
636+ end RegularExpressions
You can’t perform that action at this time.
0 commit comments