author | urbanc |
Sun, 30 Jan 2011 17:24:37 +0000 | |
changeset 53 | da85feadb8e3 |
parent 52 | 4a517c6ac07d |
child 54 | c19d2fc2cc69 |
permissions | -rw-r--r-- |
24 | 1 |
(*<*) |
2 |
theory Paper |
|
39
a59473f0229d
tuned a little bit the section about finite partitions
urbanc
parents:
37
diff
changeset
|
3 |
imports "../Myhill" "LaTeXsugar" |
24 | 4 |
begin |
39
a59473f0229d
tuned a little bit the section about finite partitions
urbanc
parents:
37
diff
changeset
|
5 |
|
a59473f0229d
tuned a little bit the section about finite partitions
urbanc
parents:
37
diff
changeset
|
6 |
declare [[show_question_marks = false]] |
a59473f0229d
tuned a little bit the section about finite partitions
urbanc
parents:
37
diff
changeset
|
7 |
|
a59473f0229d
tuned a little bit the section about finite partitions
urbanc
parents:
37
diff
changeset
|
8 |
notation (latex output) |
50 | 9 |
str_eq_rel ("\<approx>\<^bsub>_\<^esub>") and |
10 |
Seq (infixr "\<cdot>" 100) and |
|
11 |
Star ("_\<^bsup>\<star>\<^esup>") and |
|
12 |
pow ("_\<^bsup>_\<^esup>" [100, 100] 100) and |
|
52
4a517c6ac07d
tuning of the syntax; needs the stmaryrd latex package
urbanc
parents:
51
diff
changeset
|
13 |
Suc ("_+1" [100] 100) and |
4a517c6ac07d
tuning of the syntax; needs the stmaryrd latex package
urbanc
parents:
51
diff
changeset
|
14 |
quotient ("_ \<^raw:\ensuremath{\sslash}> _ " [90, 90] 90) |
4a517c6ac07d
tuning of the syntax; needs the stmaryrd latex package
urbanc
parents:
51
diff
changeset
|
15 |
|
39
a59473f0229d
tuned a little bit the section about finite partitions
urbanc
parents:
37
diff
changeset
|
16 |
|
24 | 17 |
(*>*) |
18 |
||
19 |
section {* Introduction *} |
|
20 |
||
21 |
text {* |
|
22 |
||
23 |
*} |
|
24 |
||
50 | 25 |
section {* Preliminaries *} |
26 |
||
27 |
text {* |
|
51 | 28 |
Central to our proof will be the solution of equational systems |
50 | 29 |
involving regular expressions. For this we will use the following ``reverse'' |
30 |
version of Arden's lemma. |
|
31 |
||
32 |
\begin{lemma}[Reverse Arden's Lemma]\mbox{}\\ |
|
33 |
If @{thm (prem 1) ardens_revised} then |
|
34 |
@{thm (lhs) ardens_revised} has the unique solution |
|
35 |
@{thm (rhs) ardens_revised}. |
|
36 |
\end{lemma} |
|
37 |
||
38 |
\begin{proof} |
|
51 | 39 |
For the right-to-left direction we assume @{thm (rhs) ardens_revised} and show |
40 |
that @{thm (lhs) ardens_revised} holds. From Lemma ??? we have @{term "A\<star> = {[]} \<union> A ;; A\<star>"}, |
|
50 | 41 |
which is equal to @{term "A\<star> = {[]} \<union> A\<star> ;; A"}. Adding @{text B} to both |
42 |
sides gives @{term "B ;; A\<star> = B ;; ({[]} \<union> A\<star> ;; A)"}, whose right-hand side |
|
51 | 43 |
is equal to @{term "(B ;; A\<star>) ;; A \<union> B"}. This completes this direction. |
50 | 44 |
|
45 |
For the other direction we assume @{thm (lhs) ardens_revised}. By a simple induction |
|
51 | 46 |
on @{text n}, we can establish the property |
50 | 47 |
|
48 |
\begin{center} |
|
49 |
@{text "(*)"}\hspace{5mm} @{thm (concl) ardens_helper} |
|
50 |
\end{center} |
|
51 |
||
52 |
\noindent |
|
53 |
Using this property we can show that @{term "B ;; (A \<up> n) \<subseteq> X"} holds for |
|
54 |
all @{text n}. From this we can infer @{term "B ;; A\<star> \<subseteq> X"} using Lemma ???. |
|
51 | 55 |
For the inclusion in the other direction we assume a string @{text s} |
50 | 56 |
with length @{text k} is element in @{text X}. Since @{thm (prem 1) ardens_revised} |
51 | 57 |
we know that @{term "s \<notin> X ;; (A \<up> Suc k)"} since its length is only @{text k} |
58 |
(the strings in @{term "X ;; (A \<up> Suc k)"} are all longer). |
|
53 | 59 |
From @{text "(*)"} it follows then that |
50 | 60 |
@{term s} must be element in @{term "(\<Union>m\<in>{0..k}. B ;; (A \<up> m))"}. This in turn |
61 |
implies that @{term s} is in @{term "(\<Union>n. B ;; (A \<up> n))"}. Using Lemma ??? this |
|
62 |
is equal to @{term "B ;; A\<star>"}, as we needed to show.\qed |
|
63 |
\end{proof} |
|
64 |
*} |
|
39
a59473f0229d
tuned a little bit the section about finite partitions
urbanc
parents:
37
diff
changeset
|
65 |
|
a59473f0229d
tuned a little bit the section about finite partitions
urbanc
parents:
37
diff
changeset
|
66 |
section {* Regular expressions have finitely many partitions *} |
a59473f0229d
tuned a little bit the section about finite partitions
urbanc
parents:
37
diff
changeset
|
67 |
|
a59473f0229d
tuned a little bit the section about finite partitions
urbanc
parents:
37
diff
changeset
|
68 |
text {* |
a59473f0229d
tuned a little bit the section about finite partitions
urbanc
parents:
37
diff
changeset
|
69 |
|
a59473f0229d
tuned a little bit the section about finite partitions
urbanc
parents:
37
diff
changeset
|
70 |
\begin{lemma} |
a59473f0229d
tuned a little bit the section about finite partitions
urbanc
parents:
37
diff
changeset
|
71 |
Given @{text "r"} is a regular expressions, then @{thm rexp_imp_finite}. |
a59473f0229d
tuned a little bit the section about finite partitions
urbanc
parents:
37
diff
changeset
|
72 |
\end{lemma} |
a59473f0229d
tuned a little bit the section about finite partitions
urbanc
parents:
37
diff
changeset
|
73 |
|
a59473f0229d
tuned a little bit the section about finite partitions
urbanc
parents:
37
diff
changeset
|
74 |
\begin{proof} |
a59473f0229d
tuned a little bit the section about finite partitions
urbanc
parents:
37
diff
changeset
|
75 |
By induction on the structure of @{text r}. The cases for @{const NULL}, @{const EMPTY} |
50 | 76 |
and @{const CHAR} are straightforward, because we can easily establish |
39
a59473f0229d
tuned a little bit the section about finite partitions
urbanc
parents:
37
diff
changeset
|
77 |
|
a59473f0229d
tuned a little bit the section about finite partitions
urbanc
parents:
37
diff
changeset
|
78 |
\begin{center} |
a59473f0229d
tuned a little bit the section about finite partitions
urbanc
parents:
37
diff
changeset
|
79 |
\begin{tabular}{l} |
a59473f0229d
tuned a little bit the section about finite partitions
urbanc
parents:
37
diff
changeset
|
80 |
@{thm quot_null_eq}\\ |
a59473f0229d
tuned a little bit the section about finite partitions
urbanc
parents:
37
diff
changeset
|
81 |
@{thm quot_empty_subset}\\ |
a59473f0229d
tuned a little bit the section about finite partitions
urbanc
parents:
37
diff
changeset
|
82 |
@{thm quot_char_subset} |
a59473f0229d
tuned a little bit the section about finite partitions
urbanc
parents:
37
diff
changeset
|
83 |
\end{tabular} |
a59473f0229d
tuned a little bit the section about finite partitions
urbanc
parents:
37
diff
changeset
|
84 |
\end{center} |
a59473f0229d
tuned a little bit the section about finite partitions
urbanc
parents:
37
diff
changeset
|
85 |
|
a59473f0229d
tuned a little bit the section about finite partitions
urbanc
parents:
37
diff
changeset
|
86 |
|
a59473f0229d
tuned a little bit the section about finite partitions
urbanc
parents:
37
diff
changeset
|
87 |
|
a59473f0229d
tuned a little bit the section about finite partitions
urbanc
parents:
37
diff
changeset
|
88 |
\end{proof} |
a59473f0229d
tuned a little bit the section about finite partitions
urbanc
parents:
37
diff
changeset
|
89 |
|
a59473f0229d
tuned a little bit the section about finite partitions
urbanc
parents:
37
diff
changeset
|
90 |
*} |
a59473f0229d
tuned a little bit the section about finite partitions
urbanc
parents:
37
diff
changeset
|
91 |
|
a59473f0229d
tuned a little bit the section about finite partitions
urbanc
parents:
37
diff
changeset
|
92 |
|
24 | 93 |
(*<*) |
94 |
end |
|
95 |
(*>*) |