| author | Fabian Huch <huch@in.tum.de> | 
| Tue, 27 Aug 2024 12:57:49 +0200 | |
| changeset 80779 | a1b3abc629af | 
| parent 80171 | 9e88c17a723e | 
| permissions | -rw-r--r-- | 
| 19494 | 1 | theory Nominal | 
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2 | imports "HOL-Library.Infinite_Set" "HOL-Library.Old_Datatype" | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 3 | |
| 46950 
d0181abdbdac
declare command keywords via theory header, including strict checking outside Pure;
 wenzelm parents: 
46947diff
changeset | 4 | keywords | 
| 69913 | 5 | "atom_decl" :: thy_decl and | 
| 6 | "nominal_datatype" :: thy_defn and | |
| 7 | "equivariance" :: thy_decl and | |
| 8 | "nominal_primrec" "nominal_inductive" "nominal_inductive2" :: thy_goal_defn and | |
| 46950 
d0181abdbdac
declare command keywords via theory header, including strict checking outside Pure;
 wenzelm parents: 
46947diff
changeset | 9 | "avoids" | 
| 44689 | 10 | begin | 
| 17870 | 11 | |
| 61260 | 12 | declare [[typedef_overloaded]] | 
| 13 | ||
| 14 | ||
| 63167 | 15 | section \<open>Permutations\<close> | 
| 17870 | 16 | (*======================*) | 
| 17 | ||
| 41798 | 18 | type_synonym | 
| 17870 | 19 |   'x prm = "('x \<times> 'x) list"
 | 
| 20 | ||
| 30990 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 21 | (* polymorphic constants for permutation and swapping *) | 
| 17870 | 22 | consts | 
| 69597 | 23 | perm :: "'x prm \<Rightarrow> 'a \<Rightarrow> 'a" (infixr \<open>\<bullet>\<close> 80) | 
| 17870 | 24 |   swap :: "('x \<times> 'x) \<Rightarrow> 'x \<Rightarrow> 'x"
 | 
| 25 | ||
| 30983 
e54777ab68bd
adapted permutation functions to new overloading syntax (the functions are still "unchecked" because they are used in conjunction with type-classes)
 Christian Urban <urbanc@in.tum.de> parents: 
30242diff
changeset | 26 | (* a "private" copy of the option type used in the abstraction function *) | 
| 58310 | 27 | datatype 'a noption = nSome 'a | nNone | 
| 58238 | 28 | |
| 29 | datatype_compat noption | |
| 30983 
e54777ab68bd
adapted permutation functions to new overloading syntax (the functions are still "unchecked" because they are used in conjunction with type-classes)
 Christian Urban <urbanc@in.tum.de> parents: 
30242diff
changeset | 30 | |
| 
e54777ab68bd
adapted permutation functions to new overloading syntax (the functions are still "unchecked" because they are used in conjunction with type-classes)
 Christian Urban <urbanc@in.tum.de> parents: 
30242diff
changeset | 31 | (* a "private" copy of the product type used in the nominal induct method *) | 
| 58310 | 32 | datatype ('a, 'b) nprod = nPair 'a 'b
 | 
| 58238 | 33 | |
| 34 | datatype_compat nprod | |
| 30983 
e54777ab68bd
adapted permutation functions to new overloading syntax (the functions are still "unchecked" because they are used in conjunction with type-classes)
 Christian Urban <urbanc@in.tum.de> parents: 
30242diff
changeset | 35 | |
| 24544 | 36 | (* an auxiliary constant for the decision procedure involving *) | 
| 30983 
e54777ab68bd
adapted permutation functions to new overloading syntax (the functions are still "unchecked" because they are used in conjunction with type-classes)
 Christian Urban <urbanc@in.tum.de> parents: 
30242diff
changeset | 37 | (* permutations (to avoid loops when using perm-compositions) *) | 
| 35416 
d8d7d1b785af
replaced a couple of constsdefs by definitions (also some old primrecs by modern ones)
 haftmann parents: 
32960diff
changeset | 38 | definition | 
| 44683 | 39 | "perm_aux pi x = pi\<bullet>x" | 
| 19477 | 40 | |
| 30990 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 41 | (* overloaded permutation operations *) | 
| 30983 
e54777ab68bd
adapted permutation functions to new overloading syntax (the functions are still "unchecked" because they are used in conjunction with type-classes)
 Christian Urban <urbanc@in.tum.de> parents: 
30242diff
changeset | 42 | overloading | 
| 
e54777ab68bd
adapted permutation functions to new overloading syntax (the functions are still "unchecked" because they are used in conjunction with type-classes)
 Christian Urban <urbanc@in.tum.de> parents: 
30242diff
changeset | 43 |   perm_fun    \<equiv> "perm :: 'x prm \<Rightarrow> ('a\<Rightarrow>'b) \<Rightarrow> ('a\<Rightarrow>'b)"   (unchecked)
 | 
| 
e54777ab68bd
adapted permutation functions to new overloading syntax (the functions are still "unchecked" because they are used in conjunction with type-classes)
 Christian Urban <urbanc@in.tum.de> parents: 
30242diff
changeset | 44 | perm_bool \<equiv> "perm :: 'x prm \<Rightarrow> bool \<Rightarrow> bool" (unchecked) | 
| 80171 | 45 | perm_set \<equiv> "perm :: 'x prm \<Rightarrow> 'a set \<Rightarrow> 'a set" (unchecked) | 
| 30983 
e54777ab68bd
adapted permutation functions to new overloading syntax (the functions are still "unchecked" because they are used in conjunction with type-classes)
 Christian Urban <urbanc@in.tum.de> parents: 
30242diff
changeset | 46 | perm_unit \<equiv> "perm :: 'x prm \<Rightarrow> unit \<Rightarrow> unit" (unchecked) | 
| 44689 | 47 |   perm_prod   \<equiv> "perm :: 'x prm \<Rightarrow> ('a\<times>'b) \<Rightarrow> ('a\<times>'b)"    (unchecked)
 | 
| 30983 
e54777ab68bd
adapted permutation functions to new overloading syntax (the functions are still "unchecked" because they are used in conjunction with type-classes)
 Christian Urban <urbanc@in.tum.de> parents: 
30242diff
changeset | 48 | perm_list \<equiv> "perm :: 'x prm \<Rightarrow> 'a list \<Rightarrow> 'a list" (unchecked) | 
| 
e54777ab68bd
adapted permutation functions to new overloading syntax (the functions are still "unchecked" because they are used in conjunction with type-classes)
 Christian Urban <urbanc@in.tum.de> parents: 
30242diff
changeset | 49 | perm_option \<equiv> "perm :: 'x prm \<Rightarrow> 'a option \<Rightarrow> 'a option" (unchecked) | 
| 
e54777ab68bd
adapted permutation functions to new overloading syntax (the functions are still "unchecked" because they are used in conjunction with type-classes)
 Christian Urban <urbanc@in.tum.de> parents: 
30242diff
changeset | 50 | perm_char \<equiv> "perm :: 'x prm \<Rightarrow> char \<Rightarrow> char" (unchecked) | 
| 
e54777ab68bd
adapted permutation functions to new overloading syntax (the functions are still "unchecked" because they are used in conjunction with type-classes)
 Christian Urban <urbanc@in.tum.de> parents: 
30242diff
changeset | 51 | perm_nat \<equiv> "perm :: 'x prm \<Rightarrow> nat \<Rightarrow> nat" (unchecked) | 
| 
e54777ab68bd
adapted permutation functions to new overloading syntax (the functions are still "unchecked" because they are used in conjunction with type-classes)
 Christian Urban <urbanc@in.tum.de> parents: 
30242diff
changeset | 52 | perm_int \<equiv> "perm :: 'x prm \<Rightarrow> int \<Rightarrow> int" (unchecked) | 
| 
e54777ab68bd
adapted permutation functions to new overloading syntax (the functions are still "unchecked" because they are used in conjunction with type-classes)
 Christian Urban <urbanc@in.tum.de> parents: 
30242diff
changeset | 53 | |
| 
e54777ab68bd
adapted permutation functions to new overloading syntax (the functions are still "unchecked" because they are used in conjunction with type-classes)
 Christian Urban <urbanc@in.tum.de> parents: 
30242diff
changeset | 54 | perm_noption \<equiv> "perm :: 'x prm \<Rightarrow> 'a noption \<Rightarrow> 'a noption" (unchecked) | 
| 
e54777ab68bd
adapted permutation functions to new overloading syntax (the functions are still "unchecked" because they are used in conjunction with type-classes)
 Christian Urban <urbanc@in.tum.de> parents: 
30242diff
changeset | 55 |   perm_nprod   \<equiv> "perm :: 'x prm \<Rightarrow> ('a, 'b) nprod \<Rightarrow> ('a, 'b) nprod" (unchecked)
 | 
| 
e54777ab68bd
adapted permutation functions to new overloading syntax (the functions are still "unchecked" because they are used in conjunction with type-classes)
 Christian Urban <urbanc@in.tum.de> parents: 
30242diff
changeset | 56 | begin | 
| 
e54777ab68bd
adapted permutation functions to new overloading syntax (the functions are still "unchecked" because they are used in conjunction with type-classes)
 Christian Urban <urbanc@in.tum.de> parents: 
30242diff
changeset | 57 | |
| 44838 | 58 | definition perm_fun :: "'x prm \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> 'a \<Rightarrow> 'b" where
 | 
| 44833 | 59 | "perm_fun pi f = (\<lambda>x. pi \<bullet> f (rev pi \<bullet> x))" | 
| 44683 | 60 | |
| 44689 | 61 | definition perm_bool :: "'x prm \<Rightarrow> bool \<Rightarrow> bool" where | 
| 44833 | 62 | "perm_bool pi b = b" | 
| 30983 
e54777ab68bd
adapted permutation functions to new overloading syntax (the functions are still "unchecked" because they are used in conjunction with type-classes)
 Christian Urban <urbanc@in.tum.de> parents: 
30242diff
changeset | 63 | |
| 45961 | 64 | definition perm_set :: "'x prm \<Rightarrow> 'a set \<Rightarrow> 'a set" where | 
| 46179 
47bcf3d5d1f0
Reverted several lemmas involving sets to the state before the
 berghofe parents: 
45961diff
changeset | 65 |   "perm_set pi X = {pi \<bullet> x | x. x \<in> X}"
 | 
| 45961 | 66 | |
| 44683 | 67 | primrec perm_unit :: "'x prm \<Rightarrow> unit \<Rightarrow> unit" where | 
| 30983 
e54777ab68bd
adapted permutation functions to new overloading syntax (the functions are still "unchecked" because they are used in conjunction with type-classes)
 Christian Urban <urbanc@in.tum.de> parents: 
30242diff
changeset | 68 | "perm_unit pi () = ()" | 
| 
e54777ab68bd
adapted permutation functions to new overloading syntax (the functions are still "unchecked" because they are used in conjunction with type-classes)
 Christian Urban <urbanc@in.tum.de> parents: 
30242diff
changeset | 69 | |
| 44683 | 70 | primrec perm_prod :: "'x prm \<Rightarrow> ('a\<times>'b) \<Rightarrow> ('a\<times>'b)" where
 | 
| 44833 | 71 | "perm_prod pi (x, y) = (pi\<bullet>x, pi\<bullet>y)" | 
| 30983 
e54777ab68bd
adapted permutation functions to new overloading syntax (the functions are still "unchecked" because they are used in conjunction with type-classes)
 Christian Urban <urbanc@in.tum.de> parents: 
30242diff
changeset | 72 | |
| 44683 | 73 | primrec perm_list :: "'x prm \<Rightarrow> 'a list \<Rightarrow> 'a list" where | 
| 30983 
e54777ab68bd
adapted permutation functions to new overloading syntax (the functions are still "unchecked" because they are used in conjunction with type-classes)
 Christian Urban <urbanc@in.tum.de> parents: 
30242diff
changeset | 74 | nil_eqvt: "perm_list pi [] = []" | 
| 
e54777ab68bd
adapted permutation functions to new overloading syntax (the functions are still "unchecked" because they are used in conjunction with type-classes)
 Christian Urban <urbanc@in.tum.de> parents: 
30242diff
changeset | 75 | | cons_eqvt: "perm_list pi (x#xs) = (pi\<bullet>x)#(pi\<bullet>xs)" | 
| 
e54777ab68bd
adapted permutation functions to new overloading syntax (the functions are still "unchecked" because they are used in conjunction with type-classes)
 Christian Urban <urbanc@in.tum.de> parents: 
30242diff
changeset | 76 | |
| 44683 | 77 | primrec perm_option :: "'x prm \<Rightarrow> 'a option \<Rightarrow> 'a option" where | 
| 30983 
e54777ab68bd
adapted permutation functions to new overloading syntax (the functions are still "unchecked" because they are used in conjunction with type-classes)
 Christian Urban <urbanc@in.tum.de> parents: 
30242diff
changeset | 78 | some_eqvt: "perm_option pi (Some x) = Some (pi\<bullet>x)" | 
| 
e54777ab68bd
adapted permutation functions to new overloading syntax (the functions are still "unchecked" because they are used in conjunction with type-classes)
 Christian Urban <urbanc@in.tum.de> parents: 
30242diff
changeset | 79 | | none_eqvt: "perm_option pi None = None" | 
| 
e54777ab68bd
adapted permutation functions to new overloading syntax (the functions are still "unchecked" because they are used in conjunction with type-classes)
 Christian Urban <urbanc@in.tum.de> parents: 
30242diff
changeset | 80 | |
| 44683 | 81 | definition perm_char :: "'x prm \<Rightarrow> char \<Rightarrow> char" where | 
| 44833 | 82 | "perm_char pi c = c" | 
| 44683 | 83 | |
| 84 | definition perm_nat :: "'x prm \<Rightarrow> nat \<Rightarrow> nat" where | |
| 44833 | 85 | "perm_nat pi i = i" | 
| 44683 | 86 | |
| 87 | definition perm_int :: "'x prm \<Rightarrow> int \<Rightarrow> int" where | |
| 44833 | 88 | "perm_int pi i = i" | 
| 44683 | 89 | |
| 90 | primrec perm_noption :: "'x prm \<Rightarrow> 'a noption \<Rightarrow> 'a noption" where | |
| 30983 
e54777ab68bd
adapted permutation functions to new overloading syntax (the functions are still "unchecked" because they are used in conjunction with type-classes)
 Christian Urban <urbanc@in.tum.de> parents: 
30242diff
changeset | 91 | nsome_eqvt: "perm_noption pi (nSome x) = nSome (pi\<bullet>x)" | 
| 
e54777ab68bd
adapted permutation functions to new overloading syntax (the functions are still "unchecked" because they are used in conjunction with type-classes)
 Christian Urban <urbanc@in.tum.de> parents: 
30242diff
changeset | 92 | | nnone_eqvt: "perm_noption pi nNone = nNone" | 
| 
e54777ab68bd
adapted permutation functions to new overloading syntax (the functions are still "unchecked" because they are used in conjunction with type-classes)
 Christian Urban <urbanc@in.tum.de> parents: 
30242diff
changeset | 93 | |
| 44683 | 94 | primrec perm_nprod :: "'x prm \<Rightarrow> ('a, 'b) nprod \<Rightarrow> ('a, 'b) nprod" where
 | 
| 30983 
e54777ab68bd
adapted permutation functions to new overloading syntax (the functions are still "unchecked" because they are used in conjunction with type-classes)
 Christian Urban <urbanc@in.tum.de> parents: 
30242diff
changeset | 95 | "perm_nprod pi (nPair x y) = nPair (pi\<bullet>x) (pi\<bullet>y)" | 
| 44683 | 96 | |
| 30983 
e54777ab68bd
adapted permutation functions to new overloading syntax (the functions are still "unchecked" because they are used in conjunction with type-classes)
 Christian Urban <urbanc@in.tum.de> parents: 
30242diff
changeset | 97 | end | 
| 
e54777ab68bd
adapted permutation functions to new overloading syntax (the functions are still "unchecked" because they are used in conjunction with type-classes)
 Christian Urban <urbanc@in.tum.de> parents: 
30242diff
changeset | 98 | |
| 
e54777ab68bd
adapted permutation functions to new overloading syntax (the functions are still "unchecked" because they are used in conjunction with type-classes)
 Christian Urban <urbanc@in.tum.de> parents: 
30242diff
changeset | 99 | (* permutations on booleans *) | 
| 44689 | 100 | lemmas perm_bool = perm_bool_def | 
| 101 | ||
| 102 | lemma true_eqvt [simp]: | |
| 103 | "pi \<bullet> True \<longleftrightarrow> True" | |
| 104 | by (simp add: perm_bool_def) | |
| 105 | ||
| 106 | lemma false_eqvt [simp]: | |
| 107 | "pi \<bullet> False \<longleftrightarrow> False" | |
| 108 | by (simp add: perm_bool_def) | |
| 18264 | 109 | |
| 19972 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 110 | lemma perm_boolI: | 
| 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 111 | assumes a: "P" | 
| 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 112 | shows "pi\<bullet>P" | 
| 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 113 | using a by (simp add: perm_bool) | 
| 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 114 | |
| 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 115 | lemma perm_boolE: | 
| 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 116 | assumes a: "pi\<bullet>P" | 
| 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 117 | shows "P" | 
| 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 118 | using a by (simp add: perm_bool) | 
| 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 119 | |
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 120 | lemma if_eqvt: | 
| 21010 
7fe928722821
added the missing freshness-lemmas for nat, int, char and string and
 urbanc parents: 
20809diff
changeset | 121 | fixes pi::"'a prm" | 
| 
7fe928722821
added the missing freshness-lemmas for nat, int, char and string and
 urbanc parents: 
20809diff
changeset | 122 | shows "pi\<bullet>(if b then c1 else c2) = (if (pi\<bullet>b) then (pi\<bullet>c1) else (pi\<bullet>c2))" | 
| 30983 
e54777ab68bd
adapted permutation functions to new overloading syntax (the functions are still "unchecked" because they are used in conjunction with type-classes)
 Christian Urban <urbanc@in.tum.de> parents: 
30242diff
changeset | 123 | by (simp add: perm_fun_def) | 
| 21010 
7fe928722821
added the missing freshness-lemmas for nat, int, char and string and
 urbanc parents: 
20809diff
changeset | 124 | |
| 22514 | 125 | lemma imp_eqvt: | 
| 126 | shows "pi\<bullet>(A\<longrightarrow>B) = ((pi\<bullet>A)\<longrightarrow>(pi\<bullet>B))" | |
| 127 | by (simp add: perm_bool) | |
| 128 | ||
| 129 | lemma conj_eqvt: | |
| 130 | shows "pi\<bullet>(A\<and>B) = ((pi\<bullet>A)\<and>(pi\<bullet>B))" | |
| 131 | by (simp add: perm_bool) | |
| 132 | ||
| 133 | lemma disj_eqvt: | |
| 134 | shows "pi\<bullet>(A\<or>B) = ((pi\<bullet>A)\<or>(pi\<bullet>B))" | |
| 135 | by (simp add: perm_bool) | |
| 136 | ||
| 137 | lemma neg_eqvt: | |
| 138 | shows "pi\<bullet>(\<not> A) = (\<not> (pi\<bullet>A))" | |
| 139 | by (simp add: perm_bool) | |
| 140 | ||
| 26806 | 141 | (* permutation on sets *) | 
| 80142 | 142 | lemma empty_eqvt[simp]: | 
| 26806 | 143 |   shows "pi\<bullet>{} = {}"
 | 
| 46179 
47bcf3d5d1f0
Reverted several lemmas involving sets to the state before the
 berghofe parents: 
45961diff
changeset | 144 | by (simp add: perm_set_def) | 
| 26806 | 145 | |
| 146 | lemma union_eqvt: | |
| 147 | shows "(pi\<bullet>(X\<union>Y)) = (pi\<bullet>X) \<union> (pi\<bullet>Y)" | |
| 46179 
47bcf3d5d1f0
Reverted several lemmas involving sets to the state before the
 berghofe parents: 
45961diff
changeset | 148 | by (auto simp add: perm_set_def) | 
| 
47bcf3d5d1f0
Reverted several lemmas involving sets to the state before the
 berghofe parents: 
45961diff
changeset | 149 | |
| 
47bcf3d5d1f0
Reverted several lemmas involving sets to the state before the
 berghofe parents: 
45961diff
changeset | 150 | lemma insert_eqvt: | 
| 
47bcf3d5d1f0
Reverted several lemmas involving sets to the state before the
 berghofe parents: 
45961diff
changeset | 151 | shows "pi\<bullet>(insert x X) = insert (pi\<bullet>x) (pi\<bullet>X)" | 
| 
47bcf3d5d1f0
Reverted several lemmas involving sets to the state before the
 berghofe parents: 
45961diff
changeset | 152 | by (auto simp add: perm_set_def) | 
| 26806 | 153 | |
| 30983 
e54777ab68bd
adapted permutation functions to new overloading syntax (the functions are still "unchecked" because they are used in conjunction with type-classes)
 Christian Urban <urbanc@in.tum.de> parents: 
30242diff
changeset | 154 | (* permutations on products *) | 
| 26806 | 155 | lemma fst_eqvt: | 
| 156 | "pi\<bullet>(fst x) = fst (pi\<bullet>x)" | |
| 157 | by (cases x) simp | |
| 158 | ||
| 159 | lemma snd_eqvt: | |
| 160 | "pi\<bullet>(snd x) = snd (pi\<bullet>x)" | |
| 161 | by (cases x) simp | |
| 162 | ||
| 163 | (* permutation on lists *) | |
| 164 | lemma append_eqvt: | |
| 165 | fixes pi :: "'x prm" | |
| 166 | and l1 :: "'a list" | |
| 167 | and l2 :: "'a list" | |
| 168 | shows "pi\<bullet>(l1@l2) = (pi\<bullet>l1)@(pi\<bullet>l2)" | |
| 169 | by (induct l1) auto | |
| 170 | ||
| 171 | lemma rev_eqvt: | |
| 172 | fixes pi :: "'x prm" | |
| 173 | and l :: "'a list" | |
| 174 | shows "pi\<bullet>(rev l) = rev (pi\<bullet>l)" | |
| 175 | by (induct l) (simp_all add: append_eqvt) | |
| 176 | ||
| 46179 
47bcf3d5d1f0
Reverted several lemmas involving sets to the state before the
 berghofe parents: 
45961diff
changeset | 177 | lemma set_eqvt: | 
| 
47bcf3d5d1f0
Reverted several lemmas involving sets to the state before the
 berghofe parents: 
45961diff
changeset | 178 | fixes pi :: "'x prm" | 
| 
47bcf3d5d1f0
Reverted several lemmas involving sets to the state before the
 berghofe parents: 
45961diff
changeset | 179 | and xs :: "'a list" | 
| 
47bcf3d5d1f0
Reverted several lemmas involving sets to the state before the
 berghofe parents: 
45961diff
changeset | 180 | shows "pi\<bullet>(set xs) = set (pi\<bullet>xs)" | 
| 
47bcf3d5d1f0
Reverted several lemmas involving sets to the state before the
 berghofe parents: 
45961diff
changeset | 181 | by (induct xs) (auto simp add: empty_eqvt insert_eqvt) | 
| 
47bcf3d5d1f0
Reverted several lemmas involving sets to the state before the
 berghofe parents: 
45961diff
changeset | 182 | |
| 30983 
e54777ab68bd
adapted permutation functions to new overloading syntax (the functions are still "unchecked" because they are used in conjunction with type-classes)
 Christian Urban <urbanc@in.tum.de> parents: 
30242diff
changeset | 183 | (* permutation on characters and strings *) | 
| 23050 | 184 | lemma perm_string: | 
| 185 | fixes s::"string" | |
| 186 | shows "pi\<bullet>s = s" | |
| 30983 
e54777ab68bd
adapted permutation functions to new overloading syntax (the functions are still "unchecked" because they are used in conjunction with type-classes)
 Christian Urban <urbanc@in.tum.de> parents: 
30242diff
changeset | 187 | by (induct s)(auto simp add: perm_char_def) | 
| 
e54777ab68bd
adapted permutation functions to new overloading syntax (the functions are still "unchecked" because they are used in conjunction with type-classes)
 Christian Urban <urbanc@in.tum.de> parents: 
30242diff
changeset | 188 | |
| 17870 | 189 | |
| 63167 | 190 | section \<open>permutation equality\<close> | 
| 17870 | 191 | (*==============================*) | 
| 192 | ||
| 69597 | 193 | definition prm_eq :: "'x prm \<Rightarrow> 'x prm \<Rightarrow> bool" (\<open> _ \<triangleq> _ \<close> [80,80] 80) where | 
| 44683 | 194 | "pi1 \<triangleq> pi2 \<longleftrightarrow> (\<forall>a::'x. pi1\<bullet>a = pi2\<bullet>a)" | 
| 17870 | 195 | |
| 63167 | 196 | section \<open>Support, Freshness and Supports\<close> | 
| 17870 | 197 | (*========================================*) | 
| 35416 
d8d7d1b785af
replaced a couple of constsdefs by definitions (also some old primrecs by modern ones)
 haftmann parents: 
32960diff
changeset | 198 | definition supp :: "'a \<Rightarrow> ('x set)" where  
 | 
| 44683 | 199 |    "supp x = {a . (infinite {b . [(a,b)]\<bullet>x \<noteq> x})}"
 | 
| 17870 | 200 | |
| 69597 | 201 | definition fresh :: "'x \<Rightarrow> 'a \<Rightarrow> bool" (\<open>_ \<sharp> _\<close> [80,80] 80) where | 
| 44683 | 202 | "a \<sharp> x \<longleftrightarrow> a \<notin> supp x" | 
| 17870 | 203 | |
| 69597 | 204 | definition supports :: "'x set \<Rightarrow> 'a \<Rightarrow> bool" (infixl \<open>supports\<close> 80) where | 
| 44683 | 205 | "S supports x \<longleftrightarrow> (\<forall>a b. (a\<notin>S \<and> b\<notin>S \<longrightarrow> [(a,b)]\<bullet>x=x))" | 
| 17870 | 206 | |
| 30990 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 207 | (* lemmas about supp *) | 
| 17870 | 208 | lemma supp_fresh_iff: | 
| 209 | fixes x :: "'a" | |
| 210 |   shows "(supp x) = {a::'x. \<not>a\<sharp>x}"
 | |
| 30990 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 211 | by (simp add: fresh_def) | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 212 | |
| 80142 | 213 | lemma supp_unit[simp]: | 
| 17870 | 214 |   shows "supp () = {}"
 | 
| 215 | by (simp add: supp_def) | |
| 216 | ||
| 80142 | 217 | lemma supp_set_empty[simp]: | 
| 18264 | 218 |   shows "supp {} = {}"
 | 
| 26806 | 219 | by (force simp add: supp_def empty_eqvt) | 
| 18264 | 220 | |
| 17870 | 221 | lemma supp_prod: | 
| 222 | fixes x :: "'a" | |
| 223 | and y :: "'b" | |
| 224 | shows "(supp (x,y)) = (supp x)\<union>(supp y)" | |
| 225 | by (force simp add: supp_def Collect_imp_eq Collect_neg_eq) | |
| 226 | ||
| 18600 | 227 | lemma supp_nprod: | 
| 228 | fixes x :: "'a" | |
| 229 | and y :: "'b" | |
| 230 | shows "(supp (nPair x y)) = (supp x)\<union>(supp y)" | |
| 231 | by (force simp add: supp_def Collect_imp_eq Collect_neg_eq) | |
| 232 | ||
| 80142 | 233 | lemma supp_list_nil[simp]: | 
| 17870 | 234 |   shows "supp [] = {}"
 | 
| 44696 | 235 | by (simp add: supp_def) | 
| 17870 | 236 | |
| 237 | lemma supp_list_cons: | |
| 238 | fixes x :: "'a" | |
| 239 | and xs :: "'a list" | |
| 240 | shows "supp (x#xs) = (supp x)\<union>(supp xs)" | |
| 30990 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 241 | by (auto simp add: supp_def Collect_imp_eq Collect_neg_eq) | 
| 17870 | 242 | |
| 243 | lemma supp_list_append: | |
| 244 | fixes xs :: "'a list" | |
| 245 | and ys :: "'a list" | |
| 246 | shows "supp (xs@ys) = (supp xs)\<union>(supp ys)" | |
| 30990 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 247 | by (induct xs) (auto simp add: supp_list_nil supp_list_cons) | 
| 17870 | 248 | |
| 249 | lemma supp_list_rev: | |
| 250 | fixes xs :: "'a list" | |
| 251 | shows "supp (rev xs) = (supp xs)" | |
| 252 | by (induct xs, auto simp add: supp_list_append supp_list_cons supp_list_nil) | |
| 253 | ||
| 80142 | 254 | lemma supp_bool[simp]: | 
| 17870 | 255 | fixes x :: "bool" | 
| 30983 
e54777ab68bd
adapted permutation functions to new overloading syntax (the functions are still "unchecked" because they are used in conjunction with type-classes)
 Christian Urban <urbanc@in.tum.de> parents: 
30242diff
changeset | 256 |   shows "supp x = {}"
 | 
| 
e54777ab68bd
adapted permutation functions to new overloading syntax (the functions are still "unchecked" because they are used in conjunction with type-classes)
 Christian Urban <urbanc@in.tum.de> parents: 
30242diff
changeset | 257 | by (cases "x") (simp_all add: supp_def) | 
| 17870 | 258 | |
| 80142 | 259 | lemma supp_some[simp]: | 
| 17870 | 260 | fixes x :: "'a" | 
| 261 | shows "supp (Some x) = (supp x)" | |
| 30983 
e54777ab68bd
adapted permutation functions to new overloading syntax (the functions are still "unchecked" because they are used in conjunction with type-classes)
 Christian Urban <urbanc@in.tum.de> parents: 
30242diff
changeset | 262 | by (simp add: supp_def) | 
| 17870 | 263 | |
| 80142 | 264 | lemma supp_none[simp]: | 
| 17870 | 265 | fixes x :: "'a" | 
| 266 |   shows "supp (None) = {}"
 | |
| 30983 
e54777ab68bd
adapted permutation functions to new overloading syntax (the functions are still "unchecked" because they are used in conjunction with type-classes)
 Christian Urban <urbanc@in.tum.de> parents: 
30242diff
changeset | 267 | by (simp add: supp_def) | 
| 17870 | 268 | |
| 80142 | 269 | lemma supp_int[simp]: | 
| 17870 | 270 | fixes i::"int" | 
| 271 |   shows "supp (i) = {}"
 | |
| 30983 
e54777ab68bd
adapted permutation functions to new overloading syntax (the functions are still "unchecked" because they are used in conjunction with type-classes)
 Christian Urban <urbanc@in.tum.de> parents: 
30242diff
changeset | 272 | by (simp add: supp_def perm_int_def) | 
| 17870 | 273 | |
| 80142 | 274 | lemma supp_nat[simp]: | 
| 20388 | 275 | fixes n::"nat" | 
| 30983 
e54777ab68bd
adapted permutation functions to new overloading syntax (the functions are still "unchecked" because they are used in conjunction with type-classes)
 Christian Urban <urbanc@in.tum.de> parents: 
30242diff
changeset | 276 |   shows "(supp n) = {}"
 | 
| 
e54777ab68bd
adapted permutation functions to new overloading syntax (the functions are still "unchecked" because they are used in conjunction with type-classes)
 Christian Urban <urbanc@in.tum.de> parents: 
30242diff
changeset | 277 | by (simp add: supp_def perm_nat_def) | 
| 20388 | 278 | |
| 80142 | 279 | lemma supp_char[simp]: | 
| 18627 | 280 | fixes c::"char" | 
| 30983 
e54777ab68bd
adapted permutation functions to new overloading syntax (the functions are still "unchecked" because they are used in conjunction with type-classes)
 Christian Urban <urbanc@in.tum.de> parents: 
30242diff
changeset | 281 |   shows "(supp c) = {}"
 | 
| 
e54777ab68bd
adapted permutation functions to new overloading syntax (the functions are still "unchecked" because they are used in conjunction with type-classes)
 Christian Urban <urbanc@in.tum.de> parents: 
30242diff
changeset | 282 | by (simp add: supp_def perm_char_def) | 
| 18627 | 283 | |
| 80142 | 284 | lemma supp_string[simp]: | 
| 18627 | 285 | fixes s::"string" | 
| 30983 
e54777ab68bd
adapted permutation functions to new overloading syntax (the functions are still "unchecked" because they are used in conjunction with type-classes)
 Christian Urban <urbanc@in.tum.de> parents: 
30242diff
changeset | 286 |   shows "(supp s) = {}"
 | 
| 
e54777ab68bd
adapted permutation functions to new overloading syntax (the functions are still "unchecked" because they are used in conjunction with type-classes)
 Christian Urban <urbanc@in.tum.de> parents: 
30242diff
changeset | 287 | by (simp add: supp_def perm_string) | 
| 18627 | 288 | |
| 30990 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 289 | (* lemmas about freshness *) | 
| 80142 | 290 | lemma fresh_set_empty[simp]: | 
| 18264 | 291 |   shows "a\<sharp>{}"
 | 
| 292 | by (simp add: fresh_def supp_set_empty) | |
| 293 | ||
| 80142 | 294 | lemma fresh_unit[simp]: | 
| 19858 | 295 | shows "a\<sharp>()" | 
| 296 | by (simp add: fresh_def supp_unit) | |
| 297 | ||
| 17870 | 298 | lemma fresh_prod: | 
| 299 | fixes a :: "'x" | |
| 300 | and x :: "'a" | |
| 301 | and y :: "'b" | |
| 302 | shows "a\<sharp>(x,y) = (a\<sharp>x \<and> a\<sharp>y)" | |
| 303 | by (simp add: fresh_def supp_prod) | |
| 304 | ||
| 80142 | 305 | lemma fresh_list_nil[simp]: | 
| 17870 | 306 | fixes a :: "'x" | 
| 18264 | 307 | shows "a\<sharp>[]" | 
| 17870 | 308 | by (simp add: fresh_def supp_list_nil) | 
| 309 | ||
| 310 | lemma fresh_list_cons: | |
| 311 | fixes a :: "'x" | |
| 312 | and x :: "'a" | |
| 313 | and xs :: "'a list" | |
| 314 | shows "a\<sharp>(x#xs) = (a\<sharp>x \<and> a\<sharp>xs)" | |
| 315 | by (simp add: fresh_def supp_list_cons) | |
| 316 | ||
| 317 | lemma fresh_list_append: | |
| 318 | fixes a :: "'x" | |
| 319 | and xs :: "'a list" | |
| 320 | and ys :: "'a list" | |
| 321 | shows "a\<sharp>(xs@ys) = (a\<sharp>xs \<and> a\<sharp>ys)" | |
| 322 | by (simp add: fresh_def supp_list_append) | |
| 323 | ||
| 80142 | 324 | lemma fresh_list_rev[simp]: | 
| 17870 | 325 | fixes a :: "'x" | 
| 326 | and xs :: "'a list" | |
| 327 | shows "a\<sharp>(rev xs) = a\<sharp>xs" | |
| 328 | by (simp add: fresh_def supp_list_rev) | |
| 329 | ||
| 80142 | 330 | lemma fresh_none[simp]: | 
| 17870 | 331 | fixes a :: "'x" | 
| 332 | shows "a\<sharp>None" | |
| 22831 
18f4014e1259
tuned some of the proofs and added the lemma fresh_bool
 urbanc parents: 
