thys/Exercises.thy
author Christian Urban <urbanc@in.tum.de>
Sat, 01 Jul 2017 13:08:48 +0100
changeset 260 160d0b08471c
parent 259 78dd6bca5627
child 266 fff2e1b40dfc
permissions -rw-r--r--
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
259
78dd6bca5627 updated
Christian Urban <urbanc@in.tum.de>
parents: 258
diff changeset
     1
theory Exercises
258
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     2
  imports Lexer "~~/src/HOL/Library/Infinite_Set"
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     3
begin
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     4
260
160d0b08471c updated
Christian Urban <urbanc@in.tum.de>
parents: 259
diff changeset
     5
section {* Some Fun Facts *}
258
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     6
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     7
fun
259
78dd6bca5627 updated
Christian Urban <urbanc@in.tum.de>
parents: 258
diff changeset
     8
 zeroable :: "rexp \<Rightarrow> bool"
258
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     9
where
259
78dd6bca5627 updated
Christian Urban <urbanc@in.tum.de>
parents: 258
diff changeset
    10
  "zeroable (ZERO) \<longleftrightarrow> True"
78dd6bca5627 updated
Christian Urban <urbanc@in.tum.de>
parents: 258
diff changeset
    11
| "zeroable (ONE) \<longleftrightarrow> False"
78dd6bca5627 updated
Christian Urban <urbanc@in.tum.de>
parents: 258
diff changeset
    12
| "zeroable (CHAR c) \<longleftrightarrow> False"
78dd6bca5627 updated
Christian Urban <urbanc@in.tum.de>
parents: 258
diff changeset
    13
| "zeroable (ALT r1 r2) \<longleftrightarrow> zeroable r1 \<and> zeroable r2"
78dd6bca5627 updated
Christian Urban <urbanc@in.tum.de>
parents: 258
diff changeset
    14
| "zeroable (SEQ r1 r2) \<longleftrightarrow> zeroable r1 \<or> zeroable r2"
78dd6bca5627 updated
Christian Urban <urbanc@in.tum.de>
parents: 258
diff changeset
    15
| "zeroable (STAR r) \<longleftrightarrow> False"
258
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    16
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    17
lemma zeroable_correctness:
259
78dd6bca5627 updated
Christian Urban <urbanc@in.tum.de>
parents: 258
diff changeset
    18
  shows "zeroable r \<longleftrightarrow> L r = {}"
260
160d0b08471c updated
Christian Urban <urbanc@in.tum.de>
parents: 259
diff changeset
    19
by(induct r)(auto simp add: Sequ_def)
160d0b08471c updated
Christian Urban <urbanc@in.tum.de>
parents: 259
diff changeset
    20
258
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    21
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    22
fun
259
78dd6bca5627 updated
Christian Urban <urbanc@in.tum.de>
parents: 258
diff changeset
    23
 atmostempty :: "rexp \<Rightarrow> bool"
258
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    24
where
259
78dd6bca5627 updated
Christian Urban <urbanc@in.tum.de>
parents: 258
diff changeset
    25
  "atmostempty (ZERO) \<longleftrightarrow> True"
78dd6bca5627 updated
Christian Urban <urbanc@in.tum.de>
parents: 258
diff changeset
    26
| "atmostempty (ONE) \<longleftrightarrow> True"
78dd6bca5627 updated
Christian Urban <urbanc@in.tum.de>
parents: 258
diff changeset
    27
| "atmostempty (CHAR c) \<longleftrightarrow> False"
78dd6bca5627 updated
Christian Urban <urbanc@in.tum.de>
parents: 258
diff changeset
    28
| "atmostempty (ALT r1 r2) \<longleftrightarrow> atmostempty r1 \<and> atmostempty r2"
78dd6bca5627 updated
Christian Urban <urbanc@in.tum.de>
parents: 258
diff changeset
    29
| "atmostempty (SEQ r1 r2) \<longleftrightarrow> 
78dd6bca5627 updated
Christian Urban <urbanc@in.tum.de>
parents: 258
diff changeset
    30
     zeroable r1 \<or> zeroable r2 \<or> (atmostempty r1 \<and> atmostempty r2)"
258
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    31
| "atmostempty (STAR r) = atmostempty r"
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    32
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    33
fun
259
78dd6bca5627 updated
Christian Urban <urbanc@in.tum.de>
parents: 258
diff changeset
    34
 somechars :: "rexp \<Rightarrow> bool"
258
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    35
where
259
78dd6bca5627 updated
Christian Urban <urbanc@in.tum.de>
parents: 258
diff changeset
    36
  "somechars (ZERO) \<longleftrightarrow> False"
