author | urbanc |
Wed, 18 May 2011 19:54:43 +0000 | |
changeset 162 | e93760534354 |
child 166 | 7743d2ad71d1 |
permissions | -rw-r--r-- |
162
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
1 |
theory Derivs |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
2 |
imports Closure |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
3 |
begin |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
4 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
5 |
section {* Experiments with Derivatives -- independent of Myhill-Nerode *} |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
6 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
7 |
subsection {* Left-Quotients *} |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
8 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
9 |
definition |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
10 |
Delta :: "lang \<Rightarrow> lang" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
11 |
where |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
12 |
"Delta A = (if [] \<in> A then {[]} else {})" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
13 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
14 |
definition |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
15 |
Der :: "char \<Rightarrow> lang \<Rightarrow> lang" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
16 |
where |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
17 |
"Der c A \<equiv> {s. [c] @ s \<in> A}" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
18 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
19 |
definition |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
20 |
Ders :: "string \<Rightarrow> lang \<Rightarrow> lang" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
21 |
where |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
22 |
"Ders s A \<equiv> {s'. s @ s' \<in> A}" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
23 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
24 |
definition |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
25 |
Ders_set :: "lang \<Rightarrow> lang \<Rightarrow> lang" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
26 |
where |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
27 |
"Ders_set A B \<equiv> {s' | s s'. s @ s' \<in> B \<and> s \<in> A}" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
28 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
29 |
lemma Ders_set_Ders: |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
30 |
shows "Ders_set A B = (\<Union>s \<in> A. Ders s B)" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
31 |
unfolding Ders_set_def Ders_def |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
32 |
by auto |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
33 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
34 |
lemma Der_null [simp]: |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
35 |
shows "Der c {} = {}" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
36 |
unfolding Der_def |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
37 |
by auto |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
38 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
39 |
lemma Der_empty [simp]: |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
40 |
shows "Der c {[]} = {}" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
41 |
unfolding Der_def |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
42 |
by auto |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
43 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
44 |
lemma Der_char [simp]: |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
45 |
shows "Der c {[d]} = (if c = d then {[]} else {})" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
46 |
unfolding Der_def |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
47 |
by auto |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
48 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
49 |
lemma Der_union [simp]: |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
50 |
shows "Der c (A \<union> B) = Der c A \<union> Der c B" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
51 |
unfolding Der_def |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
52 |
by auto |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
53 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
54 |
lemma Der_seq [simp]: |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
55 |
shows "Der c (A ;; B) = (Der c A) ;; B \<union> (Delta A ;; Der c B)" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
56 |
unfolding Der_def Delta_def |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
57 |
unfolding Seq_def |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
58 |
by (auto simp add: Cons_eq_append_conv) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
59 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
60 |
lemma Der_star [simp]: |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
61 |
shows "Der c (A\<star>) = (Der c A) ;; A\<star>" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
62 |
proof - |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
63 |
have incl: "Delta A ;; Der c (A\<star>) \<subseteq> (Der c A) ;; A\<star>" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
64 |
unfolding Der_def Delta_def Seq_def |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
65 |
apply(auto) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
66 |
apply(drule star_decom) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
67 |
apply(auto simp add: Cons_eq_append_conv) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
68 |
done |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
69 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
70 |
have "Der c (A\<star>) = Der c ({[]} \<union> A ;; A\<star>)" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
71 |
by (simp only: star_cases[symmetric]) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
72 |
also have "... = Der c (A ;; A\<star>)" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
73 |
by (simp only: Der_union Der_empty) (simp) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
74 |
also have "... = (Der c A) ;; A\<star> \<union> (Delta A ;; Der c (A\<star>))" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
75 |
by simp |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
76 |
also have "... = (Der c A) ;; A\<star>" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
77 |
using incl by auto |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
78 |
finally show "Der c (A\<star>) = (Der c A) ;; A\<star>" . |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
79 |
qed |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
80 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
81 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
82 |
lemma Ders_singleton: |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
83 |
shows "Ders [c] A = Der c A" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
84 |
unfolding Der_def Ders_def |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
85 |
by simp |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
86 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
87 |
lemma Ders_append: |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
88 |
shows "Ders (s1 @ s2) A = Ders s2 (Ders s1 A)" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
89 |
unfolding Ders_def by simp |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
90 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
91 |
lemma MN_Rel_Ders: |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
92 |
shows "x \<approx>A y \<longleftrightarrow> Ders x A = Ders y A" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
93 |
unfolding Ders_def str_eq_def str_eq_rel_def |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
94 |
by auto |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
95 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
96 |
subsection {* Brozowsky's derivatives of regular expressions *} |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
97 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
98 |
fun |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
99 |
nullable :: "rexp \<Rightarrow> bool" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
100 |
where |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
101 |
"nullable (NULL) = False" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
102 |
| "nullable (EMPTY) = True" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
103 |
| "nullable (CHAR c) = False" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
104 |
| "nullable (ALT r1 r2) = (nullable r1 \<or> nullable r2)" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
105 |
| "nullable (SEQ r1 r2) = (nullable r1 \<and> nullable r2)" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
106 |
| "nullable (STAR r) = True" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
107 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
108 |
fun |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
109 |
der :: "char \<Rightarrow> rexp \<Rightarrow> rexp" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
110 |
where |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
111 |
"der c (NULL) = NULL" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
112 |
| "der c (EMPTY) = NULL" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
113 |
| "der c (CHAR c') = (if c = c' then EMPTY else NULL)" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
114 |
| "der c (ALT r1 r2) = ALT (der c r1) (der c r2)" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
115 |
| "der c (SEQ r1 r2) = ALT (SEQ (der c r1) r2) (if nullable r1 then der c r2 else NULL)" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
116 |
| "der c (STAR r) = SEQ (der c r) (STAR r)" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
117 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
118 |
function |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
119 |
ders :: "string \<Rightarrow> rexp \<Rightarrow> rexp" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
120 |
where |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
121 |
"ders [] r = r" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
122 |
| "ders (s @ [c]) r = der c (ders s r)" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
123 |
by (auto) (metis rev_cases) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
124 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
125 |
termination |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
126 |
by (relation "measure (length o fst)") (auto) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
127 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
128 |
lemma Delta_nullable: |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
129 |
shows "Delta (L r) = (if nullable r then {[]} else {})" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
130 |
unfolding Delta_def |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
131 |
by (induct r) (auto simp add: Seq_def split: if_splits) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
132 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
133 |
lemma Der_der: |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
134 |
fixes r::rexp |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
135 |
shows "Der c (L r) = L (der c r)" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
136 |
by (induct r) (simp_all add: Delta_nullable) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
137 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
138 |
lemma Ders_ders: |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
139 |
fixes r::rexp |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
140 |
shows "Ders s (L r) = L (ders s r)" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
141 |
apply(induct s rule: rev_induct) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
142 |
apply(simp add: Ders_def) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
143 |
apply(simp only: ders.simps) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
144 |
apply(simp only: Ders_append) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
145 |
apply(simp only: Ders_singleton) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
146 |
apply(simp only: Der_der) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
147 |
done |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
148 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
149 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
150 |
subsection {* Antimirov's Partial Derivatives *} |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
151 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
152 |
abbreviation |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
153 |
"SEQS R r \<equiv> {SEQ r' r | r'. r' \<in> R}" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
154 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
155 |
fun |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
156 |
pder :: "char \<Rightarrow> rexp \<Rightarrow> rexp set" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
157 |
where |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
158 |
"pder c NULL = {NULL}" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
159 |
| "pder c EMPTY = {NULL}" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
160 |
| "pder c (CHAR c') = (if c = c' then {EMPTY} else {NULL})" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
161 |
| "pder c (ALT r1 r2) = (pder c r1) \<union> (pder c r2)" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
162 |
| "pder c (SEQ r1 r2) = SEQS (pder c r1) r2 \<union> (if nullable r1 then pder c r2 else {})" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
163 |
| "pder c (STAR r) = SEQS (pder c r) (STAR r)" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
164 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
165 |
abbreviation |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
166 |
"pder_set c R \<equiv> \<Union>r \<in> R. pder c r" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
167 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
168 |
function |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
169 |
pders :: "string \<Rightarrow> rexp \<Rightarrow> rexp set" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
170 |
where |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
171 |
"pders [] r = {r}" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
172 |
| "pders (s @ [c]) r = pder_set c (pders s r)" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
173 |
by (auto) (metis rev_cases) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
174 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
175 |
termination |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
176 |
by (relation "measure (length o fst)") (auto) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
177 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
178 |
abbreviation |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
179 |
"pders_set A r \<equiv> \<Union>s \<in> A. pders s r" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
180 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
181 |
lemma pders_append: |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
182 |
"pders (s1 @ s2) r = \<Union> (pders s2) ` (pders s1 r)" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
183 |
apply(induct s2 arbitrary: s1 r rule: rev_induct) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
184 |
apply(simp) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
185 |
apply(subst append_assoc[symmetric]) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
186 |
apply(simp only: pders.simps) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
187 |
apply(auto) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
188 |
done |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
189 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
190 |
lemma pders_singleton: |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
191 |
"pders [c] r = pder c r" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
192 |
apply(subst append_Nil[symmetric]) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
193 |
apply(simp only: pders.simps) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
194 |
apply(simp) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
195 |
done |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
196 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
197 |
lemma pder_set_lang: |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
198 |
shows "(\<Union> (L ` pder_set c R)) = (\<Union>r \<in> R. (\<Union>L ` (pder c r)))" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
199 |
unfolding image_def |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
200 |
by auto |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
201 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
202 |
lemma |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
203 |
shows seq_UNION_left: "B ;; (\<Union>n\<in>C. A n) = (\<Union>n\<in>C. B ;; A n)" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
204 |
and seq_UNION_right: "(\<Union>n\<in>C. A n) ;; B = (\<Union>n\<in>C. A n ;; B)" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
205 |
unfolding Seq_def by auto |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
206 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
207 |
lemma Der_pder: |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
208 |
fixes r::rexp |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
209 |
shows "Der c (L r) = \<Union> L ` (pder c r)" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
210 |
by (induct r) (auto simp add: Delta_nullable seq_UNION_right) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
211 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
212 |
lemma Ders_pders: |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
213 |
fixes r::rexp |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
214 |
shows "Ders s (L r) = \<Union> L ` (pders s r)" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
215 |
proof (induct s rule: rev_induct) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
216 |
case (snoc c s) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
217 |
have ih: "Ders s (L r) = \<Union> L ` (pders s r)" by fact |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
218 |
have "Ders (s @ [c]) (L r) = Ders [c] (Ders s (L r))" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
219 |
by (simp add: Ders_append) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
220 |
also have "\<dots> = Der c (\<Union> L ` (pders s r))" using ih |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
221 |
by (simp add: Ders_singleton) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
222 |
also have "\<dots> = (\<Union>r\<in>pders s r. Der c (L r))" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
223 |
unfolding Der_def image_def by auto |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
224 |
also have "\<dots> = (\<Union>r\<in>pders s r. (\<Union> L ` (pder c r)))" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
225 |
by (simp add: Der_pder) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
226 |
also have "\<dots> = (\<Union>L ` (pder_set c (pders s r)))" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
227 |
by (simp add: pder_set_lang) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
228 |
also have "\<dots> = (\<Union>L ` (pders (s @ [c]) r))" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
229 |
by simp |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
230 |
finally show "Ders (s @ [c]) (L r) = \<Union>L ` pders (s @ [c]) r" . |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
231 |
qed (simp add: Ders_def) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
232 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
233 |
lemma Ders_set_pders_set: |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
234 |
fixes r::rexp |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
235 |
shows "Ders_set A (L r) = (\<Union> L ` (pders_set A r))" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
236 |
by (simp add: Ders_set_Ders Ders_pders) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
237 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
238 |
lemma pders_NULL [simp]: |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
239 |
shows "pders s NULL = {NULL}" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
240 |
by (induct s rule: rev_induct) (simp_all) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
241 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
242 |
lemma pders_EMPTY [simp]: |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
243 |
shows "pders s EMPTY = (if s = [] then {EMPTY} else {NULL})" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
244 |
by (induct s rule: rev_induct) (auto) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
245 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
246 |
lemma pders_CHAR [simp]: |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
247 |
shows "pders s (CHAR c) = (if s = [] then {CHAR c} else (if s = [c] then {EMPTY} else {NULL}))" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
248 |
by (induct s rule: rev_induct) (auto) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
249 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
250 |
lemma pders_ALT [simp]: |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
251 |
shows "pders s (ALT r1 r2) = (if s = [] then {ALT r1 r2} else (pders s r1) \<union> (pders s r2))" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
252 |
by (induct s rule: rev_induct) (auto) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
253 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
254 |
definition |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
255 |
"Suf s \<equiv> {v. v \<noteq> [] \<and> (\<exists>u. u @ v = s)}" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
256 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
257 |
lemma Suf: |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
258 |
shows "Suf (s @ [c]) = (Suf s) ;; {[c]} \<union> {[c]}" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
259 |
unfolding Suf_def Seq_def |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
260 |
by (auto simp add: append_eq_append_conv2 append_eq_Cons_conv) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
261 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
262 |
lemma Suf_Union: |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
263 |
shows "(\<Union>v \<in> Suf s ;; {[c]}. P v) = (\<Union>v \<in> Suf s. P (v @ [c]))" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
264 |
by (auto simp add: Seq_def) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
265 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
266 |
lemma inclusion1: |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
267 |
shows "pder_set c (SEQS R r2) \<subseteq> SEQS (pder_set c R) r2 \<union> (pder c r2)" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
268 |
apply(auto simp add: if_splits) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
269 |
apply(blast) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
270 |
done |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
271 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
272 |
lemma pders_SEQ: |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
273 |
shows "pders s (SEQ r1 r2) \<subseteq> SEQS (pders s r1) r2 \<union> (\<Union>v \<in> Suf s. pders v r2)" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
274 |
proof (induct s rule: rev_induct) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
275 |
case (snoc c s) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
276 |
have ih: "pders s (SEQ r1 r2) \<subseteq> SEQS (pders s r1) r2 \<union> (\<Union>v \<in> Suf s. pders v r2)" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
277 |
by fact |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
278 |
have "pders (s @ [c]) (SEQ r1 r2) = pder_set c (pders s (SEQ r1 r2))" by simp |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
279 |
also have "\<dots> \<subseteq> pder_set c (SEQS (pders s r1) r2 \<union> (\<Union>v \<in> Suf s. pders v r2))" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
280 |
using ih by auto |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
281 |
also have "\<dots> = pder_set c (SEQS (pders s r1) r2) \<union> pder_set c (\<Union>v \<in> Suf s. pders v r2)" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
282 |
by (simp) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
283 |
also have "\<dots> = pder_set c (SEQS (pders s r1) r2) \<union> (\<Union>v \<in> Suf s. pder_set c (pders v r2))" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
284 |
by (simp) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
285 |
also have "\<dots> \<subseteq> pder_set c (SEQS (pders s r1) r2) \<union> (pder c r2) \<union> (\<Union>v \<in> Suf s. pders (v @ [c]) r2)" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
286 |
by (auto) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
287 |
also have "\<dots> \<subseteq> SEQS (pder_set c (pders s r1)) r2 \<union> (pder c r2) \<union> (\<Union>v \<in> Suf s. pders (v @ [c]) r2)" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
288 |
using inclusion1 by blast |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
289 |
also have "\<dots> = SEQS (pders (s @ [c]) r1) r2 \<union> (\<Union>v \<in> Suf (s @ [c]). pders v r2)" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
290 |
apply(subst (2) pders.simps) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
291 |
apply(simp only: Suf) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
292 |
apply(simp add: Suf_Union pders_singleton) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
293 |
apply(auto) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
294 |
done |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
295 |
finally show ?case . |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
296 |
qed (simp) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
297 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
298 |
lemma pders_STAR: |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
299 |
assumes a: "s \<noteq> []" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
300 |
shows "pders s (STAR r) \<subseteq> (\<Union>v \<in> Suf s. SEQS (pders v r) (STAR r))" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
301 |
using a |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
302 |
proof (induct s rule: rev_induct) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
303 |
case (snoc c s) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
304 |
have ih: "s \<noteq> [] \<Longrightarrow> pders s (STAR r) \<subseteq> (\<Union>v\<in>Suf s. SEQS (pders v r) (STAR r))" by fact |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
305 |
{ assume asm: "s \<noteq> []" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
306 |
have "pders (s @ [c]) (STAR r) = pder_set c (pders s (STAR r))" by simp |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
307 |
also have "\<dots> \<subseteq> (pder_set c (\<Union>v\<in>Suf s. SEQS (pders v r) (STAR r)))" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
308 |
using ih[OF asm] by blast |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
309 |
also have "\<dots> = (\<Union>v\<in>Suf s. pder_set c (SEQS (pders v r) (STAR r)))" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
310 |
by simp |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
311 |
also have "\<dots> \<subseteq> (\<Union>v\<in>Suf s. (SEQS (pder_set c (pders v r)) (STAR r) \<union> pder c (STAR r)))" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
312 |
using inclusion1 by blast |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
313 |
also have "\<dots> = (\<Union>v\<in>Suf s. (SEQS (pder_set c (pders v r)) (STAR r))) \<union> pder c (STAR r)" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
314 |
using asm by (auto simp add: Suf_def) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
315 |
also have "\<dots> = (\<Union>v\<in>Suf s. (SEQS (pders (v @ [c]) r) (STAR r))) \<union> (SEQS (pder c r) (STAR r))" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
316 |
by simp |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
317 |
also have "\<dots> = (\<Union>v\<in>Suf (s @ [c]). (SEQS (pders v r) (STAR r)))" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
318 |
apply(simp only: Suf) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
319 |
apply(simp add: Suf_Union pders_singleton) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
320 |
apply(auto) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
321 |
done |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
322 |
finally have ?case . |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
323 |
} |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
324 |
moreover |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
325 |
{ assume asm: "s = []" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
326 |
then have ?case |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
327 |
apply(simp add: pders_singleton Suf_def) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
328 |
apply(auto) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
329 |
apply(rule_tac x="[c]" in exI) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
330 |
apply(simp add: pders_singleton) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
331 |
done |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
332 |
} |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
333 |
ultimately show ?case by blast |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
334 |
qed (simp) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
335 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
336 |
abbreviation |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
337 |
"UNIV1 \<equiv> UNIV - {[]}" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
338 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
339 |
lemma pders_set_NULL: |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
340 |
shows "pders_set UNIV1 NULL = {NULL}" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
341 |
by auto |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
342 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
343 |
lemma pders_set_EMPTY: |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
344 |
shows "pders_set UNIV1 EMPTY = {NULL}" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
345 |
by (auto split: if_splits) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
346 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
347 |
lemma pders_set_CHAR: |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
348 |
shows "pders_set UNIV1 (CHAR c) \<subseteq> {EMPTY, NULL}" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
349 |
by (auto split: if_splits) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
350 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
351 |
lemma pders_set_ALT: |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
352 |
shows "pders_set UNIV1 (ALT r1 r2) = pders_set UNIV1 r1 \<union> pders_set UNIV1 r2" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
353 |
by auto |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
354 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
355 |
lemma pders_set_SEQ_aux: |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
356 |
assumes a: "s \<in> UNIV1" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
357 |
shows "pders_set (Suf s) r2 \<subseteq> pders_set UNIV1 r2" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
358 |
using a by (auto simp add: Suf_def) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
359 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
360 |
lemma pders_set_SEQ: |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
361 |
shows "pders_set UNIV1 (SEQ r1 r2) \<subseteq> SEQS (pders_set UNIV1 r1) r2 \<union> pders_set UNIV1 r2" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
362 |
apply(rule UN_least) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
363 |
apply(rule subset_trans) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
364 |
apply(rule pders_SEQ) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
365 |
apply(simp) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
366 |
apply(rule conjI) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
367 |
apply(auto)[1] |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
368 |
apply(rule subset_trans) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
369 |
apply(rule pders_set_SEQ_aux) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
370 |
apply(auto) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
371 |
done |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
372 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
373 |
lemma pders_set_STAR: |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
374 |
shows "pders_set UNIV1 (STAR r) \<subseteq> SEQS (pders_set UNIV1 r) (STAR r)" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
375 |
apply(rule UN_least) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
376 |
apply(rule subset_trans) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
377 |
apply(rule pders_STAR) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
378 |
apply(simp) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
379 |
apply(simp add: Suf_def) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
380 |
apply(auto) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
381 |
done |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
382 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
383 |
lemma finite_SEQS: |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
384 |
assumes a: "finite A" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
385 |
shows "finite (SEQS A r)" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
386 |
using a by (auto) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
387 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
388 |
lemma finite_pders_set_UNIV1: |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
389 |
shows "finite (pders_set UNIV1 r)" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
390 |
apply(induct r) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
391 |
apply(simp) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
392 |
apply(simp only: pders_set_EMPTY) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
393 |
apply(simp) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
394 |
apply(rule finite_subset) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
395 |
apply(rule pders_set_CHAR) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
396 |
apply(simp) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
397 |
apply(rule finite_subset) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
398 |
apply(rule pders_set_SEQ) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
399 |
apply(simp only: finite_SEQS finite_Un) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
400 |
apply(simp) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
401 |
apply(simp only: pders_set_ALT) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
402 |
apply(simp) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
403 |
apply(rule finite_subset) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
404 |
apply(rule pders_set_STAR) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
405 |
apply(simp only: finite_SEQS) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
406 |
done |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
407 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
408 |
lemma pders_set_UNIV_UNIV1: |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
409 |
shows "pders_set UNIV r = pders [] r \<union> pders_set UNIV1 r" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
410 |
apply(auto) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
411 |
apply(rule_tac x="[]" in exI) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
412 |
apply(simp) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
413 |
done |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
414 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
415 |
lemma finite_pders_set_UNIV: |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
416 |
shows "finite (pders_set UNIV r)" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
417 |
unfolding pders_set_UNIV_UNIV1 |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
418 |
by (simp add: finite_pders_set_UNIV1) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
419 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
420 |
lemma finite_pders_set: |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
421 |
shows "finite (pders_set A r)" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
422 |
apply(rule rev_finite_subset) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
423 |
apply(rule_tac r="r" in finite_pders_set_UNIV) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
424 |
apply(auto) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
425 |
done |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
426 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
427 |
lemma finite_pders: |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
428 |
shows "finite (pders s r)" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
429 |
using finite_pders_set[where A="{s}" and r="r"] |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
430 |
by simp |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
431 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
432 |
lemma finite_pders2: |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
433 |
shows "finite {pders s r | s. s \<in> A}" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
434 |
proof - |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
435 |
have "{pders s r | s. s \<in> A} \<subseteq> Pow (pders_set A r)" by auto |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
436 |
moreover |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
437 |
have "finite (Pow (pders_set A r))" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
438 |
using finite_pders_set by simp |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
439 |
ultimately |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
440 |
show "finite {pders s r | s. s \<in> A}" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
441 |
by(rule finite_subset) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
442 |
qed |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
443 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
444 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
445 |
lemma Myhill_Nerode3: |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
446 |
fixes r::"rexp" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
447 |
shows "finite (UNIV // \<approx>(L r))" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
448 |
proof - |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
449 |
have "finite (UNIV // =(\<lambda>x. pders x r)=)" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
450 |
proof - |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
451 |
have "range (\<lambda>x. pders x r) \<subseteq> {pders s r | s. s \<in> UNIV}" by auto |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
452 |
moreover |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
453 |
have "finite {pders s r | s. s \<in> UNIV}" by (rule finite_pders2) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
454 |
ultimately |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
455 |
have "finite (range (\<lambda>x. pders x r))" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
456 |
by (rule finite_subset) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
457 |
then show "finite (UNIV // =(\<lambda>x. pders x r)=)" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
458 |
by (rule finite_eq_tag_rel) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
459 |
qed |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
460 |
moreover |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
461 |
have " =(\<lambda>x. pders x r)= \<subseteq> \<approx>(L r)" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
462 |
unfolding tag_eq_rel_def |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
463 |
by (auto simp add: str_eq_def[symmetric] MN_Rel_Ders Ders_pders) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
464 |
moreover |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
465 |
have "equiv UNIV =(\<lambda>x. pders x r)=" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
466 |
unfolding equiv_def refl_on_def sym_def trans_def |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
467 |
unfolding tag_eq_rel_def |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
468 |
by auto |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
469 |
moreover |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
470 |
have "equiv UNIV (\<approx>(L r))" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
471 |
unfolding equiv_def refl_on_def sym_def trans_def |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
472 |
unfolding str_eq_rel_def |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
473 |
by auto |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
474 |
ultimately show "finite (UNIV // \<approx>(L r))" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
475 |
by (rule refined_partition_finite) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
476 |
qed |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
477 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
478 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
479 |
section {* Closure under Left-Quotients *} |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
480 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
481 |
lemma closure_left_quotient: |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
482 |
assumes "regular A" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
483 |
shows "regular (Ders_set B A)" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
484 |
proof - |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
485 |
from assms obtain r::rexp where eq: "L r = A" by auto |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
486 |
have fin: "finite (pders_set B r)" by (rule finite_pders_set) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
487 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
488 |
have "Ders_set B (L r) = (\<Union> L ` (pders_set B r))" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
489 |
by (simp add: Ders_set_pders_set) |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
490 |
also have "\<dots> = L (\<Uplus>(pders_set B r))" using fin by simp |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
491 |
finally have "Ders_set B A = L (\<Uplus>(pders_set B r))" using eq |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
492 |
by simp |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
493 |
then show "regular (Ders_set B A)" by auto |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
494 |
qed |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
495 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
496 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
497 |
section {* Relating standard and partial derivations *} |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
498 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
499 |
lemma |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
500 |
shows "(\<Union> L ` (pder c r)) = L (der c r)" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
501 |
unfolding Der_der[symmetric] Der_pder by simp |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
502 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
503 |
lemma |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
504 |
shows "(\<Union> L ` (pders s r)) = L (ders s r)" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
505 |
unfolding Ders_ders[symmetric] Ders_pders by simp |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
506 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
507 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
508 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
509 |
fun |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
510 |
width :: "rexp \<Rightarrow> nat" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
511 |
where |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
512 |
"width (NULL) = 0" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
513 |
| "width (EMPTY) = 0" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
514 |
| "width (CHAR c) = 1" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
515 |
| "width (ALT r1 r2) = width r1 + width r2" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
516 |
| "width (SEQ r1 r2) = width r1 + width r2" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
517 |
| "width (STAR r) = width r" |
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
518 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
519 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
520 |
|
e93760534354
added directory for journal version; took uptodate version of the theory files
urbanc
parents:
diff
changeset
|
521 |
end |