Paper/Paper.thy
author urbanc
Sun, 30 Jan 2011 16:59:57 +0000
changeset 50 32bff8310071
parent 39 a59473f0229d
child 51 6cfb92de4654
permissions -rw-r--r--
revised proof of Ardens lemma
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
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    13
  Suc ("_+1" [100] 100)
39
a59473f0229d tuned a little bit the section about finite partitions
urbanc
parents: 37
diff changeset
    14
24
f72c82bf59e5 added paper
urbanc
parents:
diff changeset
    15
(*>*)
f72c82bf59e5 added paper
urbanc
parents:
diff changeset
    16
f72c82bf59e5 added paper
urbanc
parents:
diff changeset
    17
section {* Introduction *}
f72c82bf59e5 added paper
urbanc
parents:
diff changeset
    18
f72c82bf59e5 added paper
urbanc
parents:
diff changeset
    19
text {*
f72c82bf59e5 added paper
urbanc
parents:
diff changeset
    20
  
f72c82bf59e5 added paper
urbanc
parents:
diff changeset
    21
*}
f72c82bf59e5 added paper
urbanc
parents:
diff changeset
    22
50
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    23
section {* Preliminaries *}
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    24
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    25
text {*
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    26
  A central technique in our proof is the solution of equational systems
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    27
  involving regular expressions. For this we will use the following ``reverse'' 
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    28
  version of Arden's lemma.
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    29
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    30
  \begin{lemma}[Reverse Arden's Lemma]\mbox{}\\
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    31
  If @{thm (prem 1) ardens_revised} then
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    32
  @{thm (lhs) ardens_revised} has the unique solution
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    33
  @{thm (rhs) ardens_revised}.
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    34
  \end{lemma}
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    35
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    36
  \begin{proof}
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    37
  For right-to-left direction we assume @{thm (rhs) ardens_revised} and show
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    38
  @{thm (lhs) ardens_revised}. From Lemma ??? we have @{term "A\<star> = {[]} \<union> A ;; A\<star>"},
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    39
  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
    40
  sides gives @{term "B ;; A\<star> = B ;; ({[]} \<union> A\<star> ;; A)"}, whose right-hand side
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    41
  is @{term "B \<union> (B ;; A\<star>) ;; A"}. This completes this direction. 
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    42
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    43
  For the other direction we assume @{thm (lhs) ardens_revised}. By a simple induction
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    44
  on @{text n}, we can show the property
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    45
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    46
  \begin{center}
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    47
  @{text "(*)"}\hspace{5mm} @{thm (concl) ardens_helper}
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    48
  \end{center}
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    49
  
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    50
  \noindent
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    51
  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
    52
  all @{text n}. From this we can infer @{term "B ;; A\<star> \<subseteq> X"} using Lemma ???.
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    53
  The inclusion in the other direction we establishing by assuming a string @{text s}
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    54
  with length @{text k} is element in @{text X}. Since @{thm (prem 1) ardens_revised}
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    55
  we know that @{term "s \<notin> X ;; (A \<up> Suc k)"} as its length is only @{text k}. 
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    56
  From @{text "(*)"} it follows that
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    57
  @{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
    58
  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
    59
  is equal to @{term "B ;; A\<star>"}, as we needed to show.\qed
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    60
  \end{proof}
32bff8310071 revised proof of Ardens lemma
urbanc
parents: 39
diff changeset
    61
*}
39
a59473f0229d tuned a little bit the section about finite partitions
urbanc
parents: 37
diff changeset
    62
a59473f0229d tuned a little bit the section about finite partitions
urbanc
parents: 37
diff changeset
    63
section {* Regular expressions have finitely many partitions *}
a59473f0229d tuned a little bit the section about finite partitions
urbanc
parents: 37
diff changeset
    64
a59473f0229d tuned a little bit the section about finite partitions
urbanc
parents: 37
diff changeset
    65
text {*
a59473f0229d tuned a little bit the section about finite partitions
urbanc
parents: 37
diff changeset
    66
a59473f0229d tuned a little bit the section about finite partitions
urbanc
parents: 37
diff changeset
    67
  \begin{lemma}
a59473f0229d tuned a little bit the section about finite partitions
urbanc
parents: 37
diff changeset
    68
  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
    69
  \end{lemma}  
a59473f0229d tuned a little bit the section about finite partitions
urbanc
parents: 37
diff changeset
    70
a59473f0229d tuned a little bit the section about finite partitions
urbanc
parents: 37
diff changeset
    71
  \begin{proof}
a59473f0229d tuned a little bit the section about finite partitions
urbanc
parents: 37
diff changeset
    72
  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
    73
  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
    74
a59473f0229d tuned a little bit the section about finite partitions
urbanc
parents: 37
diff changeset
    75
  \begin{center}
a59473f0229d tuned a little bit the section about finite partitions
urbanc
parents: 37
diff changeset
    76
  \begin{tabular}{l}
a59473f0229d tuned a little bit the section about finite partitions
urbanc
parents: 37
diff changeset
    77
  @{thm quot_null_eq}\\
a59473f0229d tuned a little bit the section about finite partitions
urbanc
parents: 37
diff changeset
    78
  @{thm quot_empty_subset}\\
a59473f0229d tuned a little bit the section about finite partitions
urbanc
parents: 37
diff changeset
    79
  @{thm quot_char_subset}
a59473f0229d tuned a little bit the section about finite partitions
urbanc
parents: 37
diff changeset
    80
  \end{tabular}
a59473f0229d tuned a little bit the section about finite partitions
urbanc
parents: 37
diff changeset
    81
  \end{center}
a59473f0229d tuned a little bit the section about finite partitions
urbanc
parents: 37
diff changeset
    82
a59473f0229d tuned a little bit the section about finite partitions
urbanc
parents: 37
diff changeset
    83
  
a59473f0229d tuned a little bit the section about finite partitions
urbanc
parents: 37
diff changeset
    84
a59473f0229d tuned a little bit the section about finite partitions
urbanc
parents: 37
diff changeset
    85
  \end{proof}
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
a59473f0229d tuned a little bit the section about finite partitions
urbanc
parents: 37
diff changeset
    89
24
f72c82bf59e5 added paper
urbanc
parents:
diff changeset
    90
(*<*)
f72c82bf59e5 added paper
urbanc
parents:
diff changeset
    91
end
f72c82bf59e5 added paper
urbanc
parents:
diff changeset
    92
(*>*)