78dd6bca5627 updated
Christian Urban <urbanc@in.tum.de>
parents: 258
diff changeset
    37
| "somechars (ONE) \<longleftrightarrow> False"
78dd6bca5627 updated
Christian Urban <urbanc@in.tum.de>
parents: 258
diff changeset
    38
| "somechars (CHAR c) \<longleftrightarrow> True"
78dd6bca5627 updated
Christian Urban <urbanc@in.tum.de>
parents: 258
diff changeset
    39
| "somechars (ALT r1 r2) \<longleftrightarrow> somechars r1 \<or> somechars r2"
78dd6bca5627 updated
Christian Urban <urbanc@in.tum.de>
parents: 258
diff changeset
    40
| "somechars (SEQ r1 r2) \<longleftrightarrow> 
78dd6bca5627 updated
Christian Urban <urbanc@in.tum.de>
parents: 258
diff changeset
    41
      (\<not> zeroable r1 \<and> somechars r2) \<or> (\<not> zeroable r2 \<and> somechars r1) \<or> 
78dd6bca5627 updated
Christian Urban <urbanc@in.tum.de>
parents: 258
diff changeset
    42
      (somechars r1 \<and> nullable r2) \<or> (somechars r2 \<and> nullable r1)"
78dd6bca5627 updated
Christian Urban <urbanc@in.tum.de>
parents: 258
diff changeset
    43
| "somechars (STAR r) \<longleftrightarrow> somechars r"
258
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    44
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    45
lemma somechars_correctness:
259
78dd6bca5627 updated
Christian Urban <urbanc@in.tum.de>
parents: 258
diff changeset
    46
  shows "somechars r \<longleftrightarrow> (\<exists>s. s \<noteq> [] \<and> s \<in> L r)"
260
160d0b08471c updated
Christian Urban <urbanc@in.tum.de>
parents: 259
diff changeset
    47
apply(induct r)
160d0b08471c updated
Christian Urban <urbanc@in.tum.de>
parents: 259
diff changeset
    48
apply(simp_all add: zeroable_correctness nullable_correctness Sequ_def)
160d0b08471c updated
Christian Urban <urbanc@in.tum.de>
parents: 259
diff changeset
    49
using Nil_is_append_conv apply blast
160d0b08471c updated
Christian Urban <urbanc@in.tum.de>
parents: 259
diff changeset
    50
apply blast
160d0b08471c updated
Christian Urban <urbanc@in.tum.de>
parents: 259
diff changeset
    51
apply(auto)
160d0b08471c updated
Christian Urban <urbanc@in.tum.de>
parents: 259
diff changeset
    52
using Star_string by fastforce
160d0b08471c updated
Christian Urban <urbanc@in.tum.de>
parents: 259
diff changeset
    53
258
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    54
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    55
lemma atmostempty_correctness_aux:
259
78dd6bca5627 updated
Christian Urban <urbanc@in.tum.de>
parents: 258
diff changeset
    56
  shows "atmostempty r \<longleftrightarrow> \<not> somechars r"
258
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    57
apply(induct r)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    58
apply(simp_all)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    59
apply(auto simp add: zeroable_correctness nullable_correctness somechars_correctness)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    60
done
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    61
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    62
lemma atmostempty_correctness:
259
78dd6bca5627 updated
Christian Urban <urbanc@in.tum.de>
parents: 258
diff changeset
    63
  shows "atmostempty r \<longleftrightarrow> L r \<subseteq> {[]}"
258
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    64
by(auto simp add: atmostempty_correctness_aux somechars_correctness)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    65
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    66
fun
259
78dd6bca5627 updated
Christian Urban <urbanc@in.tum.de>
parents: 258
diff changeset
    67
 infinitestrings :: "rexp \<Rightarrow> bool"
258
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    68
where
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    69
  "infinitestrings (ZERO) = False"
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    70
| "infinitestrings (ONE) = False"
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    71
| "infinitestrings (CHAR c) = False"
259
78dd6bca5627 updated
Christian Urban <urbanc@in.tum.de>
parents: 258
diff changeset
    72
| "infinitestrings (ALT r1 r2) = (infinitestrings r1 \<or> infinitestrings r2)"
78dd6bca5627 updated
Christian Urban <urbanc@in.tum.de>
parents: 258
diff changeset
    73
| "infinitestrings (SEQ r1 r2) \<longleftrightarrow> 
78dd6bca5627 updated
Christian Urban <urbanc@in.tum.de>
parents: 258
diff changeset
    74
      (\<not> zeroable r1 \<and> infinitestrings r2) \<or> (\<not> zeroable r2 \<and> infinitestrings r1)"
