Up to index of Isabelle/HOL/HOL-Complex/CSP-Prover
theory Conditional_cms = Conditional + Domain_SF_prod_cms:(*-------------------------------------------* | CSP-Prover | | December 2004 | | Yoshinao Isobe (AIST JAPAN) | *-------------------------------------------*) theory Conditional_cms = Conditional + Domain_SF_prod_cms: (* The following simplification rules are deleted in this theory file *) (* because they unexpectly rewrite UnionT and InterT. *) (* disj_not1: (~ P | Q) = (P --> Q) *) declare disj_not1 [simp del] (* The following simplification is sometimes unexpected. *) (* *) (* not_None_eq: (x ~= None) = (EX y. x = Some y) *) declare not_None_eq [simp del] (***************************************************************** 1. [[IF b THEN P ELSE Q]]T : map 2. [[IF b THEN P ELSE Q]]F : map 3. 4. *****************************************************************) (********************************************************* map Conditional T *********************************************************) (*** restT (subset) ***) lemma Conditional_restT_sub: "[| [[P]]T ev1 rest n <= [[P]]T ev2 rest n ; [[Q]]T ev1 rest n <= [[Q]]T ev2 rest n |] ==> [[IF b THEN P ELSE Q]]T ev1 rest n <= [[IF b THEN P ELSE Q]]T ev2 rest n" apply (simp add: subsetT_iff) apply (intro allI impI) apply (simp add: in_restT) apply (simp add: Conditional_memT) done (*** restT (equal) ***) lemma Conditional_restT: "[| [[P]]T ev1 rest n = [[P]]T ev2 rest n ; [[Q]]T ev1 rest n = [[Q]]T ev2 rest n |] ==> [[IF b THEN P ELSE Q]]T ev1 rest n = [[IF b THEN P ELSE Q]]T ev2 rest n" apply (rule order_antisym) by (simp_all add: Conditional_restT_sub) (*** distT lemma ***) lemma Conditional_distT: "TTs = {([[P]]T ev1, [[P]]T ev2), ([[Q]]T ev1, [[Q]]T ev2)} ==> (EX TT. TT:TTs & distance([[IF b THEN P ELSE Q]]T ev1, [[IF b THEN P ELSE Q]]T ev2) <= distance((fst TT), (snd TT)))" apply (rule rest_to_dist_pair) by (auto intro: Conditional_restT) (*** map_alpha T lemma ***) lemma Conditional_evalT_map_alpha_lm: "[| distance ([[P]]T ev1, [[P]]T ev2) <= alpha * distance (ev1, ev2) ; distance ([[Q]]T ev1, [[Q]]T ev2) <= alpha * distance (ev1, ev2) |] ==> distance ([[IF b THEN P ELSE Q]]T ev1, [[IF b THEN P ELSE Q]]T ev2) <= alpha * distance (ev1, ev2)" apply (insert Conditional_distT [of "{([[P]]T ev1, [[P]]T ev2), ([[Q]]T ev1, [[Q]]T ev2)}" P ev1 ev2 Q b]) by (auto) (*** Conditional_evalT_non_expanding ***) lemma Conditional_evalT_map_alpha: "[| map_alpha [[P]]T alpha ; map_alpha [[Q]]T alpha |] ==> map_alpha [[IF b THEN P ELSE Q]]T alpha" apply (simp add: map_alpha_def) apply (intro allI) apply (erule conjE) apply (drule_tac x="x" in spec) apply (drule_tac x="x" in spec) apply (drule_tac x="y" in spec) apply (drule_tac x="y" in spec) by (simp add: Conditional_evalT_map_alpha_lm) (*** Conditional_evalT_non_expanding ***) lemma Conditional_evalT_non_expanding: "[| non_expanding [[P]]T ; non_expanding [[Q]]T |] ==> non_expanding [[IF b THEN P ELSE Q]]T" by (simp add: non_expanding_def Conditional_evalT_map_alpha) (*** Conditional_evalT_contraction_alpha ***) lemma Conditional_evalT_contraction_alpha: "[| contraction_alpha [[P]]T alpha; contraction_alpha [[Q]]T alpha|] ==> contraction_alpha [[IF b THEN P ELSE Q]]T alpha" by (simp add: contraction_alpha_def Conditional_evalT_map_alpha) (********************************************************* map Conditional F *********************************************************) (*** restF (subset) ***) lemma Conditional_restF_sub: "[| [[P]]F ev1 rest n <= [[P]]F ev2 rest n ; [[Q]]F ev1 rest n <= [[Q]]F ev2 rest n |] ==> [[IF b THEN P ELSE Q]]F ev1 rest n <= [[IF b THEN P ELSE Q]]F ev2 rest n" apply (simp add: subsetF_iff) apply (intro allI impI) apply (simp add: in_restF) apply (simp add: Conditional_memF) done (*** restF (equal) ***) lemma Conditional_restF: "[| [[P]]F ev1 rest n = [[P]]F ev2 rest n ; [[Q]]F ev1 rest n = [[Q]]F ev2 rest n |] ==> [[IF b THEN P ELSE Q]]F ev1 rest n = [[IF b THEN P ELSE Q]]F ev2 rest n" apply (rule order_antisym) by (simp_all add: Conditional_restF_sub) (*** distF lemma ***) lemma Conditional_distF: "FFs = {([[P]]F ev1, [[P]]F ev2), ([[Q]]F ev1, [[Q]]F ev2)} ==> (EX FF. FF:FFs & distance([[IF b THEN P ELSE Q]]F ev1, [[IF b THEN P ELSE Q]]F ev2) <= distance((fst FF), (snd FF)))" apply (rule rest_to_dist_pair) by (auto intro: Conditional_restF) (*** map_alpha F lemma ***) lemma Conditional_evalF_map_alpha_lm: "[| distance ([[P]]F ev1, [[P]]F ev2) <= alpha * distance (ev1, ev2) ; distance ([[Q]]F ev1, [[Q]]F ev2) <= alpha * distance (ev1, ev2) |] ==> distance ([[IF b THEN P ELSE Q]]F ev1, [[IF b THEN P ELSE Q]]F ev2) <= alpha * distance (ev1, ev2)" apply (insert Conditional_distF [of "{([[P]]F ev1, [[P]]F ev2), ([[Q]]F ev1, [[Q]]F ev2)}" P ev1 ev2 Q b]) by (auto) (*** Conditional_evalF_non_expanding ***) lemma Conditional_evalF_map_alpha: "[| map_alpha [[P]]F alpha ; map_alpha [[Q]]F alpha |] ==> map_alpha [[IF b THEN P ELSE Q]]F alpha" apply (simp add: map_alpha_def) apply (intro allI) apply (erule conjE) apply (drule_tac x="x" in spec) apply (drule_tac x="x" in spec) apply (drule_tac x="y" in spec) apply (drule_tac x="y" in spec) by (simp add: Conditional_evalF_map_alpha_lm) (*** Conditional_evalF_non_expanding ***) lemma Conditional_evalF_non_expanding: "[| non_expanding [[P]]F ; non_expanding [[Q]]F |] ==> non_expanding [[IF b THEN P ELSE Q]]F" by (simp add: non_expanding_def Conditional_evalF_map_alpha) (*** Conditional_evalF_contraction_alpha ***) lemma Conditional_evalF_contraction_alpha: "[| contraction_alpha [[P]]F alpha; contraction_alpha [[Q]]F alpha|] ==> contraction_alpha [[IF b THEN P ELSE Q]]F alpha" by (simp add: contraction_alpha_def Conditional_evalF_map_alpha) (****************** to add them again ******************) declare disj_not1 [simp] declare not_None_eq [simp] end
lemma Conditional_restT_sub:
[| [[P]]T ev1 rest n ≤ [[P]]T ev2 rest n; [[Q]]T ev1 rest n ≤ [[Q]]T ev2 rest n |] ==> [[IF b THEN P ELSE Q]]T ev1 rest n ≤ [[IF b THEN P ELSE Q]]T ev2 rest n
lemma Conditional_restT:
[| [[P]]T ev1 rest n = [[P]]T ev2 rest n; [[Q]]T ev1 rest n = [[Q]]T ev2 rest n |] ==> [[IF b THEN P ELSE Q]]T ev1 rest n = [[IF b THEN P ELSE Q]]T ev2 rest n
lemma Conditional_distT:
TTs = {([[P]]T ev1, [[P]]T ev2), ([[Q]]T ev1, [[Q]]T ev2)} ==> ∃TT. TT ∈ TTs ∧ distance ([[IF b THEN P ELSE Q]]T ev1, [[IF b THEN P ELSE Q]]T ev2) ≤ distance (fst TT, snd TT)
lemma Conditional_evalT_map_alpha_lm:
[| distance ([[P]]T ev1, [[P]]T ev2) ≤ alpha * distance (ev1, ev2); distance ([[Q]]T ev1, [[Q]]T ev2) ≤ alpha * distance (ev1, ev2) |] ==> distance ([[IF b THEN P ELSE Q]]T ev1, [[IF b THEN P ELSE Q]]T ev2) ≤ alpha * distance (ev1, ev2)
lemma Conditional_evalT_map_alpha:
[| map_alpha [[P]]T alpha; map_alpha [[Q]]T alpha |] ==> map_alpha [[IF b THEN P ELSE Q]]T alpha
lemma Conditional_evalT_non_expanding:
[| non_expanding [[P]]T; non_expanding [[Q]]T |] ==> non_expanding [[IF b THEN P ELSE Q]]T
lemma Conditional_evalT_contraction_alpha:
[| contraction_alpha [[P]]T alpha; contraction_alpha [[Q]]T alpha |] ==> contraction_alpha [[IF b THEN P ELSE Q]]T alpha
lemma Conditional_restF_sub:
[| [[P]]F ev1 rest n ≤ [[P]]F ev2 rest n; [[Q]]F ev1 rest n ≤ [[Q]]F ev2 rest n |] ==> [[IF b THEN P ELSE Q]]F ev1 rest n ≤ [[IF b THEN P ELSE Q]]F ev2 rest n
lemma Conditional_restF:
[| [[P]]F ev1 rest n = [[P]]F ev2 rest n; [[Q]]F ev1 rest n = [[Q]]F ev2 rest n |] ==> [[IF b THEN P ELSE Q]]F ev1 rest n = [[IF b THEN P ELSE Q]]F ev2 rest n
lemma Conditional_distF:
FFs = {([[P]]F ev1, [[P]]F ev2), ([[Q]]F ev1, [[Q]]F ev2)} ==> ∃FF. FF ∈ FFs ∧ distance ([[IF b THEN P ELSE Q]]F ev1, [[IF b THEN P ELSE Q]]F ev2) ≤ distance (fst FF, snd FF)
lemma Conditional_evalF_map_alpha_lm:
[| distance ([[P]]F ev1, [[P]]F ev2) ≤ alpha * distance (ev1, ev2); distance ([[Q]]F ev1, [[Q]]F ev2) ≤ alpha * distance (ev1, ev2) |] ==> distance ([[IF b THEN P ELSE Q]]F ev1, [[IF b THEN P ELSE Q]]F ev2) ≤ alpha * distance (ev1, ev2)
lemma Conditional_evalF_map_alpha:
[| map_alpha [[P]]F alpha; map_alpha [[Q]]F alpha |] ==> map_alpha [[IF b THEN P ELSE Q]]F alpha
lemma Conditional_evalF_non_expanding:
[| non_expanding [[P]]F; non_expanding [[Q]]F |] ==> non_expanding [[IF b THEN P ELSE Q]]F
lemma Conditional_evalF_contraction_alpha:
[| contraction_alpha [[P]]F alpha; contraction_alpha [[Q]]F alpha |] ==> contraction_alpha [[IF b THEN P ELSE Q]]F alpha