src/HOL/UNITY/Rename.thy
author paulson
Tue, 01 Feb 2005 18:01:57 +0100
changeset 15481 fc075ae929e4
parent 13805 3786b2fd6808
child 15976 44f615d1729b
permissions -rw-r--r--
the new subst tactic, by Lucas Dixon
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
8256
6ba8fa2b0638 Rename: theory for applying a bijection over states to a UNITY program
paulson
parents:
diff changeset
     1
(*  Title:      HOL/UNITY/Rename.thy
6ba8fa2b0638 Rename: theory for applying a bijection over states to a UNITY program
paulson
parents:
diff changeset
     2
    ID:         $Id$
6ba8fa2b0638 Rename: theory for applying a bijection over states to a UNITY program
paulson
parents:
diff changeset
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
6ba8fa2b0638 Rename: theory for applying a bijection over states to a UNITY program
paulson
parents:
diff changeset
     4
    Copyright   2000  University of Cambridge
13798
4c1a53627500 conversion to new-style theories and tidying
paulson
parents: 13790
diff changeset
     5
*)
8256
6ba8fa2b0638 Rename: theory for applying a bijection over states to a UNITY program
paulson
parents:
diff changeset
     6
13798
4c1a53627500 conversion to new-style theories and tidying
paulson
parents: 13790
diff changeset
     7
header{*Renaming of State Sets*}
8256
6ba8fa2b0638 Rename: theory for applying a bijection over states to a UNITY program
paulson
parents:
diff changeset
     8
13790
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
     9
theory Rename = Extend:
8256
6ba8fa2b0638 Rename: theory for applying a bijection over states to a UNITY program
paulson
parents:
diff changeset
    10
6ba8fa2b0638 Rename: theory for applying a bijection over states to a UNITY program
paulson
parents:
diff changeset
    11
constdefs
6ba8fa2b0638 Rename: theory for applying a bijection over states to a UNITY program
paulson
parents:
diff changeset
    12
  
6ba8fa2b0638 Rename: theory for applying a bijection over states to a UNITY program
paulson
parents:
diff changeset
    13
  rename :: "['a => 'b, 'a program] => 'b program"
6ba8fa2b0638 Rename: theory for applying a bijection over states to a UNITY program
paulson
parents:
diff changeset
    14
    "rename h == extend (%(x,u::unit). h x)"
6ba8fa2b0638 Rename: theory for applying a bijection over states to a UNITY program
paulson
parents:
diff changeset
    15
13790
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    16
declare image_inv_f_f [simp] image_surj_f_inv_f [simp]
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    17
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    18
declare Extend.intro [simp,intro]
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    19
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    20
lemma good_map_bij [simp,intro]: "bij h ==> good_map (%(x,u). h x)"
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    21
apply (rule good_mapI)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    22
apply (unfold bij_def inj_on_def surj_def, auto)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    23
done
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    24
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    25
lemma fst_o_inv_eq_inv: "bij h ==> fst (inv (%(x,u). h x) s) = inv h s"
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    26
apply (unfold bij_def split_def, clarify)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    27
apply (subgoal_tac "surj (%p. h (fst p))")
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    28
 prefer 2 apply (simp add: surj_def)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    29
apply (erule injD)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    30
apply (simp (no_asm_simp) add: surj_f_inv_f)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    31
apply (erule surj_f_inv_f)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    32
done
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    33
13805
3786b2fd6808 some x-symbols
paulson
parents: 13798
diff changeset
    34
lemma mem_rename_set_iff: "bij h ==> z \<in> h`A = (inv h z \<in> A)"
13790
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    35
by (force simp add: bij_is_inj bij_is_surj [THEN surj_f_inv_f])
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    36
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    37
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    38
lemma extend_set_eq_image [simp]: "extend_set (%(x,u). h x) A = h`A"
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    39
by (force simp add: extend_set_def)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    40
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    41
lemma Init_rename [simp]: "Init (rename h F) = h`(Init F)"
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    42
by (simp add: rename_def)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    43
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    44
13798
4c1a53627500 conversion to new-style theories and tidying
paulson
parents: 13790
diff changeset
    45
