Paper/Paper.thy
author urbanc
Sun, 30 Jan 2011 17:24:37 +0000
changeset 53 da85feadb8e3
parent 52 4a517c6ac07d
child 54 c19d2fc2cc69
permissions -rw-r--r--
small typo
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
24
f72c82bf59e5 added paper
urbanc
parents:
diff changeset
     1
(*<*)
f72c82bf59e5 added paper
urbanc
parents:
diff changeset
     2
theory Paper
39
a59473f0229d tuned a little bit the section about finite partitions
urbanc
parents: 37
diff changeset
     3
imports "../Myhill" "LaTeXsugar"
24
f72c82bf59e5 added paper
urbanc
parents:
diff changeset
     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
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
     9
  str_eq_rel ("\<approx>\<^bsub>_\<^esub>") and
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    10
  Seq (infixr "\<cdot>" 100) and
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    11
  Star ("_\<^bsup>\<star>\<^esup>") and
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    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
f72c82bf59e5 added paper
urbanc
parents:
diff changeset
    17
(*>*)
f72c82bf59e5 added paper
urbanc
parents:
diff changeset
    18
f72c82bf59e5 added paper
urbanc
parents:
diff changeset
    19
section {* Introduction *}
f72c82bf59e5 added paper
urbanc
parents:
diff changeset
    20
f72c82bf59e5 added paper
urbanc
parents:
diff changeset
    21
text {*
f72c82bf59e5 added paper
urbanc
parents:
diff changeset
    22
  
f72c82bf59e5 added paper
urbanc
parents:
diff changeset
    23
*}
f72c82bf59e5 added paper
urbanc
parents:
diff changeset
    24
50
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    25
section {* Preliminaries *}
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    26
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    27
text {*
51
6cfb92de4654 some tuning of the paper
urbanc
parents: 50
diff changeset
    28
  Central to our proof will be the solution of equational systems
50
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    29
  involving regular expressions. For this we will use the following ``reverse'' 
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    30
  version of Arden's lemma.
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    31
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    32
  \begin{lemma}[Reverse Arden's Lemma]\mbox{}\\
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    33
  If @{thm (prem 1) ardens_revised} then
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    34
  @{thm (lhs) ardens_revised} has the unique solution
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    35
  @{thm (rhs) ardens_revised}.
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    36
  \end{lemma}
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    37
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    38
  \begin{proof}
51
6cfb92de4654 some tuning of the paper
urbanc
parents: 50
diff changeset
    39
  For the right-to-left direction we assume @{thm (rhs) ardens_revised} and show
6cfb92de4654 some tuning of the paper
urbanc
parents: 50
diff changeset
    40
  that @{thm (lhs) ardens_revised} holds. From Lemma ??? we have @{term "A\<star> = {[]} \<union> A ;; A\<star>"},
50
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    41
  which is equal to @{term "A\<star> = {[]} \<union> A\<star> ;; A"}. Adding @{text B} to both 
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    42
  sides gives @{term "B ;; A\<star> = B ;; ({[]} \<union> A\<star> ;; A)"}, whose right-hand side
51
6cfb92de4654 some tuning of the paper
urbanc
parents: 50
diff changeset
    43
  is equal to @{term "(B ;; A\<star>) ;; A \<union> B"}. This completes this direction. 
50
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    44
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    45
  For the other direction we assume @{thm (lhs) ardens_revised}. By a simple induction
51
6cfb92de4654 some tuning of the paper
urbanc
parents: 50
diff changeset
    46
  on @{text n}, we can establish the property
50
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    47
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    48
  \begin{center}
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    49
  @{text "(*)"}\hspace{5mm} @{thm (concl) ardens_helper}
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    50
  \end{center}
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    51
  
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    52
  \noindent
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    53
  Using this property we can show that @{term "B ;; (A \<up> n) \<subseteq> X"} holds for
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    54
  all @{text n}. From this we can infer @{term "B ;; A\<star> \<subseteq> X"} using Lemma ???.
51
6cfb92de4654 some tuning of the paper
urbanc
parents: 50
diff changeset
    55
  For the inclusion in the other direction we assume a string @{text s}
50
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    56
  with length @{text k} is element in @{text X}. Since @{thm (prem 1) ardens_revised}
51
6cfb92de4654 some tuning of the paper
urbanc
parents: 50
diff changeset
    57
  we know that @{term "s \<notin> X ;; (A \<up> Suc k)"} since its length is only @{text k}
6cfb92de4654 some tuning of the paper
urbanc
parents: 50
diff changeset
    58
  (the strings in @{term "X ;; (A \<up> Suc k)"} are all longer). 
53
da85feadb8e3 small typo
urbanc
parents: 52
diff changeset
    59
  From @{text "(*)"} it follows then that
50
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    60
  @{term s} must be element in @{term "(\<Union>m\<in>{0..k}. B ;; (A \<up> m))"}. This in turn
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    61
  implies that @{term s} is in @{term "(\<Union>n. B ;; (A \<up> n))"}. Using Lemma ??? this
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    62
  is equal to @{term "B ;; A\<star>"}, as we needed to show.\qed
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    63
  \end{proof}
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    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
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    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
f72c82bf59e5 added paper
urbanc
parents:
diff changeset
    93
(*<*)
f72c82bf59e5 added paper
urbanc
parents:
diff changeset
    94
end
f72c82bf59e5 added paper
urbanc
parents:
diff changeset
    95
(*>*)