# HG changeset patch # User wenzelm # Date 1473188958 -7200 # Node ID 67b091896158d297c97fb05996e7e273730f48a3 # Parent 56670ab6f55e3f23171cbf8d241f50cf6064d86d clarified proof: save 1-2s CPU time; diff -r 56670ab6f55e -r 67b091896158 src/HOL/Complete_Partial_Order.thy --- a/src/HOL/Complete_Partial_Order.thy Tue Sep 06 15:02:22 2016 +0200 +++ b/src/HOL/Complete_Partial_Order.thy Tue Sep 06 21:09:18 2016 +0200 @@ -80,7 +80,7 @@ by (rule chainI) simp lemma ccpo_Sup_singleton [simp]: "\{x} = x" - by (rule antisym)(auto intro: ccpo_Sup_least ccpo_Sup_upper simp add: chain_singleton) + by (rule antisym) (auto intro: ccpo_Sup_least ccpo_Sup_upper simp add: chain_singleton) subsection \Transfinite iteration of a function\ @@ -282,26 +282,6 @@ context ccpo begin -lemma admissible_disj_lemma: - assumes A: "chain (op \)A" - assumes P: "\x\A. \y\A. x \ y \ P y" - shows "Sup A = Sup {x \ A. P x}" -proof (rule antisym) - have *: "chain (op \) {x \ A. P x}" - by (rule chain_compr [OF A]) - show "Sup A \ Sup {x \ A. P x}" - apply (rule ccpo_Sup_least [OF A]) - apply (drule P [rule_format], clarify) - apply (erule order_trans) - apply (simp add: ccpo_Sup_upper [OF *]) - done - show "Sup {x \ A. P x} \ Sup A" - apply (rule ccpo_Sup_least [OF *]) - apply clarify - apply (simp add: ccpo_Sup_upper [OF A]) - done -qed - lemma admissible_disj: fixes P Q :: "'a \ bool" assumes P: "ccpo.admissible Sup (op \) (\x. P x)" @@ -309,23 +289,73 @@ shows "ccpo.admissible Sup (op \) (\x. P x \ Q x)" proof (rule ccpo.admissibleI) fix A :: "'a set" - assume A: "chain (op \) A" - assume "A \ {}" and "\x\A. P x \ Q x" - then have "(\x\A. P x) \ (\x\A. \y\A. x \ y \ P y) \ (\x\A. Q x) \ (\x\A. \y\A. x \ y \ Q y)" - using chainD[OF A] by blast (* slow *) - then have "(\x. x \ A \ P x) \ Sup A = Sup {x \ A. P x} \ (\x. x \ A \ Q x) \ Sup A = Sup {x \ A. Q x}" - using admissible_disj_lemma [OF A] by blast + assume chain: "chain (op \) A" + assume A: "A \ {}" and P_Q: "\x\A. P x \ Q x" + have "(\x\A. P x) \ (\x\A. \y\A. x \ y \ P y) \ (\x\A. Q x) \ (\x\A. \y\A. x \ y \ Q y)" + (is "?P \ ?Q" is "?P1 \ ?P2 \ _") + proof (rule disjCI) + assume "\ ?Q" + then consider "\x\A. \ Q x" | a where "a \ A" "\y\A. a \ y \ \ Q y" + by blast + then show ?P + proof cases + case 1 + with P_Q have "\x\A. P x" by blast + with A show ?P by blast + next + case 2 + note a = \a \ A\ + show ?P + proof + from P_Q 2 have *: "\y\A. a \ y \ P y" by blast + with a have "P a" by blast + with a show ?P1 by blast + show ?P2 + proof + fix x + assume x: "x \ A" + with chain a show "\y\A. x \ y \ P y" + proof (rule chainE) + assume le: "a \ x" + with * a x have "P x" by blast + with x le show ?thesis by blast + next + assume "a \ x" + with a \P a\ show ?thesis by blast + qed + qed + qed + qed + qed + moreover + have "Sup A = Sup {x \ A. P x}" if "\x\A. \y\A. x \ y \ P y" for P + proof (rule antisym) + have chain_P: "chain (op \) {x \ A. P x}" + by (rule chain_compr [OF chain]) + show "Sup A \ Sup {x \ A. P x}" + apply (rule ccpo_Sup_least [OF chain]) + apply (drule that [rule_format]) + apply clarify + apply (erule order_trans) + apply (simp add: ccpo_Sup_upper [OF chain_P]) + done + show "Sup {x \ A. P x} \ Sup A" + apply (rule ccpo_Sup_least [OF chain_P]) + apply clarify + apply (simp add: ccpo_Sup_upper [OF chain]) + done + qed + ultimately + consider "\x. x \ A \ P x" "Sup A = Sup {x \ A. P x}" + | "\x. x \ A \ Q x" "Sup A = Sup {x \ A. Q x}" + by blast then show "P (Sup A) \ Q (Sup A)" - apply (rule disjE) + apply cases apply simp_all apply (rule disjI1) - apply (rule ccpo.admissibleD [OF P chain_compr [OF A]]) - apply simp - apply simp + apply (rule ccpo.admissibleD [OF P chain_compr [OF chain]]; simp) apply (rule disjI2) - apply (rule ccpo.admissibleD [OF Q chain_compr [OF A]]) - apply simp - apply simp + apply (rule ccpo.admissibleD [OF Q chain_compr [OF chain]]; simp) done qed