# HG changeset patch # User urbanc # Date 1297183758 0 # Node ID dc879cb59c9c5d5ea54ef34ac1773e36347ebb86 # Parent f901a26bf1ac8a70f5d6cc80f2925a0a3662a4e0 more direct definitions diff -r f901a26bf1ac -r dc879cb59c9c Myhill_1.thy --- a/Myhill_1.thy Tue Feb 08 15:59:47 2011 +0000 +++ b/Myhill_1.thy Tue Feb 08 16:49:18 2011 +0000 @@ -434,21 +434,6 @@ *} text {* - The functions @{text "the_r"} and @{text "the_Trn"} are used to extract - subcomponents from right hand side items. - *} - -fun - the_r :: "rhs_item \ rexp" -where - "the_r (Lam r) = r" - -fun - the_trn_rexp:: "rhs_item \ rexp" -where - "the_trn_rexp (Trn Y r) = r" - -text {* Every right-hand side item @{text "itm"} defines a language given by @{text "L(itm)"}, defined as: *} @@ -519,26 +504,6 @@ definition "trns_of rhs X \ {Trn X r | r. Trn X r \ rhs}" -text {* - The following @{text "rexp_of rhs X"} combines all regular expressions in @{text "X"}-items - using @{text "ALT"} to form a single regular expression. - It will be used later to implement @{text "arden_variate"} and @{text "rhs_subst"}. - *} - -definition - "rexp_of rhs X \ \ {r. Trn X r \ rhs}" - -text {* - The following @{text "rexp_of_lam rhs"} combines pure regular expression items in @{text "rhs"} - using @{text "ALT"} to form a single regular expression. - When all variables inside @{text "rhs"} are eliminated, @{text "rexp_of_lam rhs"} - is used to compute compute the regular expression corresponds to @{text "rhs"}. -*} - - -definition - "rexp_of_lam rhs \ \ {r. Lam r \ rhs}" - text {* The following @{text "attach_rexp rexp' itm"} attach the regular expression @{text "rexp'"} to @@ -726,14 +691,12 @@ proof - have "finite {Trn Y r | Y r. Trn Y r \ rhs}" by (rule rev_finite_subset[OF fin]) (auto) - then have "finite (the_trn_rexp ` {Trn Y r | Y r. Trn Y r \ rhs})" - by auto + then have "finite ((\(Y, r). Trn Y r) ` {(Y, r) | Y r. Trn Y r \ rhs})" + by (simp add: image_Collect) + then have "finite {(Y, r) | Y r. Trn Y r \ rhs}" + by (erule_tac finite_imageD) (simp add: inj_on_def) then show "finite {r. Trn Y r \ rhs}" - apply(erule_tac rev_finite_subset) - apply(auto simp add: image_def) - apply(rule_tac x="Trn Y x" in exI) - apply(auto) - done + by (erule_tac f="snd" in finite_surj) (auto simp add: image_def) qed lemma finite_Lam: @@ -742,11 +705,10 @@ proof - have "finite {Lam r | r. Lam r \ rhs}" by (rule rev_finite_subset[OF fin]) (auto) - then have "finite (the_r ` {Lam r | r. Lam r \ rhs})" - by auto then show "finite {r. Lam r \ rhs}" - apply(erule_tac rev_finite_subset) - apply(auto simp add: image_def) + apply(simp add: image_Collect[symmetric]) + apply(erule finite_imageD) + apply(auto simp add: inj_on_def) done qed @@ -931,7 +893,6 @@ and finite: "finite rhs" shows "X = L (arden_variate X rhs)" proof - - thm rexp_of_def def A \ "L (\{r. Trn X r \ rhs})" def b \ "rhs - trns_of rhs X" def B \ "L b" @@ -1244,7 +1205,7 @@ shows "\ (r::rexp). L r = X" (is "\ r. ?P r") proof- def A \ "arden_variate X xrhs" - have "?P (rexp_of_lam A)" + have "?P (\{r. Lam r \ A})" proof - have "L (\{r. Lam r \ A}) = L ({Lam r | r. Lam r \ A})" proof(rule rexp_of_lam_eq_lam_set) @@ -1280,7 +1241,7 @@ from Inv_ES ES_single show "finite xrhs" by (simp add:Inv_def finite_rhs_def) qed - finally show ?thesis unfolding rexp_of_lam_def by simp + finally show ?thesis by simp qed thus ?thesis by auto qed diff -r f901a26bf1ac -r dc879cb59c9c tphols-2011/myhill.pdf Binary file tphols-2011/myhill.pdf has changed