@@ -5,6 +5,8 @@ open Classical Computability
55
66variable {α : Type }
77
8+ namespace εNFA
9+
810section concat
911
1012variable {σ₁ σ₂ : Type *}
@@ -174,6 +176,16 @@ theorem accepts_concat (εM₁ : εNFA α σ₁) (εM₂ : εNFA α σ₂) :
174176
175177end concat
176178
179+ section kstar
180+
181+
182+
183+ end kstar
184+
185+ end εNFA
186+
187+ namespace DFA
188+
177189section singleton
178190
179191def char (a : α) [DecidableEq α] : DFA α (Fin 3 ) where
@@ -226,6 +238,8 @@ theorem accepts_char (a : α) : (char a).accepts = { [a] } := by
226238
227239end singleton
228240
241+ end DFA
242+
229243namespace Language
230244
231245theorem IsRegular.zero : IsRegular (0 : Language α) := by
@@ -268,22 +282,22 @@ theorem IsRegular.mul {L₁ L₂ : Language α} [DecidableEq α]
268282 have ⟨σ₂, _, M₂, hM₂⟩ := h₂
269283 let εM₁ := M₁.toNFA.toεNFA
270284 let εM₂ := M₂.toNFA.toεNFA
271- let εM := concat εM₁ εM₂
285+ let εM := εNFA. concat εM₁ εM₂
272286 apply isRegular_iff.mpr
273287 use Set (σ₁ ⊕ σ₂), inferInstance, εM.toNFA.toDFA
274288 subst hM₁ hM₂
275289 rw [NFA.toDFA_correct, εNFA.toNFA_correct]
276290 rw [← DFA.toNFA_correct, ← NFA.toεNFA_correct]
277291 rw [← DFA.toNFA_correct, ← NFA.toεNFA_correct]
278- exact accepts_concat εM₁ εM₂
292+ exact εNFA. accepts_concat εM₁ εM₂
279293
280294theorem IsRegular.kstar {L : Language α} (h : IsRegular L) : IsRegular (L∗) := by
281295 sorry
282296
283297theorem IsRegular.singleton {a : α} : IsRegular ({ [a] }) := by
284298 apply isRegular_iff.mpr
285- let M := char a
299+ let M := DFA. char a
286300 use Fin 3 , inferInstance, M
287- exact accepts_char a
301+ exact DFA. accepts_char a
288302
289303end Language
0 commit comments