78dd6bca5627 updated
Christian Urban <urbanc@in.tum.de>
parents: 258
diff changeset
    75
| "infinitestrings (STAR r) = (\<not> atmostempty r)"
258
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    76
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    77
lemma Star_atmostempty:
259
78dd6bca5627 updated
Christian Urban <urbanc@in.tum.de>
parents: 258
diff changeset
    78
  assumes "A \<subseteq> {[]}"
78dd6bca5627 updated
Christian Urban <urbanc@in.tum.de>
parents: 258
diff changeset
    79
  shows "A\<star> \<subseteq> {[]}"
258
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    80
using assms
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    81
using Star_string concat_eq_Nil_conv empty_iff insert_iff subsetI subset_singletonD by fastforce
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    82
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    83
lemma Star_empty_string_finite:
259
78dd6bca5627 updated
Christian Urban <urbanc@in.tum.de>
parents: 258
diff changeset
    84
  shows "finite ({[]}\<star>)"
258
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    85
using Star_atmostempty infinite_super by auto
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    86
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    87
lemma Star_empty_finite:
259
78dd6bca5627 updated
Christian Urban <urbanc@in.tum.de>
parents: 258
diff changeset
    88
  shows "finite ({}\<star>)"
258
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    89
using Star_atmostempty infinite_super by auto
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    90
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    91
lemma Star_concat_replicate:
259
78dd6bca5627 updated
Christian Urban <urbanc@in.tum.de>
parents: 258
diff changeset
    92
  assumes "s \<in> A"
78dd6bca5627 updated
Christian Urban <urbanc@in.tum.de>
parents: 258
diff changeset
    93
  shows "concat (replicate n s) \<in> A\<star>"
258
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    94
using assms
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    95
by (induct n) (auto)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    96
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    97
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    98
lemma concat_replicate_inj:
259
78dd6bca5627 updated
Christian Urban <urbanc@in.tum.de>
parents: 258
diff changeset
    99
  assumes "concat (replicate n s) = concat (replicate m s)" "s \<noteq> []"
258
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   100
  shows "n = m"
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   101
using assms
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   102
apply(induct n arbitrary: m)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   103
apply(auto)[1]
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   104
apply(auto)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   105
apply(case_tac m)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   106
apply(clarify)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   107
apply(simp only: replicate.simps concat.simps)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   108
apply blast
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   109
by simp
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   110
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   111
lemma A0:
259
78dd6bca5627 updated
Christian Urban <urbanc@in.tum.de>
parents: 258
diff changeset
   112
  assumes "finite (A ;; B)" "B \<noteq> {}"
258
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   113
  shows "finite A"
259
78dd6bca5627 updated
Christian Urban <urbanc@in.tum.de>
parents: 258
diff changeset
   114
apply(subgoal_tac "\<exists>s. s \<in> B")
258
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   115
apply(erule exE)
259
78dd6bca5627 updated
Christian Urban <urbanc@in.tum.de>
parents: 258
diff changeset
   116
apply(subgoal_tac "finite {s1 @ s |s1. s1 \<in> A}")
78dd6bca5627 updated
Christian Urban <urbanc@in.tum.de>
parents: 258
diff changeset
   117
apply(rule_tac f="\<lambda>s1. s1 @ s" in finite_imageD)
258
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   118
apply(simp add: image_def)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   119
apply(smt Collect_cong)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   120
apply(simp add: inj_on_def)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   121
apply(rule_tac B="A ;; B" in finite_subset)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   122
apply(auto simp add: Sequ_def)[1]
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   123
apply(rule assms(1))
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   124
using assms(2) by auto
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   125
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   126
lemma A1:
259
78dd6bca5627 updated
Christian Urban <urbanc@in.tum.de>
parents: 258
diff changeset
   127
  assumes "finite (A ;; B)" "A \<noteq> {}"
258
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   128
  shows "finite B"
259
78dd6bca5627 updated
Christian Urban <urbanc@in.tum.de>
parents: 258
diff changeset
   129
apply(subgoal_tac "\<exists>s. s \<in> A")
258
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   130
apply(erule exE)
259
78dd6bca5627 updated
Christian Urban <urbanc@in.tum.de>
parents: 258
diff changeset
   131
apply(subgoal_tac "finite {s @ s1 |s1. s1 \<in> B}")
78dd6bca5627 updated
Christian Urban <urbanc@in.tum.de>
parents: 258
diff changeset
   132
