Theory Int_choice_cms

Up to index of Isabelle/HOL/HOL-Complex/CSP-Prover

theory Int_choice_cms = Int_choice + Domain_SF_prod_cms:

           (*-------------------------------------------*
            |                CSP-Prover                 |
            |               December 2004               |
            |        Yoshinao Isobe (AIST JAPAN)        |
            *-------------------------------------------*)

theory Int_choice_cms = Int_choice + 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. [[P |~| Q]]T : non expanding
         2. [[P |~| Q]]F : non expanding
         3. 
         4. 

 *****************************************************************)

(*********************************************************
                   map Int_choice T
 *********************************************************)

(*** restT (subset) ***)

lemma Int_choice_restT_sub:
   "[| [[P]]T ev1 rest n <= [[P]]T ev2 rest n ;
       [[Q]]T ev1 rest n <= [[Q]]T ev2 rest n |]
    ==> [[P |~| Q]]T ev1 rest n <= [[P |~| Q]]T ev2 rest n"
apply (simp add: subsetT_iff)
apply (intro allI impI)
apply (simp add: in_restT)
apply (simp add: Int_choice_memT)
by (auto)

(*** restT (equal) ***)

lemma Int_choice_restT:
   "[| [[P]]T ev1 rest n = [[P]]T ev2 rest n ;
       [[Q]]T ev1 rest n = [[Q]]T ev2 rest n |]
    ==> [[P |~| Q]]T ev1 rest n = [[P |~| Q]]T ev2 rest n"
apply (rule order_antisym)
by (simp_all add: Int_choice_restT_sub)

(*** distT lemma ***)

lemma Int_choice_distT:
  "TTs = {([[P]]T ev1, [[P]]T ev2), ([[Q]]T ev1, [[Q]]T ev2)}
    ==> (EX TT. TT:TTs & 
             distance([[P |~| Q]]T ev1, [[P |~| Q]]T ev2) 
          <= distance((fst TT), (snd TT)))"
apply (rule rest_to_dist_pair)
by (auto intro: Int_choice_restT)

(*** map_alpha T lemma ***)

lemma Int_choice_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 ([[P |~| Q]]T ev1, [[P |~| Q]]T ev2)
     <= alpha * distance (ev1, ev2)"
apply (insert Int_choice_distT
       [of "{([[P]]T ev1, [[P]]T ev2), ([[Q]]T ev1, [[Q]]T ev2)}" P ev1 ev2 Q])
by (auto)

(*** Int_choice_evalT_non_expanding ***)

lemma Int_choice_evalT_map_alpha:
 "[| map_alpha [[P]]T alpha ; map_alpha [[Q]]T alpha |]
  ==> map_alpha [[P |~| 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: Int_choice_evalT_map_alpha_lm)

(*** Int_choice_evalT_non_expanding ***)

lemma Int_choice_evalT_non_expanding:
 "[| non_expanding [[P]]T ; non_expanding [[Q]]T |]
  ==> non_expanding [[P |~| Q]]T"
by (simp add: non_expanding_def Int_choice_evalT_map_alpha)

(*** Int_choice_evalT_contraction_alpha ***)

lemma Int_choice_evalT_contraction_alpha:
 "[| contraction_alpha [[P]]T alpha; contraction_alpha [[Q]]T alpha|]
  ==> contraction_alpha [[P |~| Q]]T alpha"
by (simp add: contraction_alpha_def Int_choice_evalT_map_alpha)

(*********************************************************
                   map Int_choice F
 *********************************************************)

(*** restF (subset) ***)

lemma Int_choice_restF_sub:
   "[| [[P]]F ev1 rest n <= [[P]]F ev2 rest n ;
       [[Q]]F ev1 rest n <= [[Q]]F ev2 rest n |]
    ==> [[P |~| Q]]F ev1 rest n <= [[P |~| Q]]F ev2 rest n"
apply (simp add: subsetF_iff)
apply (intro allI impI)
apply (simp add: in_restF)
apply (simp add: Int_choice_memF)
apply (elim conjE exE disjE)
by (fast)+

(*** restF (equal) ***)

lemma Int_choice_restF:
   "[| [[P]]F ev1 rest n = [[P]]F ev2 rest n ;
       [[Q]]F ev1 rest n = [[Q]]F ev2 rest n |]
    ==> [[P |~| Q]]F ev1 rest n = [[P |~| Q]]F ev2 rest n"
apply (rule order_antisym)
by (simp_all add: Int_choice_restF_sub)

(*** distF lemma ***)

lemma Int_choice_distF:
  "FFs = {([[P]]F ev1, [[P]]F ev2), ([[Q]]F ev1, [[Q]]F ev2)}
    ==> (EX FF. FF:FFs & 
             distance([[P |~| Q]]F ev1, [[P |~| Q]]F ev2) 
          <= distance((fst FF), (snd FF)))"
apply (rule rest_to_dist_pair)
by (auto intro: Int_choice_restF)