22829diff
changeset | 333 | by (simp add: fresh_def supp_none) | 
| 17870 | 334 | |
| 80142 | 335 | lemma fresh_some[simp]: | 
| 17870 | 336 | fixes a :: "'x" | 
| 337 | and x :: "'a" | |
| 338 | shows "a\<sharp>(Some x) = a\<sharp>x" | |
| 22831 
18f4014e1259
tuned some of the proofs and added the lemma fresh_bool
 urbanc parents: 
22829diff
changeset | 339 | by (simp add: fresh_def supp_some) | 
| 17870 | 340 | |
| 80142 | 341 | lemma fresh_int[simp]: | 
| 21010 
7fe928722821
added the missing freshness-lemmas for nat, int, char and string and
 urbanc parents: 
20809diff
changeset | 342 | fixes a :: "'x" | 
| 
7fe928722821
added the missing freshness-lemmas for nat, int, char and string and
 urbanc parents: 
20809diff
changeset | 343 | and i :: "int" | 
| 
7fe928722821
added the missing freshness-lemmas for nat, int, char and string and
 urbanc parents: 
20809diff
changeset | 344 | shows "a\<sharp>i" | 
| 22831 
18f4014e1259
tuned some of the proofs and added the lemma fresh_bool
 urbanc parents: 
22829diff
changeset | 345 | by (simp add: fresh_def supp_int) | 
| 21010 
7fe928722821
added the missing freshness-lemmas for nat, int, char and string and
 urbanc parents: 
20809diff
changeset | 346 | |
| 80142 | 347 | lemma fresh_nat[simp]: | 
| 21010 
7fe928722821
added the missing freshness-lemmas for nat, int, char and string and
 urbanc parents: 
20809diff
changeset | 348 | fixes a :: "'x" | 
| 
7fe928722821
added the missing freshness-lemmas for nat, int, char and string and
 urbanc parents: 
20809diff
changeset | 349 | and n :: "nat" | 
| 
7fe928722821
added the missing freshness-lemmas for nat, int, char and string and
 urbanc parents: 
20809diff
changeset | 350 | shows "a\<sharp>n" | 
| 22831 
18f4014e1259
tuned some of the proofs and added the lemma fresh_bool
 urbanc parents: 
22829diff
changeset | 351 | by (simp add: fresh_def supp_nat) | 
| 21010 
7fe928722821
added the missing freshness-lemmas for nat, int, char and string and
 urbanc parents: 
20809diff
changeset | 352 | |
| 80142 | 353 | lemma fresh_char[simp]: | 
| 21010 
7fe928722821
added the missing freshness-lemmas for nat, int, char and string and
 urbanc parents: 
20809diff
changeset | 354 | fixes a :: "'x" | 
| 
7fe928722821
added the missing freshness-lemmas for nat, int, char and string and
 urbanc parents: 
20809diff
changeset | 355 | and c :: "char" | 
| 
7fe928722821
added the missing freshness-lemmas for nat, int, char and string and
 urbanc parents: 
20809diff
changeset | 356 | shows "a\<sharp>c" | 
| 22831 
18f4014e1259
tuned some of the proofs and added the lemma fresh_bool
 urbanc parents: 
22829diff
changeset | 357 | by (simp add: fresh_def supp_char) | 
| 21010 
7fe928722821
added the missing freshness-lemmas for nat, int, char and string and
 urbanc parents: 
20809diff
changeset | 358 | |
| 80142 | 359 | lemma fresh_string[simp]: | 
| 21010 
7fe928722821
added the missing freshness-lemmas for nat, int, char and string and
 urbanc parents: 
20809diff
changeset | 360 | fixes a :: "'x" | 
| 
7fe928722821
added the missing freshness-lemmas for nat, int, char and string and
 urbanc parents: 
20809diff
changeset | 361 | and s :: "string" | 
| 
7fe928722821
added the missing freshness-lemmas for nat, int, char and string and
 urbanc parents: 
20809diff
changeset | 362 | shows "a\<sharp>s" | 
| 22831 
18f4014e1259
tuned some of the proofs and added the lemma fresh_bool
 urbanc parents: 
22829diff
changeset | 363 | by (simp add: fresh_def supp_string) | 
| 
18f4014e1259
tuned some of the proofs and added the lemma fresh_bool
 urbanc parents: 
22829diff
changeset | 364 | |
| 80142 | 365 | lemma fresh_bool[simp]: | 
| 22831 
18f4014e1259
tuned some of the proofs and added the lemma fresh_bool
 urbanc parents: 
22829diff
changeset | 366 | fixes a :: "'x" | 
| 
18f4014e1259
tuned some of the proofs and added the lemma fresh_bool
 urbanc parents: 
22829diff
changeset | 367 | and b :: "bool" | 
| 
18f4014e1259
tuned some of the proofs and added the lemma fresh_bool
 urbanc parents: 
22829diff
changeset | 368 | shows "a\<sharp>b" | 
| 
18f4014e1259
tuned some of the proofs and added the lemma fresh_bool
 urbanc parents: 
22829diff
changeset | 369 | by (simp add: fresh_def supp_bool) | 
| 21010 
7fe928722821
added the missing freshness-lemmas for nat, int, char and string and
 urbanc parents: 
20809diff
changeset | 370 | |
| 63167 | 371 | text \<open>Normalization of freshness results; cf.\ \<open>nominal_induct\<close>\<close> | 
| 21377 
c29146dc14f1
replaced exists_fresh lemma with a version formulated with obtains;
 urbanc parents: 
21318diff
changeset | 372 | lemma fresh_unit_elim: | 
| 
c29146dc14f1
replaced exists_fresh lemma with a version formulated with obtains;
 urbanc parents: 
21318diff
changeset | 373 | shows "(a\<sharp>() \<Longrightarrow> PROP C) \<equiv> PROP C" | 
| 18294 
bbfd64cc91ab
fresh_unit_elim and fresh_prod_elim -- for nominal_induct;
 wenzelm parents: 
18268diff
changeset | 374 | by (simp add: fresh_def supp_unit) | 
| 
bbfd64cc91ab
fresh_unit_elim and fresh_prod_elim -- for nominal_induct;
 wenzelm parents: 
18268diff
changeset | 375 | |
| 21377 
c29146dc14f1
replaced exists_fresh lemma with a version formulated with obtains;
 urbanc parents: 
21318diff
changeset | 376 | lemma fresh_prod_elim: | 
| 
c29146dc14f1
replaced exists_fresh lemma with a version formulated with obtains;
 urbanc parents: 
21318diff
changeset | 377 | shows "(a\<sharp>(x,y) \<Longrightarrow> PROP C) \<equiv> (a\<sharp>x \<Longrightarrow> a\<sharp>y \<Longrightarrow> PROP C)" | 
| 18294 
bbfd64cc91ab
fresh_unit_elim and fresh_prod_elim -- for nominal_induct;
 wenzelm parents: 
18268diff
changeset | 378 | by rule (simp_all add: fresh_prod) | 
| 
bbfd64cc91ab
fresh_unit_elim and fresh_prod_elim -- for nominal_induct;
 wenzelm parents: 
18268diff
changeset | 379 | |
| 21405 
26b51f724fe6
added an intro lemma for freshness of products; set up
 urbanc parents: 
21377diff
changeset | 380 | (* this rule needs to be added before the fresh_prodD is *) | 
| 
26b51f724fe6
added an intro lemma for freshness of products; set up
 urbanc parents: 
21377diff
changeset | 381 | (* added to the simplifier with mksimps *) | 
| 
26b51f724fe6
added an intro lemma for freshness of products; set up
 urbanc parents: 
21377diff
changeset | 382 | lemma [simp]: | 
| 
26b51f724fe6
added an intro lemma for freshness of products; set up
 urbanc parents: 
21377diff
changeset | 383 | shows "a\<sharp>x1 \<Longrightarrow> a\<sharp>x2 \<Longrightarrow> a\<sharp>(x1,x2)" | 
| 
26b51f724fe6
added an intro lemma for freshness of products; set up
 urbanc parents: 
21377diff
changeset | 384 | by (simp add: fresh_prod) | 
| 
26b51f724fe6
added an intro lemma for freshness of products; set up
 urbanc parents: 
21377diff
changeset | 385 | |
| 21318 
edb595802d22
added fresh_prodD, which is included fresh_prodD into mksimps setup;
 wenzelm parents: 
21010diff
changeset | 386 | lemma fresh_prodD: | 
| 21377 
c29146dc14f1
replaced exists_fresh lemma with a version formulated with obtains;
 urbanc parents: 
21318diff
changeset | 387 | shows "a\<sharp>(x,y) \<Longrightarrow> a\<sharp>x" | 
| 
c29146dc14f1
replaced exists_fresh lemma with a version formulated with obtains;
 urbanc parents: 
21318diff
changeset | 388 | and "a\<sharp>(x,y) \<Longrightarrow> a\<sharp>y" | 
| 21318 
edb595802d22
added fresh_prodD, which is included fresh_prodD into mksimps setup;
 wenzelm parents: 
21010diff
changeset | 389 | by (simp_all add: fresh_prod) | 
| 
edb595802d22
added fresh_prodD, which is included fresh_prodD into mksimps setup;
 wenzelm parents: 
21010diff
changeset | 390 | |
| 63167 | 391 | ML \<open> | 
| 69597 | 392 |   val mksimps_pairs = (\<^const_name>\<open>Nominal.fresh\<close>, @{thms fresh_prodD}) :: mksimps_pairs;
 | 
| 63167 | 393 | \<close> | 
| 394 | declaration \<open>fn _ => | |
| 45625 
750c5a47400b
modernized some old-style infix operations, which were left over from the time of ML proof scripts;
 wenzelm parents: 
44838diff
changeset | 395 | Simplifier.map_ss (Simplifier.set_mksimps (mksimps mksimps_pairs)) | 
| 63167 | 396 | \<close> | 
| 397 | ||
| 398 | section \<open>Abstract Properties for Permutations and Atoms\<close> | |
| 17870 | 399 | (*=========================================================*) | 
| 400 | ||
| 401 | (* properties for being a permutation type *) | |
| 35416 
d8d7d1b785af
replaced a couple of constsdefs by definitions (also some old primrecs by modern ones)
 haftmann parents: 
32960diff
changeset | 402 | definition | 
| 17870 | 403 |   "pt TYPE('a) TYPE('x) \<equiv> 
 | 