apply(rule_tac f="\<lambda>s1. s @ s1" in finite_imageD)
258
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   133
apply(simp add: image_def)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   134
apply(smt Collect_cong)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   135
apply(simp add: inj_on_def)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   136
apply(rule_tac B="A ;; B" in finite_subset)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   137
apply(auto simp add: Sequ_def)[1]
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   138
apply(rule assms(1))
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   139
using assms(2) by auto
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   140
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   141
lemma Sequ_Prod_finite:
259
78dd6bca5627 updated
Christian Urban <urbanc@in.tum.de>
parents: 258
diff changeset
   142
  assumes "A \<noteq> {}" "B \<noteq> {}"
78dd6bca5627 updated
Christian Urban <urbanc@in.tum.de>
parents: 258
diff changeset
   143
  shows "finite (A ;; B) \<longleftrightarrow> (finite (A \<times> B))"
258
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   144
apply(rule iffI)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   145
apply(rule finite_cartesian_product)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   146
apply(erule A0)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   147
apply(rule assms(2))
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   148
apply(erule A1)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   149
apply(rule assms(1))
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   150
apply(simp add: Sequ_def)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   151
apply(rule finite_image_set2)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   152
apply(drule finite_cartesian_productD1)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   153
apply(rule assms(2))
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   154
apply(simp)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   155
apply(drule finite_cartesian_productD2)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   156
apply(rule assms(1))
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   157
apply(simp)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   158
done
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   159
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   160
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   161
lemma Star_non_empty_string_infinite:
259
78dd6bca5627 updated
Christian Urban <urbanc@in.tum.de>
parents: 258
diff changeset
   162
  assumes "s \<in> A" " s \<noteq> []"
78dd6bca5627 updated
Christian Urban <urbanc@in.tum.de>
parents: 258
diff changeset
   163
  shows "infinite (A\<star>)"
258
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   164
proof -
259
78dd6bca5627 updated
Christian Urban <urbanc@in.tum.de>
parents: 258
diff changeset
   165
  have "inj (\<lambda>n. concat (replicate n s))" 
258
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   166
  using assms(2) concat_replicate_inj
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   167
    by(auto simp add: inj_on_def)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   168
  moreover
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   169
  have "infinite (UNIV::nat set)" by simp
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   170
  ultimately
259
78dd6bca5627 updated
Christian Urban <urbanc@in.tum.de>
parents: 258
diff changeset
   171
  have "infinite ((\<lambda>n. concat (replicate n s)) ` UNIV)"
258
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   172
   by (simp add: range_inj_infinite)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   173
  moreover
259
78dd6bca5627 updated
Christian Urban <urbanc@in.tum.de>
parents: 258
diff changeset
   174
  have "((\<lambda>n. concat (replicate n s)) ` UNIV) \<subseteq> (A\<star>)"
258
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   175
    using Star_concat_replicate assms(1) by auto
259
78dd6bca5627 updated
Christian Urban <urbanc@in.tum.de>
parents: 258
diff changeset
   176
  ultimately show "infinite (A\<star>)" 
258
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   177
  using infinite_super by auto
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   178
qed
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   179
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   180
lemma infinitestrings_correctness:
259
78dd6bca5627 updated
Christian Urban <urbanc@in.tum.de>
parents: 258
diff changeset
   181
  shows "infinitestrings r \<longleftrightarrow> infinite (L r)"
258
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   182
apply(induct r)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   183
apply(simp_all)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   184
apply(simp add: zeroable_correctness)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   185
apply(rule iffI)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   186
apply(erule disjE)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   187
apply(subst Sequ_Prod_finite)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   188
apply(auto)[2]
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   189
using finite_cartesian_productD2 apply blast
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   190
apply(subst Sequ_Prod_finite)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   191
apply(auto)[2]
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   192
using finite_cartesian_productD1 apply blast
259
78dd6bca5627 updated
Christian Urban <urbanc@in.tum.de>
parents: 258
diff changeset
   193
apply(subgoal_tac "L r1 \<noteq> {} \<and> L r2 \<noteq> {}")
258
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   194
prefer 2
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   195
apply(auto simp add: Sequ_def)[1]
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   196
apply(subst (asm) Sequ_Prod_finite)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   197
apply(auto)[2]
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   198
apply(auto)[1]
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   199
apply(simp add: atmostempty_correctness)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   200
apply(rule iffI)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   201
apply (metis Star_empty_finite Star_empty_string_finite subset_singletonD)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   202
using Star_non_empty_string_infinite apply blast
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   203
done
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   204
260
160d0b08471c updated
Christian Urban <urbanc@in.tum.de>
parents: 259
diff changeset
   205
unused_thms
258
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   206
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   207
end