(*** map_alpha F lemma ***)

lemma Int_choice_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 ([[P |~| Q]]F ev1, [[P |~| Q]]F ev2)
     <= alpha * distance (ev1, ev2)"
apply (insert Int_choice_distF
       [of "{([[P]]F ev1, [[P]]F ev2), ([[Q]]F ev1, [[Q]]F ev2)}" P ev1 ev2 Q])
by (auto)

(*** Int_choice_evalF_non_expanding ***)

lemma Int_choice_evalF_map_alpha:
 "[| map_alpha [[P]]F alpha ; map_alpha [[Q]]F alpha |]
  ==> map_alpha [[P |~| 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: Int_choice_evalF_map_alpha_lm)

(*** Int_choice_evalF_non_expanding ***)

lemma Int_choice_evalF_non_expanding:
 "[| non_expanding [[P]]F ; non_expanding [[Q]]F |]
  ==> non_expanding [[P |~| Q]]F"
by (simp add: non_expanding_def Int_choice_evalF_map_alpha)

(*** Int_choice_evalF_contraction_alpha ***)

lemma Int_choice_evalF_contraction_alpha:
 "[| contraction_alpha [[P]]F alpha; contraction_alpha [[Q]]F alpha|]
  ==> contraction_alpha [[P |~| Q]]F alpha"
by (simp add: contraction_alpha_def Int_choice_evalF_map_alpha)

(****************** to add them again ******************)

declare disj_not1   [simp]
declare not_None_eq [simp]

end

lemma Int_choice_restT_sub:

  [| [[P]]T ev1 rest n ≤ [[P]]T ev2 rest n;
     [[Q]]T ev1 rest n ≤ [[Q]]T ev2 rest n |]
  ==> [[P |~| Q]]T ev1 rest n ≤ [[P |~| Q]]T ev2 rest n

lemma Int_choice_restT:

  [| [[P]]T ev1 rest n = [[P]]T ev2 rest n;
     [[Q]]T ev1 rest n = [[Q]]T ev2 rest n |]
  ==> [[P |~| Q]]T ev1 rest n = [[P |~| Q]]T ev2 rest n

lemma Int_choice_distT:

  TTs = {([[P]]T ev1, [[P]]T ev2), ([[Q]]T ev1, [[Q]]T ev2)}
  ==> ∃TT. TTTTs ∧
           distance ([[P |~| Q]]T ev1, [[P |~| Q]]T ev2)
           ≤ distance (fst TT, snd TT)

lemma Int_choice_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 ([[P |~| Q]]T ev1, [[P |~| Q]]T ev2) ≤ alpha * distance (ev1, ev2)

lemma Int_choice_evalT_map_alpha:

  [| map_alpha [[P]]T alpha; map_alpha [[Q]]T alpha |]
  ==> map_alpha [[P |~| Q]]T alpha

lemma Int_choice_evalT_non_expanding:

  [| non_expanding [[P]]T; non_expanding [[Q]]T |] ==> non_expanding [[P |~| Q]]T

lemma Int_choice_evalT_contraction_alpha:

  [| contraction_alpha [[P]]T alpha; contraction_alpha [[Q]]T alpha |]
  ==> contraction_alpha [[P |~| Q]]T alpha

lemma Int_choice_restF_sub:

  [| [[P]]F ev1 rest n ≤ [[P]]F ev2 rest n;
     [[Q]]F ev1 rest n ≤ [[Q]]F ev2 rest n |]
  ==> [[P |~| Q]]F ev1 rest n ≤ [[P |~| Q]]F ev2 rest n

lemma Int_choice_restF:

  [| [[P]]F ev1 rest n = [[P]]F ev2 rest n;
     [[Q]]F ev1 rest n = [[Q]]F ev2 rest n |]
  ==> [[P |~| Q]]F ev1 rest n = [[P |~| Q]]F ev2 rest n

lemma Int_choice_distF:

  FFs = {([[P]]F ev1, [[P]]F ev2), ([[Q]]F ev1, [[Q]]F ev2)}
  ==> ∃FF. FFFFs ∧
           distance ([[P |~| Q]]F ev1, [[P |~| Q]]F ev2)
           ≤ distance (fst FF, snd FF)

lemma Int_choice_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 ([[P |~| Q]]F ev1, [[P |~| Q]]F ev2) ≤ alpha * distance (ev1, ev2)

lemma Int_choice_evalF_map_alpha:

  [| map_alpha [[P]]F alpha; map_alpha [[Q]]F alpha |]
  ==> map_alpha [[P |~| Q]]F alpha

lemma Int_choice_evalF_non_expanding:

  [| non_expanding [[P]]F; non_expanding [[Q]]F |] ==> non_expanding [[P |~| Q]]F

lemma Int_choice_evalF_contraction_alpha:

  [| contraction_alpha [[P]]F alpha; contraction_alpha [[Q]]F alpha |]
  ==> contraction_alpha [[P |~| Q]]F alpha