subsection{*inverse properties*}
13790
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    46
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    47
lemma extend_set_inv: 
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    48
     "bij h  
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    49
      ==> extend_set (%(x,u::'c). inv h x) = project_set (%(x,u::'c). h x)"
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    50
apply (unfold bij_def)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    51
apply (rule ext)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    52
apply (force simp add: extend_set_def project_set_def surj_f_inv_f)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    53
done
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    54
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    55
(** for "rename" (programs) **)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    56
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    57
lemma bij_extend_act_eq_project_act: "bij h  
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    58
      ==> extend_act (%(x,u::'c). h x) = project_act (%(x,u::'c). inv h x)"
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    59
apply (rule ext)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    60
apply (force simp add: extend_act_def project_act_def bij_def surj_f_inv_f)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    61
done
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    62
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    63
lemma bij_extend_act: "bij h ==> bij (extend_act (%(x,u::'c). h x))"
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    64
apply (rule bijI)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    65
apply (rule Extend.inj_extend_act)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    66
apply (auto simp add: bij_extend_act_eq_project_act)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    67
apply (rule surjI)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    68
apply (rule Extend.extend_act_inverse)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    69
apply (blast intro: bij_imp_bij_inv good_map_bij)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    70
done
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    71
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    72
lemma bij_project_act: "bij h ==> bij (project_act (%(x,u::'c). h x))"
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    73
apply (frule bij_imp_bij_inv [THEN bij_extend_act])
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    74
apply (simp add: bij_extend_act_eq_project_act bij_imp_bij_inv inv_inv_eq)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    75
done
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    76
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    77
lemma bij_inv_project_act_eq: "bij h ==> inv (project_act (%(x,u::'c). inv h x)) =  
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    78
                project_act (%(x,u::'c). h x)"
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    79
apply (simp (no_asm_simp) add: bij_extend_act_eq_project_act [symmetric])
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    80
apply (rule surj_imp_inv_eq)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    81
apply (blast intro: bij_extend_act bij_is_surj)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    82
apply (simp (no_asm_simp) add: Extend.extend_act_inverse)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    83
done
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    84
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    85
lemma extend_inv: "bij h   
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    86
      ==> extend (%(x,u::'c). inv h x) = project (%(x,u::'c). h x) UNIV"
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    87
apply (frule bij_imp_bij_inv)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    88
apply (rule ext)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    89
apply (rule program_equalityI)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    90
  apply (simp (no_asm_simp) add: extend_set_inv)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    91
 apply (simp add: Extend.project_act_Id Extend.Acts_extend 
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    92
          insert_Id_image_Acts bij_extend_act_eq_project_act inv_inv_eq) 
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    93
apply (simp add: Extend.AllowedActs_extend Extend.AllowedActs_project 
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    94
             bij_project_act bij_vimage_eq_inv_image bij_inv_project_act_eq)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    95
done
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    96
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    97
lemma rename_inv_rename [simp]: "bij h ==> rename (inv h) (rename h F) = F"
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    98
by (simp add: rename_def extend_inv Extend.extend_inverse)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
    99
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   100
lemma rename_rename_inv [simp]: "bij h ==> rename h (rename (inv h) F) = F"
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   101
apply (frule bij_imp_bij_inv)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   102
apply (erule inv_inv_eq [THEN subst], erule rename_inv_rename)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   103
done
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   104
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   105
lemma rename_inv_eq: "bij h ==> rename (inv h) = inv (rename h)"
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   106
by (rule inv_equality [symmetric], auto)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   107
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   108
(** (rename h) is bijective <=> h is bijective **)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   109
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   110
lemma bij_extend: "bij h ==> bij (extend (%(x,u::'c). h x))"
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   111
apply (rule bijI)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   112
apply (blast intro: Extend.inj_extend)
15481
fc075ae929e4 the new subst tactic, by Lucas Dixon
paulson
parents: 13805
diff changeset
   113
apply (rule_tac f = "extend (% (x,u) . inv h x) " in surjI) 
fc075ae929e4 the new subst tactic, by Lucas Dixon
paulson
parents: 13805
diff changeset
   114
apply (simplesubst inv_inv_eq [of h, symmetric], assumption) 
13790
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   115
apply (subst extend_inv, simp add: bij_imp_bij_inv) 
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   116
apply (simp add: inv_inv_eq) 
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   117
apply (rule Extend.extend_inverse) 
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   118
apply (simp add: bij_imp_bij_inv) 
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   119
done
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   120
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   121
lemma bij_project: "bij h ==> bij (project (%(x,u::'c). h x) UNIV)"
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   122
apply (subst extend_inv [symmetric])
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   123
apply (auto simp add: bij_imp_bij_inv bij_extend)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   124
done
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   125
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   126
lemma inv_project_eq:
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   127
     "bij h   
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   128
      ==> inv (project (%(x,u::'c). h x) UNIV) = extend (%(x,u::'c). h x)"
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   129
apply (rule inj_imp_inv_eq)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   130
apply (erule bij_project [THEN bij_is_inj])
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   131
apply (simp (no_asm_simp) add: Extend.extend_inverse)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   132
done
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   133
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   134
lemma Allowed_rename [simp]:
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   135
     "bij h ==> Allowed (rename h F) = rename h ` Allowed F"
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   136
apply (simp (no_asm_simp) add: rename_def Extend.Allowed_extend)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   137
apply (subst bij_vimage_eq_inv_image)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   138
apply (rule bij_project, blast)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   139
apply (simp (no_asm_simp) add: inv_project_eq)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   140
done
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   141
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   142
lemma bij_rename: "bij h ==> bij (rename h)"
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   143
apply (simp (no_asm_simp) add: rename_def bij_extend)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   144
done
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   145
lemmas surj_rename = bij_rename [THEN bij_is_surj, standard]
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   146
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   147
lemma inj_rename_imp_inj: "inj (rename h) ==> inj h"
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   148
apply (unfold inj_on_def, auto)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   149
apply (drule_tac x = "mk_program ({x}, {}, {}) " in spec)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   150
apply (drule_tac x = "mk_program ({y}, {}, {}) " in spec)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   151
apply (auto simp add: program_equality_iff rename_def extend_def)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   152
done
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   153
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   154
lemma surj_rename_imp_surj: "surj (rename h) ==> surj h"
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   155
apply (unfold surj_def, auto)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   156
apply (drule_tac x = "mk_program ({y}, {}, {}) " in spec)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   157
apply (auto simp add: program_equality_iff rename_def extend_def)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   158
done
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   159
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   160
lemma bij_rename_imp_bij: "bij (rename h) ==> bij h"
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   161
apply (unfold bij_def)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   162
apply (simp (no_asm_simp) add: inj_rename_imp_inj surj_rename_imp_surj)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   163
done
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   164
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   165
lemma bij_rename_iff [simp]: "bij (rename h) = bij h"
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   166
by (blast intro: bij_rename bij_rename_imp_bij)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   167
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   168
13798
4c1a53627500 conversion to new-style theories and tidying
paulson
parents: 13790
diff changeset
   169
subsection{*the lattice operations*}
13790
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   170
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   171
lemma rename_SKIP [simp]: "bij h ==> rename h SKIP = SKIP"
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   172
by (simp add: rename_def Extend.extend_SKIP)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   173
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   174
lemma rename_Join [simp]: 
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   175
     "bij h ==> rename h (F Join G) = rename h F Join rename h G"
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   176
by (simp add: rename_def Extend.extend_Join)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   177
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   178
lemma rename_JN [simp]:
13805
3786b2fd6808 some x-symbols
paulson
parents: 13798
diff changeset
   179
     "bij h ==> rename h (JOIN I F) = (\<Squnion>i \<in> I. rename h (F i))"
13790
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   180
by (simp add: rename_def Extend.extend_JN)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   181
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   182
13798
4c1a53627500 conversion to new-style theories and tidying
paulson
parents: 13790
diff changeset
   183
subsection{*Strong Safety: co, stable*}
13790
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   184
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   185
lemma rename_constrains: 
13805
3786b2fd6808 some x-symbols
paulson
parents: 13798
diff changeset
   186
     "bij h ==> (rename h F \<in> (h`A) co (h`B)) = (F \<in> A co B)"
13790
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   187
apply (unfold rename_def)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   188
apply (subst extend_set_eq_image [symmetric])+
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   189
apply (erule good_map_bij [THEN Extend.intro, THEN Extend.extend_constrains])
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   190
done
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   191
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   192
lemma rename_stable: 
13805
3786b2fd6808 some x-symbols
paulson
parents: 13798
diff changeset
   193
     "bij h ==> (rename h F \<in> stable (h`A)) = (F \<in> stable A)"
13790
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   194
apply (simp add: stable_def rename_constrains)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   195
done
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   196
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   197
lemma rename_invariant:
13805
3786b2fd6808 some x-symbols
paulson
parents: 13798
diff changeset
   198
     "bij h ==> (rename h F \<in> invariant (h`A)) = (F \<in> invariant A)"
13790
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   199
apply (simp add: invariant_def rename_stable bij_is_inj [THEN inj_image_subset_iff])
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   200
done
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   201
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   202
lemma rename_increasing:
13805
3786b2fd6808 some x-symbols
paulson
parents: 13798
diff changeset
   203
     "bij h ==> (rename h F \<in> increasing func) = (F \<in> increasing (func o h))"
13790
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   204
apply (simp add: increasing_def rename_stable [symmetric] bij_image_Collect_eq bij_is_surj [THEN surj_f_inv_f])
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   205
done
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   206
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   207
13798
4c1a53627500 conversion to new-style theories and tidying
paulson
parents: 13790
diff changeset
   208
subsection{*Weak Safety: Co, Stable*}
13790
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   209
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   210
lemma reachable_rename_eq: 
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   211
     "bij h ==> reachable (rename h F) = h ` (reachable F)"
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   212
apply (simp add: rename_def Extend.reachable_extend_eq)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   213
done
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   214
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   215
lemma rename_Constrains:
13805
3786b2fd6808 some x-symbols
paulson
parents: 13798
diff changeset
   216
     "bij h ==> (rename h F \<in> (h`A) Co (h`B)) = (F \<in> A Co B)"
13790
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   217
by (simp add: Constrains_def reachable_rename_eq rename_constrains
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   218
               bij_is_inj image_Int [symmetric])
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   219
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   220
lemma rename_Stable: 
13805
3786b2fd6808 some x-symbols
paulson
parents: 13798
diff changeset
   221
     "bij h ==> (rename h F \<in> Stable (h`A)) = (F \<in> Stable A)"
13790
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   222
by (simp add: Stable_def rename_Constrains)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   223
13805
3786b2fd6808 some x-symbols
paulson
parents: 13798
diff changeset
   224
lemma rename_Always: "bij h ==> (rename h F \<in> Always (h`A)) = (F \<in> Always A)"
13790
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   225
by (simp add: Always_def rename_Stable bij_is_inj [THEN inj_image_subset_iff])
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   226
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   227
lemma rename_Increasing:
13805
3786b2fd6808 some x-symbols
paulson
parents: 13798
diff changeset
   228
     "bij h ==> (rename h F \<in> Increasing func) = (F \<in> Increasing (func o h))"
13790
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   229
by (simp add: Increasing_def rename_Stable [symmetric] bij_image_Collect_eq 
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   230
              bij_is_surj [THEN surj_f_inv_f])
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   231
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   232
13798
4c1a53627500 conversion to new-style theories and tidying
paulson
parents: 13790
diff changeset
   233
subsection{*Progress: transient, ensures*}
13790
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   234
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   235
lemma rename_transient: 
13805
3786b2fd6808 some x-symbols
paulson
parents: 13798
diff changeset
   236
     "bij h ==> (rename h F \<in> transient (h`A)) = (F \<in> transient A)"
13790
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   237
apply (unfold rename_def)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   238
apply (subst extend_set_eq_image [symmetric])
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   239
apply (erule good_map_bij [THEN Extend.intro, THEN Extend.extend_transient])
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   240
done
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   241
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   242
lemma rename_ensures: 
13805
3786b2fd6808 some x-symbols
paulson
parents: 13798
diff changeset
   243
     "bij h ==> (rename h F \<in> (h`A) ensures (h`B)) = (F \<in> A ensures B)"
13790
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   244
apply (unfold rename_def)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   245
apply (subst extend_set_eq_image [symmetric])+
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   246
apply (erule good_map_bij [THEN Extend.intro, THEN Extend.extend_ensures])
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   247
done
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   248
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   249
lemma rename_leadsTo: 
13805
3786b2fd6808 some x-symbols
paulson
parents: 13798
diff changeset
   250
     "bij h ==> (rename h F \<in> (h`A) leadsTo (h`B)) = (F \<in> A leadsTo B)"
13790
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   251
apply (unfold rename_def)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   252
apply (subst extend_set_eq_image [symmetric])+
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   253
apply (erule good_map_bij [THEN Extend.intro, THEN Extend.extend_leadsTo])
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   254
done
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   255
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   256
lemma rename_LeadsTo: 
13805
3786b2fd6808 some x-symbols
paulson
parents: 13798
diff changeset
   257
     "bij h ==> (rename h F \<in> (h`A) LeadsTo (h`B)) = (F \<in> A LeadsTo B)"
13790
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   258
apply (unfold rename_def)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   259
apply (subst extend_set_eq_image [symmetric])+
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   260
apply (erule good_map_bij [THEN Extend.intro, THEN Extend.extend_LeadsTo])
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   261
done
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   262
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   263
lemma rename_rename_guarantees_eq: 
13805
3786b2fd6808 some x-symbols
paulson
parents: 13798
diff changeset
   264
     "bij h ==> (rename h F \<in> (rename h ` X) guarantees  
13790
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   265
                              (rename h ` Y)) =  
13805
3786b2fd6808 some x-symbols
paulson
parents: 13798
diff changeset
   266
                (F \<in> X guarantees Y)"
13790
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   267
apply (unfold rename_def)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   268
apply (subst good_map_bij [THEN Extend.intro, THEN Extend.extend_guarantees_eq [symmetric]], assumption)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   269
apply (simp (no_asm_simp) add: fst_o_inv_eq_inv o_def)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   270
done
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   271
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   272
lemma rename_guarantees_eq_rename_inv:
13805
3786b2fd6808 some x-symbols
paulson
parents: 13798
diff changeset
   273
     "bij h ==> (rename h F \<in> X guarantees Y) =  
3786b2fd6808 some x-symbols
paulson
parents: 13798
diff changeset
   274
                (F \<in> (rename (inv h) ` X) guarantees  
13790
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   275
                     (rename (inv h) ` Y))"
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   276
apply (subst rename_rename_guarantees_eq [symmetric], assumption)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   277
apply (simp add: image_eq_UN o_def bij_is_surj [THEN surj_f_inv_f])
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   278
done
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   279
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   280
lemma rename_preserves:
13805
3786b2fd6808 some x-symbols
paulson
parents: 13798
diff changeset
   281
     "bij h ==> (rename h G \<in> preserves v) = (G \<in> preserves (v o h))"
13790
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   282
apply (subst good_map_bij [THEN Extend.intro, THEN Extend.extend_preserves [symmetric]], assumption)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   283
apply (simp add: o_def fst_o_inv_eq_inv rename_def bij_is_surj [THEN surj_f_inv_f])
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   284
done
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   285
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   286
lemma ok_rename_iff [simp]: "bij h ==> (rename h F ok rename h G) = (F ok G)"
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   287
by (simp add: Extend.ok_extend_iff rename_def)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   288
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   289
lemma OK_rename_iff [simp]: "bij h ==> OK I (%i. rename h (F i)) = (OK I F)"
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   290
by (simp add: Extend.OK_extend_iff rename_def)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   291
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   292
13798
4c1a53627500 conversion to new-style theories and tidying
paulson
parents: 13790
diff changeset
   293
subsection{*"image" versions of the rules, for lifting "guarantees" properties*}
13790
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   294
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   295
(*All the proofs are similar.  Better would have been to prove one 
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   296
  meta-theorem, but how can we handle the polymorphism?  E.g. in 
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   297
  rename_constrains the two appearances of "co" have different types!*)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   298
lemmas bij_eq_rename = surj_rename [THEN surj_f_inv_f, symmetric]
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   299
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   300
lemma rename_image_constrains:
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   301
     "bij h ==> rename h ` (A co B) = (h ` A) co (h`B)" 
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   302
apply auto 
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   303
 defer 1
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   304
 apply (rename_tac F) 
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   305
 apply (subgoal_tac "\<exists>G. F = rename h G") 
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   306
 apply (auto intro!: bij_eq_rename simp add: rename_constrains) 
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   307
done
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   308
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   309
lemma rename_image_stable: "bij h ==> rename h ` stable A = stable (h ` A)"
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   310
apply auto 
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   311
 defer 1
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   312
 apply (rename_tac F) 
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   313
 apply (subgoal_tac "\<exists>G. F = rename h G") 
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   314
 apply (auto intro!: bij_eq_rename simp add: rename_stable)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   315
done
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   316
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   317
lemma rename_image_increasing:
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   318
     "bij h ==> rename h ` increasing func = increasing (func o inv h)"
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   319
apply auto 
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   320
 defer 1
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   321
 apply (rename_tac F) 
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   322
 apply (subgoal_tac "\<exists>G. F = rename h G") 
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   323
 apply (auto intro!: bij_eq_rename simp add: rename_increasing o_def bij_is_inj) 
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   324
done
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   325
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   326
lemma rename_image_invariant:
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   327
     "bij h ==> rename h ` invariant A = invariant (h ` A)"
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   328
apply auto 
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   329
 defer 1
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   330
 apply (rename_tac F) 
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   331
 apply (subgoal_tac "\<exists>G. F = rename h G") 
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   332
 apply (auto intro!: bij_eq_rename simp add: rename_invariant) 
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   333
done
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   334
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   335
lemma rename_image_Constrains:
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   336
     "bij h ==> rename h ` (A Co B) = (h ` A) Co (h`B)"
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   337
apply auto 
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   338
 defer 1
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   339
 apply (rename_tac F) 
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   340
 apply (subgoal_tac "\<exists>G. F = rename h G") 
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   341
 apply (auto intro!: bij_eq_rename simp add: rename_Constrains)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   342
done
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   343
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   344
lemma rename_image_preserves:
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   345
     "bij h ==> rename h ` preserves v = preserves (v o inv h)"
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   346
by (simp add: o_def rename_image_stable preserves_def bij_image_INT 
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   347
              bij_image_Collect_eq)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   348
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   349
lemma rename_image_Stable:
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   350
     "bij h ==> rename h ` Stable A = Stable (h ` A)"
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   351
apply auto 
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   352
 defer 1
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   353
 apply (rename_tac F) 
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   354
 apply (subgoal_tac "\<exists>G. F = rename h G") 
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   355
 apply (auto intro!: bij_eq_rename simp add: rename_Stable) 
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   356
done
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   357
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   358
lemma rename_image_Increasing:
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   359
     "bij h ==> rename h ` Increasing func = Increasing (func o inv h)"
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   360
apply auto 
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   361
 defer 1
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   362
 apply (rename_tac F) 
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   363
 apply (subgoal_tac "\<exists>G. F = rename h G") 
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   364
 apply (auto intro!: bij_eq_rename simp add: rename_Increasing o_def bij_is_inj)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   365
done
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   366
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   367
lemma rename_image_Always: "bij h ==> rename h ` Always A = Always (h ` A)"
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   368
apply auto 
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   369
 defer 1
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   370
 apply (rename_tac F) 
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   371
 apply (subgoal_tac "\<exists>G. F = rename h G") 
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   372
 apply (auto intro!: bij_eq_rename simp add: rename_Always)
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   373
done
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   374
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   375
lemma rename_image_leadsTo:
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   376
     "bij h ==> rename h ` (A leadsTo B) = (h ` A) leadsTo (h`B)"
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   377
apply auto 
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   378
 defer 1
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   379
 apply (rename_tac F) 
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   380
 apply (subgoal_tac "\<exists>G. F = rename h G") 
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   381
 apply (auto intro!: bij_eq_rename simp add: rename_leadsTo) 
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   382
done
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   383
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   384
lemma rename_image_LeadsTo:
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   385
     "bij h ==> rename h ` (A LeadsTo B) = (h ` A) LeadsTo (h`B)"
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   386
apply auto 
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   387
 defer 1
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   388
 apply (rename_tac F) 
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   389
 apply (subgoal_tac "\<exists>G. F = rename h G") 
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   390
 apply (auto intro!: bij_eq_rename simp add: rename_LeadsTo) 
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   391
done
8d7e9fce8c50 converting UNITY to new-style theories
paulson
parents: 9403
diff changeset
   392
8256
6ba8fa2b0638 Rename: theory for applying a bijection over states to a UNITY program
paulson
parents:
diff changeset
   393
end