| 404 | (\<forall>(x::'a). ([]::'x prm)\<bullet>x = x) \<and> | |
| 405 | (\<forall>(pi1::'x prm) (pi2::'x prm) (x::'a). (pi1@pi2)\<bullet>x = pi1\<bullet>(pi2\<bullet>x)) \<and> | |
| 18295 
dd50de393330
changed \<sim> of permutation equality to \<triangleq>
 urbanc parents: 
18294diff
changeset | 406 | (\<forall>(pi1::'x prm) (pi2::'x prm) (x::'a). pi1 \<triangleq> pi2 \<longrightarrow> pi1\<bullet>x = pi2\<bullet>x)" | 
| 17870 | 407 | |
| 408 | (* properties for being an atom type *) | |
| 35416 
d8d7d1b785af
replaced a couple of constsdefs by definitions (also some old primrecs by modern ones)
 haftmann parents: 
32960diff
changeset | 409 | definition | 
| 17870 | 410 |   "at TYPE('x) \<equiv> 
 | 
| 411 | (\<forall>(x::'x). ([]::'x prm)\<bullet>x = x) \<and> | |
| 412 | (\<forall>(a::'x) (b::'x) (pi::'x prm) (x::'x). ((a,b)#(pi::'x prm))\<bullet>x = swap (a,b) (pi\<bullet>x)) \<and> | |
| 413 | (\<forall>(a::'x) (b::'x) (c::'x). swap (a,b) c = (if a=c then b else (if b=c then a else c))) \<and> | |
| 414 | (infinite (UNIV::'x set))" | |
| 415 | ||
| 416 | (* property of two atom-types being disjoint *) | |
| 35416 
d8d7d1b785af
replaced a couple of constsdefs by definitions (also some old primrecs by modern ones)
 haftmann parents: 
32960diff
changeset | 417 | definition | 
| 17870 | 418 |   "disjoint TYPE('x) TYPE('y) \<equiv> 
 | 
| 419 | (\<forall>(pi::'x prm)(x::'y). pi\<bullet>x = x) \<and> | |
| 420 | (\<forall>(pi::'y prm)(x::'x). pi\<bullet>x = x)" | |
| 421 | ||
| 422 | (* composition property of two permutation on a type 'a *) | |
| 35416 
d8d7d1b785af
replaced a couple of constsdefs by definitions (also some old primrecs by modern ones)
 haftmann parents: 
32960diff
changeset | 423 | definition | 
| 17870 | 424 |   "cp TYPE ('a) TYPE('x) TYPE('y) \<equiv> 
 | 
| 425 | (\<forall>(pi2::'y prm) (pi1::'x prm) (x::'a) . pi1\<bullet>(pi2\<bullet>x) = (pi1\<bullet>pi2)\<bullet>(pi1\<bullet>x))" | |
| 426 | ||
| 427 | (* property of having finite support *) | |
| 35416 
d8d7d1b785af
replaced a couple of constsdefs by definitions (also some old primrecs by modern ones)
 haftmann parents: 
32960diff
changeset | 428 | definition | 
| 17870 | 429 |   "fs TYPE('a) TYPE('x) \<equiv> \<forall>(x::'a). finite ((supp x)::'x set)"
 | 
| 430 | ||
| 63167 | 431 | section \<open>Lemmas about the atom-type properties\<close> | 
| 17870 | 432 | (*==============================================*) | 
| 433 | ||
| 434 | lemma at1: | |
| 435 | fixes x::"'x" | |
| 436 |   assumes a: "at TYPE('x)"
 | |
| 437 | shows "([]::'x prm)\<bullet>x = x" | |
| 438 | using a by (simp add: at_def) | |
| 439 | ||
| 440 | lemma at2: | |
| 441 | fixes a ::"'x" | |
| 442 | and b ::"'x" | |
| 443 | and x ::"'x" | |
| 444 | and pi::"'x prm" | |
| 445 |   assumes a: "at TYPE('x)"
 | |
| 446 | shows "((a,b)#pi)\<bullet>x = swap (a,b) (pi\<bullet>x)" | |
| 447 | using a by (simp only: at_def) | |
| 448 | ||
| 449 | lemma at3: | |
| 450 | fixes a ::"'x" | |
| 451 | and b ::"'x" | |
| 452 | and c ::"'x" | |
| 453 |   assumes a: "at TYPE('x)"
 | |
| 454 | shows "swap (a,b) c = (if a=c then b else (if b=c then a else c))" | |
| 455 | using a by (simp only: at_def) | |
| 456 | ||
| 30990 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 457 | (* rules to calculate simple permutations *) | 
| 17870 | 458 | lemmas at_calc = at2 at1 at3 | 
| 459 | ||
| 22610 | 460 | lemma at_swap_simps: | 
| 461 | fixes a ::"'x" | |
| 462 | and b ::"'x" | |
| 463 |   assumes a: "at TYPE('x)"
 | |
| 464 | shows "[(a,b)]\<bullet>a = b" | |
| 465 | and "[(a,b)]\<bullet>b = a" | |
| 27374 | 466 | and "\<lbrakk>a\<noteq>c; b\<noteq>c\<rbrakk> \<Longrightarrow> [(a,b)]\<bullet>c = c" | 
| 22610 | 467 | using a by (simp_all add: at_calc) | 
| 468 | ||
| 17870 | 469 | lemma at4: | 
| 470 |   assumes a: "at TYPE('x)"
 | |
| 471 | shows "infinite (UNIV::'x set)" | |
| 472 | using a by (simp add: at_def) | |
| 473 | ||
| 474 | lemma at_append: | |
| 475 | fixes pi1 :: "'x prm" | |
| 476 | and pi2 :: "'x prm" | |
| 477 | and c :: "'x" | |
| 478 |   assumes at: "at TYPE('x)" 
 | |
| 479 | shows "(pi1@pi2)\<bullet>c = pi1\<bullet>(pi2\<bullet>c)" | |
| 480 | proof (induct pi1) | |
| 481 | case Nil show ?case by (simp add: at1[OF at]) | |
| 482 | next | |
| 483 | case (Cons x xs) | |
| 18053 
2719a6b7d95e
some minor tweaks in some proofs (nothing extraordinary)
 urbanc parents: 
18048diff
changeset | 484 | have "(xs@pi2)\<bullet>c = xs\<bullet>(pi2\<bullet>c)" by fact | 
| 
2719a6b7d95e
some minor tweaks in some proofs (nothing extraordinary)
 urbanc parents: 
18048diff
changeset | 485 | also have "(x#xs)@pi2 = x#(xs@pi2)" by simp | 
| 
2719a6b7d95e
some minor tweaks in some proofs (nothing extraordinary)
 urbanc parents: 
18048diff
changeset | 486 | ultimately show ?case by (cases "x", simp add: at2[OF at]) | 
| 17870 | 487 | qed | 
| 488 | ||
| 489 | lemma at_swap: | |
| 490 | fixes a :: "'x" | |
| 491 | and b :: "'x" | |
| 492 | and c :: "'x" | |
| 493 |   assumes at: "at TYPE('x)" 
 | |
| 494 | shows "swap (a,b) (swap (a,b) c) = c" | |
| 495 | by (auto simp add: at3[OF at]) | |
| 496 | ||
| 497 | lemma at_rev_pi: | |
| 498 | fixes pi :: "'x prm" | |
| 499 | and c :: "'x" | |
| 500 |   assumes at: "at TYPE('x)"
 | |
| 501 | shows "(rev pi)\<bullet>(pi\<bullet>c) = c" | |
| 502 | proof(induct pi) | |
| 503 | case Nil show ?case by (simp add: at1[OF at]) | |
| 504 | next | |
| 505 | case (Cons x xs) thus ?case | |
| 506 | by (cases "x", simp add: at2[OF at] at_append[OF at] at1[OF at] at_swap[OF at]) | |
| 507 | qed | |
| 508 | ||
| 509 | lemma at_pi_rev: | |
| 510 | fixes pi :: "'x prm" | |
| 511 | and x :: "'x" | |
| 512 |   assumes at: "at TYPE('x)"
 | |
| 513 | shows "pi\<bullet>((rev pi)\<bullet>x) = x" | |
| 514 | by (rule at_rev_pi[OF at, of "rev pi" _,simplified]) | |
| 515 | ||
| 516 | lemma at_bij1: | |
| 517 | fixes pi :: "'x prm" | |
| 518 | and x :: "'x" | |
| 519 | and y :: "'x" | |
| 520 |   assumes at: "at TYPE('x)"
 | |
| 521 | and a: "(pi\<bullet>x) = y" | |
| 522 | shows "x=(rev pi)\<bullet>y" | |
| 523 | proof - | |
| 524 | from a have "y=(pi\<bullet>x)" by (rule sym) | |
| 525 | thus ?thesis by (simp only: at_rev_pi[OF at]) | |
| 526 | qed | |
| 527 | ||
| 528 | lemma at_bij2: | |
| 529 | fixes pi :: "'x prm" | |
| 530 | and x :: "'x" | |
| 531 | and y :: "'x" | |
| 532 |   assumes at: "at TYPE('x)"
 | |
| 533 | and a: "((rev pi)\<bullet>x) = y" | |
| 534 | shows "x=pi\<bullet>y" | |
| 535 | proof - | |
| 536 | from a have "y=((rev pi)\<bullet>x)" by (rule sym) | |
| 537 | thus ?thesis by (simp only: at_pi_rev[OF at]) | |
| 538 | qed | |
| 539 | ||
| 540 | lemma at_bij: | |
| 541 | fixes pi :: "'x prm" | |
| 542 | and x :: "'x" | |
| 543 | and y :: "'x" | |
| 544 |   assumes at: "at TYPE('x)"
 | |
| 545 | shows "(pi\<bullet>x = pi\<bullet>y) = (x=y)" | |
| 546 | proof | |
| 547 | assume "pi\<bullet>x = pi\<bullet>y" | |
| 548 | hence "x=(rev pi)\<bullet>(pi\<bullet>y)" by (rule at_bij1[OF at]) | |
| 549 | thus "x=y" by (simp only: at_rev_pi[OF at]) | |
| 550 | next | |
| 551 | assume "x=y" | |
| 552 | thus "pi\<bullet>x = pi\<bullet>y" by simp | |
| 553 | qed | |
| 554 | ||
| 555 | lemma at_supp: | |
| 556 | fixes x :: "'x" | |
| 557 |   assumes at: "at TYPE('x)"
 | |
| 558 |   shows "supp x = {x}"
 | |
| 29903 | 559 | by(auto simp: supp_def Collect_conj_eq Collect_imp_eq at_calc[OF at] at4[OF at]) | 
| 17870 | 560 | |
| 561 | lemma at_fresh: | |
| 562 | fixes a :: "'x" | |
| 563 | and b :: "'x" | |
| 564 |   assumes at: "at TYPE('x)"
 | |
| 565 | shows "(a\<sharp>b) = (a\<noteq>b)" | |
| 566 | by (simp add: at_supp[OF at] fresh_def) | |
| 567 | ||
| 26766 
0e2a29a1065c
polished the proof for atm_prm_fresh and more lemmas for fresh_star
 urbanc parents: 
26522diff
changeset | 568 | lemma at_prm_fresh1: | 
| 
0e2a29a1065c
polished the proof for atm_prm_fresh and more lemmas for fresh_star
 urbanc parents: 
26522diff
changeset | 569 | fixes c :: "'x" | 
| 
0e2a29a1065c
polished the proof for atm_prm_fresh and more lemmas for fresh_star
 urbanc parents: 
26522diff
changeset | 570 | and pi:: "'x prm" | 
| 
0e2a29a1065c
polished the proof for atm_prm_fresh and more lemmas for fresh_star
 urbanc parents: 
26522diff
changeset | 571 |   assumes at: "at TYPE('x)"
 | 
| 
0e2a29a1065c
polished the proof for atm_prm_fresh and more lemmas for fresh_star
 urbanc parents: 
26522diff
changeset | 572 | and a: "c\<sharp>pi" | 
| 
0e2a29a1065c
polished the proof for atm_prm_fresh and more lemmas for fresh_star
 urbanc parents: 
26522diff
changeset | 573 | shows "\<forall>(a,b)\<in>set pi. c\<noteq>a \<and> c\<noteq>b" | 
| 
0e2a29a1065c
polished the proof for atm_prm_fresh and more lemmas for fresh_star
 urbanc parents: 
26522diff
changeset | 574 | using a by (induct pi) (auto simp add: fresh_list_cons fresh_prod at_fresh[OF at]) | 
| 
0e2a29a1065c
polished the proof for atm_prm_fresh and more lemmas for fresh_star
 urbanc parents: 
26522diff
changeset | 575 | |
| 
0e2a29a1065c
polished the proof for atm_prm_fresh and more lemmas for fresh_star
 urbanc parents: 
26522diff
changeset | 576 | lemma at_prm_fresh2: | 
| 
0e2a29a1065c
polished the proof for atm_prm_fresh and more lemmas for fresh_star
 urbanc parents: 
26522diff
changeset | 577 | fixes c :: "'x" | 
| 
0e2a29a1065c
polished the proof for atm_prm_fresh and more lemmas for fresh_star
 urbanc parents: 
26522diff
changeset | 578 | and pi:: "'x prm" | 
| 
0e2a29a1065c
polished the proof for atm_prm_fresh and more lemmas for fresh_star
 urbanc parents: 
26522diff
changeset | 579 |   assumes at: "at TYPE('x)"
 | 
| 
0e2a29a1065c
polished the proof for atm_prm_fresh and more lemmas for fresh_star
 urbanc parents: 
26522diff
changeset | 580 | and a: "\<forall>(a,b)\<in>set pi. c\<noteq>a \<and> c\<noteq>b" | 
| 
0e2a29a1065c
polished the proof for atm_prm_fresh and more lemmas for fresh_star
 urbanc parents: 
26522diff
changeset | 581 | shows "pi\<bullet>c = c" | 
| 
0e2a29a1065c
polished the proof for atm_prm_fresh and more lemmas for fresh_star
 urbanc parents: 
26522diff
changeset | 582 | using a by(induct pi) (auto simp add: at1[OF at] at2[OF at] at3[OF at]) | 
| 
0e2a29a1065c
polished the proof for atm_prm_fresh and more lemmas for fresh_star
 urbanc parents: 
26522diff
changeset | 583 | |
| 19107 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 584 | lemma at_prm_fresh: | 
| 17870 | 585 | fixes c :: "'x" | 
| 586 | and pi:: "'x prm" | |
| 587 |   assumes at: "at TYPE('x)"
 | |
| 19107 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 588 | and a: "c\<sharp>pi" | 
| 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 589 | shows "pi\<bullet>c = c" | 
| 26766 
0e2a29a1065c
polished the proof for atm_prm_fresh and more lemmas for fresh_star
 urbanc parents: 
26522diff
changeset | 590 | by (rule at_prm_fresh2[OF at], rule at_prm_fresh1[OF at, OF a]) | 
| 17870 | 591 | |
| 592 | lemma at_prm_rev_eq: | |
| 593 | fixes pi1 :: "'x prm" | |
| 594 | and pi2 :: "'x prm" | |
| 595 |   assumes at: "at TYPE('x)"
 | |
| 19107 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 596 | shows "((rev pi1) \<triangleq> (rev pi2)) = (pi1 \<triangleq> pi2)" | 
| 17870 | 597 | proof (simp add: prm_eq_def, auto) | 
| 598 | fix x | |
| 599 | assume "\<forall>x::'x. (rev pi1)\<bullet>x = (rev pi2)\<bullet>x" | |
| 600 | hence "(rev (pi1::'x prm))\<bullet>(pi2\<bullet>(x::'x)) = (rev (pi2::'x prm))\<bullet>(pi2\<bullet>x)" by simp | |
| 601 | hence "(rev (pi1::'x prm))\<bullet>((pi2::'x prm)\<bullet>x) = (x::'x)" by (simp add: at_rev_pi[OF at]) | |
| 602 | hence "(pi2::'x prm)\<bullet>x = (pi1::'x prm)\<bullet>x" by (simp add: at_bij2[OF at]) | |
| 18295 
dd50de393330
changed \<sim> of permutation equality to \<triangleq>
 urbanc parents: 
18294diff
changeset | 603 | thus "pi1\<bullet>x = pi2\<bullet>x" by simp | 
| 17870 | 604 | next | 
| 605 | fix x | |
| 606 | assume "\<forall>x::'x. pi1\<bullet>x = pi2\<bullet>x" | |
| 607 | hence "(pi1::'x prm)\<bullet>((rev pi2)\<bullet>x) = (pi2::'x prm)\<bullet>((rev pi2)\<bullet>(x::'x))" by simp | |
| 608 | hence "(pi1::'x prm)\<bullet>((rev pi2)\<bullet>(x::'x)) = x" by (simp add: at_pi_rev[OF at]) | |
| 609 | hence "(rev pi2)\<bullet>x = (rev pi1)\<bullet>(x::'x)" by (simp add: at_bij1[OF at]) | |
| 610 | thus "(rev pi1)\<bullet>x = (rev pi2)\<bullet>(x::'x)" by simp | |
| 611 | qed | |
| 19107 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 612 | |
| 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 613 | lemma at_prm_eq_append: | 
| 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 614 | fixes pi1 :: "'x prm" | 
| 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 615 | and pi2 :: "'x prm" | 
| 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 616 | and pi3 :: "'x prm" | 
| 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 617 |   assumes at: "at TYPE('x)"
 | 
| 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 618 | and a: "pi1 \<triangleq> pi2" | 
| 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 619 | shows "(pi3@pi1) \<triangleq> (pi3@pi2)" | 
| 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 620 | using a by (simp add: prm_eq_def at_append[OF at] at_bij[OF at]) | 
| 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 621 | |
| 19325 | 622 | lemma at_prm_eq_append': | 
| 623 | fixes pi1 :: "'x prm" | |
| 624 | and pi2 :: "'x prm" | |
| 625 | and pi3 :: "'x prm" | |
| 626 |   assumes at: "at TYPE('x)"
 | |
| 627 | and a: "pi1 \<triangleq> pi2" | |
| 628 | shows "(pi1@pi3) \<triangleq> (pi2@pi3)" | |
| 629 | using a by (simp add: prm_eq_def at_append[OF at]) | |
| 630 | ||
| 19107 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 631 | lemma at_prm_eq_trans: | 
| 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 632 | fixes pi1 :: "'x prm" | 
| 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 633 | and pi2 :: "'x prm" | 
| 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 634 | and pi3 :: "'x prm" | 
| 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 635 | assumes a1: "pi1 \<triangleq> pi2" | 
| 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 636 | and a2: "pi2 \<triangleq> pi3" | 
| 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 637 | shows "pi1 \<triangleq> pi3" | 
| 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 638 | using a1 a2 by (auto simp add: prm_eq_def) | 
| 17870 | 639 | |
| 19107 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 640 | lemma at_prm_eq_refl: | 
| 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 641 | fixes pi :: "'x prm" | 
| 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 642 | shows "pi \<triangleq> pi" | 
| 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 643 | by (simp add: prm_eq_def) | 
| 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 644 | |
| 17870 | 645 | lemma at_prm_rev_eq1: | 
| 646 | fixes pi1 :: "'x prm" | |
| 647 | and pi2 :: "'x prm" | |
| 648 |   assumes at: "at TYPE('x)"
 | |
| 18295 
dd50de393330
changed \<sim> of permutation equality to \<triangleq>
 urbanc parents: 
18294diff
changeset | 649 | shows "pi1 \<triangleq> pi2 \<Longrightarrow> (rev pi1) \<triangleq> (rev pi2)" | 
| 17870 | 650 | by (simp add: at_prm_rev_eq[OF at]) | 
| 651 | ||
| 652 | lemma at_ds1: | |
| 653 | fixes a :: "'x" | |
| 654 |   assumes at: "at TYPE('x)"
 | |
| 18295 
dd50de393330
changed \<sim> of permutation equality to \<triangleq>
 urbanc parents: 
18294diff
changeset | 655 | shows "[(a,a)] \<triangleq> []" | 
| 17870 | 656 | by (force simp add: prm_eq_def at_calc[OF at]) | 
| 657 | ||
| 658 | lemma at_ds2: | |
| 659 | fixes pi :: "'x prm" | |
| 660 | and a :: "'x" | |
| 661 | and b :: "'x" | |
| 662 |   assumes at: "at TYPE('x)"
 | |
| 19107 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 663 | shows "([(a,b)]@pi) \<triangleq> (pi@[((rev pi)\<bullet>a,(rev pi)\<bullet>b)])" | 
| 17870 | 664 | by (force simp add: prm_eq_def at_append[OF at] at_bij[OF at] at_pi_rev[OF at] | 
| 665 | at_rev_pi[OF at] at_calc[OF at]) | |
| 666 | ||
| 667 | lemma at_ds3: | |
| 668 | fixes a :: "'x" | |
| 669 | and b :: "'x" | |
| 670 | and c :: "'x" | |
| 671 |   assumes at: "at TYPE('x)"
 | |
| 672 | and a: "distinct [a,b,c]" | |
| 18295 
dd50de393330
changed \<sim> of permutation equality to \<triangleq>
 urbanc parents: 
18294diff
changeset | 673 | shows "[(a,c),(b,c),(a,c)] \<triangleq> [(a,b)]" | 
| 17870 | 674 | using a by (force simp add: prm_eq_def at_calc[OF at]) | 
| 675 | ||
| 676 | lemma at_ds4: | |
| 677 | fixes a :: "'x" | |
| 678 | and b :: "'x" | |
| 679 | and pi :: "'x prm" | |
| 680 |   assumes at: "at TYPE('x)"
 | |
| 18295 
dd50de393330
changed \<sim> of permutation equality to \<triangleq>
 urbanc parents: 
18294diff
changeset | 681 | shows "(pi@[(a,(rev pi)\<bullet>b)]) \<triangleq> ([(pi\<bullet>a,b)]@pi)" | 
| 17870 | 682 | by (force simp add: prm_eq_def at_append[OF at] at_calc[OF at] at_bij[OF at] | 
| 683 | at_pi_rev[OF at] at_rev_pi[OF at]) | |
| 684 | ||
| 685 | lemma at_ds5: | |
| 686 | fixes a :: "'x" | |
| 687 | and b :: "'x" | |
| 688 |   assumes at: "at TYPE('x)"
 | |
| 18295 
dd50de393330
changed \<sim> of permutation equality to \<triangleq>
 urbanc parents: 
18294diff
changeset | 689 | shows "[(a,b)] \<triangleq> [(b,a)]" | 
| 17870 | 690 | by (force simp add: prm_eq_def at_calc[OF at]) | 
| 691 | ||
| 19164 | 692 | lemma at_ds5': | 
| 693 | fixes a :: "'x" | |
| 694 | and b :: "'x" | |
| 695 |   assumes at: "at TYPE('x)"
 | |
| 696 | shows "[(a,b),(b,a)] \<triangleq> []" | |
| 697 | by (force simp add: prm_eq_def at_calc[OF at]) | |
| 698 | ||
| 17870 | 699 | lemma at_ds6: | 
| 700 | fixes a :: "'x" | |
| 701 | and b :: "'x" | |
| 702 | and c :: "'x" | |
| 703 |   assumes at: "at TYPE('x)"
 | |
| 704 | and a: "distinct [a,b,c]" | |
| 18295 
dd50de393330
changed \<sim> of permutation equality to \<triangleq>
 urbanc parents: 
18294diff
changeset | 705 | shows "[(a,c),(a,b)] \<triangleq> [(b,c),(a,c)]" | 
| 17870 | 706 | using a by (force simp add: prm_eq_def at_calc[OF at]) | 
| 707 | ||
| 708 | lemma at_ds7: | |
| 709 | fixes pi :: "'x prm" | |
| 710 |   assumes at: "at TYPE('x)"
 | |
| 18295 
dd50de393330
changed \<sim> of permutation equality to \<triangleq>
 urbanc parents: 
18294diff
changeset | 711 | shows "((rev pi)@pi) \<triangleq> []" | 
| 17870 | 712 | by (simp add: prm_eq_def at1[OF at] at_append[OF at] at_rev_pi[OF at]) | 
| 713 | ||
| 714 | lemma at_ds8_aux: | |
| 715 | fixes pi :: "'x prm" | |
| 716 | and a :: "'x" | |
| 717 | and b :: "'x" | |
| 718 | and c :: "'x" | |
| 719 |   assumes at: "at TYPE('x)"
 | |
| 720 | shows "pi\<bullet>(swap (a,b) c) = swap (pi\<bullet>a,pi\<bullet>b) (pi\<bullet>c)" | |
| 721 | by (force simp add: at_calc[OF at] at_bij[OF at]) | |
| 722 | ||
| 723 | lemma at_ds8: | |
| 724 | fixes pi1 :: "'x prm" | |
| 725 | and pi2 :: "'x prm" | |
| 726 | and a :: "'x" | |
| 727 | and b :: "'x" | |
| 728 |   assumes at: "at TYPE('x)"
 | |
| 18295 
dd50de393330
changed \<sim> of permutation equality to \<triangleq>
 urbanc parents: 
18294diff
changeset | 729 | shows "(pi1@pi2) \<triangleq> ((pi1\<bullet>pi2)@pi1)" | 
| 80171 | 730 | proof(induct pi2) | 
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 731 | show "(pi1 @ []) \<triangleq> (pi1 \<bullet> [] @ pi1)" | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 732 | by(simp add: prm_eq_def) | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 733 | show "\<And>a l. (pi1 @ l) \<triangleq> (pi1 \<bullet> l @ pi1) \<Longrightarrow> | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 734 | (pi1 @ a # l) \<triangleq> (pi1 \<bullet> (a # l) @ pi1) " | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 735 | by(auto simp add: prm_eq_def at at2 at_append at_ds8_aux) | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 736 | qed | 
| 17870 | 737 | |
| 738 | lemma at_ds9: | |
| 739 | fixes pi1 :: "'x prm" | |
| 740 | and pi2 :: "'x prm" | |
| 741 | and a :: "'x" | |
| 742 | and b :: "'x" | |
| 743 |   assumes at: "at TYPE('x)"
 | |
| 18295 
dd50de393330
changed \<sim> of permutation equality to \<triangleq>
 urbanc parents: 
18294diff
changeset | 744 | shows " ((rev pi2)@(rev pi1)) \<triangleq> ((rev pi1)@(rev (pi1\<bullet>pi2)))" | 
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 745 | using at at_ds8 at_prm_rev_eq1 rev_append by fastforce | 
| 17870 | 746 | |
| 19107 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 747 | lemma at_ds10: | 
| 19132 | 748 | fixes pi :: "'x prm" | 
| 19107 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 749 | and a :: "'x" | 
| 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 750 | and b :: "'x" | 
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 751 |   assumes "at TYPE('x)"
 | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 752 | and "b\<sharp>(rev pi)" | 
| 19132 | 753 | shows "([(pi\<bullet>a,b)]@pi) \<triangleq> (pi@[(a,b)])" | 
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 754 | by (metis assms at_bij1 at_ds2 at_prm_fresh) | 
| 19107 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 755 | |
| 67443 
3abf6a722518
standardized towards new-style formal comments: isabelle update_comments;
 wenzelm parents: 
66453diff
changeset | 756 | \<comment> \<open>there always exists an atom that is not being in a finite set\<close> | 
| 17870 | 757 | lemma ex_in_inf: | 
| 758 | fixes A::"'x set" | |
| 759 |   assumes at: "at TYPE('x)"
 | |
| 760 | and fs: "finite A" | |
| 21377 
c29146dc14f1
replaced exists_fresh lemma with a version formulated with obtains;
 urbanc parents: 
21318diff
changeset | 761 | obtains c::"'x" where "c\<notin>A" | 
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 762 | using at at4 ex_new_if_finite fs by blast | 
| 17870 | 763 | |
| 63167 | 764 | text \<open>there always exists a fresh name for an object with finite support\<close> | 
| 21377 
c29146dc14f1
replaced exists_fresh lemma with a version formulated with obtains;
 urbanc parents: 
21318diff
changeset | 765 | lemma at_exists_fresh': | 
| 
c29146dc14f1
replaced exists_fresh lemma with a version formulated with obtains;
 urbanc parents: 
21318diff
changeset | 766 | fixes x :: "'a" | 
| 
c29146dc14f1
replaced exists_fresh lemma with a version formulated with obtains;
 urbanc parents: 
21318diff
changeset | 767 |   assumes at: "at TYPE('x)"
 | 
| 
c29146dc14f1
replaced exists_fresh lemma with a version formulated with obtains;
 urbanc parents: 
21318diff
changeset | 768 | and fs: "finite ((supp x)::'x set)" | 
| 
c29146dc14f1
replaced exists_fresh lemma with a version formulated with obtains;
 urbanc parents: 
21318diff
changeset | 769 | shows "\<exists>c::'x. c\<sharp>x" | 
| 
c29146dc14f1
replaced exists_fresh lemma with a version formulated with obtains;
 urbanc parents: 
21318diff
changeset | 770 | by (auto simp add: fresh_def intro: ex_in_inf[OF at, OF fs]) | 
| 
c29146dc14f1
replaced exists_fresh lemma with a version formulated with obtains;
 urbanc parents: 
21318diff
changeset | 771 | |
| 17870 | 772 | lemma at_exists_fresh: | 
| 773 | fixes x :: "'a" | |
| 774 |   assumes at: "at TYPE('x)"
 | |
| 775 | and fs: "finite ((supp x)::'x set)" | |
| 21377 
c29146dc14f1
replaced exists_fresh lemma with a version formulated with obtains;
 urbanc parents: 
21318diff
changeset | 776 | obtains c::"'x" where "c\<sharp>x" | 
| 
c29146dc14f1
replaced exists_fresh lemma with a version formulated with obtains;
 urbanc parents: 
21318diff
changeset | 777 | by (auto intro: ex_in_inf[OF at, OF fs] simp add: fresh_def) | 
| 17870 | 778 | |
| 21377 
c29146dc14f1
replaced exists_fresh lemma with a version formulated with obtains;
 urbanc parents: 
21318diff
changeset | 779 | lemma at_finite_select: | 
| 30990 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 780 | fixes S::"'a set" | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 781 |   assumes a: "at TYPE('a)"
 | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 782 | and b: "finite S" | 
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 783 | shows "\<exists>x. x \<notin> S" | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 784 | by (meson a b ex_in_inf) | 
| 18657 | 785 | |
| 19140 | 786 | lemma at_different: | 
| 19132 | 787 |   assumes at: "at TYPE('x)"
 | 
| 19140 | 788 | shows "\<exists>(b::'x). a\<noteq>b" | 
| 19132 | 789 | proof - | 
| 19140 | 790 | have "infinite (UNIV::'x set)" by (rule at4[OF at]) | 
| 791 |   hence inf2: "infinite (UNIV-{a})" by (rule infinite_remove)
 | |
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 792 |   have "(UNIV-{a}) \<noteq> ({}::'x set)"
 | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 793 | by (metis finite.emptyI inf2) | 
| 19132 | 794 |   hence "\<exists>(b::'x). b\<in>(UNIV-{a})" by blast
 | 
| 795 |   then obtain b::"'x" where mem2: "b\<in>(UNIV-{a})" by blast
 | |
| 19140 | 796 | from mem2 have "a\<noteq>b" by blast | 
| 797 | then show "\<exists>(b::'x). a\<noteq>b" by blast | |
| 19132 | 798 | qed | 
| 799 | ||
| 67443 
3abf6a722518
standardized towards new-style formal comments: isabelle update_comments;
 wenzelm parents: 
66453diff
changeset | 800 | \<comment> \<open>the at-props imply the pt-props\<close> | 
| 17870 | 801 | lemma at_pt_inst: | 
| 802 |   assumes at: "at TYPE('x)"
 | |
| 803 |   shows "pt TYPE('x) TYPE('x)"
 | |
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 804 | using at at_append at_def prm_eq_def pt_def by fastforce | 
| 17870 | 805 | |
| 63167 | 806 | section \<open>finite support properties\<close> | 
| 17870 | 807 | (*===================================*) | 
| 808 | ||
| 809 | lemma fs1: | |
| 810 | fixes x :: "'a" | |
| 811 |   assumes a: "fs TYPE('a) TYPE('x)"
 | |
| 812 | shows "finite ((supp x)::'x set)" | |
| 813 | using a by (simp add: fs_def) | |
| 814 | ||
| 815 | lemma fs_at_inst: | |
| 816 | fixes a :: "'x" | |
| 817 |   assumes at: "at TYPE('x)"
 | |
| 818 |   shows "fs TYPE('x) TYPE('x)"
 | |
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 819 | by (simp add: at at_supp fs_def) | 
| 17870 | 820 | |
| 821 | lemma fs_unit_inst: | |
| 822 |   shows "fs TYPE(unit) TYPE('x)"
 | |
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 823 | by(simp add: fs_def supp_unit) | 
| 17870 | 824 | |
| 825 | lemma fs_prod_inst: | |
| 826 |   assumes fsa: "fs TYPE('a) TYPE('x)"
 | |
| 827 |   and     fsb: "fs TYPE('b) TYPE('x)"
 | |
| 828 |   shows "fs TYPE('a\<times>'b) TYPE('x)"
 | |
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 829 | by (simp add: assms fs1 supp_prod fs_def) | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 830 | |
| 17870 | 831 | |
| 18600 | 832 | lemma fs_nprod_inst: | 
| 833 |   assumes fsa: "fs TYPE('a) TYPE('x)"
 | |
| 834 |   and     fsb: "fs TYPE('b) TYPE('x)"
 | |
| 835 |   shows "fs TYPE(('a,'b) nprod) TYPE('x)"
 | |
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 836 | unfolding fs_def by (metis assms finite_Un fs_def nprod.exhaust supp_nprod) | 
| 18600 | 837 | |
| 17870 | 838 | lemma fs_list_inst: | 
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 839 |   assumes "fs TYPE('a) TYPE('x)"
 | 
| 17870 | 840 |   shows "fs TYPE('a list) TYPE('x)"
 | 
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 841 | unfolding fs_def | 
| 80171 | 842 | by (clarify, induct_tac x) (auto simp: fs1 assms supp_list_cons) | 
| 17870 | 843 | |
| 18431 | 844 | lemma fs_option_inst: | 
| 845 |   assumes fs: "fs TYPE('a) TYPE('x)"
 | |
| 846 |   shows "fs TYPE('a option) TYPE('x)"
 | |
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 847 | unfolding fs_def | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 848 | by (metis assms finite.emptyI fs1 option.exhaust supp_none supp_some) | 
| 17870 | 849 | |
| 63167 | 850 | section \<open>Lemmas about the permutation properties\<close> | 
| 17870 | 851 | (*=================================================*) | 
| 852 | ||
| 853 | lemma pt1: | |
| 854 | fixes x::"'a" | |
| 855 |   assumes a: "pt TYPE('a) TYPE('x)"
 | |
| 856 | shows "([]::'x prm)\<bullet>x = x" | |
| 857 | using a by (simp add: pt_def) | |
| 858 | ||
| 859 | lemma pt2: | |
| 860 | fixes pi1::"'x prm" | |
| 861 | and pi2::"'x prm" | |
| 862 | and x ::"'a" | |
| 863 |   assumes a: "pt TYPE('a) TYPE('x)"
 | |
| 864 | shows "(pi1@pi2)\<bullet>x = pi1\<bullet>(pi2\<bullet>x)" | |
| 865 | using a by (simp add: pt_def) | |
| 866 | ||
| 867 | lemma pt3: | |
| 868 | fixes pi1::"'x prm" | |
| 869 | and pi2::"'x prm" | |
| 870 | and x ::"'a" | |
| 871 |   assumes a: "pt TYPE('a) TYPE('x)"
 | |
| 18295 
dd50de393330
changed \<sim> of permutation equality to \<triangleq>
 urbanc parents: 
18294diff
changeset | 872 | shows "pi1 \<triangleq> pi2 \<Longrightarrow> pi1\<bullet>x = pi2\<bullet>x" | 
| 17870 | 873 | using a by (simp add: pt_def) | 
| 874 | ||
| 875 | lemma pt3_rev: | |
| 876 | fixes pi1::"'x prm" | |
| 877 | and pi2::"'x prm" | |
| 878 | and x ::"'a" | |
| 879 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 880 |   and     at: "at TYPE('x)"
 | |
| 18295 
dd50de393330
changed \<sim> of permutation equality to \<triangleq>
 urbanc parents: 
18294diff
changeset | 881 | shows "pi1 \<triangleq> pi2 \<Longrightarrow> (rev pi1)\<bullet>x = (rev pi2)\<bullet>x" | 
| 17870 | 882 | by (rule pt3[OF pt], simp add: at_prm_rev_eq[OF at]) | 
| 883 | ||
| 63167 | 884 | section \<open>composition properties\<close> | 
| 17870 | 885 | (* ============================== *) | 
| 886 | lemma cp1: | |
| 887 | fixes pi1::"'x prm" | |
| 888 | and pi2::"'y prm" | |
| 889 | and x ::"'a" | |
| 890 |   assumes cp: "cp TYPE ('a) TYPE('x) TYPE('y)"
 | |
| 891 | shows "pi1\<bullet>(pi2\<bullet>x) = (pi1\<bullet>pi2)\<bullet>(pi1\<bullet>x)" | |
| 892 | using cp by (simp add: cp_def) | |
| 893 | ||
| 894 | lemma cp_pt_inst: | |
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 895 |   assumes "pt TYPE('a) TYPE('x)"
 | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 896 |   and     "at TYPE('x)"
 | 
| 17870 | 897 |   shows "cp TYPE('a) TYPE('x) TYPE('x)"
 | 
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 898 | using assms at_ds8 cp_def pt2 pt3 by fastforce | 
| 17870 | 899 | |
| 63167 | 900 | section \<open>disjointness properties\<close> | 
| 19638 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 901 | (*=================================*) | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 902 | lemma dj_perm_forget: | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 903 | fixes pi::"'y prm" | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 904 | and x ::"'x" | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 905 |   assumes dj: "disjoint TYPE('x) TYPE('y)"
 | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 906 | shows "pi\<bullet>x=x" | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 907 | using dj by (simp_all add: disjoint_def) | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 908 | |
| 28371 
471a356fdea9
Added some more lemmas that are useful in proof of strong induction rule.
 berghofe parents: 
28322diff
changeset | 909 | lemma dj_perm_set_forget: | 
| 
471a356fdea9
Added some more lemmas that are useful in proof of strong induction rule.
 berghofe parents: 
28322diff
changeset | 910 | fixes pi::"'y prm" | 
| 
471a356fdea9
Added some more lemmas that are useful in proof of strong induction rule.
 berghofe parents: 
28322diff
changeset | 911 | and x ::"'x set" | 
| 
471a356fdea9
Added some more lemmas that are useful in proof of strong induction rule.
 berghofe parents: 
28322diff
changeset | 912 |   assumes dj: "disjoint TYPE('x) TYPE('y)"
 | 
| 44833 | 913 | shows "pi\<bullet>x=x" | 
| 45961 | 914 | using dj by (simp_all add: perm_set_def disjoint_def) | 
| 28371 
471a356fdea9
Added some more lemmas that are useful in proof of strong induction rule.
 berghofe parents: 
28322diff
changeset | 915 | |
| 19638 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 916 | lemma dj_perm_perm_forget: | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 917 | fixes pi1::"'x prm" | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 918 | and pi2::"'y prm" | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 919 |   assumes dj: "disjoint TYPE('x) TYPE('y)"
 | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 920 | shows "pi2\<bullet>pi1=pi1" | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 921 | using dj by (induct pi1, auto simp add: disjoint_def) | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 922 | |
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 923 | lemma dj_cp: | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 924 | fixes pi1::"'x prm" | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 925 | and pi2::"'y prm" | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 926 | and x ::"'a" | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 927 |   assumes cp: "cp TYPE ('a) TYPE('x) TYPE('y)"
 | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 928 |   and     dj: "disjoint TYPE('y) TYPE('x)"
 | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 929 | shows "pi1\<bullet>(pi2\<bullet>x) = (pi2)\<bullet>(pi1\<bullet>x)" | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 930 | by (simp add: cp1[OF cp] dj_perm_perm_forget[OF dj]) | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 931 | |
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 932 | lemma dj_supp: | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 933 | fixes a::"'x" | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 934 |   assumes dj: "disjoint TYPE('x) TYPE('y)"
 | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 935 |   shows "(supp a) = ({}::'y set)"
 | 
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 936 | by (simp add: supp_def dj_perm_forget[OF dj]) | 
| 19638 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 937 | |
| 19972 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 938 | lemma at_fresh_ineq: | 
| 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 939 | fixes a :: "'x" | 
| 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 940 | and b :: "'y" | 
| 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 941 |   assumes dj: "disjoint TYPE('y) TYPE('x)"
 | 
| 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 942 | shows "a\<sharp>b" | 
| 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 943 | by (simp add: fresh_def dj_supp[OF dj]) | 
| 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 944 | |
| 63167 | 945 | section \<open>permutation type instances\<close> | 
| 17870 | 946 | (* ===================================*) | 
| 947 | ||
| 44696 | 948 | lemma pt_fun_inst: | 
| 949 |   assumes pta: "pt TYPE('a) TYPE('x)"
 | |
| 950 |   and     ptb: "pt TYPE('b) TYPE('x)"
 | |
| 951 |   and     at:  "at TYPE('x)"
 | |
| 952 |   shows  "pt TYPE('a\<Rightarrow>'b) TYPE('x)"
 | |
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 953 | unfolding pt_def using assms | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 954 | by (auto simp add: perm_fun_def pt1 pt2 ptb pt3 pt3_rev) | 
| 44696 | 955 | |
| 80142 | 956 | lemma pt_bool_inst[simp]: | 
| 44696 | 957 |   shows  "pt TYPE(bool) TYPE('x)"
 | 
| 958 | by (simp add: pt_def perm_bool_def) | |
| 959 | ||
| 960 | lemma pt_set_inst: | |
| 46179 
47bcf3d5d1f0
Reverted several lemmas involving sets to the state before the
 berghofe parents: 
45961diff
changeset | 961 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | 
| 
47bcf3d5d1f0
Reverted several lemmas involving sets to the state before the
 berghofe parents: 
45961diff
changeset | 962 |   shows  "pt TYPE('a set) TYPE('x)"
 | 
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 963 | unfolding pt_def | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 964 | by(auto simp add: perm_set_def pt1[OF pt] pt2[OF pt] pt3[OF pt]) | 
| 44696 | 965 | |
| 80142 | 966 | lemma pt_unit_inst[simp]: | 
| 44833 | 967 |   shows "pt TYPE(unit) TYPE('x)"
 | 
| 44696 | 968 | by (simp add: pt_def) | 
| 969 | ||
| 970 | lemma pt_prod_inst: | |
| 971 |   assumes pta: "pt TYPE('a) TYPE('x)"
 | |
| 972 |   and     ptb: "pt TYPE('b) TYPE('x)"
 | |
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 973 | shows  "pt TYPE('a \<times> 'b) TYPE('x)"
 | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 974 | using assms pt1 pt2 pt3 | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 975 | by(auto simp add: pt_def) | 
| 44696 | 976 | |
| 17870 | 977 | lemma pt_list_nil: | 
| 978 | fixes xs :: "'a list" | |
| 979 |   assumes pt: "pt TYPE('a) TYPE ('x)"
 | |
| 980 | shows "([]::'x prm)\<bullet>xs = xs" | |
| 80171 | 981 | by (induct xs) (simp_all add: pt1[OF pt]) | 
| 17870 | 982 | |
| 983 | lemma pt_list_append: | |
| 984 | fixes pi1 :: "'x prm" | |
| 985 | and pi2 :: "'x prm" | |
| 986 | and xs :: "'a list" | |
| 987 |   assumes pt: "pt TYPE('a) TYPE ('x)"
 | |
| 988 | shows "(pi1@pi2)\<bullet>xs = pi1\<bullet>(pi2\<bullet>xs)" | |
| 80171 | 989 | by (induct xs) (simp_all add: pt2[OF pt]) | 
| 17870 | 990 | |
| 991 | lemma pt_list_prm_eq: | |
| 992 | fixes pi1 :: "'x prm" | |
| 993 | and pi2 :: "'x prm" | |
| 994 | and xs :: "'a list" | |
| 995 |   assumes pt: "pt TYPE('a) TYPE ('x)"
 | |
| 18295 
dd50de393330
changed \<sim> of permutation equality to \<triangleq>
 urbanc parents: 
18294diff
changeset | 996 | shows "pi1 \<triangleq> pi2 \<Longrightarrow> pi1\<bullet>xs = pi2\<bullet>xs" | 
| 80171 | 997 | by (induct xs) (simp_all add: pt3[OF pt]) | 
| 17870 | 998 | |
| 999 | lemma pt_list_inst: | |
| 1000 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1001 |   shows  "pt TYPE('a list) TYPE('x)"
 | |
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1002 | by (simp add: pt pt_def pt_list_append pt_list_nil pt_list_prm_eq) | 
| 17870 | 1003 | |
| 1004 | lemma pt_option_inst: | |
| 1005 |   assumes pta: "pt TYPE('a) TYPE('x)"
 | |
| 1006 |   shows  "pt TYPE('a option) TYPE('x)"
 | |
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1007 | proof - | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1008 |   have "([]::('x \<times> _) list) \<bullet> x = x" for x :: "'a option"
 | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1009 | by (metis assms none_eqvt not_None_eq pt1 some_eqvt) | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1010 | moreover have "(pi1 @ pi2) \<bullet> x = pi1 \<bullet> pi2 \<bullet> x" | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1011 |     for pi1 pi2 :: "('x \<times> 'x) list" and x :: "'a option"
 | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1012 | by (metis assms none_eqvt option.collapse pt2 some_eqvt) | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1013 | moreover have "pi1 \<bullet> x = pi2 \<bullet> x" | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1014 |     if "pi1 \<triangleq> pi2" for pi1 pi2 :: "('x \<times> 'x) list" and x :: "'a option"
 | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1015 | using that pt3[OF pta] by (metis none_eqvt not_Some_eq some_eqvt) | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1016 | ultimately show ?thesis | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1017 | by (auto simp add: pt_def) | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1018 | qed | 
| 17870 | 1019 | |
| 1020 | lemma pt_noption_inst: | |
| 1021 |   assumes pta: "pt TYPE('a) TYPE('x)"
 | |
| 18579 
002d371401f5
changed the name of the type "nOption" to "noption".
 urbanc parents: 
18578diff
changeset | 1022 |   shows  "pt TYPE('a noption) TYPE('x)"
 | 
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1023 | proof - | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1024 |   have "([]::('x \<times> _) list) \<bullet> x = x" for x :: "'a noption"
 | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1025 | by (metis assms nnone_eqvt noption.exhaust nsome_eqvt pt1) | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1026 | moreover have "(pi1 @ pi2) \<bullet> x = pi1 \<bullet> pi2 \<bullet> x" | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1027 |     for pi1 pi2 :: "('x \<times> 'x) list" and x :: "'a noption"
 | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1028 | using pt2[OF pta] | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1029 | by (metis nnone_eqvt noption.exhaust nsome_eqvt) | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1030 | moreover have "pi1 \<bullet> x = pi2 \<bullet> x" | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1031 | if "pi1 \<triangleq> pi2" | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1032 |     for pi1 pi2 :: "('x \<times> 'x) list"
 | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1033 | and x :: "'a noption" | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1034 | using that pt3[OF pta] by (metis nnone_eqvt noption.exhaust nsome_eqvt) | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1035 | ultimately show ?thesis | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1036 | by (auto simp add: pt_def) | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1037 | qed | 
| 17870 | 1038 | |
| 44696 | 1039 | lemma pt_nprod_inst: | 
| 1040 |   assumes pta: "pt TYPE('a) TYPE('x)"
 | |
| 1041 |   and     ptb: "pt TYPE('b) TYPE('x)"
 | |
| 1042 |   shows  "pt TYPE(('a,'b) nprod) TYPE('x)"
 | |
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1043 | proof - | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1044 |   have "([]::('x \<times> _) list) \<bullet> x = x"
 | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1045 |     for x :: "('a, 'b) nprod"
 | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1046 | by (metis assms(1) nprod.exhaust perm_nprod.simps pt1 ptb) | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1047 | moreover have "(pi1 @ pi2) \<bullet> x = pi1 \<bullet> pi2 \<bullet> x" | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1048 |     for pi1 pi2 :: "('x \<times> 'x) list" and x :: "('a, 'b) nprod"
 | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1049 | using pt2[OF pta] pt2[OF ptb] | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1050 | by (metis nprod.exhaust perm_nprod.simps) | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1051 | moreover have "pi1 \<bullet> x = pi2 \<bullet> x" | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1052 |     if "pi1 \<triangleq> pi2" for pi1 pi2 :: "('x \<times> 'x) list" and x :: "('a, 'b) nprod"
 | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1053 | using that pt3[OF pta] pt3[OF ptb] by (smt (verit) nprod.exhaust perm_nprod.simps) | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1054 | ultimately show ?thesis | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1055 | by (auto simp add: pt_def) | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1056 | qed | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1057 | |
| 24544 | 1058 | |
| 63167 | 1059 | section \<open>further lemmas for permutation types\<close> | 
| 17870 | 1060 | (*==============================================*) | 
| 1061 | ||
| 1062 | lemma pt_rev_pi: | |
| 1063 | fixes pi :: "'x prm" | |
| 1064 | and x :: "'a" | |
| 1065 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1066 |   and     at: "at TYPE('x)"
 | |
| 1067 | shows "(rev pi)\<bullet>(pi\<bullet>x) = x" | |
| 1068 | proof - | |
| 18295 
dd50de393330
changed \<sim> of permutation equality to \<triangleq>
 urbanc parents: 
18294diff
changeset | 1069 | have "((rev pi)@pi) \<triangleq> ([]::'x prm)" by (simp add: at_ds7[OF at]) | 
| 17870 | 1070 | hence "((rev pi)@pi)\<bullet>(x::'a) = ([]::'x prm)\<bullet>x" by (simp add: pt3[OF pt]) | 
| 1071 | thus ?thesis by (simp add: pt1[OF pt] pt2[OF pt]) | |
| 1072 | qed | |
| 1073 | ||
| 1074 | lemma pt_pi_rev: | |
| 1075 | fixes pi :: "'x prm" | |
| 1076 | and x :: "'a" | |
| 1077 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1078 |   and     at: "at TYPE('x)"
 | |
| 1079 | shows "pi\<bullet>((rev pi)\<bullet>x) = x" | |
| 1080 | by (simp add: pt_rev_pi[OF pt, OF at,of "rev pi" "x",simplified]) | |
| 1081 | ||
| 1082 | lemma pt_bij1: | |
| 1083 | fixes pi :: "'x prm" | |
| 1084 | and x :: "'a" | |
| 1085 | and y :: "'a" | |
| 1086 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1087 |   and     at: "at TYPE('x)"
 | |
| 1088 | and a: "(pi\<bullet>x) = y" | |
| 1089 | shows "x=(rev pi)\<bullet>y" | |
| 1090 | proof - | |
| 1091 | from a have "y=(pi\<bullet>x)" by (rule sym) | |
| 1092 | thus ?thesis by (simp only: pt_rev_pi[OF pt, OF at]) | |
| 1093 | qed | |
| 1094 | ||
| 1095 | lemma pt_bij2: | |
| 1096 | fixes pi :: "'x prm" | |
| 1097 | and x :: "'a" | |
| 1098 | and y :: "'a" | |
| 1099 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1100 |   and     at: "at TYPE('x)"
 | |
| 1101 | and a: "x = (rev pi)\<bullet>y" | |
| 1102 | shows "(pi\<bullet>x)=y" | |
| 1103 | using a by (simp add: pt_pi_rev[OF pt, OF at]) | |
| 1104 | ||
| 1105 | lemma pt_bij: | |
| 1106 | fixes pi :: "'x prm" | |
| 1107 | and x :: "'a" | |
| 1108 | and y :: "'a" | |
| 1109 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1110 |   and     at: "at TYPE('x)"
 | |
| 1111 | shows "(pi\<bullet>x = pi\<bullet>y) = (x=y)" | |
| 1112 | proof | |
| 1113 | assume "pi\<bullet>x = pi\<bullet>y" | |
| 1114 | hence "x=(rev pi)\<bullet>(pi\<bullet>y)" by (rule pt_bij1[OF pt, OF at]) | |
| 1115 | thus "x=y" by (simp only: pt_rev_pi[OF pt, OF at]) | |
| 1116 | next | |
| 1117 | assume "x=y" | |
| 1118 | thus "pi\<bullet>x = pi\<bullet>y" by simp | |
| 1119 | qed | |
| 1120 | ||
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 1121 | lemma pt_eq_eqvt: | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 1122 | fixes pi :: "'x prm" | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 1123 | and x :: "'a" | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 1124 | and y :: "'a" | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 1125 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 1126 |   and     at: "at TYPE('x)"
 | 
| 22829 
f1db55c7534d
tuned some proofs and changed variable names in some definitions of Nominal.thy
 urbanc parents: 
22808diff
changeset | 1127 | shows "pi\<bullet>(x=y) = (pi\<bullet>x = pi\<bullet>y)" | 
| 30990 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 1128 | using pt at | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 1129 | by (auto simp add: pt_bij perm_bool) | 
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 1130 | |
| 17870 | 1131 | lemma pt_bij3: | 
| 1132 | fixes pi :: "'x prm" | |
| 1133 | and x :: "'a" | |
| 1134 | and y :: "'a" | |
| 1135 | assumes a: "x=y" | |
| 1136 | shows "(pi\<bullet>x = pi\<bullet>y)" | |
| 30990 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 1137 | using a by simp | 
| 17870 | 1138 | |
| 1139 | lemma pt_bij4: | |
| 1140 | fixes pi :: "'x prm" | |
| 1141 | and x :: "'a" | |
| 1142 | and y :: "'a" | |
| 1143 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1144 |   and     at: "at TYPE('x)"
 | |
| 1145 | and a: "pi\<bullet>x = pi\<bullet>y" | |
| 1146 | shows "x = y" | |
| 30990 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 1147 | using a by (simp add: pt_bij[OF pt, OF at]) | 
| 17870 | 1148 | |
| 1149 | lemma pt_swap_bij: | |
| 1150 | fixes a :: "'x" | |
| 1151 | and b :: "'x" | |
| 1152 | and x :: "'a" | |
| 1153 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1154 |   and     at: "at TYPE('x)"
 | |
| 1155 | shows "[(a,b)]\<bullet>([(a,b)]\<bullet>x) = x" | |
| 1156 | by (rule pt_bij2[OF pt, OF at], simp) | |
| 1157 | ||
| 19164 | 1158 | lemma pt_swap_bij': | 
| 1159 | fixes a :: "'x" | |
| 1160 | and b :: "'x" | |
| 1161 | and x :: "'a" | |
| 1162 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1163 |   and     at: "at TYPE('x)"
 | |
| 1164 | shows "[(a,b)]\<bullet>([(b,a)]\<bullet>x) = x" | |
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1165 | by (metis assms at_ds5 pt_def pt_swap_bij) | 
| 19164 | 1166 | |
| 24571 | 1167 | lemma pt_swap_bij'': | 
| 1168 | fixes a :: "'x" | |
| 1169 | and x :: "'a" | |
| 1170 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1171 |   and     at: "at TYPE('x)"
 | |
| 1172 | shows "[(a,a)]\<bullet>x = x" | |
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1173 | by (metis assms at_ds1 pt_def) | 
| 24571 | 1174 | |
| 26806 | 1175 | lemma supp_singleton: | 
| 46179 
47bcf3d5d1f0
Reverted several lemmas involving sets to the state before the
 berghofe parents: 
45961diff
changeset | 1176 |   shows "supp {x} = supp x"
 | 
| 
47bcf3d5d1f0
Reverted several lemmas involving sets to the state before the
 berghofe parents: 
45961diff
changeset | 1177 | by (force simp add: supp_def perm_set_def) | 
| 26806 | 1178 | |
| 1179 | lemma fresh_singleton: | |
| 46179 
47bcf3d5d1f0
Reverted several lemmas involving sets to the state before the
 berghofe parents: 
45961diff
changeset | 1180 |   shows "a\<sharp>{x} = a\<sharp>x"
 | 
| 
47bcf3d5d1f0
Reverted several lemmas involving sets to the state before the
 berghofe parents: 
45961diff
changeset | 1181 | by (simp add: fresh_def supp_singleton) | 
| 26806 | 1182 | |
| 17870 | 1183 | lemma pt_set_bij1: | 
| 1184 | fixes pi :: "'x prm" | |
| 1185 | and x :: "'a" | |
| 1186 | and X :: "'a set" | |
| 1187 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1188 |   and     at: "at TYPE('x)"
 | |
| 1189 | shows "((pi\<bullet>x)\<in>X) = (x\<in>((rev pi)\<bullet>X))" | |
| 46179 
47bcf3d5d1f0
Reverted several lemmas involving sets to the state before the
 berghofe parents: 
45961diff
changeset | 1190 | by (force simp add: perm_set_def pt_rev_pi[OF pt, OF at] pt_pi_rev[OF pt, OF at]) | 
| 17870 | 1191 | |
| 1192 | lemma pt_set_bij1a: | |
| 1193 | fixes pi :: "'x prm" | |
| 1194 | and x :: "'a" | |
| 1195 | and X :: "'a set" | |
| 1196 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1197 |   and     at: "at TYPE('x)"
 | |
| 1198 | shows "(x\<in>(pi\<bullet>X)) = (((rev pi)\<bullet>x)\<in>X)" | |
| 46179 
47bcf3d5d1f0
Reverted several lemmas involving sets to the state before the
 berghofe parents: 
45961diff
changeset | 1199 | by (force simp add: perm_set_def pt_rev_pi[OF pt, OF at] pt_pi_rev[OF pt, OF at]) | 
| 17870 | 1200 | |
| 1201 | lemma pt_set_bij: | |
| 1202 | fixes pi :: "'x prm" | |
| 1203 | and x :: "'a" | |
| 1204 | and X :: "'a set" | |
| 1205 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1206 |   and     at: "at TYPE('x)"
 | |
| 1207 | shows "((pi\<bullet>x)\<in>(pi\<bullet>X)) = (x\<in>X)" | |
| 46179 
47bcf3d5d1f0
Reverted several lemmas involving sets to the state before the
 berghofe parents: 
45961diff
changeset | 1208 | by (simp add: perm_set_def pt_bij[OF pt, OF at]) | 
| 17870 | 1209 | |
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 1210 | lemma pt_in_eqvt: | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 1211 | fixes pi :: "'x prm" | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 1212 | and x :: "'a" | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 1213 | and X :: "'a set" | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 1214 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 1215 |   and     at: "at TYPE('x)"
 | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 1216 | shows "pi\<bullet>(x\<in>X)=((pi\<bullet>x)\<in>(pi\<bullet>X))" | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 1217 | using assms | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 1218 | by (auto simp add: pt_set_bij perm_bool) | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 1219 | |
| 17870 | 1220 | lemma pt_set_bij2: | 
| 1221 | fixes pi :: "'x prm" | |
| 1222 | and x :: "'a" | |
| 1223 | and X :: "'a set" | |
| 1224 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1225 |   and     at: "at TYPE('x)"
 | |
| 1226 | and a: "x\<in>X" | |
| 1227 | shows "(pi\<bullet>x)\<in>(pi\<bullet>X)" | |
| 1228 | using a by (simp add: pt_set_bij[OF pt, OF at]) | |
| 1229 | ||
| 18264 | 1230 | lemma pt_set_bij2a: | 
| 1231 | fixes pi :: "'x prm" | |
| 1232 | and x :: "'a" | |
| 1233 | and X :: "'a set" | |
| 1234 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1235 |   and     at: "at TYPE('x)"
 | |
| 1236 | and a: "x\<in>((rev pi)\<bullet>X)" | |
| 1237 | shows "(pi\<bullet>x)\<in>X" | |
| 1238 | using a by (simp add: pt_set_bij1[OF pt, OF at]) | |
| 1239 | ||
| 18159 
08282ca0402e
added a few equivariance lemmas (they need to be automated
 urbanc parents: 
18068diff
changeset | 1240 | lemma pt_subseteq_eqvt: | 
| 
08282ca0402e
added a few equivariance lemmas (they need to be automated
 urbanc parents: 
18068diff
changeset | 1241 | fixes pi :: "'x prm" | 
| 
08282ca0402e
added a few equivariance lemmas (they need to be automated
 urbanc parents: 
18068diff
changeset | 1242 | and Y :: "'a set" | 
| 
08282ca0402e
added a few equivariance lemmas (they need to be automated
 urbanc parents: 
18068diff
changeset | 1243 | and X :: "'a set" | 
| 
08282ca0402e
added a few equivariance lemmas (they need to be automated
 urbanc parents: 
18068diff
changeset | 1244 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | 
| 
08282ca0402e
added a few equivariance lemmas (they need to be automated
 urbanc parents: 
18068diff
changeset | 1245 |   and     at: "at TYPE('x)"
 | 
| 26090 | 1246 | shows "(pi\<bullet>(X\<subseteq>Y)) = ((pi\<bullet>X)\<subseteq>(pi\<bullet>Y))" | 
| 46179 
47bcf3d5d1f0
Reverted several lemmas involving sets to the state before the
 berghofe parents: 
45961diff
changeset | 1247 | by (auto simp add: perm_set_def perm_bool pt_bij[OF pt, OF at]) | 
| 18159 
08282ca0402e
added a few equivariance lemmas (they need to be automated
 urbanc parents: 
18068diff
changeset | 1248 | |
| 19772 
45897b49fdd2
added some further lemmas that deal with permutations and set-operators
 urbanc parents: 
19771diff
changeset | 1249 | lemma pt_set_diff_eqvt: | 
| 
45897b49fdd2
added some further lemmas that deal with permutations and set-operators
 urbanc parents: 
19771diff
changeset | 1250 | fixes X::"'a set" | 
| 
45897b49fdd2
added some further lemmas that deal with permutations and set-operators
 urbanc parents: 
19771diff
changeset | 1251 | and Y::"'a set" | 
| 
45897b49fdd2
added some further lemmas that deal with permutations and set-operators
 urbanc parents: 
19771diff
changeset | 1252 | and pi::"'x prm" | 
| 
45897b49fdd2
added some further lemmas that deal with permutations and set-operators
 urbanc parents: 
19771diff
changeset | 1253 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | 
| 
45897b49fdd2
added some further lemmas that deal with permutations and set-operators
 urbanc parents: 
19771diff
changeset | 1254 |   and     at: "at TYPE('x)"
 | 
| 22829 
f1db55c7534d
tuned some proofs and changed variable names in some definitions of Nominal.thy
 urbanc parents: 
22808diff
changeset | 1255 | shows "pi\<bullet>(X - Y) = (pi\<bullet>X) - (pi\<bullet>Y)" | 
| 46179 
47bcf3d5d1f0
Reverted several lemmas involving sets to the state before the
 berghofe parents: 
45961diff
changeset | 1256 | by (auto simp add: perm_set_def pt_bij[OF pt, OF at]) | 
| 19772 
45897b49fdd2
added some further lemmas that deal with permutations and set-operators
 urbanc parents: 
19771diff
changeset | 1257 | |
| 22829 
f1db55c7534d
tuned some proofs and changed variable names in some definitions of Nominal.thy
 urbanc parents: 
22808diff
changeset | 1258 | lemma pt_Collect_eqvt: | 
| 
f1db55c7534d
tuned some proofs and changed variable names in some definitions of Nominal.thy
 urbanc parents: 
22808diff
changeset | 1259 | fixes pi::"'x prm" | 
| 
f1db55c7534d
tuned some proofs and changed variable names in some definitions of Nominal.thy
 urbanc parents: 
22808diff
changeset | 1260 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | 
| 
f1db55c7534d
tuned some proofs and changed variable names in some definitions of Nominal.thy
 urbanc parents: 
22808diff
changeset | 1261 |   and     at: "at TYPE('x)"
 | 
| 
f1db55c7534d
tuned some proofs and changed variable names in some definitions of Nominal.thy
 urbanc parents: 
22808diff
changeset | 1262 |   shows "pi\<bullet>{x::'a. P x} = {x. P ((rev pi)\<bullet>x)}"
 | 
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1263 | proof - | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1264 | have "\<exists>y. x = pi \<bullet> y \<and> P y" | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1265 | if "P (rev pi \<bullet> x)" for x | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1266 | using that by (metis at pt pt_pi_rev) | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1267 | then show ?thesis | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1268 | by (auto simp add: perm_set_def pt_rev_pi [OF assms]) | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1269 | qed | 
| 19772 
45897b49fdd2
added some further lemmas that deal with permutations and set-operators
 urbanc parents: 
19771diff
changeset | 1270 | |
| 67443 
3abf6a722518
standardized towards new-style formal comments: isabelle update_comments;
 wenzelm parents: 
66453diff
changeset | 1271 | \<comment> \<open>some helper lemmas for the pt_perm_supp_ineq lemma\<close> | 
| 17870 | 1272 | lemma Collect_permI: | 
| 1273 | fixes pi :: "'x prm" | |
| 1274 | and x :: "'a" | |
| 1275 | assumes a: "\<forall>x. (P1 x = P2 x)" | |
| 1276 |   shows "{pi\<bullet>x| x. P1 x} = {pi\<bullet>x| x. P2 x}"
 | |
| 1277 | using a by force | |
| 1278 | ||
| 1279 | lemma Infinite_cong: | |
| 1280 | assumes a: "X = Y" | |
| 1281 | shows "infinite X = infinite Y" | |
| 1282 | using a by (simp) | |
| 1283 | ||
| 1284 | lemma pt_set_eq_ineq: | |
| 1285 | fixes pi :: "'y prm" | |
| 1286 |   assumes pt: "pt TYPE('x) TYPE('y)"
 | |
| 1287 |   and     at: "at TYPE('y)"
 | |
| 1288 |   shows "{pi\<bullet>x| x::'x. P x} = {x::'x. P ((rev pi)\<bullet>x)}"
 | |
| 1289 | by (force simp only: pt_rev_pi[OF pt, OF at] pt_pi_rev[OF pt, OF at]) | |
| 1290 | ||
| 1291 | lemma pt_inject_on_ineq: | |
| 1292 | fixes X :: "'y set" | |
| 1293 | and pi :: "'x prm" | |
| 1294 |   assumes pt: "pt TYPE('y) TYPE('x)"
 | |
| 1295 |   and     at: "at TYPE('x)"
 | |
| 1296 | shows "inj_on (perm pi) X" | |
| 1297 | proof (unfold inj_on_def, intro strip) | |
| 1298 | fix x::"'y" and y::"'y" | |
| 1299 | assume "pi\<bullet>x = pi\<bullet>y" | |
| 1300 | thus "x=y" by (simp add: pt_bij[OF pt, OF at]) | |
| 1301 | qed | |
| 1302 | ||
| 1303 | lemma pt_set_finite_ineq: | |
| 1304 | fixes X :: "'x set" | |
| 1305 | and pi :: "'y prm" | |
| 1306 |   assumes pt: "pt TYPE('x) TYPE('y)"
 | |
| 1307 |   and     at: "at TYPE('y)"
 | |
| 1308 | shows "finite (pi\<bullet>X) = finite X" | |
| 1309 | proof - | |
| 46179 
47bcf3d5d1f0
Reverted several lemmas involving sets to the state before the
 berghofe parents: 
45961diff
changeset | 1310 | have image: "(pi\<bullet>X) = (perm pi ` X)" by (force simp only: perm_set_def) | 
| 17870 | 1311 | show ?thesis | 
| 1312 | proof (rule iffI) | |
| 1313 | assume "finite (pi\<bullet>X)" | |
| 1314 | hence "finite (perm pi ` X)" using image by (simp) | |
| 1315 | thus "finite X" using pt_inject_on_ineq[OF pt, OF at] by (rule finite_imageD) | |
| 1316 | next | |
| 1317 | assume "finite X" | |
| 1318 | hence "finite (perm pi ` X)" by (rule finite_imageI) | |
| 1319 | thus "finite (pi\<bullet>X)" using image by (simp) | |
| 1320 | qed | |
| 1321 | qed | |
| 1322 | ||
| 1323 | lemma pt_set_infinite_ineq: | |
| 1324 | fixes X :: "'x set" | |
| 1325 | and pi :: "'y prm" | |
| 1326 |   assumes pt: "pt TYPE('x) TYPE('y)"
 | |
| 1327 |   and     at: "at TYPE('y)"
 | |
| 1328 | shows "infinite (pi\<bullet>X) = infinite X" | |
| 1329 | using pt at by (simp add: pt_set_finite_ineq) | |
| 1330 | ||
| 1331 | lemma pt_perm_supp_ineq: | |
| 1332 | fixes pi :: "'x prm" | |
| 1333 | and x :: "'a" | |
| 1334 |   assumes pta: "pt TYPE('a) TYPE('x)"
 | |
| 1335 |   and     ptb: "pt TYPE('y) TYPE('x)"
 | |
| 1336 |   and     at:  "at TYPE('x)"
 | |
| 1337 |   and     cp:  "cp TYPE('a) TYPE('x) TYPE('y)"
 | |
| 1338 | shows "(pi\<bullet>((supp x)::'y set)) = supp (pi\<bullet>x)" (is "?LHS = ?RHS") | |
| 1339 | proof - | |
| 46179 
47bcf3d5d1f0
Reverted several lemmas involving sets to the state before the
 berghofe parents: 
45961diff
changeset | 1340 |   have "?LHS = {pi\<bullet>a | a. infinite {b. [(a,b)]\<bullet>x \<noteq> x}}" by (simp add: supp_def perm_set_def)
 | 
| 17870 | 1341 |   also have "\<dots> = {pi\<bullet>a | a. infinite {pi\<bullet>b | b. [(a,b)]\<bullet>x \<noteq> x}}" 
 | 
| 1342 | proof (rule Collect_permI, rule allI, rule iffI) | |
| 1343 | fix a | |
| 1344 |     assume "infinite {b::'y. [(a,b)]\<bullet>x  \<noteq> x}"
 | |
| 1345 |     hence "infinite (pi\<bullet>{b::'y. [(a,b)]\<bullet>x \<noteq> x})" by (simp add: pt_set_infinite_ineq[OF ptb, OF at])
 | |
| 46179 
47bcf3d5d1f0
Reverted several lemmas involving sets to the state before the
 berghofe parents: 
45961diff
changeset | 1346 |     thus "infinite {pi\<bullet>b |b::'y. [(a,b)]\<bullet>x  \<noteq> x}" by (simp add: perm_set_def)
 | 
| 17870 | 1347 | next | 
| 1348 | fix a | |
| 1349 |     assume "infinite {pi\<bullet>b |b::'y. [(a,b)]\<bullet>x \<noteq> x}"
 | |
| 46179 
47bcf3d5d1f0
Reverted several lemmas involving sets to the state before the
 berghofe parents: 
45961diff
changeset | 1350 |     hence "infinite (pi\<bullet>{b::'y. [(a,b)]\<bullet>x \<noteq> x})" by (simp add: perm_set_def)
 | 
| 17870 | 1351 |     thus "infinite {b::'y. [(a,b)]\<bullet>x  \<noteq> x}" 
 | 
| 1352 | by (simp add: pt_set_infinite_ineq[OF ptb, OF at]) | |
| 1353 | qed | |
| 1354 |   also have "\<dots> = {a. infinite {b::'y. [((rev pi)\<bullet>a,(rev pi)\<bullet>b)]\<bullet>x \<noteq> x}}" 
 | |
| 1355 | by (simp add: pt_set_eq_ineq[OF ptb, OF at]) | |
| 1356 |   also have "\<dots> = {a. infinite {b. pi\<bullet>([((rev pi)\<bullet>a,(rev pi)\<bullet>b)]\<bullet>x) \<noteq> (pi\<bullet>x)}}"
 | |
| 1357 | by (simp add: pt_bij[OF pta, OF at]) | |
| 1358 |   also have "\<dots> = {a. infinite {b. [(a,b)]\<bullet>(pi\<bullet>x) \<noteq> (pi\<bullet>x)}}"
 | |
| 1359 | proof (rule Collect_cong, rule Infinite_cong, rule Collect_cong) | |
| 1360 | fix a::"'y" and b::"'y" | |
| 1361 | have "pi\<bullet>(([((rev pi)\<bullet>a,(rev pi)\<bullet>b)])\<bullet>x) = [(a,b)]\<bullet>(pi\<bullet>x)" | |
| 1362 | by (simp add: cp1[OF cp] pt_pi_rev[OF ptb, OF at]) | |
| 1363 | thus "(pi\<bullet>([((rev pi)\<bullet>a,(rev pi)\<bullet>b)]\<bullet>x) \<noteq> pi\<bullet>x) = ([(a,b)]\<bullet>(pi\<bullet>x) \<noteq> pi\<bullet>x)" by simp | |
| 1364 | qed | |
| 1365 | finally show "?LHS = ?RHS" by (simp add: supp_def) | |
| 1366 | qed | |
| 1367 | ||
| 1368 | lemma pt_perm_supp: | |
| 1369 | fixes pi :: "'x prm" | |
| 1370 | and x :: "'a" | |
| 1371 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1372 |   and     at: "at TYPE('x)"
 | |
| 1373 | shows "(pi\<bullet>((supp x)::'x set)) = supp (pi\<bullet>x)" | |
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1374 | by (rule pt_perm_supp_ineq) (auto simp: assms at_pt_inst cp_pt_inst) | 
| 17870 | 1375 | |
| 1376 | lemma pt_supp_finite_pi: | |
| 1377 | fixes pi :: "'x prm" | |
| 1378 | and x :: "'a" | |
| 1379 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1380 |   and     at: "at TYPE('x)"
 | |
| 1381 | and f: "finite ((supp x)::'x set)" | |
| 1382 | shows "finite ((supp (pi\<bullet>x))::'x set)" | |
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1383 | by (metis at at_pt_inst f pt pt_perm_supp pt_set_finite_ineq) | 
| 17870 | 1384 | |
| 1385 | lemma pt_fresh_left_ineq: | |
| 1386 | fixes pi :: "'x prm" | |
| 1387 | and x :: "'a" | |
| 1388 | and a :: "'y" | |
| 1389 |   assumes pta: "pt TYPE('a) TYPE('x)"
 | |
| 1390 |   and     ptb: "pt TYPE('y) TYPE('x)"
 | |
| 1391 |   and     at:  "at TYPE('x)"
 | |
| 1392 |   and     cp:  "cp TYPE('a) TYPE('x) TYPE('y)"
 | |
| 1393 | shows "a\<sharp>(pi\<bullet>x) = ((rev pi)\<bullet>a)\<sharp>x" | |
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1394 | using pt_perm_supp_ineq[OF pta, OF ptb, OF at, OF cp] pt_set_bij1[OF ptb, OF at] | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1395 | by (simp add: fresh_def) | 
| 17870 | 1396 | |
| 1397 | lemma pt_fresh_right_ineq: | |
| 1398 | fixes pi :: "'x prm" | |
| 1399 | and x :: "'a" | |
| 1400 | and a :: "'y" | |
| 1401 |   assumes pta: "pt TYPE('a) TYPE('x)"
 | |
| 1402 |   and     ptb: "pt TYPE('y) TYPE('x)"
 | |
| 1403 |   and     at:  "at TYPE('x)"
 | |
| 1404 |   and     cp:  "cp TYPE('a) TYPE('x) TYPE('y)"
 | |
| 1405 | shows "(pi\<bullet>a)\<sharp>x = a\<sharp>((rev pi)\<bullet>x)" | |
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1406 | by (simp add: assms pt_fresh_left_ineq) | 
| 17870 | 1407 | |
| 1408 | lemma pt_fresh_bij_ineq: | |
| 1409 | fixes pi :: "'x prm" | |
| 1410 | and x :: "'a" | |
| 1411 | and a :: "'y" | |
| 1412 |   assumes pta: "pt TYPE('a) TYPE('x)"
 | |
| 1413 |   and     ptb: "pt TYPE('y) TYPE('x)"
 | |
| 1414 |   and     at:  "at TYPE('x)"
 | |
| 1415 |   and     cp:  "cp TYPE('a) TYPE('x) TYPE('y)"
 | |
| 1416 | shows "(pi\<bullet>a)\<sharp>(pi\<bullet>x) = a\<sharp>x" | |
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1417 | using assms pt_bij1 pt_fresh_right_ineq by fastforce | 
| 17870 | 1418 | |
| 1419 | lemma pt_fresh_left: | |
| 1420 | fixes pi :: "'x prm" | |
| 1421 | and x :: "'a" | |
| 1422 | and a :: "'x" | |
| 1423 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1424 |   and     at: "at TYPE('x)"
 | |
| 1425 | shows "a\<sharp>(pi\<bullet>x) = ((rev pi)\<bullet>a)\<sharp>x" | |
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1426 | by (simp add: assms at_pt_inst cp_pt_inst pt_fresh_left_ineq) | 
| 17870 | 1427 | |
| 1428 | lemma pt_fresh_right: | |
| 1429 | fixes pi :: "'x prm" | |
| 1430 | and x :: "'a" | |
| 1431 | and a :: "'x" | |
| 1432 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1433 |   and     at: "at TYPE('x)"
 | |
| 1434 | shows "(pi\<bullet>a)\<sharp>x = a\<sharp>((rev pi)\<bullet>x)" | |
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1435 | by (simp add: assms at_pt_inst cp_pt_inst pt_fresh_right_ineq) | 
| 17870 | 1436 | |
| 1437 | lemma pt_fresh_bij: | |
| 1438 | fixes pi :: "'x prm" | |
| 1439 | and x :: "'a" | |
| 1440 | and a :: "'x" | |
| 1441 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1442 |   and     at: "at TYPE('x)"
 | |
| 1443 | shows "(pi\<bullet>a)\<sharp>(pi\<bullet>x) = a\<sharp>x" | |
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1444 | by (metis assms pt_bij1 pt_fresh_right) | 
| 17870 | 1445 | |
| 1446 | lemma pt_fresh_bij1: | |
| 1447 | fixes pi :: "'x prm" | |
| 1448 | and x :: "'a" | |
| 1449 | and a :: "'x" | |
| 1450 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1451 |   and     at: "at TYPE('x)"
 | |
| 1452 | and a: "a\<sharp>x" | |
| 1453 | shows "(pi\<bullet>a)\<sharp>(pi\<bullet>x)" | |
| 1454 | using a by (simp add: pt_fresh_bij[OF pt, OF at]) | |
| 1455 | ||
| 19566 | 1456 | lemma pt_fresh_bij2: | 
| 1457 | fixes pi :: "'x prm" | |
| 1458 | and x :: "'a" | |
| 1459 | and a :: "'x" | |
| 1460 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1461 |   and     at: "at TYPE('x)"
 | |
| 1462 | and a: "(pi\<bullet>a)\<sharp>(pi\<bullet>x)" | |
| 1463 | shows "a\<sharp>x" | |
| 1464 | using a by (simp add: pt_fresh_bij[OF pt, OF at]) | |
| 1465 | ||
| 19972 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 1466 | lemma pt_fresh_eqvt: | 
| 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 1467 | fixes pi :: "'x prm" | 
| 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 1468 | and x :: "'a" | 
| 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 1469 | and a :: "'x" | 
| 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 1470 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | 
| 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 1471 |   and     at: "at TYPE('x)"
 | 
| 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 1472 | shows "pi\<bullet>(a\<sharp>x) = (pi\<bullet>a)\<sharp>(pi\<bullet>x)" | 
| 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 1473 | by (simp add: perm_bool pt_fresh_bij[OF pt, OF at]) | 
| 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 1474 | |
| 17870 | 1475 | lemma pt_perm_fresh1: | 
| 1476 | fixes a :: "'x" | |
| 1477 | and b :: "'x" | |
| 1478 | and x :: "'a" | |
| 1479 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1480 |   and     at: "at TYPE ('x)"
 | |
| 1481 | and a1: "\<not>(a\<sharp>x)" | |
| 1482 | and a2: "b\<sharp>x" | |
| 1483 | shows "[(a,b)]\<bullet>x \<noteq> x" | |
| 1484 | proof | |
| 1485 | assume neg: "[(a,b)]\<bullet>x = x" | |
| 1486 | from a1 have a1':"a\<in>(supp x)" by (simp add: fresh_def) | |
| 1487 | from a2 have a2':"b\<notin>(supp x)" by (simp add: fresh_def) | |
| 1488 | from a1' a2' have a3: "a\<noteq>b" by force | |
| 1489 | from a1' have "([(a,b)]\<bullet>a)\<in>([(a,b)]\<bullet>(supp x))" | |
| 1490 | by (simp only: pt_set_bij[OF at_pt_inst[OF at], OF at]) | |
| 19325 | 1491 | hence "b\<in>([(a,b)]\<bullet>(supp x))" by (simp add: at_calc[OF at]) | 
| 17870 | 1492 | hence "b\<in>(supp ([(a,b)]\<bullet>x))" by (simp add: pt_perm_supp[OF pt,OF at]) | 
| 1493 | with a2' neg show False by simp | |
| 1494 | qed | |
| 1495 | ||
| 19638 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 1496 | (* the next two lemmas are needed in the proof *) | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 1497 | (* of the structural induction principle *) | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 1498 | lemma pt_fresh_aux: | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 1499 | fixes a::"'x" | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 1500 | and b::"'x" | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 1501 | and c::"'x" | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 1502 | and x::"'a" | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 1503 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 1504 |   and     at: "at TYPE ('x)"
 | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 1505 | assumes a1: "c\<noteq>a" and a2: "a\<sharp>x" and a3: "c\<sharp>x" | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 1506 | shows "c\<sharp>([(a,b)]\<bullet>x)" | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 1507 | using a1 a2 a3 by (simp_all add: pt_fresh_left[OF pt, OF at] at_calc[OF at]) | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 1508 | |
| 22786 | 1509 | lemma pt_fresh_perm_app: | 
| 1510 | fixes pi :: "'x prm" | |
| 1511 | and a :: "'x" | |
| 1512 | and x :: "'y" | |
| 1513 |   assumes pt: "pt TYPE('y) TYPE('x)"
 | |
| 1514 |   and     at: "at TYPE('x)"
 | |
| 22829 
f1db55c7534d
tuned some proofs and changed variable names in some definitions of Nominal.thy
 urbanc parents: 
22808diff
changeset | 1515 | and h1: "a\<sharp>pi" | 
| 
f1db55c7534d
tuned some proofs and changed variable names in some definitions of Nominal.thy
 urbanc parents: 
22808diff
changeset | 1516 | and h2: "a\<sharp>x" | 
| 
f1db55c7534d
tuned some proofs and changed variable names in some definitions of Nominal.thy
 urbanc parents: 
22808diff
changeset | 1517 | shows "a\<sharp>(pi\<bullet>x)" | 
| 22786 | 1518 | using assms | 
| 1519 | proof - | |
| 22829 
f1db55c7534d
tuned some proofs and changed variable names in some definitions of Nominal.thy
 urbanc parents: 
22808diff
changeset | 1520 | have "a\<sharp>(rev pi)"using h1 by (simp add: fresh_list_rev) | 
| 
f1db55c7534d
tuned some proofs and changed variable names in some definitions of Nominal.thy
 urbanc parents: 
22808diff
changeset | 1521 | then have "(rev pi)\<bullet>a = a" by (simp add: at_prm_fresh[OF at]) | 
| 
f1db55c7534d
tuned some proofs and changed variable names in some definitions of Nominal.thy
 urbanc parents: 
22808diff
changeset | 1522 | then have "((rev pi)\<bullet>a)\<sharp>x" using h2 by simp | 
| 
f1db55c7534d
tuned some proofs and changed variable names in some definitions of Nominal.thy
 urbanc parents: 
22808diff
changeset | 1523 | thus "a\<sharp>(pi\<bullet>x)" by (simp add: pt_fresh_right[OF pt, OF at]) | 
| 22786 | 1524 | qed | 
| 1525 | ||
| 1526 | lemma pt_fresh_perm_app_ineq: | |
| 19638 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 1527 | fixes pi::"'x prm" | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 1528 | and c::"'y" | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 1529 | and x::"'a" | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 1530 |   assumes pta: "pt TYPE('a) TYPE('x)"
 | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 1531 |   and     ptb: "pt TYPE('y) TYPE('x)"
 | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 1532 |   and     at:  "at TYPE('x)"
 | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 1533 |   and     cp:  "cp TYPE('a) TYPE('x) TYPE('y)"
 | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 1534 |   and     dj:  "disjoint TYPE('y) TYPE('x)"
 | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 1535 | assumes a: "c\<sharp>x" | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 1536 | shows "c\<sharp>(pi\<bullet>x)" | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 1537 | using a by (simp add: pt_fresh_left_ineq[OF pta, OF ptb, OF at, OF cp] dj_perm_forget[OF dj]) | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 1538 | |
| 22535 
cbee450f88a6
added extended the lemma for equivariance of freshness
 urbanc parents: 
22514diff
changeset | 1539 | lemma pt_fresh_eqvt_ineq: | 
| 
cbee450f88a6
added extended the lemma for equivariance of freshness
 urbanc parents: 
22514diff
changeset | 1540 | fixes pi::"'x prm" | 
| 
cbee450f88a6
added extended the lemma for equivariance of freshness
 urbanc parents: 
22514diff
changeset | 1541 | and c::"'y" | 
| 
cbee450f88a6
added extended the lemma for equivariance of freshness
 urbanc parents: 
22514diff
changeset | 1542 | and x::"'a" | 
| 
cbee450f88a6
added extended the lemma for equivariance of freshness
 urbanc parents: 
22514diff
changeset | 1543 |   assumes pta: "pt TYPE('a) TYPE('x)"
 | 
| 
cbee450f88a6
added extended the lemma for equivariance of freshness
 urbanc parents: 
22514diff
changeset | 1544 |   and     ptb: "pt TYPE('y) TYPE('x)"
 | 
| 
cbee450f88a6
added extended the lemma for equivariance of freshness
 urbanc parents: 
22514diff
changeset | 1545 |   and     at:  "at TYPE('x)"
 | 
| 
cbee450f88a6
added extended the lemma for equivariance of freshness
 urbanc parents: 
22514diff
changeset | 1546 |   and     cp:  "cp TYPE('a) TYPE('x) TYPE('y)"
 | 
| 
cbee450f88a6
added extended the lemma for equivariance of freshness
 urbanc parents: 
22514diff
changeset | 1547 |   and     dj:  "disjoint TYPE('y) TYPE('x)"
 | 
| 
cbee450f88a6
added extended the lemma for equivariance of freshness
 urbanc parents: 
22514diff
changeset | 1548 | shows "pi\<bullet>(c\<sharp>x) = (pi\<bullet>c)\<sharp>(pi\<bullet>x)" | 
| 
cbee450f88a6
added extended the lemma for equivariance of freshness
 urbanc parents: 
22514diff
changeset | 1549 | by (simp add: pt_fresh_left_ineq[OF pta, OF ptb, OF at, OF cp] dj_perm_forget[OF dj] perm_bool) | 
| 
cbee450f88a6
added extended the lemma for equivariance of freshness
 urbanc parents: 
22514diff
changeset | 1550 | |
| 67443 
3abf6a722518
standardized towards new-style formal comments: isabelle update_comments;
 wenzelm parents: 
66453diff
changeset | 1551 | \<comment> \<open>the co-set of a finite set is infinte\<close> | 
| 17870 | 1552 | lemma finite_infinite: | 
| 1553 |   assumes a: "finite {b::'x. P b}"
 | |
| 1554 | and b: "infinite (UNIV::'x set)" | |
| 1555 |   shows "infinite {b. \<not>P b}"
 | |
| 27687 | 1556 | proof - | 
| 1557 |   from a b have "infinite (UNIV - {b::'x. P b})" by (simp add: Diff_infinite_finite)
 | |
| 1558 | moreover | |
| 1559 |   have "{b::'x. \<not>P b} = UNIV - {b::'x. P b}" by auto
 | |
| 1560 |   ultimately show "infinite {b::'x. \<not>P b}" by simp
 | |
| 1561 | qed | |
| 17870 | 1562 | |
| 1563 | lemma pt_fresh_fresh: | |
| 1564 | fixes x :: "'a" | |
| 1565 | and a :: "'x" | |
| 1566 | and b :: "'x" | |
| 1567 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1568 |   and     at: "at TYPE ('x)"
 | |
| 1569 | and a1: "a\<sharp>x" and a2: "b\<sharp>x" | |
| 1570 | shows "[(a,b)]\<bullet>x=x" | |
| 1571 | proof (cases "a=b") | |
| 19325 | 1572 | assume "a=b" | 
| 1573 | hence "[(a,b)] \<triangleq> []" by (simp add: at_ds1[OF at]) | |
| 17870 | 1574 | hence "[(a,b)]\<bullet>x=([]::'x prm)\<bullet>x" by (rule pt3[OF pt]) | 
| 1575 | thus ?thesis by (simp only: pt1[OF pt]) | |
| 1576 | next | |
| 1577 | assume c2: "a\<noteq>b" | |
| 1578 |   from a1 have f1: "finite {c. [(a,c)]\<bullet>x \<noteq> x}" by (simp add: fresh_def supp_def)
 | |
| 1579 |   from a2 have f2: "finite {c. [(b,c)]\<bullet>x \<noteq> x}" by (simp add: fresh_def supp_def)
 | |
| 1580 |   from f1 and f2 have f3: "finite {c. perm [(a,c)] x \<noteq> x \<or> perm [(b,c)] x \<noteq> x}" 
 | |
| 1581 | by (force simp only: Collect_disj_eq) | |
| 1582 |   have "infinite {c. [(a,c)]\<bullet>x = x \<and> [(b,c)]\<bullet>x = x}" 
 | |
| 1583 | by (simp add: finite_infinite[OF f3,OF at4[OF at], simplified]) | |
| 1584 |   hence "infinite ({c. [(a,c)]\<bullet>x = x \<and> [(b,c)]\<bullet>x = x}-{a,b})" 
 | |
| 1585 | by (force dest: Diff_infinite_finite) | |
| 29903 | 1586 |   hence "({c. [(a,c)]\<bullet>x = x \<and> [(b,c)]\<bullet>x = x}-{a,b}) \<noteq> {}"
 | 
| 44683 | 1587 | by (metis finite_set set_empty2) | 
| 17870 | 1588 |   hence "\<exists>c. c\<in>({c. [(a,c)]\<bullet>x = x \<and> [(b,c)]\<bullet>x = x}-{a,b})" by (force)
 | 
| 1589 | then obtain c | |
| 1590 | where eq1: "[(a,c)]\<bullet>x = x" | |
| 1591 | and eq2: "[(b,c)]\<bullet>x = x" | |
| 1592 | and ineq: "a\<noteq>c \<and> b\<noteq>c" | |
| 1593 | by (force) | |
| 1594 | hence "[(a,c)]\<bullet>([(b,c)]\<bullet>([(a,c)]\<bullet>x)) = x" by simp | |
| 1595 | hence eq3: "[(a,c),(b,c),(a,c)]\<bullet>x = x" by (simp add: pt2[OF pt,symmetric]) | |
| 18295 
dd50de393330
changed \<sim> of permutation equality to \<triangleq>
 urbanc parents: 
18294diff
changeset | 1596 | from c2 ineq have "[(a,c),(b,c),(a,c)] \<triangleq> [(a,b)]" by (simp add: at_ds3[OF at]) | 
| 17870 | 1597 | hence "[(a,c),(b,c),(a,c)]\<bullet>x = [(a,b)]\<bullet>x" by (rule pt3[OF pt]) | 
| 1598 | thus ?thesis using eq3 by simp | |
| 1599 | qed | |
| 1600 | ||
| 26773 | 1601 | lemma pt_pi_fresh_fresh: | 
| 1602 | fixes x :: "'a" | |
| 1603 | and pi :: "'x prm" | |
| 1604 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1605 |   and     at: "at TYPE ('x)"
 | |
| 1606 | and a: "\<forall>(a,b)\<in>set pi. a\<sharp>x \<and> b\<sharp>x" | |
| 1607 | shows "pi\<bullet>x=x" | |
| 1608 | using a | |
| 1609 | proof (induct pi) | |
| 1610 | case Nil | |
| 1611 | show "([]::'x prm)\<bullet>x = x" by (rule pt1[OF pt]) | |
| 1612 | next | |
| 1613 | case (Cons ab pi) | |
| 1614 | have a: "\<forall>(a,b)\<in>set (ab#pi). a\<sharp>x \<and> b\<sharp>x" by fact | |
| 1615 | have ih: "(\<forall>(a,b)\<in>set pi. a\<sharp>x \<and> b\<sharp>x) \<Longrightarrow> pi\<bullet>x=x" by fact | |
| 1616 | obtain a b where e: "ab=(a,b)" by (cases ab) (auto) | |
| 1617 | from a have a': "a\<sharp>x" "b\<sharp>x" using e by auto | |
| 1618 | have "(ab#pi)\<bullet>x = ([(a,b)]@pi)\<bullet>x" using e by simp | |
| 1619 | also have "\<dots> = [(a,b)]\<bullet>(pi\<bullet>x)" by (simp only: pt2[OF pt]) | |
| 1620 | also have "\<dots> = [(a,b)]\<bullet>x" using ih a by simp | |
| 1621 | also have "\<dots> = x" using a' by (simp add: pt_fresh_fresh[OF pt, OF at]) | |
| 1622 | finally show "(ab#pi)\<bullet>x = x" by simp | |
| 1623 | qed | |
| 1624 | ||
| 17870 | 1625 | lemma pt_perm_compose: | 
| 1626 | fixes pi1 :: "'x prm" | |
| 1627 | and pi2 :: "'x prm" | |
| 1628 | and x :: "'a" | |
| 1629 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1630 |   and     at: "at TYPE('x)"
 | |
| 1631 | shows "pi2\<bullet>(pi1\<bullet>x) = (pi2\<bullet>pi1)\<bullet>(pi2\<bullet>x)" | |
| 1632 | proof - | |
| 23393 | 1633 | have "(pi2@pi1) \<triangleq> ((pi2\<bullet>pi1)@pi2)" by (rule at_ds8 [OF at]) | 
| 17870 | 1634 | hence "(pi2@pi1)\<bullet>x = ((pi2\<bullet>pi1)@pi2)\<bullet>x" by (rule pt3[OF pt]) | 
| 1635 | thus ?thesis by (simp add: pt2[OF pt]) | |
| 1636 | qed | |
| 1637 | ||
| 19045 | 1638 | lemma pt_perm_compose': | 
| 1639 | fixes pi1 :: "'x prm" | |
| 1640 | and pi2 :: "'x prm" | |
| 1641 | and x :: "'a" | |
| 1642 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1643 |   and     at: "at TYPE('x)"
 | |
| 1644 | shows "(pi2\<bullet>pi1)\<bullet>x = pi2\<bullet>(pi1\<bullet>((rev pi2)\<bullet>x))" | |
| 1645 | proof - | |
| 1646 | have "pi2\<bullet>(pi1\<bullet>((rev pi2)\<bullet>x)) = (pi2\<bullet>pi1)\<bullet>(pi2\<bullet>((rev pi2)\<bullet>x))" | |
| 1647 | by (rule pt_perm_compose[OF pt, OF at]) | |
| 1648 | also have "\<dots> = (pi2\<bullet>pi1)\<bullet>x" by (simp add: pt_pi_rev[OF pt, OF at]) | |
| 1649 | finally have "pi2\<bullet>(pi1\<bullet>((rev pi2)\<bullet>x)) = (pi2\<bullet>pi1)\<bullet>x" by simp | |
| 1650 | thus ?thesis by simp | |
| 1651 | qed | |
| 1652 | ||
| 17870 | 1653 | lemma pt_perm_compose_rev: | 
| 1654 | fixes pi1 :: "'x prm" | |
| 1655 | and pi2 :: "'x prm" | |
| 1656 | and x :: "'a" | |
| 1657 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1658 |   and     at: "at TYPE('x)"
 | |
| 1659 | shows "(rev pi2)\<bullet>((rev pi1)\<bullet>x) = (rev pi1)\<bullet>(rev (pi1\<bullet>pi2)\<bullet>x)" | |
| 1660 | proof - | |
| 18295 
dd50de393330
changed \<sim> of permutation equality to \<triangleq>
 urbanc parents: 
18294diff
changeset | 1661 | have "((rev pi2)@(rev pi1)) \<triangleq> ((rev pi1)@(rev (pi1\<bullet>pi2)))" by (rule at_ds9[OF at]) | 
| 17870 | 1662 | hence "((rev pi2)@(rev pi1))\<bullet>x = ((rev pi1)@(rev (pi1\<bullet>pi2)))\<bullet>x" by (rule pt3[OF pt]) | 
| 1663 | thus ?thesis by (simp add: pt2[OF pt]) | |
| 1664 | qed | |
| 1665 | ||
| 63167 | 1666 | section \<open>equivariance for some connectives\<close> | 
| 19972 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 1667 | lemma pt_all_eqvt: | 
| 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 1668 | fixes pi :: "'x prm" | 
| 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 1669 | and x :: "'a" | 
| 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 1670 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | 
| 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 1671 |   and     at: "at TYPE('x)"
 | 
| 22715 
381e6c45f13b
improved the equivariance lemmas for the quantifiers; had to export the lemma eqvt_force_add and eqvt_force_del in the thmdecls
 urbanc parents: 
22714diff
changeset | 1672 | shows "pi\<bullet>(\<forall>(x::'a). P x) = (\<forall>(x::'a). pi\<bullet>(P ((rev pi)\<bullet>x)))" | 
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1673 | by (smt (verit, ccfv_threshold) assms pt_bij1 true_eqvt) | 
| 19972 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 1674 | |
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 1675 | lemma pt_ex_eqvt: | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 1676 | fixes pi :: "'x prm" | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 1677 | and x :: "'a" | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 1678 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 1679 |   and     at: "at TYPE('x)"
 | 
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1680 | shows "pi\<bullet>(\<exists>(x::'a). P x) = (\<exists>(x::'a). pi\<bullet>(P ((rev pi)\<bullet>x)))" | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1681 | proof - | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1682 | have "\<And>x. P x \<Longrightarrow> P (rev pi \<bullet> pi \<bullet> x)" | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1683 | by (simp add: assms(1) at pt_rev_pi) | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1684 | then show ?thesis | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1685 | by(auto simp add: perm_bool perm_fun_def) | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1686 | qed | 
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 1687 | |
| 28011 | 1688 | lemma pt_ex1_eqvt: | 
| 1689 | fixes pi :: "'x prm" | |
| 1690 | and x :: "'a" | |
| 1691 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1692 |   and     at: "at TYPE('x)"
 | |
| 1693 | shows "(pi\<bullet>(\<exists>!x. P (x::'a))) = (\<exists>!x. pi\<bullet>(P (rev pi\<bullet>x)))" | |
| 1694 | unfolding Ex1_def | |
| 1695 | by (simp add: pt_ex_eqvt[OF pt at] conj_eqvt pt_all_eqvt[OF pt at] | |
| 1696 | imp_eqvt pt_eq_eqvt[OF pt at] pt_pi_rev[OF pt at]) | |
| 1697 | ||
| 1698 | lemma pt_the_eqvt: | |
| 1699 | fixes pi :: "'x prm" | |
| 1700 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1701 |   and     at: "at TYPE('x)"
 | |
| 1702 | and unique: "\<exists>!x. P x" | |
| 1703 | shows "pi\<bullet>(THE(x::'a). P x) = (THE(x::'a). pi\<bullet>(P ((rev pi)\<bullet>x)))" | |
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1704 | by (smt (verit, best) assms perm_bool_def pt_rev_pi theI_unique unique) | 
| 28011 | 1705 | |
| 63167 | 1706 | section \<open>facts about supports\<close> | 
| 17870 | 1707 | (*==============================*) | 
| 1708 | ||
| 1709 | lemma supports_subset: | |
| 1710 | fixes x :: "'a" | |
| 1711 | and S1 :: "'x set" | |
| 1712 | and S2 :: "'x set" | |
| 1713 | assumes a: "S1 supports x" | |
| 18053 
2719a6b7d95e
some minor tweaks in some proofs (nothing extraordinary)
 urbanc parents: 
18048diff
changeset | 1714 | and b: "S1 \<subseteq> S2" | 
| 17870 | 1715 | shows "S2 supports x" | 
| 1716 | using a b | |
| 22808 | 1717 | by (force simp add: supports_def) | 
| 17870 | 1718 | |
| 1719 | lemma supp_is_subset: | |
| 1720 | fixes S :: "'x set" | |
| 1721 | and x :: "'a" | |
| 1722 | assumes a1: "S supports x" | |
| 1723 | and a2: "finite S" | |
| 1724 | shows "(supp x)\<subseteq>S" | |
| 1725 | proof (rule ccontr) | |
| 1726 | assume "\<not>(supp x \<subseteq> S)" | |
| 1727 | hence "\<exists>a. a\<in>(supp x) \<and> a\<notin>S" by force | |
| 1728 | then obtain a where b1: "a\<in>supp x" and b2: "a\<notin>S" by force | |
| 22808 | 1729 | from a1 b2 have "\<forall>b. (b\<notin>S \<longrightarrow> ([(a,b)]\<bullet>x = x))" by (unfold supports_def, force) | 
| 19216 | 1730 |   hence "{b. [(a,b)]\<bullet>x \<noteq> x}\<subseteq>S" by force
 | 
| 17870 | 1731 |   with a2 have "finite {b. [(a,b)]\<bullet>x \<noteq> x}" by (simp add: finite_subset)
 | 
| 1732 | hence "a\<notin>(supp x)" by (unfold supp_def, auto) | |
| 1733 | with b1 show False by simp | |
| 1734 | qed | |
| 1735 | ||
| 18264 | 1736 | lemma supp_supports: | 
| 1737 | fixes x :: "'a" | |
| 1738 |   assumes  pt: "pt TYPE('a) TYPE('x)"
 | |
| 1739 |   and      at: "at TYPE ('x)"
 | |
| 1740 | shows "((supp x)::'x set) supports x" | |
| 22808 | 1741 | proof (unfold supports_def, intro strip) | 
| 18264 | 1742 | fix a b | 
| 1743 | assume "(a::'x)\<notin>(supp x) \<and> (b::'x)\<notin>(supp x)" | |
| 1744 | hence "a\<sharp>x" and "b\<sharp>x" by (auto simp add: fresh_def) | |
| 1745 | thus "[(a,b)]\<bullet>x = x" by (rule pt_fresh_fresh[OF pt, OF at]) | |
| 1746 | qed | |
| 1747 | ||
| 17870 | 1748 | lemma supports_finite: | 
| 1749 | fixes S :: "'x set" | |
| 1750 | and x :: "'a" | |
| 1751 | assumes a1: "S supports x" | |
| 1752 | and a2: "finite S" | |
| 1753 | shows "finite ((supp x)::'x set)" | |
| 1754 | proof - | |
| 1755 | have "(supp x)\<subseteq>S" using a1 a2 by (rule supp_is_subset) | |
| 1756 | thus ?thesis using a2 by (simp add: finite_subset) | |
| 1757 | qed | |
| 1758 | ||
| 1759 | lemma supp_is_inter: | |
| 1760 | fixes x :: "'a" | |
| 1761 |   assumes  pt: "pt TYPE('a) TYPE('x)"
 | |
| 1762 |   and      at: "at TYPE ('x)"
 | |
| 1763 |   and      fs: "fs TYPE('a) TYPE('x)"
 | |
| 60585 | 1764 |   shows "((supp x)::'x set) = (\<Inter>{S. finite S \<and> S supports x})"
 | 
| 17870 | 1765 | proof (rule equalityI) | 
| 60585 | 1766 |   show "((supp x)::'x set) \<subseteq> (\<Inter>{S. finite S \<and> S supports x})"
 | 
| 17870 | 1767 | proof (clarify) | 
| 1768 | fix S c | |
| 1769 | assume b: "c\<in>((supp x)::'x set)" and "finite (S::'x set)" and "S supports x" | |
| 1770 | hence "((supp x)::'x set)\<subseteq>S" by (simp add: supp_is_subset) | |
| 1771 | with b show "c\<in>S" by force | |
| 1772 | qed | |
| 1773 | next | |
| 60585 | 1774 |   show "(\<Inter>{S. finite S \<and> S supports x}) \<subseteq> ((supp x)::'x set)"
 | 
| 17870 | 1775 | proof (clarify, simp) | 
| 1776 | fix c | |
| 1777 | assume d: "\<forall>(S::'x set). finite S \<and> S supports x \<longrightarrow> c\<in>S" | |
| 1778 | have "((supp x)::'x set) supports x" by (rule supp_supports[OF pt, OF at]) | |
| 1779 | with d fs1[OF fs] show "c\<in>supp x" by force | |
| 1780 | qed | |
| 1781 | qed | |
| 1782 | ||
| 1783 | lemma supp_is_least_supports: | |
| 1784 | fixes S :: "'x set" | |
| 1785 | and x :: "'a" | |
| 1786 |   assumes  pt: "pt TYPE('a) TYPE('x)"
 | |
| 1787 |   and      at: "at TYPE ('x)"
 | |
| 1788 | and a1: "S supports x" | |
| 1789 | and a2: "finite S" | |
| 19477 | 1790 | and a3: "\<forall>S'. (S' supports x) \<longrightarrow> S\<subseteq>S'" | 
| 17870 | 1791 | shows "S = (supp x)" | 
| 1792 | proof (rule equalityI) | |
| 1793 | show "((supp x)::'x set)\<subseteq>S" using a1 a2 by (rule supp_is_subset) | |
| 1794 | next | |
| 19477 | 1795 | have "((supp x)::'x set) supports x" by (rule supp_supports[OF pt, OF at]) | 
| 1796 | with a3 show "S\<subseteq>supp x" by force | |
| 17870 | 1797 | qed | 
| 1798 | ||
| 1799 | lemma supports_set: | |
| 1800 | fixes S :: "'x set" | |
| 1801 | and X :: "'a set" | |
| 1802 |   assumes  pt: "pt TYPE('a) TYPE('x)"
 | |
| 1803 |   and      at: "at TYPE ('x)"
 | |
| 1804 | and a: "\<forall>x\<in>X. (\<forall>(a::'x) (b::'x). a\<notin>S\<and>b\<notin>S \<longrightarrow> ([(a,b)]\<bullet>x)\<in>X)" | |
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1805 | shows "S supports X" | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1806 | proof - | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1807 | have "x \<in> X" | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1808 | if "a \<notin> S" "b \<notin> S" and "x \<in> [(a, b)] \<bullet> X" for a b x | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1809 | using that by (metis a assms(1) at pt_pi_rev pt_set_bij1a) | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1810 | moreover have "x \<in> [(a, b)] \<bullet> X" | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1811 | if "a \<notin> S" "b \<notin> S" and "x \<in> X" for a b x | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1812 | using that by (simp add: a assms(1) at pt_set_bij1a) | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1813 | ultimately show ?thesis | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1814 | by (meson subsetI subset_antisym supports_def) | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1815 | qed | 
| 17870 | 1816 | |
| 1817 | lemma supports_fresh: | |
| 1818 | fixes S :: "'x set" | |
| 1819 | and a :: "'x" | |
| 1820 | and x :: "'a" | |
| 1821 | assumes a1: "S supports x" | |
| 1822 | and a2: "finite S" | |
| 1823 | and a3: "a\<notin>S" | |
| 1824 | shows "a\<sharp>x" | |
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1825 | by (meson assms fresh_def in_mono supp_is_subset) | 
| 17870 | 1826 | |
| 1827 | lemma at_fin_set_supports: | |
| 1828 | fixes X::"'x set" | |
| 1829 |   assumes at: "at TYPE('x)"
 | |
| 1830 | shows "X supports X" | |
| 19329 | 1831 | proof - | 
| 26806 | 1832 | have "\<forall>a b. a\<notin>X \<and> b\<notin>X \<longrightarrow> [(a,b)]\<bullet>X = X" | 
| 46179 
47bcf3d5d1f0
Reverted several lemmas involving sets to the state before the
 berghofe parents: 
45961diff
changeset | 1833 | by (auto simp add: perm_set_def at_calc[OF at]) | 
| 22808 | 1834 | then show ?thesis by (simp add: supports_def) | 
| 17870 | 1835 | qed | 
| 1836 | ||
| 19329 | 1837 | lemma infinite_Collection: | 
| 1838 | assumes a1:"infinite X" | |
| 1839 | and a2:"\<forall>b\<in>X. P(b)" | |
| 1840 |   shows "infinite {b\<in>X. P(b)}"
 | |
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 1841 | using assms rev_finite_subset by fastforce | 
| 19329 | 1842 | |
| 17870 | 1843 | lemma at_fin_set_supp: | 
| 19329 | 1844 | fixes X::"'x set" | 
| 17870 | 1845 |   assumes at: "at TYPE('x)"
 | 
| 1846 | and fs: "finite X" | |
| 1847 | shows "(supp X) = X" | |
| 19329 | 1848 | proof (rule subset_antisym) | 
| 1849 | show "(supp X) \<subseteq> X" using at_fin_set_supports[OF at] using fs by (simp add: supp_is_subset) | |
| 1850 | next | |
| 1851 | have inf: "infinite (UNIV-X)" using at4[OF at] fs by (auto simp add: Diff_infinite_finite) | |
| 1852 |   { fix a::"'x"
 | |
| 1853 | assume asm: "a\<in>X" | |
| 26806 | 1854 | hence "\<forall>b\<in>(UNIV-X). [(a,b)]\<bullet>X\<noteq>X" | 
| 46179 
47bcf3d5d1f0
Reverted several lemmas involving sets to the state before the
 berghofe parents: 
45961diff
changeset | 1855 | by (auto simp add: perm_set_def at_calc[OF at]) | 
| 19329 | 1856 |     with inf have "infinite {b\<in>(UNIV-X). [(a,b)]\<bullet>X\<noteq>X}" by (rule infinite_Collection)
 | 
| 1857 |     hence "infinite {b. [(a,b)]\<bullet>X\<noteq>X}" by (rule_tac infinite_super, auto)
 | |
| 1858 | hence "a\<in>(supp X)" by (simp add: supp_def) | |
| 1859 | } | |
| 1860 | then show "X\<subseteq>(supp X)" by blast | |
| 17870 | 1861 | qed | 
| 1862 | ||
| 25950 | 1863 | lemma at_fin_set_fresh: | 
| 1864 | fixes X::"'x set" | |
| 1865 |   assumes at: "at TYPE('x)"
 | |
| 1866 | and fs: "finite X" | |
| 1867 | shows "(x \<sharp> X) = (x \<notin> X)" | |
| 1868 | by (simp add: at_fin_set_supp fresh_def at fs) | |
| 1869 | ||
| 30990 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 1870 | |
| 63167 | 1871 | section \<open>Permutations acting on Functions\<close> | 
| 17870 | 1872 | (*==========================================*) | 
| 1873 | ||
| 1874 | lemma pt_fun_app_eq: | |
| 1875 | fixes f :: "'a\<Rightarrow>'b" | |
| 1876 | and x :: "'a" | |
| 1877 | and pi :: "'x prm" | |
| 1878 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1879 |   and     at: "at TYPE('x)"
 | |
| 1880 | shows "pi\<bullet>(f x) = (pi\<bullet>f)(pi\<bullet>x)" | |
| 1881 | by (simp add: perm_fun_def pt_rev_pi[OF pt, OF at]) | |
| 1882 | ||
| 1883 | ||
| 67443 
3abf6a722518
standardized towards new-style formal comments: isabelle update_comments;
 wenzelm parents: 
66453diff
changeset | 1884 | \<comment> \<open>sometimes pt_fun_app_eq does too much; this lemma 'corrects it'\<close> | 
| 17870 | 1885 | lemma pt_perm: | 
| 1886 | fixes x :: "'a" | |
| 1887 | and pi1 :: "'x prm" | |
| 1888 | and pi2 :: "'x prm" | |
| 1889 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1890 |   and     at: "at TYPE ('x)"
 | |
| 1891 | shows "(pi1\<bullet>perm pi2)(pi1\<bullet>x) = pi1\<bullet>(pi2\<bullet>x)" | |
| 1892 | by (simp add: pt_fun_app_eq[OF pt, OF at]) | |
| 1893 | ||
| 1894 | ||
| 1895 | lemma pt_fun_eq: | |
| 1896 | fixes f :: "'a\<Rightarrow>'b" | |
| 1897 | and pi :: "'x prm" | |
| 1898 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1899 |   and     at: "at TYPE('x)"
 | |
| 1900 | shows "(pi\<bullet>f = f) = (\<forall> x. pi\<bullet>(f x) = f (pi\<bullet>x))" (is "?LHS = ?RHS") | |
| 1901 | proof | |
| 1902 | assume a: "?LHS" | |
| 1903 | show "?RHS" | |
| 1904 | proof | |
| 1905 | fix x | |
| 1906 | have "pi\<bullet>(f x) = (pi\<bullet>f)(pi\<bullet>x)" by (simp add: pt_fun_app_eq[OF pt, OF at]) | |
| 1907 | also have "\<dots> = f (pi\<bullet>x)" using a by simp | |
| 1908 | finally show "pi\<bullet>(f x) = f (pi\<bullet>x)" by simp | |
| 1909 | qed | |
| 1910 | next | |
| 1911 | assume b: "?RHS" | |
| 1912 | show "?LHS" | |
| 1913 | proof (rule ccontr) | |
| 1914 | assume "(pi\<bullet>f) \<noteq> f" | |
| 39302 
d7728f65b353
renamed lemmas: ext_iff -> fun_eq_iff, set_ext_iff -> set_eq_iff, set_ext -> set_eqI
 nipkow parents: 
39198diff
changeset | 1915 | hence "\<exists>x. (pi\<bullet>f) x \<noteq> f x" by (simp add: fun_eq_iff) | 
| 19477 | 1916 | then obtain x where b1: "(pi\<bullet>f) x \<noteq> f x" by force | 
| 1917 | from b have "pi\<bullet>(f ((rev pi)\<bullet>x)) = f (pi\<bullet>((rev pi)\<bullet>x))" by force | |
| 1918 | hence "(pi\<bullet>f)(pi\<bullet>((rev pi)\<bullet>x)) = f (pi\<bullet>((rev pi)\<bullet>x))" | |
| 17870 | 1919 | by (simp add: pt_fun_app_eq[OF pt, OF at]) | 
| 19477 | 1920 | hence "(pi\<bullet>f) x = f x" by (simp add: pt_pi_rev[OF pt, OF at]) | 
| 17870 | 1921 | with b1 show "False" by simp | 
| 1922 | qed | |
| 1923 | qed | |
| 1924 | ||
| 67443 
3abf6a722518
standardized towards new-style formal comments: isabelle update_comments;
 wenzelm parents: 
66453diff
changeset | 1925 | \<comment> \<open>two helper lemmas for the equivariance of functions\<close> | 
| 17870 | 1926 | lemma pt_swap_eq_aux: | 
| 1927 | fixes y :: "'a" | |
| 1928 | and pi :: "'x prm" | |
| 1929 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1930 | and a: "\<forall>(a::'x) (b::'x). [(a,b)]\<bullet>y = y" | |
| 1931 | shows "pi\<bullet>y = y" | |
| 1932 | proof(induct pi) | |
| 24544 | 1933 | case Nil show ?case by (simp add: pt1[OF pt]) | 
| 1934 | next | |
| 1935 | case (Cons x xs) | |
| 1936 | have ih: "xs\<bullet>y = y" by fact | |
| 1937 | obtain a b where p: "x=(a,b)" by force | |
| 1938 | have "((a,b)#xs)\<bullet>y = ([(a,b)]@xs)\<bullet>y" by simp | |
| 1939 | also have "\<dots> = [(a,b)]\<bullet>(xs\<bullet>y)" by (simp only: pt2[OF pt]) | |
| 1940 | finally show ?case using a ih p by simp | |
| 1941 | qed | |
| 17870 | 1942 | |
| 1943 | lemma pt_swap_eq: | |
| 1944 | fixes y :: "'a" | |
| 1945 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1946 | shows "(\<forall>(a::'x) (b::'x). [(a,b)]\<bullet>y = y) = (\<forall>pi::'x prm. pi\<bullet>y = y)" | |
| 1947 | by (force intro: pt_swap_eq_aux[OF pt]) | |
| 1948 | ||
| 1949 | lemma pt_eqvt_fun1a: | |
| 1950 | fixes f :: "'a\<Rightarrow>'b" | |
| 1951 |   assumes pta: "pt TYPE('a) TYPE('x)"
 | |
| 1952 |   and     ptb: "pt TYPE('b) TYPE('x)"
 | |
| 1953 |   and     at:  "at TYPE('x)"
 | |
| 1954 |   and     a:   "((supp f)::'x set)={}"
 | |
| 1955 | shows "\<forall>(pi::'x prm). pi\<bullet>f = f" | |
| 1956 | proof (intro strip) | |
| 1957 | fix pi | |
| 1958 | have "\<forall>a b. a\<notin>((supp f)::'x set) \<and> b\<notin>((supp f)::'x set) \<longrightarrow> (([(a,b)]\<bullet>f) = f)" | |
| 1959 | by (intro strip, fold fresh_def, | |
| 1960 | simp add: pt_fresh_fresh[OF pt_fun_inst[OF pta, OF ptb, OF at],OF at]) | |
| 1961 | with a have "\<forall>(a::'x) (b::'x). ([(a,b)]\<bullet>f) = f" by force | |
| 1962 | hence "\<forall>(pi::'x prm). pi\<bullet>f = f" | |
| 1963 | by (simp add: pt_swap_eq[OF pt_fun_inst[OF pta, OF ptb, OF at]]) | |
| 1964 | thus "(pi::'x prm)\<bullet>f = f" by simp | |
| 1965 | qed | |
| 1966 | ||
| 1967 | lemma pt_eqvt_fun1b: | |
| 1968 | fixes f :: "'a\<Rightarrow>'b" | |
| 1969 | assumes a: "\<forall>(pi::'x prm). pi\<bullet>f = f" | |
| 1970 |   shows "((supp f)::'x set)={}"
 | |
| 1971 | using a by (simp add: supp_def) | |
| 1972 | ||
| 1973 | lemma pt_eqvt_fun1: | |
| 1974 | fixes f :: "'a\<Rightarrow>'b" | |
| 1975 |   assumes pta: "pt TYPE('a) TYPE('x)"
 | |
| 1976 |   and     ptb: "pt TYPE('b) TYPE('x)"
 | |
| 1977 |   and     at: "at TYPE('x)"
 | |
| 1978 |   shows "(((supp f)::'x set)={}) = (\<forall>(pi::'x prm). pi\<bullet>f = f)" (is "?LHS = ?RHS")
 | |
| 1979 | by (rule iffI, simp add: pt_eqvt_fun1a[OF pta, OF ptb, OF at], simp add: pt_eqvt_fun1b) | |
| 1980 | ||
| 1981 | lemma pt_eqvt_fun2a: | |
| 1982 | fixes f :: "'a\<Rightarrow>'b" | |
| 1983 |   assumes pta: "pt TYPE('a) TYPE('x)"
 | |
| 1984 |   and     ptb: "pt TYPE('b) TYPE('x)"
 | |
| 1985 |   and     at: "at TYPE('x)"
 | |
| 1986 |   assumes a: "((supp f)::'x set)={}"
 | |
| 1987 | shows "\<forall>(pi::'x prm) (x::'a). pi\<bullet>(f x) = f(pi\<bullet>x)" | |
| 1988 | proof (intro strip) | |
| 1989 | fix pi x | |
| 1990 | from a have b: "\<forall>(pi::'x prm). pi\<bullet>f = f" by (simp add: pt_eqvt_fun1[OF pta, OF ptb, OF at]) | |
| 1991 | have "(pi::'x prm)\<bullet>(f x) = (pi\<bullet>f)(pi\<bullet>x)" by (simp add: pt_fun_app_eq[OF pta, OF at]) | |
| 1992 | with b show "(pi::'x prm)\<bullet>(f x) = f (pi\<bullet>x)" by force | |
| 1993 | qed | |
| 1994 | ||
| 1995 | lemma pt_eqvt_fun2b: | |
| 1996 | fixes f :: "'a\<Rightarrow>'b" | |
| 1997 |   assumes pt1: "pt TYPE('a) TYPE('x)"
 | |
| 1998 |   and     pt2: "pt TYPE('b) TYPE('x)"
 | |
| 1999 |   and     at: "at TYPE('x)"
 | |
| 2000 | assumes a: "\<forall>(pi::'x prm) (x::'a). pi\<bullet>(f x) = f(pi\<bullet>x)" | |
| 2001 |   shows "((supp f)::'x set)={}"
 | |
| 2002 | proof - | |
| 2003 | from a have "\<forall>(pi::'x prm). pi\<bullet>f = f" by (simp add: pt_fun_eq[OF pt1, OF at, symmetric]) | |
| 2004 | thus ?thesis by (simp add: supp_def) | |
| 2005 | qed | |
| 2006 | ||
| 2007 | lemma pt_eqvt_fun2: | |
| 2008 | fixes f :: "'a\<Rightarrow>'b" | |
| 2009 |   assumes pta: "pt TYPE('a) TYPE('x)"
 | |
| 2010 |   and     ptb: "pt TYPE('b) TYPE('x)"
 | |
| 2011 |   and     at: "at TYPE('x)"
 | |
| 2012 |   shows "(((supp f)::'x set)={}) = (\<forall>(pi::'x prm) (x::'a). pi\<bullet>(f x) = f(pi\<bullet>x))" 
 | |
| 2013 | by (rule iffI, | |
| 2014 | simp add: pt_eqvt_fun2a[OF pta, OF ptb, OF at], | |
| 2015 | simp add: pt_eqvt_fun2b[OF pta, OF ptb, OF at]) | |
| 2016 | ||
| 2017 | lemma pt_supp_fun_subset: | |
| 2018 | fixes f :: "'a\<Rightarrow>'b" | |
| 2019 |   assumes pta: "pt TYPE('a) TYPE('x)"
 | |
| 2020 |   and     ptb: "pt TYPE('b) TYPE('x)"
 | |
| 2021 |   and     at: "at TYPE('x)" 
 | |
| 2022 | and f1: "finite ((supp f)::'x set)" | |
| 2023 | and f2: "finite ((supp x)::'x set)" | |
| 2024 | shows "supp (f x) \<subseteq> (((supp f)\<union>(supp x))::'x set)" | |
| 2025 | proof - | |
| 2026 | have s1: "((supp f)\<union>((supp x)::'x set)) supports (f x)" | |
| 22808 | 2027 | proof (simp add: supports_def, fold fresh_def, auto) | 
| 17870 | 2028 | fix a::"'x" and b::"'x" | 
| 2029 | assume "a\<sharp>f" and "b\<sharp>f" | |
| 2030 | hence a1: "[(a,b)]\<bullet>f = f" | |
| 2031 | by (rule pt_fresh_fresh[OF pt_fun_inst[OF pta, OF ptb, OF at], OF at]) | |
| 2032 | assume "a\<sharp>x" and "b\<sharp>x" | |
| 2033 | hence a2: "[(a,b)]\<bullet>x = x" by (rule pt_fresh_fresh[OF pta, OF at]) | |
| 2034 | from a1 a2 show "[(a,b)]\<bullet>(f x) = (f x)" by (simp add: pt_fun_app_eq[OF pta, OF at]) | |
| 2035 | qed | |
| 2036 | from f1 f2 have "finite ((supp f)\<union>((supp x)::'x set))" by force | |
| 2037 | with s1 show ?thesis by (rule supp_is_subset) | |
| 2038 | qed | |
| 2039 | ||
| 2040 | lemma pt_empty_supp_fun_subset: | |
| 2041 | fixes f :: "'a\<Rightarrow>'b" | |
| 2042 |   assumes pta: "pt TYPE('a) TYPE('x)"
 | |
| 2043 |   and     ptb: "pt TYPE('b) TYPE('x)"
 | |
| 2044 |   and     at:  "at TYPE('x)" 
 | |
| 2045 |   and     e:   "(supp f)=({}::'x set)"
 | |
| 2046 | shows "supp (f x) \<subseteq> ((supp x)::'x set)" | |
| 2047 | proof (unfold supp_def, auto) | |
| 2048 | fix a::"'x" | |
| 2049 |   assume a1: "finite {b. [(a, b)]\<bullet>x \<noteq> x}"
 | |
| 2050 |   assume "infinite {b. [(a, b)]\<bullet>(f x) \<noteq> f x}"
 | |
| 2051 |   hence a2: "infinite {b. f ([(a, b)]\<bullet>x) \<noteq> f x}" using e
 | |
| 2052 | by (simp add: pt_eqvt_fun2[OF pta, OF ptb, OF at]) | |
| 2053 |   have a3: "{b. f ([(a,b)]\<bullet>x) \<noteq> f x}\<subseteq>{b. [(a,b)]\<bullet>x \<noteq> x}" by force
 | |
| 2054 | from a1 a2 a3 show False by (force dest: finite_subset) | |
| 2055 | qed | |
| 2056 | ||
| 63167 | 2057 | section \<open>Facts about the support of finite sets of finitely supported things\<close> | 
| 18264 | 2058 | (*=============================================================================*) | 
| 2059 | ||
| 35416 
d8d7d1b785af
replaced a couple of constsdefs by definitions (also some old primrecs by modern ones)
 haftmann parents: 
32960diff
changeset | 2060 | definition X_to_Un_supp :: "('a set) \<Rightarrow> 'x set" where
 | 
| 18264 | 2061 | "X_to_Un_supp X \<equiv> \<Union>x\<in>X. ((supp x)::'x set)" | 
| 2062 | ||
| 2063 | lemma UNION_f_eqvt: | |
| 2064 |   fixes X::"('a set)"
 | |
| 2065 | and f::"'a \<Rightarrow> 'x set" | |
| 2066 | and pi::"'x prm" | |
| 2067 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 2068 |   and     at: "at TYPE('x)"
 | |
| 2069 | shows "pi\<bullet>(\<Union>x\<in>X. f x) = (\<Union>x\<in>(pi\<bullet>X). (pi\<bullet>f) x)" | |
| 2070 | proof - | |
| 2071 |   have pt_x: "pt TYPE('x) TYPE('x)" by (force intro: at_pt_inst at)
 | |
| 2072 | show ?thesis | |
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2073 | proof - | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2074 | have "\<exists>x. (\<exists>u. x = pi \<bullet> u \<and> u \<in> X) \<and> pi \<bullet> z \<in> (pi \<bullet> f) x" | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2075 | if "y \<in> X" and "z \<in> f y" for y z | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2076 | using that by (metis assms at_pt_inst pt_fun_app_eq pt_set_bij) | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2077 | moreover have "\<exists>u. x = pi \<bullet> u \<and> (\<exists>x\<in>X. u \<in> f x)" | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2078 | if "x \<in> (pi \<bullet> f) (pi \<bullet> y)" and "y \<in> X" for x y | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2079 | using that by (metis at at_pi_rev pt pt_fun_app_eq pt_set_bij1a pt_x) | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2080 | ultimately show ?thesis | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2081 | by (auto simp: perm_set_def) | 
| 18351 | 2082 | qed | 
| 18264 | 2083 | qed | 
| 2084 | ||
| 2085 | lemma X_to_Un_supp_eqvt: | |
| 2086 |   fixes X::"('a set)"
 | |
| 2087 | and pi::"'x prm" | |
| 2088 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 2089 |   and     at: "at TYPE('x)"
 | |
| 2090 | shows "pi\<bullet>(X_to_Un_supp X) = ((X_to_Un_supp (pi\<bullet>X))::'x set)" | |
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2091 | by (metis UNION_f_eqvt X_to_Un_supp_def assms pt_fun_eq pt_perm_supp) | 
| 18264 | 2092 | |
| 2093 | lemma Union_supports_set: | |
| 2094 |   fixes X::"('a set)"
 | |
| 2095 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 2096 |   and     at: "at TYPE('x)"
 | |
| 2097 | shows "(\<Union>x\<in>X. ((supp x)::'x set)) supports X" | |
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2098 | by (simp add: assms fresh_def pt_fresh_fresh supports_set) | 
| 18264 | 2099 | |
| 2100 | lemma Union_of_fin_supp_sets: | |
| 2101 |   fixes X::"('a set)"
 | |
| 2102 |   assumes fs: "fs TYPE('a) TYPE('x)" 
 | |
| 2103 | and fi: "finite X" | |
| 2104 | shows "finite (\<Union>x\<in>X. ((supp x)::'x set))" | |
| 2105 | using fi by (induct, auto simp add: fs1[OF fs]) | |
| 2106 | ||
| 2107 | lemma Union_included_in_supp: | |
| 2108 |   fixes X::"('a set)"
 | |
| 2109 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 2110 |   and     at: "at TYPE('x)"
 | |
| 2111 |   and     fs: "fs TYPE('a) TYPE('x)" 
 | |
| 2112 | and fi: "finite X" | |
| 2113 | shows "(\<Union>x\<in>X. ((supp x)::'x set)) \<subseteq> supp X" | |
| 2114 | proof - | |
| 2115 | have "supp ((X_to_Un_supp X)::'x set) \<subseteq> ((supp X)::'x set)" | |
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2116 | proof (rule pt_empty_supp_fun_subset) | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2117 |     show "supp (\<lambda>a. X_to_Un_supp (a::'a set)::'x set) = ({}::'x set)"
 | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2118 | by (simp add: X_to_Un_supp_eqvt at at_pt_inst pt pt_eqvt_fun2b pt_set_inst) | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2119 | qed (use assms at_pt_inst pt_set_inst in auto) | 
| 18264 | 2120 | hence "supp (\<Union>x\<in>X. ((supp x)::'x set)) \<subseteq> ((supp X)::'x set)" by (simp add: X_to_Un_supp_def) | 
| 2121 | moreover | |
| 2122 | have "supp (\<Union>x\<in>X. ((supp x)::'x set)) = (\<Union>x\<in>X. ((supp x)::'x set))" | |
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2123 | using Union_of_fin_supp_sets at at_fin_set_supp fi fs by auto | 
| 18264 | 2124 | ultimately show ?thesis by force | 
| 2125 | qed | |
| 2126 | ||
| 2127 | lemma supp_of_fin_sets: | |
| 2128 |   fixes X::"('a set)"
 | |
| 2129 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 2130 |   and     at: "at TYPE('x)"
 | |
| 2131 |   and     fs: "fs TYPE('a) TYPE('x)" 
 | |
| 2132 | and fi: "finite X" | |
| 2133 | shows "(supp X) = (\<Union>x\<in>X. ((supp x)::'x set))" | |
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2134 | proof (rule equalityI) | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2135 | have "finite (\<Union> (supp ` X)::'x set)" | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2136 | using Union_of_fin_supp_sets fi fs by blast | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2137 | then show "(supp X::'x set) \<subseteq> \<Union> (supp ` X)" | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2138 | by (metis Union_supports_set at pt supp_is_subset) | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2139 | next | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2140 | show "(\<Union>x\<in>X. (supp x::'x set)) \<subseteq> supp X" | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2141 | by (simp add: Union_included_in_supp at fi fs pt) | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2142 | qed | 
| 18264 | 2143 | |
| 2144 | lemma supp_fin_union: | |
| 2145 |   fixes X::"('a set)"
 | |
| 2146 |   and   Y::"('a set)"
 | |
| 2147 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 2148 |   and     at: "at TYPE('x)"
 | |
| 2149 |   and     fs: "fs TYPE('a) TYPE('x)" 
 | |
| 2150 | and f1: "finite X" | |
| 2151 | and f2: "finite Y" | |
| 2152 | shows "(supp (X\<union>Y)) = (supp X)\<union>((supp Y)::'x set)" | |
| 2153 | using f1 f2 by (force simp add: supp_of_fin_sets[OF pt, OF at, OF fs]) | |
| 2154 | ||
| 2155 | lemma supp_fin_insert: | |
| 2156 |   fixes X::"('a set)"
 | |
| 2157 | and x::"'a" | |
| 2158 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 2159 |   and     at: "at TYPE('x)"
 | |
| 2160 |   and     fs: "fs TYPE('a) TYPE('x)" 
 | |
| 2161 | and f: "finite X" | |
| 2162 | shows "(supp (insert x X)) = (supp x)\<union>((supp X)::'x set)" | |
| 2163 | proof - | |
| 2164 |   have "(supp (insert x X)) = ((supp ({x}\<union>(X::'a set)))::'x set)" by simp
 | |
| 2165 |   also have "\<dots> = (supp {x})\<union>(supp X)"
 | |
| 2166 | by (rule supp_fin_union[OF pt, OF at, OF fs], simp_all add: f) | |
| 2167 | finally show "(supp (insert x X)) = (supp x)\<union>((supp X)::'x set)" | |
| 46179 
47bcf3d5d1f0
Reverted several lemmas involving sets to the state before the
 berghofe parents: 
45961diff
changeset | 2168 | by (simp add: supp_singleton) | 
| 18264 | 2169 | qed | 
| 2170 | ||
| 2171 | lemma fresh_fin_union: | |
| 2172 |   fixes X::"('a set)"
 | |
| 2173 |   and   Y::"('a set)"
 | |
| 2174 | and a::"'x" | |
| 2175 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 2176 |   and     at: "at TYPE('x)"
 | |
| 2177 |   and     fs: "fs TYPE('a) TYPE('x)" 
 | |
| 2178 | and f1: "finite X" | |
| 2179 | and f2: "finite Y" | |
| 2180 | shows "a\<sharp>(X\<union>Y) = (a\<sharp>X \<and> a\<sharp>Y)" | |
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2181 | by (simp add: assms fresh_def supp_fin_union) | 
| 18264 | 2182 | |
| 2183 | lemma fresh_fin_insert: | |
| 2184 |   fixes X::"('a set)"
 | |
| 2185 | and x::"'a" | |
| 2186 | and a::"'x" | |
| 2187 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 2188 |   and     at: "at TYPE('x)"
 | |
| 2189 |   and     fs: "fs TYPE('a) TYPE('x)" 
 | |
| 2190 | and f: "finite X" | |
| 2191 | shows "a\<sharp>(insert x X) = (a\<sharp>x \<and> a\<sharp>X)" | |
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2192 | by (simp add: assms fresh_def supp_fin_insert) | 
| 18264 | 2193 | |
| 2194 | lemma fresh_fin_insert1: | |
| 2195 |   fixes X::"('a set)"
 | |
| 2196 | and x::"'a" | |
| 2197 | and a::"'x" | |
| 2198 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 2199 |   and     at: "at TYPE('x)"
 | |
| 2200 |   and     fs: "fs TYPE('a) TYPE('x)" 
 | |
| 2201 | and f: "finite X" | |
| 2202 | and a1: "a\<sharp>x" | |
| 2203 | and a2: "a\<sharp>X" | |
| 2204 | shows "a\<sharp>(insert x X)" | |
| 30990 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2205 | using a1 a2 | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2206 | by (simp add: fresh_fin_insert[OF pt, OF at, OF fs, OF f]) | 
| 18264 | 2207 | |
| 2208 | lemma pt_list_set_supp: | |
| 2209 | fixes xs :: "'a list" | |
| 2210 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 2211 |   and     at: "at TYPE('x)"
 | |
| 2212 |   and     fs: "fs TYPE('a) TYPE('x)"
 | |
| 2213 | shows "supp (set xs) = ((supp xs)::'x set)" | |
| 2214 | proof - | |
| 2215 | have "supp (set xs) = (\<Union>x\<in>(set xs). ((supp x)::'x set))" | |
| 2216 | by (rule supp_of_fin_sets[OF pt, OF at, OF fs], rule finite_set) | |
| 2217 | also have "(\<Union>x\<in>(set xs). ((supp x)::'x set)) = (supp xs)" | |
| 2218 | proof(induct xs) | |
| 2219 | case Nil show ?case by (simp add: supp_list_nil) | |
| 2220 | next | |
| 2221 | case (Cons h t) thus ?case by (simp add: supp_list_cons) | |
| 2222 | qed | |
| 2223 | finally show ?thesis by simp | |
| 2224 | qed | |
| 2225 | ||
| 2226 | lemma pt_list_set_fresh: | |
| 2227 | fixes a :: "'x" | |
| 2228 | and xs :: "'a list" | |
| 2229 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 2230 |   and     at: "at TYPE('x)"
 | |
| 2231 |   and     fs: "fs TYPE('a) TYPE('x)"
 | |
| 2232 | shows "a\<sharp>(set xs) = a\<sharp>xs" | |
| 2233 | by (simp add: fresh_def pt_list_set_supp[OF pt, OF at, OF fs]) | |
| 26847 | 2234 | |
| 30990 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2235 | |
| 63167 | 2236 | section \<open>generalisation of freshness to lists and sets of atoms\<close> | 
| 30990 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2237 | (*================================================================*) | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2238 | |
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2239 | consts | 
| 69597 | 2240 | fresh_star :: "'b \<Rightarrow> 'a \<Rightarrow> bool" (\<open>_ \<sharp>* _\<close> [100,100] 100) | 
| 30990 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2241 | |
| 62145 | 2242 | overloading fresh_star_set \<equiv> "fresh_star :: 'b set \<Rightarrow> 'a \<Rightarrow> bool" | 
| 2243 | begin | |
| 2244 | definition fresh_star_set: "xs\<sharp>*c \<equiv> \<forall>x::'b\<in>xs. x\<sharp>(c::'a)" | |
| 2245 | end | |
| 2246 | ||
| 2247 | overloading frsh_star_list \<equiv> "fresh_star :: 'b list \<Rightarrow> 'a \<Rightarrow> bool" | |
| 2248 | begin | |
| 2249 | definition fresh_star_list: "xs\<sharp>*c \<equiv> \<forall>x::'b\<in>set xs. x\<sharp>(c::'a)" | |
| 2250 | end | |
| 30990 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2251 | |
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2252 | lemmas fresh_star_def = fresh_star_list fresh_star_set | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2253 | |
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2254 | lemma fresh_star_prod_set: | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2255 | fixes xs::"'a set" | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2256 | shows "xs\<sharp>*(a,b) = (xs\<sharp>*a \<and> xs\<sharp>*b)" | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2257 | by (auto simp add: fresh_star_def fresh_prod) | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2258 | |
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2259 | lemma fresh_star_prod_list: | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2260 | fixes xs::"'a list" | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2261 | shows "xs\<sharp>*(a,b) = (xs\<sharp>*a \<and> xs\<sharp>*b)" | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2262 | by (auto simp add: fresh_star_def fresh_prod) | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2263 | |
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2264 | lemmas fresh_star_prod = fresh_star_prod_list fresh_star_prod_set | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2265 | |
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2266 | lemma fresh_star_set_eq: "set xs \<sharp>* c = xs \<sharp>* c" | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2267 | by (simp add: fresh_star_def) | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2268 | |
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2269 | lemma fresh_star_Un_elim: | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2270 | "((S \<union> T) \<sharp>* c \<Longrightarrow> PROP C) \<equiv> (S \<sharp>* c \<Longrightarrow> T \<sharp>* c \<Longrightarrow> PROP C)" | 
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2271 | proof | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2272 | assume \<section>: "(S \<union> T) \<sharp>* c \<Longrightarrow> PROP C" and c: "S \<sharp>* c" "T \<sharp>* c" | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2273 | show "PROP C" | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2274 | using c by (intro \<section>) (metis Un_iff fresh_star_set) | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2275 | qed (auto simp: fresh_star_def) | 
| 30990 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2276 | |
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2277 | lemma fresh_star_insert_elim: | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2278 | "(insert x S \<sharp>* c \<Longrightarrow> PROP C) \<equiv> (x \<sharp> c \<Longrightarrow> S \<sharp>* c \<Longrightarrow> PROP C)" | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2279 | by rule (simp_all add: fresh_star_def) | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2280 | |
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2281 | lemma fresh_star_empty_elim: | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2282 |   "({} \<sharp>* c \<Longrightarrow> PROP C) \<equiv> PROP C"
 | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2283 | by (simp add: fresh_star_def) | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2284 | |
| 63167 | 2285 | text \<open>Normalization of freshness results; see \ \<open>nominal_induct\<close>\<close> | 
| 30990 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2286 | |
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2287 | lemma fresh_star_unit_elim: | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2288 | shows "((a::'a set)\<sharp>*() \<Longrightarrow> PROP C) \<equiv> PROP C" | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2289 | and "((b::'a list)\<sharp>*() \<Longrightarrow> PROP C) \<equiv> PROP C" | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2290 | by (simp_all add: fresh_star_def fresh_def supp_unit) | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2291 | |
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2292 | lemma fresh_star_prod_elim: | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2293 | shows "((a::'a set)\<sharp>*(x,y) \<Longrightarrow> PROP C) \<equiv> (a\<sharp>*x \<Longrightarrow> a\<sharp>*y \<Longrightarrow> PROP C)" | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2294 | and "((b::'a list)\<sharp>*(x,y) \<Longrightarrow> PROP C) \<equiv> (b\<sharp>*x \<Longrightarrow> b\<sharp>*y \<Longrightarrow> PROP C)" | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2295 | by (rule, simp_all add: fresh_star_prod)+ | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2296 | |
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2297 | |
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2298 | lemma pt_fresh_star_bij_ineq: | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2299 | fixes pi :: "'x prm" | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2300 | and x :: "'a" | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2301 | and a :: "'y set" | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2302 | and b :: "'y list" | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2303 |   assumes pta: "pt TYPE('a) TYPE('x)"
 | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2304 |   and     ptb: "pt TYPE('y) TYPE('x)"
 | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2305 |   and     at:  "at TYPE('x)"
 | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2306 |   and     cp:  "cp TYPE('a) TYPE('x) TYPE('y)"
 | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2307 | shows "(pi\<bullet>a)\<sharp>*(pi\<bullet>x) = a\<sharp>*x" | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2308 | and "(pi\<bullet>b)\<sharp>*(pi\<bullet>x) = b\<sharp>*x" | 
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2309 | unfolding fresh_star_def | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2310 | proof - | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2311 | have "y \<sharp> x" if "\<forall>z\<in>pi \<bullet> a. z \<sharp> pi \<bullet> x" and "y \<in> a" for y | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2312 | using that by (meson assms at pt_fresh_bij_ineq pt_set_bij2) | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2313 | moreover have "y \<sharp> pi \<bullet> x" if "\<forall>z\<in>a. z \<sharp> x" and "y \<in> pi \<bullet> a" for y | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2314 | using that by (simp add: assms pt_fresh_left_ineq pt_set_bij1a) | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2315 | moreover have "y \<sharp> x" | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2316 | if "\<forall>z\<in>set (pi \<bullet> b). z \<sharp> pi \<bullet> x" and "y \<in> set b" for y | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2317 | using that by (metis at cp pt_fresh_bij_ineq pt_set_bij pta ptb set_eqvt) | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2318 | moreover have "y \<sharp> pi \<bullet> x" | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2319 | if "\<forall>z\<in>set b. z \<sharp> x" and "y \<in> set (pi \<bullet> b)" for y | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2320 | using that by (metis at cp pt_fresh_left_ineq pt_set_bij1a pta ptb set_eqvt) | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2321 | ultimately show "(\<forall>xa\<in>pi \<bullet> a. xa \<sharp> pi \<bullet> x) = (\<forall>xa\<in>a. xa \<sharp> x)" "(\<forall>xa\<in>set (pi \<bullet> b). xa \<sharp> pi \<bullet> x) = (\<forall>xa\<in>set b. xa \<sharp> x)" | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2322 | by blast+ | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2323 | qed | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2324 | |
| 30990 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2325 | |
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2326 | lemma pt_fresh_star_bij: | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2327 | fixes pi :: "'x prm" | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2328 | and x :: "'a" | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2329 | and a :: "'x set" | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2330 | and b :: "'x list" | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2331 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2332 |   and     at: "at TYPE('x)"
 | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2333 | shows "(pi\<bullet>a)\<sharp>*(pi\<bullet>x) = a\<sharp>*x" | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2334 | and "(pi\<bullet>b)\<sharp>*(pi\<bullet>x) = b\<sharp>*x" | 
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2335 | proof (rule pt_fresh_star_bij_ineq) | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2336 | show "(pi \<bullet> b) \<sharp>* (pi \<bullet> x) = b \<sharp>* x" | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2337 | by (simp add: at at_pt_inst cp_pt_inst pt pt_fresh_star_bij_ineq) | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2338 | qed (auto simp: at pt at_pt_inst cp_pt_inst) | 
| 30990 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2339 | |
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2340 | lemma pt_fresh_star_eqvt: | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2341 | fixes pi :: "'x prm" | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2342 | and x :: "'a" | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2343 | and a :: "'x set" | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2344 | and b :: "'x list" | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2345 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2346 |   and     at: "at TYPE('x)"
 | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2347 | shows "pi\<bullet>(a\<sharp>*x) = (pi\<bullet>a)\<sharp>*(pi\<bullet>x)" | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2348 | and "pi\<bullet>(b\<sharp>*x) = (pi\<bullet>b)\<sharp>*(pi\<bullet>x)" | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2349 | by (simp_all add: perm_bool pt_fresh_star_bij[OF pt, OF at]) | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2350 | |
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2351 | lemma pt_fresh_star_eqvt_ineq: | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2352 | fixes pi::"'x prm" | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2353 | and a::"'y set" | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2354 | and b::"'y list" | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2355 | and x::"'a" | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2356 |   assumes pta: "pt TYPE('a) TYPE('x)"
 | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2357 |   and     ptb: "pt TYPE('y) TYPE('x)"
 | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2358 |   and     at:  "at TYPE('x)"
 | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2359 |   and     cp:  "cp TYPE('a) TYPE('x) TYPE('y)"
 | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2360 |   and     dj:  "disjoint TYPE('y) TYPE('x)"
 | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2361 | shows "pi\<bullet>(a\<sharp>*x) = (pi\<bullet>a)\<sharp>*(pi\<bullet>x)" | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2362 | and "pi\<bullet>(b\<sharp>*x) = (pi\<bullet>b)\<sharp>*(pi\<bullet>x)" | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2363 | by (simp_all add: pt_fresh_star_bij_ineq[OF pta, OF ptb, OF at, OF cp] dj_perm_forget[OF dj] perm_bool) | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2364 | |
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2365 | lemma pt_freshs_freshs: | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2366 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2367 |   and at: "at TYPE ('x)"
 | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2368 | and pi: "set (pi::'x prm) \<subseteq> Xs \<times> Ys" | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2369 | and Xs: "Xs \<sharp>* (x::'a)" | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2370 | and Ys: "Ys \<sharp>* x" | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2371 | shows "pi\<bullet>x = x" | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2372 | using pi | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2373 | proof (induct pi) | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2374 | case Nil | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2375 | show ?case by (simp add: pt1 [OF pt]) | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2376 | next | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2377 | case (Cons p pi) | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2378 | obtain a b where p: "p = (a, b)" by (cases p) | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2379 | with Cons Xs Ys have "a \<sharp> x" "b \<sharp> x" | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2380 | by (simp_all add: fresh_star_def) | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2381 | with Cons p show ?case | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2382 | by (simp add: pt_fresh_fresh [OF pt at] | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2383 | pt2 [OF pt, of "[(a, b)]" pi, simplified]) | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2384 | qed | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2385 | |
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2386 | lemma pt_fresh_star_pi: | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2387 | fixes x::"'a" | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2388 | and pi::"'x prm" | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2389 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2390 |   and     at: "at TYPE('x)"
 | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2391 | and a: "((supp x)::'x set)\<sharp>* pi" | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2392 | shows "pi\<bullet>x = x" | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2393 | using a | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2394 | apply(induct pi) | 
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2395 | apply (simp add: assms(1) pt1) | 
| 30990 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2396 | apply(auto simp add: fresh_star_def fresh_list_cons fresh_prod pt1[OF pt]) | 
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2397 | by (metis Cons_eq_append_conv append_self_conv2 assms(1) at at_fresh fresh_def pt2 pt_fresh_fresh) | 
| 30990 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2398 | |
| 63167 | 2399 | section \<open>Infrastructure lemmas for strong rule inductions\<close> | 
| 26847 | 2400 | (*==========================================================*) | 
| 2401 | ||
| 63167 | 2402 | text \<open> | 
| 26847 | 2403 | For every set of atoms, there is another set of atoms | 
| 2404 | avoiding a finitely supported c and there is a permutation | |
| 30990 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 2405 | which 'translates' between both sets. | 
| 63167 | 2406 | \<close> | 
| 32638 | 2407 | |
| 26847 | 2408 | lemma at_set_avoiding_aux: | 
| 2409 | fixes Xs::"'a set" | |
| 2410 | and As::"'a set" | |
| 2411 |   assumes at: "at TYPE('a)"
 | |
| 2412 | and b: "Xs \<subseteq> As" | |
| 2413 | and c: "finite As" | |
| 2414 | and d: "finite ((supp c)::'a set)" | |
| 32638 | 2415 |   shows "\<exists>(pi::'a prm). (pi\<bullet>Xs)\<sharp>*c \<and> (pi\<bullet>Xs) \<inter> As = {} \<and> set pi \<subseteq> Xs \<times> (pi\<bullet>Xs)"
 | 
| 2416 | proof - | |
| 2417 | from b c have "finite Xs" by (simp add: finite_subset) | |
| 2418 | then show ?thesis using b | |
| 2419 | proof (induct) | |
| 2420 | case empty | |
| 2421 |     have "({}::'a set)\<sharp>*c" by (simp add: fresh_star_def)
 | |
| 2422 | moreover | |
| 2423 |     have "({}::'a set) \<inter> As = {}" by simp
 | |
| 2424 | moreover | |
| 2425 |     have "set ([]::'a prm) \<subseteq> {} \<times> {}" by simp
 | |
| 46179 
47bcf3d5d1f0
Reverted several lemmas involving sets to the state before the
 berghofe parents: 
45961diff
changeset | 2426 | ultimately show ?case by (simp add: empty_eqvt) | 
| 32638 | 2427 | next | 
| 2428 | case (insert x Xs) | |
| 2429 |     then have ih: "\<exists>pi. (pi\<bullet>Xs)\<sharp>*c \<and> (pi\<bullet>Xs) \<inter> As = {} \<and> set pi \<subseteq> Xs \<times> (pi\<bullet>Xs)" by simp
 | |
| 2430 |     then obtain pi where a1: "(pi\<bullet>Xs)\<sharp>*c" and a2: "(pi\<bullet>Xs) \<inter> As = {}" and 
 | |
| 2431 | a4: "set pi \<subseteq> Xs \<times> (pi\<bullet>Xs)" by blast | |
| 2432 | have b: "x\<notin>Xs" by fact | |
| 2433 | have d1: "finite As" by fact | |
| 2434 | have d2: "finite Xs" by fact | |
| 2435 |     have d3: "({x} \<union> Xs) \<subseteq> As" using insert(4) by simp
 | |
| 2436 | from d d1 d2 | |
| 2437 | obtain y::"'a" where fr: "y\<sharp>(c,pi\<bullet>Xs,As)" | |
| 2438 | apply(rule_tac at_exists_fresh[OF at, where x="(c,pi\<bullet>Xs,As)"]) | |
| 2439 | apply(auto simp add: supp_prod at_supp[OF at] at_fin_set_supp[OF at] | |
| 46179 
47bcf3d5d1f0
Reverted several lemmas involving sets to the state before the
 berghofe parents: 
45961diff
changeset | 2440 | pt_supp_finite_pi[OF pt_set_inst[OF at_pt_inst[OF at]] at]) | 
| 32638 | 2441 | done | 
| 2442 |     have "({y}\<union>(pi\<bullet>Xs))\<sharp>*c" using a1 fr by (simp add: fresh_star_def)
 | |
| 2443 | moreover | |
| 2444 |     have "({y}\<union>(pi\<bullet>Xs))\<inter>As = {}" using a2 d1 fr 
 | |
| 2445 | by (simp add: fresh_prod at_fin_set_fresh[OF at]) | |
| 2446 | moreover | |
| 2447 | have "pi\<bullet>x=x" using a4 b a2 d3 | |
| 2448 | by (rule_tac at_prm_fresh2[OF at]) (auto) | |
| 2449 |     then have "set ((pi\<bullet>x,y)#pi) \<subseteq> ({x} \<union> Xs) \<times> ({y}\<union>(pi\<bullet>Xs))" using a4 by auto
 | |
| 2450 | moreover | |
| 2451 |     have "(((pi\<bullet>x,y)#pi)\<bullet>({x} \<union> Xs)) = {y}\<union>(pi\<bullet>Xs)"
 | |
| 26847 | 2452 | proof - | 
| 32638 | 2453 | have eq: "[(pi\<bullet>x,y)]\<bullet>(pi\<bullet>Xs) = (pi\<bullet>Xs)" | 
| 2454 | proof - | |
| 32960 
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
 wenzelm parents: 
32638diff
changeset | 2455 | have "(pi\<bullet>x)\<sharp>(pi\<bullet>Xs)" using b d2 | 
| 46179 
47bcf3d5d1f0
Reverted several lemmas involving sets to the state before the
 berghofe parents: 
45961diff
changeset | 2456 | by (simp add: pt_fresh_bij [OF pt_set_inst [OF at_pt_inst [OF at]], OF at] | 
| 45961 | 2457 | at_fin_set_fresh [OF at]) | 
| 32960 
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
 wenzelm parents: 
32638diff
changeset | 2458 | moreover | 
| 
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
 wenzelm parents: 
32638diff
changeset | 2459 | have "y\<sharp>(pi\<bullet>Xs)" using fr by simp | 
| 
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
 wenzelm parents: 
32638diff
changeset | 2460 | ultimately show "[(pi\<bullet>x,y)]\<bullet>(pi\<bullet>Xs) = (pi\<bullet>Xs)" | 
| 46179 
47bcf3d5d1f0
Reverted several lemmas involving sets to the state before the
 berghofe parents: 
45961diff
changeset | 2461 | by (simp add: pt_fresh_fresh[OF pt_set_inst | 
| 
47bcf3d5d1f0
Reverted several lemmas involving sets to the state before the
 berghofe parents: 
45961diff
changeset | 2462 | [OF at_pt_inst[OF at]], OF at]) | 
| 32638 | 2463 | qed | 
| 2464 |       have "(((pi\<bullet>x,y)#pi)\<bullet>({x}\<union>Xs)) = ([(pi\<bullet>x,y)]\<bullet>(pi\<bullet>({x}\<union>Xs)))"
 | |
| 46179 
47bcf3d5d1f0
Reverted several lemmas involving sets to the state before the
 berghofe parents: 
45961diff
changeset | 2465 | by (simp add: pt2[symmetric, OF pt_set_inst [OF at_pt_inst[OF at]]]) | 
| 32638 | 2466 |       also have "\<dots> = {y}\<union>([(pi\<bullet>x,y)]\<bullet>(pi\<bullet>Xs))" 
 | 
| 46179 
47bcf3d5d1f0
Reverted several lemmas involving sets to the state before the
 berghofe parents: 
45961diff
changeset | 2467 | by (simp only: union_eqvt perm_set_def at_calc[OF at])(auto) | 
| 32638 | 2468 |       finally show "(((pi\<bullet>x,y)#pi)\<bullet>({x} \<union> Xs)) = {y}\<union>(pi\<bullet>Xs)" using eq by simp
 | 
| 26847 | 2469 | qed | 
| 32638 | 2470 | ultimately | 
| 2471 | show ?case by (rule_tac x="(pi\<bullet>x,y)#pi" in exI) (auto) | |
| 26847 | 2472 | qed | 
| 2473 | qed | |
| 2474 | ||
| 2475 | lemma at_set_avoiding: | |
| 2476 | fixes Xs::"'a set" | |
| 2477 |   assumes at: "at TYPE('a)"
 | |
| 2478 | and a: "finite Xs" | |
| 2479 | and b: "finite ((supp c)::'a set)" | |
| 32638 | 2480 | obtains pi::"'a prm" where "(pi\<bullet>Xs)\<sharp>*c" and "set pi \<subseteq> Xs \<times> (pi\<bullet>Xs)" | 
| 2481 | using a b at_set_avoiding_aux[OF at, where Xs="Xs" and As="Xs" and c="c"] | |
| 2482 | by (blast) | |
| 2483 | ||
| 63167 | 2484 | section \<open>composition instances\<close> | 
| 19477 | 2485 | (* ============================= *) | 
| 2486 | ||
| 2487 | lemma cp_list_inst: | |
| 2488 |   assumes c1: "cp TYPE ('a) TYPE('x) TYPE('y)"
 | |
| 2489 |   shows "cp TYPE ('a list) TYPE('x) TYPE('y)"
 | |
| 2490 | using c1 | |
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2491 | apply(clarsimp simp add: cp_def) | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2492 | by (induct_tac x) auto | 
| 19477 | 2493 | |
| 46179 
47bcf3d5d1f0
Reverted several lemmas involving sets to the state before the
 berghofe parents: 
45961diff
changeset | 2494 | lemma cp_set_inst: | 
| 
47bcf3d5d1f0
Reverted several lemmas involving sets to the state before the
 berghofe parents: 
45961diff
changeset | 2495 |   assumes c1: "cp TYPE ('a) TYPE('x) TYPE('y)"
 | 
| 
47bcf3d5d1f0
Reverted several lemmas involving sets to the state before the
 berghofe parents: 
45961diff
changeset | 2496 |   shows "cp TYPE ('a set) TYPE('x) TYPE('y)"
 | 
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2497 | using c1 | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2498 | unfolding cp_def perm_set_def | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2499 | by (smt (verit) Collect_cong mem_Collect_eq) | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2500 | |
| 46179 
47bcf3d5d1f0
Reverted several lemmas involving sets to the state before the
 berghofe parents: 
45961diff
changeset | 2501 | |
| 19477 | 2502 | lemma cp_option_inst: | 
| 2503 |   assumes c1: "cp TYPE ('a) TYPE('x) TYPE('y)"
 | |
| 2504 |   shows "cp TYPE ('a option) TYPE('x) TYPE('y)"
 | |
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2505 | using c1 unfolding cp_def by (metis none_eqvt not_None_eq some_eqvt) | 
| 19477 | 2506 | |
| 2507 | lemma cp_noption_inst: | |
| 2508 |   assumes c1: "cp TYPE ('a) TYPE('x) TYPE('y)"
 | |
| 2509 |   shows "cp TYPE ('a noption) TYPE('x) TYPE('y)"
 | |
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2510 | using c1 unfolding cp_def | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2511 | by (metis nnone_eqvt noption.exhaust nsome_eqvt) | 
| 19477 | 2512 | |
| 2513 | lemma cp_unit_inst: | |
| 2514 |   shows "cp TYPE (unit) TYPE('x) TYPE('y)"
 | |
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2515 | by (simp add: cp_def) | 
| 19477 | 2516 | |
| 2517 | lemma cp_bool_inst: | |
| 2518 |   shows "cp TYPE (bool) TYPE('x) TYPE('y)"
 | |
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2519 | apply(clarsimp simp add: cp_def) | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2520 | by (induct_tac x) auto | 
| 19477 | 2521 | |
| 2522 | lemma cp_prod_inst: | |
| 2523 |   assumes c1: "cp TYPE ('a) TYPE('x) TYPE('y)"
 | |
| 2524 |   and     c2: "cp TYPE ('b) TYPE('x) TYPE('y)"
 | |
| 2525 |   shows "cp TYPE ('a\<times>'b) TYPE('x) TYPE('y)"
 | |
| 2526 | using c1 c2 | |
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2527 | by (simp add: cp_def) | 
| 19477 | 2528 | |
| 2529 | lemma cp_fun_inst: | |
| 2530 |   assumes c1: "cp TYPE ('a) TYPE('x) TYPE('y)"
 | |
| 2531 |   and     c2: "cp TYPE ('b) TYPE('x) TYPE('y)"
 | |
| 2532 |   and     pt: "pt TYPE ('y) TYPE('x)"
 | |
| 2533 |   and     at: "at TYPE ('x)"
 | |
| 2534 |   shows "cp TYPE ('a\<Rightarrow>'b) TYPE('x) TYPE('y)"
 | |
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2535 | using c1 c2 | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2536 | by(auto simp add: cp_def perm_fun_def fun_eq_iff at pt pt_list_inst pt_prod_inst pt_rev_pi rev_eqvt) | 
| 19477 | 2537 | |
| 2538 | ||
| 63167 | 2539 | section \<open>Andy's freshness lemma\<close> | 
| 17870 | 2540 | (*================================*) | 
| 2541 | ||
| 2542 | lemma freshness_lemma: | |
| 2543 | fixes h :: "'x\<Rightarrow>'a" | |
| 2544 |   assumes pta: "pt TYPE('a) TYPE('x)"
 | |
| 2545 |   and     at:  "at TYPE('x)" 
 | |
| 2546 | and f1: "finite ((supp h)::'x set)" | |
| 22500 
8436bfd21bf3
corrected the lemmas min_nat_eqvt and min_int_eqvt
 urbanc parents: 
22446diff
changeset | 2547 | and a: "\<exists>a::'x. a\<sharp>(h,h a)" | 
| 17870 | 2548 | shows "\<exists>fr::'a. \<forall>a::'x. a\<sharp>h \<longrightarrow> (h a) = fr" | 
| 2549 | proof - | |
| 2550 |   have ptb: "pt TYPE('x) TYPE('x)" by (simp add: at_pt_inst[OF at]) 
 | |
| 2551 |   have ptc: "pt TYPE('x\<Rightarrow>'a) TYPE('x)" by (simp add: pt_fun_inst[OF ptb, OF pta, OF at]) 
 | |
| 22500 
8436bfd21bf3
corrected the lemmas min_nat_eqvt and min_int_eqvt
 urbanc parents: 
22446diff
changeset | 2552 | from a obtain a0 where a1: "a0\<sharp>h" and a2: "a0\<sharp>(h a0)" by (force simp add: fresh_prod) | 
| 17870 | 2553 | show ?thesis | 
| 2554 | proof | |
| 2555 | let ?fr = "h (a0::'x)" | |
| 2556 | show "\<forall>(a::'x). (a\<sharp>h \<longrightarrow> ((h a) = ?fr))" | |
| 2557 | proof (intro strip) | |
| 2558 | fix a | |
| 2559 | assume a3: "(a::'x)\<sharp>h" | |
| 2560 | show "h (a::'x) = h a0" | |
| 2561 | proof (cases "a=a0") | |
| 32960 
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
 wenzelm parents: 
32638diff
changeset | 2562 | case True thus "h (a::'x) = h a0" by simp | 
| 17870 | 2563 | next | 
| 32960 
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
 wenzelm parents: 
32638diff
changeset | 2564 | case False | 
| 
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
 wenzelm parents: 
32638diff
changeset | 2565 | assume "a\<noteq>a0" | 
| 
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
 wenzelm parents: 
32638diff
changeset | 2566 | hence c1: "a\<notin>((supp a0)::'x set)" by (simp add: fresh_def[symmetric] at_fresh[OF at]) | 
| 
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
 wenzelm parents: 
32638diff
changeset | 2567 | have c2: "a\<notin>((supp h)::'x set)" using a3 by (simp add: fresh_def) | 
| 
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
 wenzelm parents: 
32638diff
changeset | 2568 | from c1 c2 have c3: "a\<notin>((supp h)\<union>((supp a0)::'x set))" by force | 
| 
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
 wenzelm parents: 
32638diff
changeset | 2569 | have f2: "finite ((supp a0)::'x set)" by (simp add: at_supp[OF at]) | 
| 
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
 wenzelm parents: 
32638diff
changeset | 2570 | from f1 f2 have "((supp (h a0))::'x set)\<subseteq>((supp h)\<union>(supp a0))" | 
| 
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
 wenzelm parents: 
32638diff
changeset | 2571 | by (simp add: pt_supp_fun_subset[OF ptb, OF pta, OF at]) | 
| 
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
 wenzelm parents: 
32638diff
changeset | 2572 | hence "a\<notin>((supp (h a0))::'x set)" using c3 by force | 
| 
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
 wenzelm parents: 
32638diff
changeset | 2573 | hence "a\<sharp>(h a0)" by (simp add: fresh_def) | 
| 
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
 wenzelm parents: 
32638diff
changeset | 2574 | with a2 have d1: "[(a0,a)]\<bullet>(h a0) = (h a0)" by (rule pt_fresh_fresh[OF pta, OF at]) | 
| 
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
 wenzelm parents: 
32638diff
changeset | 2575 | from a1 a3 have d2: "[(a0,a)]\<bullet>h = h" by (rule pt_fresh_fresh[OF ptc, OF at]) | 
| 
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
 wenzelm parents: 
32638diff
changeset | 2576 | from d1 have "h a0 = [(a0,a)]\<bullet>(h a0)" by simp | 
| 
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
 wenzelm parents: 
32638diff
changeset | 2577 | also have "\<dots>= ([(a0,a)]\<bullet>h)([(a0,a)]\<bullet>a0)" by (simp add: pt_fun_app_eq[OF ptb, OF at]) | 
| 
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
 wenzelm parents: 
32638diff
changeset | 2578 | also have "\<dots> = h ([(a0,a)]\<bullet>a0)" using d2 by simp | 
| 
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
 wenzelm parents: 
32638diff
changeset | 2579 | also have "\<dots> = h a" by (simp add: at_calc[OF at]) | 
| 
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
 wenzelm parents: 
32638diff
changeset | 2580 | finally show "h a = h a0" by simp | 
| 17870 | 2581 | qed | 
| 2582 | qed | |
| 2583 | qed | |
| 2584 | qed | |
| 32960 
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
 wenzelm parents: 
32638diff
changeset | 2585 | |
| 17870 | 2586 | lemma freshness_lemma_unique: | 
| 2587 | fixes h :: "'x\<Rightarrow>'a" | |
| 2588 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 2589 |   and     at: "at TYPE('x)" 
 | |
| 2590 | and f1: "finite ((supp h)::'x set)" | |
| 22500 
8436bfd21bf3
corrected the lemmas min_nat_eqvt and min_int_eqvt
 urbanc parents: 
22446diff
changeset | 2591 | and a: "\<exists>(a::'x). a\<sharp>(h,h a)" | 
| 17870 | 2592 | shows "\<exists>!(fr::'a). \<forall>(a::'x). a\<sharp>h \<longrightarrow> (h a) = fr" | 
| 18703 | 2593 | proof (rule ex_ex1I) | 
| 17870 | 2594 | from pt at f1 a show "\<exists>fr::'a. \<forall>a::'x. a\<sharp>h \<longrightarrow> h a = fr" by (simp add: freshness_lemma) | 
| 2595 | next | |
| 2596 | fix fr1 fr2 | |
| 2597 | assume b1: "\<forall>a::'x. a\<sharp>h \<longrightarrow> h a = fr1" | |
| 2598 | assume b2: "\<forall>a::'x. a\<sharp>h \<longrightarrow> h a = fr2" | |
| 22500 
8436bfd21bf3
corrected the lemmas min_nat_eqvt and min_int_eqvt
 urbanc parents: 
22446diff
changeset | 2599 | from a obtain a where "(a::'x)\<sharp>h" by (force simp add: fresh_prod) | 
| 17870 | 2600 | with b1 b2 have "h a = fr1 \<and> h a = fr2" by force | 
| 2601 | thus "fr1 = fr2" by force | |
| 2602 | qed | |
| 2603 | ||
| 67443 
3abf6a722518
standardized towards new-style formal comments: isabelle update_comments;
 wenzelm parents: 
66453diff
changeset | 2604 | \<comment> \<open>packaging the freshness lemma into a function\<close> | 
| 35416 
d8d7d1b785af
replaced a couple of constsdefs by definitions (also some old primrecs by modern ones)
 haftmann parents: 
32960diff
changeset | 2605 | definition fresh_fun :: "('x\<Rightarrow>'a)\<Rightarrow>'a" where
 | 
| 17870 | 2606 | "fresh_fun (h) \<equiv> THE fr. (\<forall>(a::'x). a\<sharp>h \<longrightarrow> (h a) = fr)" | 
| 2607 | ||
| 2608 | lemma fresh_fun_app: | |
| 2609 | fixes h :: "'x\<Rightarrow>'a" | |
| 2610 | and a :: "'x" | |
| 2611 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 2612 |   and     at: "at TYPE('x)" 
 | |
| 2613 | and f1: "finite ((supp h)::'x set)" | |
| 22500 
8436bfd21bf3
corrected the lemmas min_nat_eqvt and min_int_eqvt
 urbanc parents: 
22446diff
changeset | 2614 | and a: "\<exists>(a::'x). a\<sharp>(h,h a)" | 
| 17870 | 2615 | and b: "a\<sharp>h" | 
| 2616 | shows "(fresh_fun h) = (h a)" | |
| 2617 | proof (unfold fresh_fun_def, rule the_equality) | |
| 2618 | show "\<forall>(a'::'x). a'\<sharp>h \<longrightarrow> h a' = h a" | |
| 2619 | proof (intro strip) | |
| 2620 | fix a'::"'x" | |
| 2621 | assume c: "a'\<sharp>h" | |
| 2622 | from pt at f1 a have "\<exists>(fr::'a). \<forall>(a::'x). a\<sharp>h \<longrightarrow> (h a) = fr" by (rule freshness_lemma) | |
| 2623 | with b c show "h a' = h a" by force | |
| 2624 | qed | |
| 2625 | next | |
| 2626 | fix fr::"'a" | |
| 2627 | assume "\<forall>a. a\<sharp>h \<longrightarrow> h a = fr" | |
| 2628 | with b show "fr = h a" by force | |
| 2629 | qed | |
| 2630 | ||
| 22714 
ca804eb70d39
added a more usuable lemma for dealing with fresh_fun
 urbanc parents: 
22650diff
changeset | 2631 | lemma fresh_fun_app': | 
| 
ca804eb70d39
added a more usuable lemma for dealing with fresh_fun
 urbanc parents: 
22650diff
changeset | 2632 | fixes h :: "'x\<Rightarrow>'a" | 
| 
ca804eb70d39
added a more usuable lemma for dealing with fresh_fun
 urbanc parents: 
22650diff
changeset | 2633 | and a :: "'x" | 
| 
ca804eb70d39
added a more usuable lemma for dealing with fresh_fun
 urbanc parents: 
22650diff
changeset | 2634 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | 
| 
ca804eb70d39
added a more usuable lemma for dealing with fresh_fun
 urbanc parents: 
22650diff
changeset | 2635 |   and     at: "at TYPE('x)" 
 | 
| 
ca804eb70d39
added a more usuable lemma for dealing with fresh_fun
 urbanc parents: 
22650diff
changeset | 2636 | and f1: "finite ((supp h)::'x set)" | 
| 
ca804eb70d39
added a more usuable lemma for dealing with fresh_fun
 urbanc parents: 
22650diff
changeset | 2637 | and a: "a\<sharp>h" "a\<sharp>h a" | 
| 
ca804eb70d39
added a more usuable lemma for dealing with fresh_fun
 urbanc parents: 
22650diff
changeset | 2638 | shows "(fresh_fun h) = (h a)" | 
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2639 | by (meson assms fresh_fun_app fresh_prod pt) | 
| 22714 
ca804eb70d39
added a more usuable lemma for dealing with fresh_fun
 urbanc parents: 
22650diff
changeset | 2640 | |
| 19477 | 2641 | lemma fresh_fun_equiv_ineq: | 
| 2642 | fixes h :: "'y\<Rightarrow>'a" | |
| 2643 | and pi:: "'x prm" | |
| 2644 |   assumes pta: "pt TYPE('a) TYPE('x)"
 | |
| 2645 |   and     ptb: "pt TYPE('y) TYPE('x)"
 | |
| 2646 |   and     ptb':"pt TYPE('a) TYPE('y)"
 | |
| 2647 |   and     at:  "at TYPE('x)" 
 | |
| 2648 |   and     at': "at TYPE('y)"
 | |
| 2649 |   and     cpa: "cp TYPE('a) TYPE('x) TYPE('y)"
 | |
| 2650 |   and     cpb: "cp TYPE('y) TYPE('x) TYPE('y)"
 | |
| 2651 | and f1: "finite ((supp h)::'y set)" | |
| 22500 
8436bfd21bf3
corrected the lemmas min_nat_eqvt and min_int_eqvt
 urbanc parents: 
22446diff
changeset | 2652 | and a1: "\<exists>(a::'y). a\<sharp>(h,h a)" | 
| 19477 | 2653 | shows "pi\<bullet>(fresh_fun h) = fresh_fun(pi\<bullet>h)" (is "?LHS = ?RHS") | 
| 2654 | proof - | |
| 2655 |   have ptd: "pt TYPE('y) TYPE('y)" by (simp add: at_pt_inst[OF at']) 
 | |
| 2656 |   have ptc: "pt TYPE('y\<Rightarrow>'a) TYPE('x)" by (simp add: pt_fun_inst[OF ptb, OF pta, OF at]) 
 | |
| 23393 | 2657 |   have cpc: "cp TYPE('y\<Rightarrow>'a) TYPE ('x) TYPE ('y)" by (rule cp_fun_inst[OF cpb cpa ptb at])
 | 
| 19477 | 2658 | have f2: "finite ((supp (pi\<bullet>h))::'y set)" | 
| 2659 | proof - | |
| 2660 | from f1 have "finite (pi\<bullet>((supp h)::'y set))" | |
| 2661 | by (simp add: pt_set_finite_ineq[OF ptb, OF at]) | |
| 2662 | thus ?thesis | |
| 2663 | by (simp add: pt_perm_supp_ineq[OF ptc, OF ptb, OF at, OF cpc]) | |
| 2664 | qed | |
| 22500 
8436bfd21bf3
corrected the lemmas min_nat_eqvt and min_int_eqvt
 urbanc parents: 
22446diff
changeset | 2665 | from a1 obtain a' where c0: "a'\<sharp>(h,h a')" by force | 
| 
8436bfd21bf3
corrected the lemmas min_nat_eqvt and min_int_eqvt
 urbanc parents: 
22446diff
changeset | 2666 | hence c1: "a'\<sharp>h" and c2: "a'\<sharp>(h a')" by (simp_all add: fresh_prod) | 
| 19477 | 2667 | have c3: "(pi\<bullet>a')\<sharp>(pi\<bullet>h)" using c1 | 
| 2668 | by (simp add: pt_fresh_bij_ineq[OF ptc, OF ptb, OF at, OF cpc]) | |
| 2669 | have c4: "(pi\<bullet>a')\<sharp>(pi\<bullet>h) (pi\<bullet>a')" | |
| 2670 | proof - | |
| 2671 | from c2 have "(pi\<bullet>a')\<sharp>(pi\<bullet>(h a'))" | |
| 2672 | by (simp add: pt_fresh_bij_ineq[OF pta, OF ptb, OF at,OF cpa]) | |
| 2673 | thus ?thesis by (simp add: pt_fun_app_eq[OF ptb, OF at]) | |
| 2674 | qed | |
| 22500 
8436bfd21bf3
corrected the lemmas min_nat_eqvt and min_int_eqvt
 urbanc parents: 
22446diff
changeset | 2675 | have a2: "\<exists>(a::'y). a\<sharp>(pi\<bullet>h,(pi\<bullet>h) a)" using c3 c4 by (force simp add: fresh_prod) | 
| 19477 | 2676 | have d1: "?LHS = pi\<bullet>(h a')" using c1 a1 by (simp add: fresh_fun_app[OF ptb', OF at', OF f1]) | 
| 2677 | have d2: "?RHS = (pi\<bullet>h) (pi\<bullet>a')" using c3 a2 | |
| 2678 | by (simp add: fresh_fun_app[OF ptb', OF at', OF f2]) | |
| 2679 | show ?thesis using d1 d2 by (simp add: pt_fun_app_eq[OF ptb, OF at]) | |
| 2680 | qed | |
| 2681 | ||
| 17870 | 2682 | lemma fresh_fun_equiv: | 
| 2683 | fixes h :: "'x\<Rightarrow>'a" | |
| 2684 | and pi:: "'x prm" | |
| 2685 |   assumes pta: "pt TYPE('a) TYPE('x)"
 | |
| 2686 |   and     at:  "at TYPE('x)" 
 | |
| 2687 | and f1: "finite ((supp h)::'x set)" | |
| 22500 
8436bfd21bf3
corrected the lemmas min_nat_eqvt and min_int_eqvt
 urbanc parents: 
22446diff
changeset | 2688 | and a1: "\<exists>(a::'x). a\<sharp>(h,h a)" | 
| 17870 | 2689 | shows "pi\<bullet>(fresh_fun h) = fresh_fun(pi\<bullet>h)" (is "?LHS = ?RHS") | 
| 2690 | proof - | |
| 2691 |   have ptb: "pt TYPE('x) TYPE('x)" by (simp add: at_pt_inst[OF at]) 
 | |
| 2692 |   have ptc: "pt TYPE('x\<Rightarrow>'a) TYPE('x)" by (simp add: pt_fun_inst[OF ptb, OF pta, OF at]) 
 | |
| 2693 | have f2: "finite ((supp (pi\<bullet>h))::'x set)" | |
| 2694 | proof - | |
| 2695 | from f1 have "finite (pi\<bullet>((supp h)::'x set))" by (simp add: pt_set_finite_ineq[OF ptb, OF at]) | |
| 2696 | thus ?thesis by (simp add: pt_perm_supp[OF ptc, OF at]) | |
| 2697 | qed | |
| 22500 
8436bfd21bf3
corrected the lemmas min_nat_eqvt and min_int_eqvt
 urbanc parents: 
22446diff
changeset | 2698 | from a1 obtain a' where c0: "a'\<sharp>(h,h a')" by force | 
| 
8436bfd21bf3
corrected the lemmas min_nat_eqvt and min_int_eqvt
 urbanc parents: 
22446diff
changeset | 2699 | hence c1: "a'\<sharp>h" and c2: "a'\<sharp>(h a')" by (simp_all add: fresh_prod) | 
| 17870 | 2700 | have c3: "(pi\<bullet>a')\<sharp>(pi\<bullet>h)" using c1 by (simp add: pt_fresh_bij[OF ptc, OF at]) | 
| 2701 | have c4: "(pi\<bullet>a')\<sharp>(pi\<bullet>h) (pi\<bullet>a')" | |
| 2702 | proof - | |
| 2703 | from c2 have "(pi\<bullet>a')\<sharp>(pi\<bullet>(h a'))" by (simp add: pt_fresh_bij[OF pta, OF at]) | |
| 2704 | thus ?thesis by (simp add: pt_fun_app_eq[OF ptb, OF at]) | |
| 2705 | qed | |
| 22500 
8436bfd21bf3
corrected the lemmas min_nat_eqvt and min_int_eqvt
 urbanc parents: 
22446diff
changeset | 2706 | have a2: "\<exists>(a::'x). a\<sharp>(pi\<bullet>h,(pi\<bullet>h) a)" using c3 c4 by (force simp add: fresh_prod) | 
| 17870 | 2707 | have d1: "?LHS = pi\<bullet>(h a')" using c1 a1 by (simp add: fresh_fun_app[OF pta, OF at, OF f1]) | 
| 2708 | have d2: "?RHS = (pi\<bullet>h) (pi\<bullet>a')" using c3 a2 by (simp add: fresh_fun_app[OF pta, OF at, OF f2]) | |
| 2709 | show ?thesis using d1 d2 by (simp add: pt_fun_app_eq[OF ptb, OF at]) | |
| 2710 | qed | |
| 19216 | 2711 | |
| 2712 | lemma fresh_fun_supports: | |
| 2713 | fixes h :: "'x\<Rightarrow>'a" | |
| 2714 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 2715 |   and     at: "at TYPE('x)" 
 | |
| 2716 | and f1: "finite ((supp h)::'x set)" | |
| 22500 
8436bfd21bf3
corrected the lemmas min_nat_eqvt and min_int_eqvt
 urbanc parents: 
22446diff
changeset | 2717 | and a: "\<exists>(a::'x). a\<sharp>(h,h a)" | 
| 19216 | 2718 | shows "((supp h)::'x set) supports (fresh_fun h)" | 
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2719 | by(simp flip: fresh_def add: supports_def assms at_pt_inst fresh_fun_equiv pt_fresh_fresh pt_fun_inst) | 
| 17870 | 2720 | |
| 63167 | 2721 | section \<open>Abstraction function\<close> | 
| 17870 | 2722 | (*==============================*) | 
| 2723 | ||
| 2724 | lemma pt_abs_fun_inst: | |
| 2725 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 2726 |   and     at: "at TYPE('x)"
 | |
| 18579 
002d371401f5
changed the name of the type "nOption" to "noption".
 urbanc parents: 
18578diff
changeset | 2727 |   shows "pt TYPE('x\<Rightarrow>('a noption)) TYPE('x)"
 | 
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2728 | by (simp add: at at_pt_inst pt pt_fun_inst pt_noption_inst) | 
| 17870 | 2729 | |
| 69597 | 2730 | definition abs_fun :: "'x\<Rightarrow>'a\<Rightarrow>('x\<Rightarrow>('a noption))" (\<open>[_]._\<close> [100,100] 100) where 
 | 
| 17870 | 2731 | "[a].x \<equiv> (\<lambda>b. (if b=a then nSome(x) else (if b\<sharp>x then nSome([(a,b)]\<bullet>x) else nNone)))" | 
| 2732 | ||
| 18745 
060400dc077c
a fixme comments about abs_fun_if, which should be called perm_if
 urbanc parents: 
18703diff
changeset | 2733 | (* FIXME: should be called perm_if and placed close to the definition of permutations on bools *) | 
| 17870 | 2734 | lemma abs_fun_if: | 
| 2735 | fixes pi :: "'x prm" | |
| 2736 | and x :: "'a" | |
| 2737 | and y :: "'a" | |
| 2738 | and c :: "bool" | |
| 2739 | shows "pi\<bullet>(if c then x else y) = (if c then (pi\<bullet>x) else (pi\<bullet>y))" | |
| 2740 | by force | |
| 2741 | ||
| 2742 | lemma abs_fun_pi_ineq: | |
| 2743 | fixes a :: "'y" | |
| 2744 | and x :: "'a" | |
| 2745 | and pi :: "'x prm" | |
| 2746 |   assumes pta: "pt TYPE('a) TYPE('x)"
 | |
| 2747 |   and     ptb: "pt TYPE('y) TYPE('x)"
 | |
| 2748 |   and     at:  "at TYPE('x)"
 | |
| 2749 |   and     cp:  "cp TYPE('a) TYPE('x) TYPE('y)"
 | |
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2750 | shows "pi\<bullet>([a].x) = [(pi\<bullet>a)].(pi\<bullet>x)" | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2751 | unfolding fun_eq_iff | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2752 | proof | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2753 | fix y | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2754 | have "(((rev pi)\<bullet>y) = a) = (y = pi\<bullet>a)" | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2755 | by (metis at pt_rev_pi ptb) | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2756 | moreover | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2757 | have "(((rev pi)\<bullet>y)\<sharp>x) = (y\<sharp>(pi\<bullet>x))" | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2758 | by (simp add: assms pt_fresh_left_ineq) | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2759 | moreover | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2760 | have "pi\<bullet>([(a,(rev pi)\<bullet>y)]\<bullet>x) = [(pi\<bullet>a,y)]\<bullet>(pi\<bullet>x)" | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2761 | using assms cp1[OF cp] by (simp add: pt_pi_rev) | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2762 | ultimately | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2763 | show "(pi \<bullet> [a].x) y = ([(pi \<bullet> a)].(pi \<bullet> x)) y" | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2764 | by (simp add: abs_fun_def perm_fun_def) | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2765 | qed | 
| 17870 | 2766 | |
| 2767 | lemma abs_fun_pi: | |
| 2768 | fixes a :: "'x" | |
| 2769 | and x :: "'a" | |
| 2770 | and pi :: "'x prm" | |
| 2771 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 2772 |   and     at: "at TYPE('x)"
 | |
| 2773 | shows "pi\<bullet>([a].x) = [(pi\<bullet>a)].(pi\<bullet>x)" | |
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2774 | by (simp add: abs_fun_pi_ineq at at_pt_inst cp_pt_inst pt) | 
| 17870 | 2775 | |
| 2776 | lemma abs_fun_eq1: | |
| 2777 | fixes x :: "'a" | |
| 2778 | and y :: "'a" | |
| 2779 | and a :: "'x" | |
| 2780 | shows "([a].x = [a].y) = (x = y)" | |
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2781 | by (metis abs_fun_def noption.inject) | 
| 17870 | 2782 | |
| 2783 | lemma abs_fun_eq2: | |
| 2784 | fixes x :: "'a" | |
| 2785 | and y :: "'a" | |
| 2786 | and a :: "'x" | |
| 2787 | and b :: "'x" | |
| 2788 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 2789 |       and at: "at TYPE('x)"
 | |
| 2790 | and a1: "a\<noteq>b" | |
| 2791 | and a2: "[a].x = [b].y" | |
| 18268 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2792 | shows "x=[(a,b)]\<bullet>y \<and> a\<sharp>y" | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2793 | proof - | 
| 39302 
d7728f65b353
renamed lemmas: ext_iff -> fun_eq_iff, set_ext_iff -> set_eq_iff, set_ext -> set_eqI
 nipkow parents: 
39198diff
changeset | 2794 | from a2 have "\<forall>c::'x. ([a].x) c = ([b].y) c" by (force simp add: fun_eq_iff) | 
| 18268 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2795 | hence "([a].x) a = ([b].y) a" by simp | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2796 | hence a3: "nSome(x) = ([b].y) a" by (simp add: abs_fun_def) | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2797 | show "x=[(a,b)]\<bullet>y \<and> a\<sharp>y" | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2798 | proof (cases "a\<sharp>y") | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2799 | assume a4: "a\<sharp>y" | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2800 | hence "x=[(b,a)]\<bullet>y" using a3 a1 by (simp add: abs_fun_def) | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2801 | moreover | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2802 | have "[(a,b)]\<bullet>y = [(b,a)]\<bullet>y" by (rule pt3[OF pt], rule at_ds5[OF at]) | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2803 | ultimately show ?thesis using a4 by simp | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2804 | next | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2805 | assume "\<not>a\<sharp>y" | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2806 | hence "nSome(x) = nNone" using a1 a3 by (simp add: abs_fun_def) | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2807 | hence False by simp | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2808 | thus ?thesis by simp | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2809 | qed | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2810 | qed | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2811 | |
| 17870 | 2812 | lemma abs_fun_eq3: | 
| 2813 | fixes x :: "'a" | |
| 2814 | and y :: "'a" | |
| 2815 | and a :: "'x" | |
| 2816 | and b :: "'x" | |
| 2817 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 2818 |       and at: "at TYPE('x)"
 | |
| 2819 | and a1: "a\<noteq>b" | |
| 2820 | and a2: "x=[(a,b)]\<bullet>y" | |
| 2821 | and a3: "a\<sharp>y" | |
| 2822 | shows "[a].x =[b].y" | |
| 2823 | proof - | |
| 18268 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2824 | show ?thesis | 
| 39302 
d7728f65b353
renamed lemmas: ext_iff -> fun_eq_iff, set_ext_iff -> set_eq_iff, set_ext -> set_eqI
 nipkow parents: 
39198diff
changeset | 2825 | proof (simp only: abs_fun_def fun_eq_iff, intro strip) | 
| 18268 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2826 | fix c::"'x" | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2827 | let ?LHS = "if c=a then nSome(x) else if c\<sharp>x then nSome([(a,c)]\<bullet>x) else nNone" | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2828 | and ?RHS = "if c=b then nSome(y) else if c\<sharp>y then nSome([(b,c)]\<bullet>y) else nNone" | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2829 | show "?LHS=?RHS" | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2830 | proof - | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2831 | have "(c=a) \<or> (c=b) \<or> (c\<noteq>a \<and> c\<noteq>b)" by blast | 
| 67443 
3abf6a722518
standardized towards new-style formal comments: isabelle update_comments;
 wenzelm parents: 
66453diff
changeset | 2832 | moreover \<comment> \<open>case c=a\<close> | 
| 18268 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2833 |       { have "nSome(x) = nSome([(a,b)]\<bullet>y)" using a2 by simp
 | 
| 32960 
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
 wenzelm parents: 
32638diff
changeset | 2834 | also have "\<dots> = nSome([(b,a)]\<bullet>y)" by (simp, rule pt3[OF pt], rule at_ds5[OF at]) | 
| 
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
 wenzelm parents: 
32638diff
changeset | 2835 | finally have "nSome(x) = nSome([(b,a)]\<bullet>y)" by simp | 
| 
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
 wenzelm parents: 
32638diff
changeset | 2836 | moreover | 
| 
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
 wenzelm parents: 
32638diff
changeset | 2837 | assume "c=a" | 
| 
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
 wenzelm parents: 
32638diff
changeset | 2838 | ultimately have "?LHS=?RHS" using a1 a3 by simp | 
| 18268 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2839 | } | 
| 67443 
3abf6a722518
standardized towards new-style formal comments: isabelle update_comments;
 wenzelm parents: 
66453diff
changeset | 2840 | moreover \<comment> \<open>case c=b\<close> | 
| 18268 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2841 |       { have a4: "y=[(a,b)]\<bullet>x" using a2 by (simp only: pt_swap_bij[OF pt, OF at])
 | 
| 32960 
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
 wenzelm parents: 
32638diff
changeset | 2842 | hence "a\<sharp>([(a,b)]\<bullet>x)" using a3 by simp | 
| 
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
 wenzelm parents: 
32638diff
changeset | 2843 | hence "b\<sharp>x" by (simp add: at_calc[OF at] pt_fresh_left[OF pt, OF at]) | 
| 
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
 wenzelm parents: 
32638diff
changeset | 2844 | moreover | 
| 
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
 wenzelm parents: 
32638diff
changeset | 2845 | assume "c=b" | 
| 
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
 wenzelm parents: 
32638diff
changeset | 2846 | ultimately have "?LHS=?RHS" using a1 a4 by simp | 
| 18268 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2847 | } | 
| 67443 
3abf6a722518
standardized towards new-style formal comments: isabelle update_comments;
 wenzelm parents: 
66453diff
changeset | 2848 | moreover \<comment> \<open>case c\<noteq>a \<and> c\<noteq>b\<close> | 
| 18268 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2849 |       { assume a5: "c\<noteq>a \<and> c\<noteq>b"
 | 
| 32960 
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
 wenzelm parents: 
32638diff
changeset | 2850 | moreover | 
| 
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
 wenzelm parents: 
32638diff
changeset | 2851 | have "c\<sharp>x = c\<sharp>y" using a2 a5 by (force simp add: at_calc[OF at] pt_fresh_left[OF pt, OF at]) | 
| 
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
 wenzelm parents: 
32638diff
changeset | 2852 | moreover | 
| 
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
 wenzelm parents: 
32638diff
changeset | 2853 | have "c\<sharp>y \<longrightarrow> [(a,c)]\<bullet>x = [(b,c)]\<bullet>y" | 
| 
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
 wenzelm parents: 
32638diff
changeset | 2854 | proof (intro strip) | 
| 
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
 wenzelm parents: 
32638diff
changeset | 2855 | assume a6: "c\<sharp>y" | 
| 
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
 wenzelm parents: 
32638diff
changeset | 2856 | have "[(a,c),(b,c),(a,c)] \<triangleq> [(a,b)]" using a1 a5 by (force intro: at_ds3[OF at]) | 
| 
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
 wenzelm parents: 
32638diff
changeset | 2857 | hence "[(a,c)]\<bullet>([(b,c)]\<bullet>([(a,c)]\<bullet>y)) = [(a,b)]\<bullet>y" | 
| 
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
 wenzelm parents: 
32638diff
changeset | 2858 | by (simp add: pt2[OF pt, symmetric] pt3[OF pt]) | 
| 
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
 wenzelm parents: 
32638diff
changeset | 2859 | hence "[(a,c)]\<bullet>([(b,c)]\<bullet>y) = [(a,b)]\<bullet>y" using a3 a6 | 
| 
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
 wenzelm parents: 
32638diff
changeset | 2860 | by (simp add: pt_fresh_fresh[OF pt, OF at]) | 
| 
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
 wenzelm parents: 
32638diff
changeset | 2861 | hence "[(a,c)]\<bullet>([(b,c)]\<bullet>y) = x" using a2 by simp | 
| 
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
 wenzelm parents: 
32638diff
changeset | 2862 | hence "[(b,c)]\<bullet>y = [(a,c)]\<bullet>x" by (drule_tac pt_bij1[OF pt, OF at], simp) | 
| 
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
 wenzelm parents: 
32638diff
changeset | 2863 | thus "[(a,c)]\<bullet>x = [(b,c)]\<bullet>y" by simp | 
| 
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
 wenzelm parents: 
32638diff
changeset | 2864 | qed | 
| 
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
 wenzelm parents: 
32638diff
changeset | 2865 | ultimately have "?LHS=?RHS" by simp | 
| 18268 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2866 | } | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2867 | ultimately show "?LHS = ?RHS" by blast | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2868 | qed | 
| 17870 | 2869 | qed | 
| 18268 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2870 | qed | 
| 32960 
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
 wenzelm parents: 
32638diff
changeset | 2871 | |
| 23158 
749b6870b1a1
introduced symmetric variants of the lemmas for alpha-equivalence
 urbanc parents: 
23050diff
changeset | 2872 | (* alpha equivalence *) | 
| 17870 | 2873 | lemma abs_fun_eq: | 
| 2874 | fixes x :: "'a" | |
| 2875 | and y :: "'a" | |
| 2876 | and a :: "'x" | |
| 2877 | and b :: "'x" | |
| 2878 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 2879 |       and at: "at TYPE('x)"
 | |
| 2880 | shows "([a].x = [b].y) = ((a=b \<and> x=y)\<or>(a\<noteq>b \<and> x=[(a,b)]\<bullet>y \<and> a\<sharp>y))" | |
| 2881 | proof (rule iffI) | |
| 2882 | assume b: "[a].x = [b].y" | |
| 2883 | show "(a=b \<and> x=y)\<or>(a\<noteq>b \<and> x=[(a,b)]\<bullet>y \<and> a\<sharp>y)" | |
| 2884 | proof (cases "a=b") | |
| 2885 | case True with b show ?thesis by (simp add: abs_fun_eq1) | |
| 2886 | next | |
| 2887 | case False with b show ?thesis by (simp add: abs_fun_eq2[OF pt, OF at]) | |
| 2888 | qed | |
| 2889 | next | |
| 2890 | assume "(a=b \<and> x=y)\<or>(a\<noteq>b \<and> x=[(a,b)]\<bullet>y \<and> a\<sharp>y)" | |
| 2891 | thus "[a].x = [b].y" | |
| 2892 | proof | |
| 2893 | assume "a=b \<and> x=y" thus ?thesis by simp | |
| 2894 | next | |
| 2895 | assume "a\<noteq>b \<and> x=[(a,b)]\<bullet>y \<and> a\<sharp>y" | |
| 2896 | thus ?thesis by (simp add: abs_fun_eq3[OF pt, OF at]) | |
| 2897 | qed | |
| 2898 | qed | |
| 2899 | ||
| 23158 
749b6870b1a1
introduced symmetric variants of the lemmas for alpha-equivalence
 urbanc parents: 
23050diff
changeset | 2900 | (* symmetric version of alpha-equivalence *) | 
| 19562 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2901 | lemma abs_fun_eq': | 
| 23158 
749b6870b1a1
introduced symmetric variants of the lemmas for alpha-equivalence
 urbanc parents: 
23050diff
changeset | 2902 | fixes x :: "'a" | 
| 
749b6870b1a1
introduced symmetric variants of the lemmas for alpha-equivalence
 urbanc parents: 
23050diff
changeset | 2903 | and y :: "'a" | 
| 
749b6870b1a1
introduced symmetric variants of the lemmas for alpha-equivalence
 urbanc parents: 
23050diff
changeset | 2904 | and a :: "'x" | 
| 
749b6870b1a1
introduced symmetric variants of the lemmas for alpha-equivalence
 urbanc parents: 
23050diff
changeset | 2905 | and b :: "'x" | 
| 
749b6870b1a1
introduced symmetric variants of the lemmas for alpha-equivalence
 urbanc parents: 
23050diff
changeset | 2906 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | 
| 
749b6870b1a1
introduced symmetric variants of the lemmas for alpha-equivalence
 urbanc parents: 
23050diff
changeset | 2907 |       and at: "at TYPE('x)"
 | 
| 23159 | 2908 | shows "([a].x = [b].y) = ((a=b \<and> x=y)\<or>(a\<noteq>b \<and> [(b,a)]\<bullet>x=y \<and> b\<sharp>x))" | 
| 2909 | by (auto simp add: abs_fun_eq[OF pt, OF at] pt_swap_bij'[OF pt, OF at] | |
| 23158 
749b6870b1a1
introduced symmetric variants of the lemmas for alpha-equivalence
 urbanc parents: 
23050diff
changeset | 2910 | pt_fresh_left[OF pt, OF at] | 
| 
749b6870b1a1
introduced symmetric variants of the lemmas for alpha-equivalence
 urbanc parents: 
23050diff
changeset | 2911 | at_calc[OF at]) | 
| 
749b6870b1a1
introduced symmetric variants of the lemmas for alpha-equivalence
 urbanc parents: 
23050diff
changeset | 2912 | |
| 
749b6870b1a1
introduced symmetric variants of the lemmas for alpha-equivalence
 urbanc parents: 
23050diff
changeset | 2913 | (* alpha_equivalence with a fresh name *) | 
| 
749b6870b1a1
introduced symmetric variants of the lemmas for alpha-equivalence
 urbanc parents: 
23050diff
changeset | 2914 | lemma abs_fun_fresh: | 
| 19562 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2915 | fixes x :: "'a" | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2916 | and y :: "'a" | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2917 | and c :: "'x" | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2918 | and a :: "'x" | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2919 | and b :: "'x" | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2920 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2921 |       and at: "at TYPE('x)"
 | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2922 | and fr: "c\<noteq>a" "c\<noteq>b" "c\<sharp>x" "c\<sharp>y" | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2923 | shows "([a].x = [b].y) = ([(a,c)]\<bullet>x = [(b,c)]\<bullet>y)" | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2924 | proof (rule iffI) | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2925 | assume eq0: "[a].x = [b].y" | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2926 | show "[(a,c)]\<bullet>x = [(b,c)]\<bullet>y" | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2927 | proof (cases "a=b") | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2928 | case True then show ?thesis using eq0 by (simp add: pt_bij[OF pt, OF at] abs_fun_eq[OF pt, OF at]) | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2929 | next | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2930 | case False | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2931 | have ineq: "a\<noteq>b" by fact | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2932 | with eq0 have eq: "x=[(a,b)]\<bullet>y" and fr': "a\<sharp>y" by (simp_all add: abs_fun_eq[OF pt, OF at]) | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2933 | from eq have "[(a,c)]\<bullet>x = [(a,c)]\<bullet>[(a,b)]\<bullet>y" by (simp add: pt_bij[OF pt, OF at]) | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2934 | also have "\<dots> = ([(a,c)]\<bullet>[(a,b)])\<bullet>([(a,c)]\<bullet>y)" by (rule pt_perm_compose[OF pt, OF at]) | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2935 | also have "\<dots> = [(c,b)]\<bullet>y" using ineq fr fr' | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2936 | by (simp add: pt_fresh_fresh[OF pt, OF at] at_calc[OF at]) | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2937 | also have "\<dots> = [(b,c)]\<bullet>y" by (rule pt3[OF pt], rule at_ds5[OF at]) | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2938 | finally show ?thesis by simp | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2939 | qed | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2940 | next | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2941 | assume eq: "[(a,c)]\<bullet>x = [(b,c)]\<bullet>y" | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2942 | thus "[a].x = [b].y" | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2943 | proof (cases "a=b") | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2944 | case True then show ?thesis using eq by (simp add: pt_bij[OF pt, OF at] abs_fun_eq[OF pt, OF at]) | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2945 | next | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2946 | case False | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2947 | have ineq: "a\<noteq>b" by fact | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2948 | from fr have "([(a,c)]\<bullet>c)\<sharp>([(a,c)]\<bullet>x)" by (simp add: pt_fresh_bij[OF pt, OF at]) | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2949 | hence "a\<sharp>([(b,c)]\<bullet>y)" using eq fr by (simp add: at_calc[OF at]) | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2950 | hence fr0: "a\<sharp>y" using ineq fr by (simp add: pt_fresh_left[OF pt, OF at] at_calc[OF at]) | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2951 | from eq have "x = (rev [(a,c)])\<bullet>([(b,c)]\<bullet>y)" by (rule pt_bij1[OF pt, OF at]) | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2952 | also have "\<dots> = [(a,c)]\<bullet>([(b,c)]\<bullet>y)" by simp | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2953 | also have "\<dots> = ([(a,c)]\<bullet>[(b,c)])\<bullet>([(a,c)]\<bullet>y)" by (rule pt_perm_compose[OF pt, OF at]) | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2954 | also have "\<dots> = [(b,a)]\<bullet>y" using ineq fr fr0 | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2955 | by (simp add: pt_fresh_fresh[OF pt, OF at] at_calc[OF at]) | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2956 | also have "\<dots> = [(a,b)]\<bullet>y" by (rule pt3[OF pt], rule at_ds5[OF at]) | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2957 | finally show ?thesis using ineq fr0 by (simp add: abs_fun_eq[OF pt, OF at]) | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2958 | qed | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2959 | qed | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2960 | |
| 23158 
749b6870b1a1
introduced symmetric variants of the lemmas for alpha-equivalence
 urbanc parents: 
23050diff
changeset | 2961 | lemma abs_fun_fresh': | 
| 
749b6870b1a1
introduced symmetric variants of the lemmas for alpha-equivalence
 urbanc parents: 
23050diff
changeset | 2962 | fixes x :: "'a" | 
| 
749b6870b1a1
introduced symmetric variants of the lemmas for alpha-equivalence
 urbanc parents: 
23050diff
changeset | 2963 | and y :: "'a" | 
| 
749b6870b1a1
introduced symmetric variants of the lemmas for alpha-equivalence
 urbanc parents: 
23050diff
changeset | 2964 | and c :: "'x" | 
| 
749b6870b1a1
introduced symmetric variants of the lemmas for alpha-equivalence
 urbanc parents: 
23050diff
changeset | 2965 | and a :: "'x" | 
| 
749b6870b1a1
introduced symmetric variants of the lemmas for alpha-equivalence
 urbanc parents: 
23050diff
changeset | 2966 | and b :: "'x" | 
| 
749b6870b1a1
introduced symmetric variants of the lemmas for alpha-equivalence
 urbanc parents: 
23050diff
changeset | 2967 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | 
| 
749b6870b1a1
introduced symmetric variants of the lemmas for alpha-equivalence
 urbanc parents: 
23050diff
changeset | 2968 |       and at: "at TYPE('x)"
 | 
| 
749b6870b1a1
introduced symmetric variants of the lemmas for alpha-equivalence
 urbanc parents: 
23050diff
changeset | 2969 | and as: "[a].x = [b].y" | 
| 
749b6870b1a1
introduced symmetric variants of the lemmas for alpha-equivalence
 urbanc parents: 
23050diff
changeset | 2970 | and fr: "c\<noteq>a" "c\<noteq>b" "c\<sharp>x" "c\<sharp>y" | 
| 
749b6870b1a1
introduced symmetric variants of the lemmas for alpha-equivalence
 urbanc parents: 
23050diff
changeset | 2971 | shows "x = [(a,c)]\<bullet>[(b,c)]\<bullet>y" | 
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 2972 | using assms by (metis abs_fun_fresh pt_swap_bij) | 
| 23158 
749b6870b1a1
introduced symmetric variants of the lemmas for alpha-equivalence
 urbanc parents: 
23050diff
changeset | 2973 | |
| 17870 | 2974 | lemma abs_fun_supp_approx: | 
| 2975 | fixes x :: "'a" | |
| 2976 | and a :: "'x" | |
| 2977 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 2978 |   and     at: "at TYPE('x)"
 | |
| 18048 | 2979 | shows "((supp ([a].x))::'x set) \<subseteq> (supp (x,a))" | 
| 2980 | proof | |
| 2981 | fix c | |
| 2982 | assume "c\<in>((supp ([a].x))::'x set)" | |
| 2983 |   hence "infinite {b. [(c,b)]\<bullet>([a].x) \<noteq> [a].x}" by (simp add: supp_def)
 | |
| 2984 |   hence "infinite {b. [([(c,b)]\<bullet>a)].([(c,b)]\<bullet>x) \<noteq> [a].x}" by (simp add: abs_fun_pi[OF pt, OF at])
 | |
| 2985 | moreover | |
| 2986 |   have "{b. [([(c,b)]\<bullet>a)].([(c,b)]\<bullet>x) \<noteq> [a].x} \<subseteq> {b. ([(c,b)]\<bullet>x,[(c,b)]\<bullet>a) \<noteq> (x, a)}" by force
 | |
| 2987 |   ultimately have "infinite {b. ([(c,b)]\<bullet>x,[(c,b)]\<bullet>a) \<noteq> (x, a)}" by (simp add: infinite_super)
 | |
| 2988 | thus "c\<in>(supp (x,a))" by (simp add: supp_def) | |
| 17870 | 2989 | qed | 
| 2990 | ||
| 2991 | lemma abs_fun_finite_supp: | |
| 2992 | fixes x :: "'a" | |
| 2993 | and a :: "'x" | |
| 2994 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 2995 |   and     at: "at TYPE('x)"
 | |
| 2996 | and f: "finite ((supp x)::'x set)" | |
| 2997 | shows "finite ((supp ([a].x))::'x set)" | |
| 2998 | proof - | |
| 18048 | 2999 | from f have "finite ((supp (x,a))::'x set)" by (simp add: supp_prod at_supp[OF at]) | 
| 3000 | moreover | |
| 3001 | have "((supp ([a].x))::'x set) \<subseteq> (supp (x,a))" by (rule abs_fun_supp_approx[OF pt, OF at]) | |
| 3002 | ultimately show ?thesis by (simp add: finite_subset) | |
| 17870 | 3003 | qed | 
| 3004 | ||
| 3005 | lemma fresh_abs_funI1: | |
| 3006 | fixes x :: "'a" | |
| 3007 | and a :: "'x" | |
| 3008 | and b :: "'x" | |
| 3009 |   assumes pt:  "pt TYPE('a) TYPE('x)"
 | |
| 3010 |   and     at:   "at TYPE('x)"
 | |
| 3011 | and f: "finite ((supp x)::'x set)" | |
| 3012 | and a1: "b\<sharp>x" | |
| 3013 | and a2: "a\<noteq>b" | |
| 3014 | shows "b\<sharp>([a].x)" | |
| 3015 | proof - | |
| 3016 | have "\<exists>c::'x. c\<sharp>(b,a,x,[a].x)" | |
| 21377 
c29146dc14f1
replaced exists_fresh lemma with a version formulated with obtains;
 urbanc parents: 
21318diff
changeset | 3017 | proof (rule at_exists_fresh'[OF at], auto simp add: supp_prod at_supp[OF at] f) | 
| 17870 | 3018 | show "finite ((supp ([a].x))::'x set)" using f | 
| 32960 
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
 wenzelm parents: 
32638diff
changeset | 3019 | by (simp add: abs_fun_finite_supp[OF pt, OF at]) | 
| 17870 | 3020 | qed | 
| 3021 | then obtain c where fr1: "c\<noteq>b" | |
| 3022 | and fr2: "c\<noteq>a" | |
| 3023 | and fr3: "c\<sharp>x" | |
| 3024 | and fr4: "c\<sharp>([a].x)" | |
| 3025 | by (force simp add: fresh_prod at_fresh[OF at]) | |
| 3026 | have e: "[(c,b)]\<bullet>([a].x) = [a].([(c,b)]\<bullet>x)" using a2 fr1 fr2 | |
| 3027 | by (force simp add: abs_fun_pi[OF pt, OF at] at_calc[OF at]) | |
| 3028 | from fr4 have "([(c,b)]\<bullet>c)\<sharp> ([(c,b)]\<bullet>([a].x))" | |
| 3029 | by (simp add: pt_fresh_bij[OF pt_abs_fun_inst[OF pt, OF at], OF at]) | |
| 3030 | hence "b\<sharp>([a].([(c,b)]\<bullet>x))" using fr1 fr2 e | |
| 3031 | by (simp add: at_calc[OF at]) | |
| 3032 | thus ?thesis using a1 fr3 | |
| 3033 | by (simp add: pt_fresh_fresh[OF pt, OF at]) | |
| 3034 | qed | |
| 3035 | ||
| 3036 | lemma fresh_abs_funE: | |
| 3037 | fixes a :: "'x" | |
| 3038 | and b :: "'x" | |
| 3039 | and x :: "'a" | |
| 3040 |   assumes pt:  "pt TYPE('a) TYPE('x)"
 | |
| 3041 |   and     at:  "at TYPE('x)"
 | |
| 3042 | and f: "finite ((supp x)::'x set)" | |
| 3043 | and a1: "b\<sharp>([a].x)" | |
| 3044 | and a2: "b\<noteq>a" | |
| 3045 | shows "b\<sharp>x" | |
| 3046 | proof - | |
| 3047 | have "\<exists>c::'x. c\<sharp>(b,a,x,[a].x)" | |
| 21377 
c29146dc14f1
replaced exists_fresh lemma with a version formulated with obtains;
 urbanc parents: 
21318diff
changeset | 3048 | proof (rule at_exists_fresh'[OF at], auto simp add: supp_prod at_supp[OF at] f) | 
| 17870 | 3049 | show "finite ((supp ([a].x))::'x set)" using f | 
| 32960 
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
 wenzelm parents: 
32638diff
changeset | 3050 | by (simp add: abs_fun_finite_supp[OF pt, OF at]) | 
| 17870 | 3051 | qed | 
| 3052 | then obtain c where fr1: "b\<noteq>c" | |
| 3053 | and fr2: "c\<noteq>a" | |
| 3054 | and fr3: "c\<sharp>x" | |
| 3055 | and fr4: "c\<sharp>([a].x)" by (force simp add: fresh_prod at_fresh[OF at]) | |
| 3056 | have "[a].x = [(b,c)]\<bullet>([a].x)" using a1 fr4 | |
| 3057 | by (simp add: pt_fresh_fresh[OF pt_abs_fun_inst[OF pt, OF at], OF at]) | |
| 3058 | hence "[a].x = [a].([(b,c)]\<bullet>x)" using fr2 a2 | |
| 3059 | by (force simp add: abs_fun_pi[OF pt, OF at] at_calc[OF at]) | |
| 3060 | hence b: "([(b,c)]\<bullet>x) = x" by (simp add: abs_fun_eq1) | |
| 3061 | from fr3 have "([(b,c)]\<bullet>c)\<sharp>([(b,c)]\<bullet>x)" | |
| 3062 | by (simp add: pt_fresh_bij[OF pt, OF at]) | |
| 3063 | thus ?thesis using b fr1 by (simp add: at_calc[OF at]) | |
| 3064 | qed | |
| 3065 | ||
| 3066 | lemma fresh_abs_funI2: | |
| 3067 | fixes a :: "'x" | |
| 3068 | and x :: "'a" | |
| 3069 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 3070 |   and     at: "at TYPE('x)"
 | |
| 3071 | and f: "finite ((supp x)::'x set)" | |
| 3072 | shows "a\<sharp>([a].x)" | |
| 3073 | proof - | |
| 3074 | have "\<exists>c::'x. c\<sharp>(a,x)" | |
| 21377 
c29146dc14f1
replaced exists_fresh lemma with a version formulated with obtains;
 urbanc parents: 
21318diff
changeset | 3075 | by (rule at_exists_fresh'[OF at], auto simp add: supp_prod at_supp[OF at] f) | 
| 17870 | 3076 | then obtain c where fr1: "a\<noteq>c" and fr1_sym: "c\<noteq>a" | 
| 3077 | and fr2: "c\<sharp>x" by (force simp add: fresh_prod at_fresh[OF at]) | |
| 3078 | have "c\<sharp>([a].x)" using f fr1 fr2 by (simp add: fresh_abs_funI1[OF pt, OF at]) | |
| 3079 | hence "([(c,a)]\<bullet>c)\<sharp>([(c,a)]\<bullet>([a].x))" using fr1 | |
| 3080 | by (simp only: pt_fresh_bij[OF pt_abs_fun_inst[OF pt, OF at], OF at]) | |
| 3081 | hence a: "a\<sharp>([c].([(c,a)]\<bullet>x))" using fr1_sym | |
| 3082 | by (simp add: abs_fun_pi[OF pt, OF at] at_calc[OF at]) | |
| 3083 | have "[c].([(c,a)]\<bullet>x) = ([a].x)" using fr1_sym fr2 | |
| 3084 | by (simp add: abs_fun_eq[OF pt, OF at]) | |
| 3085 | thus ?thesis using a by simp | |
| 3086 | qed | |
| 3087 | ||
| 3088 | lemma fresh_abs_fun_iff: | |
| 3089 | fixes a :: "'x" | |
| 3090 | and b :: "'x" | |
| 3091 | and x :: "'a" | |
| 3092 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 3093 |   and     at: "at TYPE('x)"
 | |
| 3094 | and f: "finite ((supp x)::'x set)" | |
| 3095 | shows "(b\<sharp>([a].x)) = (b=a \<or> b\<sharp>x)" | |
| 3096 | by (auto dest: fresh_abs_funE[OF pt, OF at,OF f] | |
| 3097 | intro: fresh_abs_funI1[OF pt, OF at,OF f] | |
| 3098 | fresh_abs_funI2[OF pt, OF at,OF f]) | |
| 3099 | ||
| 3100 | lemma abs_fun_supp: | |
| 3101 | fixes a :: "'x" | |
| 3102 | and x :: "'a" | |
| 3103 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 3104 |   and     at: "at TYPE('x)"
 | |
| 3105 | and f: "finite ((supp x)::'x set)" | |
| 3106 |   shows "supp ([a].x) = (supp x)-{a}"
 | |
| 3107 | by (force simp add: supp_fresh_iff fresh_abs_fun_iff[OF pt, OF at, OF f]) | |
| 3108 | ||
| 18048 | 3109 | (* maybe needs to be better stated as supp intersection supp *) | 
| 17870 | 3110 | lemma abs_fun_supp_ineq: | 
| 3111 | fixes a :: "'y" | |
| 3112 | and x :: "'a" | |
| 3113 |   assumes pta: "pt TYPE('a) TYPE('x)"
 | |
| 3114 |   and     ptb: "pt TYPE('y) TYPE('x)"
 | |
| 3115 |   and     at:  "at TYPE('x)"
 | |
| 3116 |   and     cp:  "cp TYPE('a) TYPE('x) TYPE('y)"
 | |
| 3117 |   and     dj:  "disjoint TYPE('y) TYPE('x)"
 | |
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 3118 | shows "((supp ([a].x))::'x set) = (supp x)" | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 3119 | unfolding supp_def | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 3120 | using abs_fun_pi_ineq[OF pta, OF ptb, OF at, OF cp] dj_perm_forget[OF dj] | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 3121 | by (smt (verit, ccfv_threshold) Collect_cong abs_fun_eq1) | 
| 17870 | 3122 | |
| 3123 | lemma fresh_abs_fun_iff_ineq: | |
| 3124 | fixes a :: "'y" | |
| 3125 | and b :: "'x" | |
| 3126 | and x :: "'a" | |
| 3127 |   assumes pta: "pt TYPE('a) TYPE('x)"
 | |
| 3128 |   and     ptb: "pt TYPE('y) TYPE('x)"
 | |
| 3129 |   and     at:  "at TYPE('x)"
 | |
| 3130 |   and     cp:  "cp TYPE('a) TYPE('x) TYPE('y)"
 | |
| 3131 |   and     dj:  "disjoint TYPE('y) TYPE('x)"
 | |
| 3132 | shows "b\<sharp>([a].x) = b\<sharp>x" | |
| 3133 | by (simp add: fresh_def abs_fun_supp_ineq[OF pta, OF ptb, OF at, OF cp, OF dj]) | |
| 3134 | ||
| 63167 | 3135 | section \<open>abstraction type for the parsing in nominal datatype\<close> | 
| 18048 | 3136 | (*==============================================================*) | 
| 23755 | 3137 | |
| 3138 | inductive_set ABS_set :: "('x\<Rightarrow>('a noption)) set"
 | |
| 3139 | where | |
| 17870 | 3140 | ABS_in: "(abs_fun a x)\<in>ABS_set" | 
| 3141 | ||
| 45694 
4a8743618257
prefer typedef without extra definition and alternative name;
 wenzelm parents: 
45625diff
changeset | 3142 | definition "ABS = ABS_set" | 
| 
4a8743618257
prefer typedef without extra definition and alternative name;
 wenzelm parents: 
45625diff
changeset | 3143 | |
| 69597 | 3144 | typedef ('x, 'a) ABS (\<open>\<guillemotleft>_\<guillemotright>_\<close> [1000,1000] 1000) =
 | 
| 45694 
4a8743618257
prefer typedef without extra definition and alternative name;
 wenzelm parents: 
45625diff
changeset | 3145 |     "ABS::('x\<Rightarrow>('a noption)) set"
 | 
| 
4a8743618257
prefer typedef without extra definition and alternative name;
 wenzelm parents: 
45625diff
changeset | 3146 | morphisms Rep_ABS Abs_ABS | 
| 
4a8743618257
prefer typedef without extra definition and alternative name;
 wenzelm parents: 
45625diff
changeset | 3147 | unfolding ABS_def | 
| 17870 | 3148 | proof | 
| 3149 | fix x::"'a" and a::"'x" | |
| 3150 | show "(abs_fun a x)\<in> ABS_set" by (rule ABS_in) | |
| 3151 | qed | |
| 3152 | ||
| 3153 | ||
| 63167 | 3154 | section \<open>lemmas for deciding permutation equations\<close> | 
| 17870 | 3155 | (*===================================================*) | 
| 3156 | ||
| 19477 | 3157 | lemma perm_aux_fold: | 
| 3158 | shows "perm_aux pi x = pi\<bullet>x" by (simp only: perm_aux_def) | |
| 3159 | ||
| 3160 | lemma pt_perm_compose_aux: | |
| 3161 | fixes pi1 :: "'x prm" | |
| 3162 | and pi2 :: "'x prm" | |
| 3163 | and x :: "'a" | |
| 3164 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 3165 |   and     at: "at TYPE('x)"
 | |
| 3166 | shows "pi2\<bullet>(pi1\<bullet>x) = perm_aux (pi2\<bullet>pi1) (pi2\<bullet>x)" | |
| 3167 | proof - | |
| 23393 | 3168 | have "(pi2@pi1) \<triangleq> ((pi2\<bullet>pi1)@pi2)" by (rule at_ds8[OF at]) | 
| 19477 | 3169 | hence "(pi2@pi1)\<bullet>x = ((pi2\<bullet>pi1)@pi2)\<bullet>x" by (rule pt3[OF pt]) | 
| 3170 | thus ?thesis by (simp add: pt2[OF pt] perm_aux_def) | |
| 3171 | qed | |
| 3172 | ||
| 3173 | lemma cp1_aux: | |
| 3174 | fixes pi1::"'x prm" | |
| 3175 | and pi2::"'y prm" | |
| 3176 | and x ::"'a" | |
| 3177 |   assumes cp: "cp TYPE ('a) TYPE('x) TYPE('y)"
 | |
| 3178 | shows "pi1\<bullet>(pi2\<bullet>x) = perm_aux (pi1\<bullet>pi2) (pi1\<bullet>x)" | |
| 3179 | using cp by (simp add: cp_def perm_aux_def) | |
| 3180 | ||
| 17870 | 3181 | lemma perm_eq_app: | 
| 3182 | fixes f :: "'a\<Rightarrow>'b" | |
| 3183 | and x :: "'a" | |
| 3184 | and pi :: "'x prm" | |
| 3185 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 3186 |   and     at: "at TYPE('x)"
 | |
| 3187 | shows "(pi\<bullet>(f x)=y) = ((pi\<bullet>f)(pi\<bullet>x)=y)" | |
| 3188 | by (simp add: pt_fun_app_eq[OF pt, OF at]) | |
| 3189 | ||
| 3190 | lemma perm_eq_lam: | |
| 3191 | fixes f :: "'a\<Rightarrow>'b" | |
| 3192 | and x :: "'a" | |
| 3193 | and pi :: "'x prm" | |
| 3194 | shows "((pi\<bullet>(\<lambda>x. f x))=y) = ((\<lambda>x. (pi\<bullet>(f ((rev pi)\<bullet>x))))=y)" | |
| 3195 | by (simp add: perm_fun_def) | |
| 3196 | ||
| 63167 | 3197 | section \<open>test\<close> | 
| 19132 | 3198 | lemma at_prm_eq_compose: | 
| 3199 | fixes pi1 :: "'x prm" | |
| 3200 | and pi2 :: "'x prm" | |
| 3201 | and pi3 :: "'x prm" | |
| 3202 |   assumes at: "at TYPE('x)"
 | |
| 3203 | and a: "pi1 \<triangleq> pi2" | |
| 3204 | shows "(pi3\<bullet>pi1) \<triangleq> (pi3\<bullet>pi2)" | |
| 3205 | proof - | |
| 3206 |   have pt: "pt TYPE('x) TYPE('x)" by (rule at_pt_inst[OF at])
 | |
| 3207 |   have pt_prm: "pt TYPE('x prm) TYPE('x)" 
 | |
| 3208 | by (rule pt_list_inst[OF pt_prod_inst[OF pt, OF pt]]) | |
| 3209 | from a show ?thesis | |
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 3210 | by (auto simp add: prm_eq_def at pt pt_perm_compose') | 
| 19132 | 3211 | qed | 
| 3212 | ||
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3213 | (************************) | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3214 | (* Various eqvt-lemmas *) | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3215 | |
| 80142 | 3216 | lemma Zero_nat_eqvt[simp]: | 
| 22446 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3217 | shows "pi\<bullet>(0::nat) = 0" | 
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3218 | by (auto simp add: perm_nat_def) | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3219 | |
| 80142 | 3220 | lemma One_nat_eqvt[simp]: | 
| 22446 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3221 | shows "pi\<bullet>(1::nat) = 1" | 
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3222 | by (simp add: perm_nat_def) | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3223 | |
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3224 | lemma Suc_eqvt: | 
| 22446 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3225 | shows "pi\<bullet>(Suc x) = Suc (pi\<bullet>x)" | 
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3226 | by (auto simp add: perm_nat_def) | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3227 | |
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3228 | lemma numeral_nat_eqvt: | 
| 47108 
2a1953f0d20d
merged fork with new numeral representation (see NEWS)
 huffman parents: 
46950diff
changeset | 3229 | shows "pi\<bullet>((numeral n)::nat) = numeral n" | 
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3230 | by (simp add: perm_nat_def perm_int_def) | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3231 | |
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3232 | lemma max_nat_eqvt: | 
| 22446 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3233 | fixes x::"nat" | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3234 | shows "pi\<bullet>(max x y) = max (pi\<bullet>x) (pi\<bullet>y)" | 
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3235 | by (simp add:perm_nat_def) | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3236 | |
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3237 | lemma min_nat_eqvt: | 
| 22446 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3238 | fixes x::"nat" | 
| 22500 
8436bfd21bf3
corrected the lemmas min_nat_eqvt and min_int_eqvt
 urbanc parents: 
22446diff
changeset | 3239 | shows "pi\<bullet>(min x y) = min (pi\<bullet>x) (pi\<bullet>y)" | 
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3240 | by (simp add:perm_nat_def) | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3241 | |
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3242 | lemma plus_nat_eqvt: | 
| 22446 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3243 | fixes x::"nat" | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3244 | shows "pi\<bullet>(x + y) = (pi\<bullet>x) + (pi\<bullet>y)" | 
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3245 | by (simp add:perm_nat_def) | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3246 | |
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3247 | lemma minus_nat_eqvt: | 
| 22446 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3248 | fixes x::"nat" | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3249 | shows "pi\<bullet>(x - y) = (pi\<bullet>x) - (pi\<bullet>y)" | 
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3250 | by (simp add:perm_nat_def) | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3251 | |
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3252 | lemma mult_nat_eqvt: | 
| 22446 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3253 | fixes x::"nat" | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3254 | shows "pi\<bullet>(x * y) = (pi\<bullet>x) * (pi\<bullet>y)" | 
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3255 | by (simp add:perm_nat_def) | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3256 | |
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3257 | lemma div_nat_eqvt: | 
| 22446 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3258 | fixes x::"nat" | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3259 | shows "pi\<bullet>(x div y) = (pi\<bullet>x) div (pi\<bullet>y)" | 
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3260 | by (simp add:perm_nat_def) | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3261 | |
| 80142 | 3262 | lemma Zero_int_eqvt[simp]: | 
| 22446 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3263 | shows "pi\<bullet>(0::int) = 0" | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3264 | by (auto simp add: perm_int_def) | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3265 | |
| 80142 | 3266 | lemma One_int_eqvt[simp]: | 
| 22446 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3267 | shows "pi\<bullet>(1::int) = 1" | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3268 | by (simp add: perm_int_def) | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3269 | |
| 80142 | 3270 | lemma numeral_int_eqvt[simp]: | 
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 3271 | shows "pi\<bullet>((numeral n)::int) = numeral n" | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 3272 | using perm_int_def by blast | 
| 47108 
2a1953f0d20d
merged fork with new numeral representation (see NEWS)
 huffman parents: 
46950diff
changeset | 3273 | |
| 80142 | 3274 | lemma neg_numeral_int_eqvt[simp]: | 
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 3275 | shows "pi\<bullet>((- numeral n)::int) = - numeral n" | 
| 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 3276 | by (simp add: perm_int_def) | 
| 22446 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3277 | |
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3278 | lemma max_int_eqvt: | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3279 | fixes x::"int" | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3280 | shows "pi\<bullet>(max (x::int) y) = max (pi\<bullet>x) (pi\<bullet>y)" | 
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 3281 | by (simp add:perm_int_def) | 
| 22446 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3282 | |
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3283 | lemma min_int_eqvt: | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3284 | fixes x::"int" | 
| 22500 
8436bfd21bf3
corrected the lemmas min_nat_eqvt and min_int_eqvt
 urbanc parents: 
22446diff
changeset | 3285 | shows "pi\<bullet>(min x y) = min (pi\<bullet>x) (pi\<bullet>y)" | 
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 3286 | by (simp add:perm_int_def) | 
| 22446 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3287 | |
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3288 | lemma plus_int_eqvt: | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3289 | fixes x::"int" | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3290 | shows "pi\<bullet>(x + y) = (pi\<bullet>x) + (pi\<bullet>y)" | 
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 3291 | by (simp add:perm_int_def) | 
| 22446 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3292 | |
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3293 | lemma minus_int_eqvt: | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3294 | fixes x::"int" | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3295 | shows "pi\<bullet>(x - y) = (pi\<bullet>x) - (pi\<bullet>y)" | 
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 3296 | by (simp add:perm_int_def) | 
| 22446 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3297 | |
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3298 | lemma mult_int_eqvt: | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3299 | fixes x::"int" | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3300 | shows "pi\<bullet>(x * y) = (pi\<bullet>x) * (pi\<bullet>y)" | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3301 | by (simp add:perm_int_def) | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3302 | |
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3303 | lemma div_int_eqvt: | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3304 | fixes x::"int" | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3305 | shows "pi\<bullet>(x div y) = (pi\<bullet>x) div (pi\<bullet>y)" | 
| 80129 
601ff5c7cad5
Tidied up horrible archaic proofs
 paulson <lp15@cam.ac.uk> parents: 
69913diff
changeset | 3306 | by (simp add:perm_int_def) | 
| 22446 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3307 | |
| 30990 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 3308 | (*******************************************************) | 
| 
4872eef36167
reorganised the section about fresh_star and added lemma pt_fresh_star_pi
 Christian Urban <urbanc@in.tum.de> parents: 
30983diff
changeset | 3309 | (* Setup of the theorem attributes eqvt and eqvt_force *) | 
| 69605 | 3310 | ML_file \<open>nominal_thmdecls.ML\<close> | 
| 22245 
1b8f4ef50c48
moved the infrastructure from the nominal_tags file to nominal_thmdecls
 urbanc parents: 
22231diff
changeset | 3311 | setup "NominalThmDecls.setup" | 
| 19132 | 3312 | |
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3313 | lemmas [eqvt] = | 
| 22446 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3314 | (* connectives *) | 
| 22732 
5bd1a2a94e1b
declared lemmas true_eqvt and false_eqvt to be equivariant (suggested by samth at ccs.neu.edu)
 urbanc parents: 
22729diff
changeset | 3315 | if_eqvt imp_eqvt disj_eqvt conj_eqvt neg_eqvt | 
| 
5bd1a2a94e1b
declared lemmas true_eqvt and false_eqvt to be equivariant (suggested by samth at ccs.neu.edu)
 urbanc parents: 
22729diff
changeset | 3316 | true_eqvt false_eqvt | 
| 59940 
087d81f5213e
local setup of induction tools, with restricted access to auxiliary consts;
 wenzelm parents: 
58372diff
changeset | 3317 | imp_eqvt [folded HOL.induct_implies_def] | 
| 22446 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3318 | |
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3319 | (* datatypes *) | 
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3320 | perm_unit.simps | 
| 22446 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3321 | perm_list.simps append_eqvt | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3322 | perm_prod.simps | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3323 | fst_eqvt snd_eqvt | 
| 22511 
ca326e0fb5c5
added the permutation operation on options to the list of equivariance lemmas
 urbanc parents: 
22500diff
changeset | 3324 | perm_option.simps | 
| 22446 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3325 | |
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3326 | (* nats *) | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3327 | Suc_eqvt Zero_nat_eqvt One_nat_eqvt min_nat_eqvt max_nat_eqvt | 
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3328 | plus_nat_eqvt minus_nat_eqvt mult_nat_eqvt div_nat_eqvt | 
| 22446 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3329 | |
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3330 | (* ints *) | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3331 | Zero_int_eqvt One_int_eqvt min_int_eqvt max_int_eqvt | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3332 | plus_int_eqvt minus_int_eqvt mult_int_eqvt div_int_eqvt | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3333 | |
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3334 | (* sets *) | 
| 46179 
47bcf3d5d1f0
Reverted several lemmas involving sets to the state before the
 berghofe parents: 
45961diff
changeset | 3335 | union_eqvt empty_eqvt insert_eqvt set_eqvt | 
| 22446 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3336 | |
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3337 | |
| 22446 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3338 | (* the lemmas numeral_nat_eqvt numeral_int_eqvt do not conform with the *) | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3339 | (* usual form of an eqvt-lemma, but they are needed for analysing *) | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3340 | (* permutations on nats and ints *) | 
| 47108 
2a1953f0d20d
merged fork with new numeral representation (see NEWS)
 huffman parents: 
46950diff
changeset | 3341 | lemmas [eqvt_force] = numeral_nat_eqvt numeral_int_eqvt neg_numeral_int_eqvt | 
| 22326 
a3acee47a883
start adding the attribute eqvt to some lemmas of the nominal library
 narboux parents: 
22312diff
changeset | 3342 | |
| 17870 | 3343 | (***************************************) | 
| 3344 | (* setup for the individial atom-kinds *) | |
| 18047 
3d643b13eb65
simplified the abs_supp_approx proof and tuned some comments in
 urbanc parents: 
18012diff
changeset | 3345 | (* and nominal datatypes *) | 
| 69605 | 3346 | ML_file \<open>nominal_atoms.ML\<close> | 
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3347 | |
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3348 | (************************************************************) | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3349 | (* various tactics for analysing permutations, supports etc *) | 
| 69605 | 3350 | ML_file \<open>nominal_permeq.ML\<close> | 
| 17870 | 3351 | |
| 3352 | method_setup perm_simp = | |
| 63167 | 3353 | \<open>NominalPermeq.perm_simp_meth\<close> | 
| 3354 | \<open>simp rules and simprocs for analysing permutations\<close> | |
| 17870 | 3355 | |
| 3356 | method_setup perm_simp_debug = | |
| 63167 | 3357 | \<open>NominalPermeq.perm_simp_meth_debug\<close> | 
| 3358 | \<open>simp rules and simprocs for analysing permutations including debugging facilities\<close> | |
| 19477 | 3359 | |
| 28322 
6f4cf302c798
made the perm_simp tactic to understand options such as (no_asm)
 urbanc parents: 
28011diff
changeset | 3360 | method_setup perm_extend_simp = | 
| 63167 | 3361 | \<open>NominalPermeq.perm_extend_simp_meth\<close> | 
| 3362 | \<open>tactic for deciding equalities involving permutations\<close> | |
| 19477 | 3363 | |
| 28322 
6f4cf302c798
made the perm_simp tactic to understand options such as (no_asm)
 urbanc parents: 
28011diff
changeset | 3364 | method_setup perm_extend_simp_debug = | 
| 63167 | 3365 | \<open>NominalPermeq.perm_extend_simp_meth_debug\<close> | 
| 3366 | \<open>tactic for deciding equalities involving permutations including debugging facilities\<close> | |
| 17870 | 3367 | |
| 3368 | method_setup supports_simp = | |
| 63167 | 3369 | \<open>NominalPermeq.supports_meth\<close> | 
| 3370 | \<open>tactic for deciding whether something supports something else\<close> | |
| 17870 | 3371 | |
| 3372 | method_setup supports_simp_debug = | |
| 63167 | 3373 | \<open>NominalPermeq.supports_meth_debug\<close> | 
| 3374 | \<open>tactic for deciding whether something supports something else including debugging facilities\<close> | |
| 17870 | 3375 | |
| 19164 | 3376 | method_setup finite_guess = | 
| 63167 | 3377 | \<open>NominalPermeq.finite_guess_meth\<close> | 
| 3378 | \<open>tactic for deciding whether something has finite support\<close> | |
| 19164 | 3379 | |
| 3380 | method_setup finite_guess_debug = | |
| 63167 | 3381 | \<open>NominalPermeq.finite_guess_meth_debug\<close> | 
| 3382 | \<open>tactic for deciding whether something has finite support including debugging facilities\<close> | |
| 19494 | 3383 | |
| 19638 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 3384 | method_setup fresh_guess = | 
| 63167 | 3385 | \<open>NominalPermeq.fresh_guess_meth\<close> | 
| 3386 | \<open>tactic for deciding whether an atom is fresh for something\<close> | |
| 19638 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 3387 | |
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 3388 | method_setup fresh_guess_debug = | 
| 63167 | 3389 | \<open>NominalPermeq.fresh_guess_meth_debug\<close> | 
| 3390 | \<open>tactic for deciding whether an atom is fresh for something including debugging facilities\<close> | |
| 19638 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 3391 | |
| 22762 | 3392 | (*****************************************************************) | 
| 3393 | (* tactics for generating fresh names and simplifying fresh_funs *) | |
| 69605 | 3394 | ML_file \<open>nominal_fresh_fun.ML\<close> | 
| 22729 | 3395 | |
| 63167 | 3396 | method_setup generate_fresh = \<open> | 
| 56230 | 3397 |   Args.type_name {proper = true, strict = true} >>
 | 
| 3398 | (fn s => fn ctxt => SIMPLE_METHOD (generate_fresh_tac ctxt s)) | |
| 63167 | 3399 | \<close> "generate a name fresh for all the variables in the goal" | 
| 3400 | ||
| 3401 | method_setup fresh_fun_simp = \<open> | |
| 56230 | 3402 | Scan.lift (Args.parens (Args.$$$ "no_asm") >> K true || Scan.succeed false) >> | 
| 3403 | (fn b => fn ctxt => SIMPLE_METHOD' (fresh_fun_tac ctxt b)) | |
| 63167 | 3404 | \<close> "delete one inner occurrence of fresh_fun" | 
| 22729 | 3405 | |
| 3406 | ||
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3407 | (************************************************) | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3408 | (* main file for constructing nominal datatypes *) | 
| 27228 
4f7976a6ffc3
allE_Nil: only one copy, proven in regular theory source;
 wenzelm parents: 
26847diff
changeset | 3409 | lemma allE_Nil: assumes "\<forall>x. P x" obtains "P []" | 
| 
4f7976a6ffc3
allE_Nil: only one copy, proven in regular theory source;
 wenzelm parents: 
26847diff
changeset | 3410 | using assms .. | 
| 
4f7976a6ffc3
allE_Nil: only one copy, proven in regular theory source;
 wenzelm parents: 
26847diff
changeset | 3411 | |
| 69605 | 3412 | ML_file \<open>nominal_datatype.ML\<close> | 
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3413 | |
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3414 | (******************************************************) | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3415 | (* primitive recursive functions on nominal datatypes *) | 
| 69605 | 3416 | ML_file \<open>nominal_primrec.ML\<close> | 
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3417 | |
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3418 | (****************************************************) | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3419 | (* inductive definition involving nominal datatypes *) | 
| 69605 | 3420 | ML_file \<open>nominal_inductive.ML\<close> | 
| 3421 | ML_file \<open>nominal_inductive2.ML\<close> | |
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3422 | |
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3423 | (*****************************************) | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3424 | (* setup for induction principles method *) | 
| 69605 | 3425 | ML_file \<open>nominal_induct.ML\<close> | 
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3426 | method_setup nominal_induct = | 
| 63167 | 3427 | \<open>NominalInduct.nominal_induct_method\<close> | 
| 3428 | \<open>nominal induction\<close> | |
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3429 | |
| 17870 | 3430 | end |