Nominal-General/Nominal2_Supp.thy
author Christian Urban <urbanc@in.tum.de>
Fri, 03 Sep 2010 20:48:45 +0800
changeset 2462 937b6088a3a0
parent 2388 ebf253d80670
child 2463 217149972715
permissions -rw-r--r--
added supp_set lemma
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1062
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
     1
(*  Title:      Nominal2_Supp
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
     2
    Authors:    Brian Huffman, Christian Urban
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
     3
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
     4
    Supplementary Lemmas and Definitions for 
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
     5
    Nominal Isabelle. 
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
     6
*)
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
     7
theory Nominal2_Supp
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
     8
imports Nominal2_Base Nominal2_Eqvt Nominal2_Atoms
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
     9
begin
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
    10
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
    11
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
    12
section {* Fresh-Star *}
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
    13
1930
f189cf2c0987 moved some lemmas into the right places
Christian Urban <urbanc@in.tum.de>
parents: 1923
diff changeset
    14
1062
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
    15
text {* The fresh-star generalisation of fresh is used in strong
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
    16
  induction principles. *}
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
    17
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
    18
definition 
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
    19
  fresh_star :: "atom set \<Rightarrow> 'a::pt \<Rightarrow> bool" ("_ \<sharp>* _" [80,80] 80)
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
    20
where 
1506
7c607df46a0a slightly more in the paper
Christian Urban <urbanc@in.tum.de>
parents: 1436
diff changeset
    21
  "as \<sharp>* x \<equiv> \<forall>a \<in> as. a \<sharp> x"
1062
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
    22
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
    23
lemma fresh_star_prod:
1506
7c607df46a0a slightly more in the paper
Christian Urban <urbanc@in.tum.de>
parents: 1436
diff changeset
    24
  fixes as::"atom set"
2012
a48a6f88f76e simplified the supp-of-finite-sets proof
Christian Urban <urbanc@in.tum.de>
parents: 2003
diff changeset
    25
  shows "as \<sharp>* (x, y) = (as \<sharp>* x \<and> as \<sharp>* y)" 
1062
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
    26
  by (auto simp add: fresh_star_def fresh_Pair)
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
    27
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
    28
lemma fresh_star_union:
1506
7c607df46a0a slightly more in the paper
Christian Urban <urbanc@in.tum.de>
parents: 1436
diff changeset
    29
  shows "(as \<union> bs) \<sharp>* x = (as \<sharp>* x \<and> bs \<sharp>* x)"
1062
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
    30
  by (auto simp add: fresh_star_def)
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
    31
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
    32
lemma fresh_star_insert:
1506
7c607df46a0a slightly more in the paper
Christian Urban <urbanc@in.tum.de>
parents: 1436
diff changeset
    33
  shows "(insert a as) \<sharp>* x = (a \<sharp> x \<and> as \<sharp>* x)"
1062
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
    34
  by (auto simp add: fresh_star_def)
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
    35
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
    36
lemma fresh_star_Un_elim:
1506
7c607df46a0a slightly more in the paper
Christian Urban <urbanc@in.tum.de>
parents: 1436
diff changeset
    37
  "((as \<union> bs) \<sharp>* x \<Longrightarrow> PROP C) \<equiv> (as \<sharp>* x \<Longrightarrow> bs \<sharp>* x \<Longrightarrow> PROP C)"
1062
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
    38
  unfolding fresh_star_def
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
    39
  apply(rule)
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
    40
  apply(erule meta_mp)
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
    41
  apply(auto)
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
    42
  done
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
    43
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
    44
lemma fresh_star_insert_elim:
1506
7c607df46a0a slightly more in the paper
Christian Urban <urbanc@in.tum.de>
parents: 1436
diff changeset
    45
  "(insert a as \<sharp>* x \<Longrightarrow> PROP C) \<equiv> (a \<sharp> x \<Longrightarrow> as \<sharp>* x \<Longrightarrow> PROP C)"
1062
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
    46
  unfolding fresh_star_def
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
    47
  by rule (simp_all add: fresh_star_def)
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
    48
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
    49
lemma fresh_star_empty_elim:
1506
7c607df46a0a slightly more in the paper
Christian Urban <urbanc@in.tum.de>
parents: 1436
diff changeset
    50
  "({} \<sharp>* x \<Longrightarrow> PROP C) \<equiv> PROP C"
1062
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
    51
  by (simp add: fresh_star_def)
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
    52
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
    53
lemma fresh_star_unit_elim: 
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
    54
  shows "(a \<sharp>* () \<Longrightarrow> PROP C) \<equiv> PROP C"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
    55
  by (simp add: fresh_star_def fresh_unit) 
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
    56
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
    57
lemma fresh_star_prod_elim: 
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
    58
  shows "(a \<sharp>* (x, y) \<Longrightarrow> PROP C) \<equiv> (a \<sharp>* x \<Longrightarrow> a \<sharp>* y \<Longrightarrow> PROP C)"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
    59
  by (rule, simp_all add: fresh_star_prod)
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
    60
2388
ebf253d80670 equivariance for size
Christian Urban <urbanc@in.tum.de>
parents: 2372
diff changeset
    61
lemma fresh_star_zero:
ebf253d80670 equivariance for size
Christian Urban <urbanc@in.tum.de>
parents: 2372
diff changeset
    62
  shows "as \<sharp>* (0::perm)"
ebf253d80670 equivariance for size
Christian Urban <urbanc@in.tum.de>
parents: 2372
diff changeset
    63
  unfolding fresh_star_def
ebf253d80670 equivariance for size
Christian Urban <urbanc@in.tum.de>
parents: 2372
diff changeset
    64
  by (simp add: fresh_zero_perm)
ebf253d80670 equivariance for size
Christian Urban <urbanc@in.tum.de>
parents: 2372
diff changeset
    65
1436
04dad9b0136d started supp-fv proofs (is going to work)
Christian Urban <urbanc@in.tum.de>
parents: 1258
diff changeset
    66
lemma fresh_star_plus:
04dad9b0136d started supp-fv proofs (is going to work)
Christian Urban <urbanc@in.tum.de>
parents: 1258
diff changeset
    67
  fixes p q::perm
04dad9b0136d started supp-fv proofs (is going to work)
Christian Urban <urbanc@in.tum.de>
parents: 1258
diff changeset
    68
  shows "\<lbrakk>a \<sharp>* p;  a \<sharp>* q\<rbrakk> \<Longrightarrow> a \<sharp>* (p + q)"
04dad9b0136d started supp-fv proofs (is going to work)
Christian Urban <urbanc@in.tum.de>
parents: 1258
diff changeset
    69
  unfolding fresh_star_def
04dad9b0136d started supp-fv proofs (is going to work)
Christian Urban <urbanc@in.tum.de>
parents: 1258
diff changeset
    70
  by (simp add: fresh_plus_perm)
04dad9b0136d started supp-fv proofs (is going to work)
Christian Urban <urbanc@in.tum.de>
parents: 1258
diff changeset
    71
2388
ebf253d80670 equivariance for size
Christian Urban <urbanc@in.tum.de>
parents: 2372
diff changeset
    72
1436
04dad9b0136d started supp-fv proofs (is going to work)
Christian Urban <urbanc@in.tum.de>
parents: 1258
diff changeset
    73
lemma fresh_star_permute_iff:
04dad9b0136d started supp-fv proofs (is going to work)
Christian Urban <urbanc@in.tum.de>
parents: 1258
diff changeset
    74
  shows "(p \<bullet> a) \<sharp>* (p \<bullet> x) \<longleftrightarrow> a \<sharp>* x"
04dad9b0136d started supp-fv proofs (is going to work)
Christian Urban <urbanc@in.tum.de>
parents: 1258
diff changeset
    75
  unfolding fresh_star_def
2012
a48a6f88f76e simplified the supp-of-finite-sets proof
Christian Urban <urbanc@in.tum.de>
parents: 2003
diff changeset
    76
  by (metis mem_permute_iff permute_minus_cancel(1) fresh_permute_iff)
1436
04dad9b0136d started supp-fv proofs (is going to work)
Christian Urban <urbanc@in.tum.de>
parents: 1258
diff changeset
    77
1861
226b797868dc some tuning of eqvt-infrastructure
Christian Urban <urbanc@in.tum.de>
parents: 1778
diff changeset
    78
lemma fresh_star_eqvt[eqvt]:
1436
04dad9b0136d started supp-fv proofs (is going to work)
Christian Urban <urbanc@in.tum.de>
parents: 1258
diff changeset
    79
  shows "(p \<bullet> (as \<sharp>* x)) = (p \<bullet> as) \<sharp>* (p \<bullet> x)"
04dad9b0136d started supp-fv proofs (is going to work)
Christian Urban <urbanc@in.tum.de>
parents: 1258
diff changeset
    80
unfolding fresh_star_def
04dad9b0136d started supp-fv proofs (is going to work)
Christian Urban <urbanc@in.tum.de>
parents: 1258
diff changeset
    81
unfolding Ball_def
04dad9b0136d started supp-fv proofs (is going to work)
Christian Urban <urbanc@in.tum.de>
parents: 1258
diff changeset
    82
apply(simp add: all_eqvt)
04dad9b0136d started supp-fv proofs (is going to work)
Christian Urban <urbanc@in.tum.de>
parents: 1258
diff changeset
    83
apply(subst permute_fun_def)
04dad9b0136d started supp-fv proofs (is going to work)
Christian Urban <urbanc@in.tum.de>
parents: 1258
diff changeset
    84
apply(simp add: imp_eqvt fresh_eqvt mem_eqvt)
04dad9b0136d started supp-fv proofs (is going to work)
Christian Urban <urbanc@in.tum.de>
parents: 1258
diff changeset
    85
done
1062
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
    86
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
    87
section {* Avoiding of atom sets *}
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
    88
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
    89
text {* 
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
    90
  For every set of atoms, there is another set of atoms
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
    91
  avoiding a finitely supported c and there is a permutation
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
    92
  which 'translates' between both sets.
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
    93
*}
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
    94
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
    95
lemma at_set_avoiding_aux:
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
    96
  fixes Xs::"atom set"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
    97
  and   As::"atom set"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
    98
  assumes b: "Xs \<subseteq> As"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
    99
  and     c: "finite As"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   100
  shows "\<exists>p. (p \<bullet> Xs) \<inter> As = {} \<and> (supp p) \<subseteq> (Xs \<union> (p \<bullet> Xs))"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   101
proof -
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   102
  from b c have "finite Xs" by (rule finite_subset)
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   103
  then show ?thesis using b
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   104
  proof (induct rule: finite_subset_induct)
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   105
    case empty
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   106
    have "0 \<bullet> {} \<inter> As = {}" by simp
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   107
    moreover
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   108
    have "supp (0::perm) \<subseteq> {} \<union> 0 \<bullet> {}" by (simp add: supp_zero_perm)
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   109
    ultimately show ?case by blast
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   110
  next
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   111
    case (insert x Xs)
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   112
    then obtain p where
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   113
      p1: "(p \<bullet> Xs) \<inter> As = {}" and 
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   114
      p2: "supp p \<subseteq> (Xs \<union> (p \<bullet> Xs))" by blast
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   115
    from `x \<in> As` p1 have "x \<notin> p \<bullet> Xs" by fast
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   116
    with `x \<notin> Xs` p2 have "x \<notin> supp p" by fast
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   117
    hence px: "p \<bullet> x = x" unfolding supp_perm by simp
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   118
    have "finite (As \<union> p \<bullet> Xs)"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   119
      using `finite As` `finite Xs`
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   120
      by (simp add: permute_set_eq_image)
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   121
    then obtain y where "y \<notin> (As \<union> p \<bullet> Xs)" "sort_of y = sort_of x"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   122
      by (rule obtain_atom)
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   123
    hence y: "y \<notin> As" "y \<notin> p \<bullet> Xs" "sort_of y = sort_of x"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   124
      by simp_all
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   125
    let ?q = "(x \<rightleftharpoons> y) + p"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   126
    have q: "?q \<bullet> insert x Xs = insert y (p \<bullet> Xs)"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   127
      unfolding insert_eqvt
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   128
      using `p \<bullet> x = x` `sort_of y = sort_of x`
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   129
      using `x \<notin> p \<bullet> Xs` `y \<notin> p \<bullet> Xs`
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   130
      by (simp add: swap_atom swap_set_not_in)
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   131
    have "?q \<bullet> insert x Xs \<inter> As = {}"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   132
      using `y \<notin> As` `p \<bullet> Xs \<inter> As = {}`
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   133
      unfolding q by simp
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   134
    moreover
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   135
    have "supp ?q \<subseteq> insert x Xs \<union> ?q \<bullet> insert x Xs"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   136
      using p2 unfolding q
1930
f189cf2c0987 moved some lemmas into the right places
Christian Urban <urbanc@in.tum.de>
parents: 1923
diff changeset
   137
      by (intro subset_trans [OF supp_plus_perm])
f189cf2c0987 moved some lemmas into the right places
Christian Urban <urbanc@in.tum.de>
parents: 1923
diff changeset
   138
         (auto simp add: supp_swap)
1062
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   139
    ultimately show ?case by blast
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   140
  qed
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   141
qed
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   142
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   143
lemma at_set_avoiding:
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   144
  assumes a: "finite Xs"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   145
  and     b: "finite (supp c)"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   146
  obtains p::"perm" where "(p \<bullet> Xs)\<sharp>*c" and "(supp p) \<subseteq> (Xs \<union> (p \<bullet> Xs))"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   147
  using a b at_set_avoiding_aux [where Xs="Xs" and As="Xs \<union> supp c"]
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   148
  unfolding fresh_star_def fresh_def by blast
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   149
1879
869d1183e082 tuned proofs
Christian Urban <urbanc@in.tum.de>
parents: 1861
diff changeset
   150
lemma at_set_avoiding2:
869d1183e082 tuned proofs
Christian Urban <urbanc@in.tum.de>
parents: 1861
diff changeset
   151
  assumes "finite xs"
869d1183e082 tuned proofs
Christian Urban <urbanc@in.tum.de>
parents: 1861
diff changeset
   152
  and     "finite (supp c)" "finite (supp x)"
869d1183e082 tuned proofs
Christian Urban <urbanc@in.tum.de>
parents: 1861
diff changeset
   153
  and     "xs \<sharp>* x"
869d1183e082 tuned proofs
Christian Urban <urbanc@in.tum.de>
parents: 1861
diff changeset
   154
  shows "\<exists>p. (p \<bullet> xs) \<sharp>* c \<and> supp x \<sharp>* p"
869d1183e082 tuned proofs
Christian Urban <urbanc@in.tum.de>
parents: 1861
diff changeset
   155
using assms
869d1183e082 tuned proofs
Christian Urban <urbanc@in.tum.de>
parents: 1861
diff changeset
   156
apply(erule_tac c="(c, x)" in at_set_avoiding)
869d1183e082 tuned proofs
Christian Urban <urbanc@in.tum.de>
parents: 1861
diff changeset
   157
apply(simp add: supp_Pair)
869d1183e082 tuned proofs
Christian Urban <urbanc@in.tum.de>
parents: 1861
diff changeset
   158
apply(rule_tac x="p" in exI)
869d1183e082 tuned proofs
Christian Urban <urbanc@in.tum.de>
parents: 1861
diff changeset
   159
apply(simp add: fresh_star_prod)
869d1183e082 tuned proofs
Christian Urban <urbanc@in.tum.de>
parents: 1861
diff changeset
   160
apply(subgoal_tac "\<forall>a \<in> supp p. a \<sharp> x")
869d1183e082 tuned proofs
Christian Urban <urbanc@in.tum.de>
parents: 1861
diff changeset
   161
apply(auto simp add: fresh_star_def fresh_def supp_perm)[1]
869d1183e082 tuned proofs
Christian Urban <urbanc@in.tum.de>
parents: 1861
diff changeset
   162
apply(auto simp add: fresh_star_def fresh_def)
869d1183e082 tuned proofs
Christian Urban <urbanc@in.tum.de>
parents: 1861
diff changeset
   163
done
869d1183e082 tuned proofs
Christian Urban <urbanc@in.tum.de>
parents: 1861
diff changeset
   164
869d1183e082 tuned proofs
Christian Urban <urbanc@in.tum.de>
parents: 1861
diff changeset
   165
lemma at_set_avoiding2_atom:
869d1183e082 tuned proofs
Christian Urban <urbanc@in.tum.de>
parents: 1861
diff changeset
   166
  assumes "finite (supp c)" "finite (supp x)"
1930
f189cf2c0987 moved some lemmas into the right places
Christian Urban <urbanc@in.tum.de>
parents: 1923
diff changeset
   167
  and     b: "a \<sharp> x"
f189cf2c0987 moved some lemmas into the right places
Christian Urban <urbanc@in.tum.de>
parents: 1923
diff changeset
   168
  shows "\<exists>p. (p \<bullet> a) \<sharp> c \<and> supp x \<sharp>* p"
1879
869d1183e082 tuned proofs
Christian Urban <urbanc@in.tum.de>
parents: 1861
diff changeset
   169
proof -
1930
f189cf2c0987 moved some lemmas into the right places
Christian Urban <urbanc@in.tum.de>
parents: 1923
diff changeset
   170
  have a: "{a} \<sharp>* x" unfolding fresh_star_def by (simp add: b)
f189cf2c0987 moved some lemmas into the right places
Christian Urban <urbanc@in.tum.de>
parents: 1923
diff changeset
   171
  obtain p where p1: "(p \<bullet> {a}) \<sharp>* c" and p2: "supp x \<sharp>* p"
f189cf2c0987 moved some lemmas into the right places
Christian Urban <urbanc@in.tum.de>
parents: 1923
diff changeset
   172
    using at_set_avoiding2[of "{a}" "c" "x"] assms a by blast
f189cf2c0987 moved some lemmas into the right places
Christian Urban <urbanc@in.tum.de>
parents: 1923
diff changeset
   173
  have c: "(p \<bullet> a) \<sharp> c" using p1
1879
869d1183e082 tuned proofs
Christian Urban <urbanc@in.tum.de>
parents: 1861
diff changeset
   174
    unfolding fresh_star_def Ball_def 
2012
a48a6f88f76e simplified the supp-of-finite-sets proof
Christian Urban <urbanc@in.tum.de>
parents: 2003
diff changeset
   175
    by(erule_tac x="p \<bullet> a" in allE) (simp add: permute_set_eq)
1930
f189cf2c0987 moved some lemmas into the right places
Christian Urban <urbanc@in.tum.de>
parents: 1923
diff changeset
   176
  hence "p \<bullet> a \<sharp> c \<and> supp x \<sharp>* p" using p2 by blast
f189cf2c0987 moved some lemmas into the right places
Christian Urban <urbanc@in.tum.de>
parents: 1923
diff changeset
   177
  then show "\<exists>p. (p \<bullet> a) \<sharp> c \<and> supp x \<sharp>* p" by blast
1879
869d1183e082 tuned proofs
Christian Urban <urbanc@in.tum.de>
parents: 1861
diff changeset
   178
qed
1062
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   179
1930
f189cf2c0987 moved some lemmas into the right places
Christian Urban <urbanc@in.tum.de>
parents: 1923
diff changeset
   180
f189cf2c0987 moved some lemmas into the right places
Christian Urban <urbanc@in.tum.de>
parents: 1923
diff changeset
   181
section {* The freshness lemma according to Andy Pitts *}
1062
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   182
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   183
lemma freshness_lemma:
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   184
  fixes h :: "'a::at \<Rightarrow> 'b::pt"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   185
  assumes a: "\<exists>a. atom a \<sharp> (h, h a)"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   186
  shows  "\<exists>x. \<forall>a. atom a \<sharp> h \<longrightarrow> h a = x"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   187
proof -
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   188
  from a obtain b where a1: "atom b \<sharp> h" and a2: "atom b \<sharp> h b"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   189
    by (auto simp add: fresh_Pair)
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   190
  show "\<exists>x. \<forall>a. atom a \<sharp> h \<longrightarrow> h a = x"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   191
  proof (intro exI allI impI)
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   192
    fix a :: 'a
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   193
    assume a3: "atom a \<sharp> h"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   194
    show "h a = h b"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   195
    proof (cases "a = b")
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   196
      assume "a = b"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   197
      thus "h a = h b" by simp
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   198
    next
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   199
      assume "a \<noteq> b"
1080
2f1377bb4e1f fixed lemma name
Christian Urban <urbanc@in.tum.de>
parents: 1062
diff changeset
   200
      hence "atom a \<sharp> b" by (simp add: fresh_at_base)
1879
869d1183e082 tuned proofs
Christian Urban <urbanc@in.tum.de>
parents: 1861
diff changeset
   201
      with a3 have "atom a \<sharp> h b" 
2372
Christian Urban <urbanc@in.tum.de>
parents: 2033
diff changeset
   202
        by (rule fresh_fun_app)
1062
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   203
      with a2 have d1: "(atom b \<rightleftharpoons> atom a) \<bullet> (h b) = (h b)"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   204
        by (rule swap_fresh_fresh)
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   205
      from a1 a3 have d2: "(atom b \<rightleftharpoons> atom a) \<bullet> h = h"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   206
        by (rule swap_fresh_fresh)
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   207
      from d1 have "h b = (atom b \<rightleftharpoons> atom a) \<bullet> (h b)" by simp
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   208
      also have "\<dots> = ((atom b \<rightleftharpoons> atom a) \<bullet> h) ((atom b \<rightleftharpoons> atom a) \<bullet> b)"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   209
        by (rule permute_fun_app_eq)
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   210
      also have "\<dots> = h a"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   211
        using d2 by simp
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   212
      finally show "h a = h b"  by simp
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   213
    qed
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   214
  qed
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   215
qed
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   216
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   217
lemma freshness_lemma_unique:
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   218
  fixes h :: "'a::at \<Rightarrow> 'b::pt"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   219
  assumes a: "\<exists>a. atom a \<sharp> (h, h a)"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   220
  shows "\<exists>!x. \<forall>a. atom a \<sharp> h \<longrightarrow> h a = x"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   221
proof (rule ex_ex1I)
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   222
  from a show "\<exists>x. \<forall>a. atom a \<sharp> h \<longrightarrow> h a = x"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   223
    by (rule freshness_lemma)
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   224
next
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   225
  fix x y
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   226
  assume x: "\<forall>a. atom a \<sharp> h \<longrightarrow> h a = x"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   227
  assume y: "\<forall>a. atom a \<sharp> h \<longrightarrow> h a = y"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   228
  from a x y show "x = y"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   229
    by (auto simp add: fresh_Pair)
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   230
qed
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   231
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   232
text {* packaging the freshness lemma into a function *}
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   233
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   234
definition
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   235
  fresh_fun :: "('a::at \<Rightarrow> 'b::pt) \<Rightarrow> 'b"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   236
where
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   237
  "fresh_fun h = (THE x. \<forall>a. atom a \<sharp> h \<longrightarrow> h a = x)"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   238
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   239
lemma fresh_fun_app:
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   240
  fixes h :: "'a::at \<Rightarrow> 'b::pt"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   241
  assumes a: "\<exists>a. atom a \<sharp> (h, h a)"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   242
  assumes b: "atom a \<sharp> h"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   243
  shows "fresh_fun h = h a"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   244
unfolding fresh_fun_def
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   245
proof (rule the_equality)
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   246
  show "\<forall>a'. atom a' \<sharp> h \<longrightarrow> h a' = h a"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   247
  proof (intro strip)
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   248
    fix a':: 'a
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   249
    assume c: "atom a' \<sharp> h"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   250
    from a have "\<exists>x. \<forall>a. atom a \<sharp> h \<longrightarrow> h a = x" by (rule freshness_lemma)
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   251
    with b c show "h a' = h a" by auto
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   252
  qed
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   253
next
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   254
  fix fr :: 'b
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   255
  assume "\<forall>a. atom a \<sharp> h \<longrightarrow> h a = fr"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   256
  with b show "fr = h a" by auto
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   257
qed
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   258
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   259
lemma fresh_fun_app':
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   260
  fixes h :: "'a::at \<Rightarrow> 'b::pt"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   261
  assumes a: "atom a \<sharp> h" "atom a \<sharp> h a"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   262
  shows "fresh_fun h = h a"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   263
  apply (rule fresh_fun_app)
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   264
  apply (auto simp add: fresh_Pair intro: a)
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   265
  done
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   266
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   267
lemma fresh_fun_eqvt:
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   268
  fixes h :: "'a::at \<Rightarrow> 'b::pt"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   269
  assumes a: "\<exists>a. atom a \<sharp> (h, h a)"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   270
  shows "p \<bullet> (fresh_fun h) = fresh_fun (p \<bullet> h)"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   271
  using a
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   272
  apply (clarsimp simp add: fresh_Pair)
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   273
  apply (subst fresh_fun_app', assumption+)
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   274
  apply (drule fresh_permute_iff [where p=p, THEN iffD2])
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   275
  apply (drule fresh_permute_iff [where p=p, THEN iffD2])
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   276
  apply (simp add: atom_eqvt permute_fun_app_eq [where f=h])
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   277
  apply (erule (1) fresh_fun_app' [symmetric])
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   278
  done
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   279
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   280
lemma fresh_fun_supports:
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   281
  fixes h :: "'a::at \<Rightarrow> 'b::pt"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   282
  assumes a: "\<exists>a. atom a \<sharp> (h, h a)"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   283
  shows "(supp h) supports (fresh_fun h)"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   284
  apply (simp add: supports_def fresh_def [symmetric])
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   285
  apply (simp add: fresh_fun_eqvt [OF a] swap_fresh_fresh)
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   286
  done
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   287
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   288
notation fresh_fun (binder "FRESH " 10)
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   289
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   290
lemma FRESH_f_iff:
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   291
  fixes P :: "'a::at \<Rightarrow> 'b::pure"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   292
  fixes f :: "'b \<Rightarrow> 'c::pure"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   293
  assumes P: "finite (supp P)"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   294
  shows "(FRESH x. f (P x)) = f (FRESH x. P x)"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   295
proof -
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   296
  obtain a::'a where "atom a \<notin> supp P"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   297
    using P by (rule obtain_at_base)
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   298
  hence "atom a \<sharp> P"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   299
    by (simp add: fresh_def)
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   300
  show "(FRESH x. f (P x)) = f (FRESH x. P x)"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   301
    apply (subst fresh_fun_app' [where a=a, OF _ pure_fresh])
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   302
    apply (cut_tac `atom a \<sharp> P`)
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   303
    apply (simp add: fresh_conv_MOST)
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   304
    apply (elim MOST_rev_mp, rule MOST_I, clarify)
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   305
    apply (simp add: permute_fun_def permute_pure expand_fun_eq)
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   306
    apply (subst fresh_fun_app' [where a=a, OF `atom a \<sharp> P` pure_fresh])
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   307
    apply (rule refl)
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   308
    done
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   309
qed
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   310
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   311
lemma FRESH_binop_iff:
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   312
  fixes P :: "'a::at \<Rightarrow> 'b::pure"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   313
  fixes Q :: "'a::at \<Rightarrow> 'c::pure"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   314
  fixes binop :: "'b \<Rightarrow> 'c \<Rightarrow> 'd::pure"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   315
  assumes P: "finite (supp P)" 
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   316
  and     Q: "finite (supp Q)"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   317
  shows "(FRESH x. binop (P x) (Q x)) = binop (FRESH x. P x) (FRESH x. Q x)"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   318
proof -
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   319
  from assms have "finite (supp P \<union> supp Q)" by simp
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   320
  then obtain a::'a where "atom a \<notin> (supp P \<union> supp Q)"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   321
    by (rule obtain_at_base)
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   322
  hence "atom a \<sharp> P" and "atom a \<sharp> Q"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   323
    by (simp_all add: fresh_def)
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   324
  show ?thesis
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   325
    apply (subst fresh_fun_app' [where a=a, OF _ pure_fresh])
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   326
    apply (cut_tac `atom a \<sharp> P` `atom a \<sharp> Q`)
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   327
    apply (simp add: fresh_conv_MOST)
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   328
    apply (elim MOST_rev_mp, rule MOST_I, clarify)
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   329
    apply (simp add: permute_fun_def permute_pure expand_fun_eq)
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   330
    apply (subst fresh_fun_app' [where a=a, OF `atom a \<sharp> P` pure_fresh])
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   331
    apply (subst fresh_fun_app' [where a=a, OF `atom a \<sharp> Q` pure_fresh])
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   332
    apply (rule refl)
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   333
    done
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   334
qed
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   335
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   336
lemma FRESH_conj_iff:
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   337
  fixes P Q :: "'a::at \<Rightarrow> bool"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   338
  assumes P: "finite (supp P)" and Q: "finite (supp Q)"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   339
  shows "(FRESH x. P x \<and> Q x) \<longleftrightarrow> (FRESH x. P x) \<and> (FRESH x. Q x)"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   340
using P Q by (rule FRESH_binop_iff)
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   341
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   342
lemma FRESH_disj_iff:
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   343
  fixes P Q :: "'a::at \<Rightarrow> bool"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   344
  assumes P: "finite (supp P)" and Q: "finite (supp Q)"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   345
  shows "(FRESH x. P x \<or> Q x) \<longleftrightarrow> (FRESH x. P x) \<or> (FRESH x. Q x)"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   346
using P Q by (rule FRESH_binop_iff)
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   347
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   348
1930
f189cf2c0987 moved some lemmas into the right places
Christian Urban <urbanc@in.tum.de>
parents: 1923
diff changeset
   349
section {* @{const nat_of} is an example of a function 
f189cf2c0987 moved some lemmas into the right places
Christian Urban <urbanc@in.tum.de>
parents: 1923
diff changeset
   350
  without finite support *}
1062
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   351
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   352
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   353
lemma not_fresh_nat_of:
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   354
  shows "\<not> a \<sharp> nat_of"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   355
unfolding fresh_def supp_def
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   356
proof (clarsimp)
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   357
  assume "finite {b. (a \<rightleftharpoons> b) \<bullet> nat_of \<noteq> nat_of}"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   358
  hence "finite ({a} \<union> {b. (a \<rightleftharpoons> b) \<bullet> nat_of \<noteq> nat_of})"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   359
    by simp
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   360
  then obtain b where
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   361
    b1: "b \<noteq> a" and
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   362
    b2: "sort_of b = sort_of a" and
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   363
    b3: "(a \<rightleftharpoons> b) \<bullet> nat_of = nat_of"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   364
    by (rule obtain_atom) auto
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   365
  have "nat_of a = (a \<rightleftharpoons> b) \<bullet> (nat_of a)" by (simp add: permute_nat_def)
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   366
  also have "\<dots> = ((a \<rightleftharpoons> b) \<bullet> nat_of) ((a \<rightleftharpoons> b) \<bullet> a)" by (simp add: permute_fun_app_eq)
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   367
  also have "\<dots> = nat_of ((a \<rightleftharpoons> b) \<bullet> a)" using b3 by simp
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   368
  also have "\<dots> = nat_of b" using b2 by simp
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   369
  finally have "nat_of a = nat_of b" by simp
1930
f189cf2c0987 moved some lemmas into the right places
Christian Urban <urbanc@in.tum.de>
parents: 1923
diff changeset
   370
  with b2 have "a = b" by (simp add: atom_components_eq_iff)
1062
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   371
  with b1 show "False" by simp
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   372
qed
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   373
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   374
lemma supp_nat_of:
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   375
  shows "supp nat_of = UNIV"
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   376
  using not_fresh_nat_of [unfolded fresh_def] by auto
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   377
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   378
1930
f189cf2c0987 moved some lemmas into the right places
Christian Urban <urbanc@in.tum.de>
parents: 1923
diff changeset
   379
section {* Induction principle for permutations *}
1563
eb60f360a200 moved lemmas supp_perm_eq and exists_perm to Nominal2_Supp
Christian Urban <urbanc@in.tum.de>
parents: 1506
diff changeset
   380
1918
e2e963f4e90d added an improved version of the induction principle for permutations
Christian Urban <urbanc@in.tum.de>
parents: 1879
diff changeset
   381
e2e963f4e90d added an improved version of the induction principle for permutations
Christian Urban <urbanc@in.tum.de>
parents: 1879
diff changeset
   382
lemma perm_struct_induct[consumes 1, case_names zero swap]:
1778
88ec05a09772 added an induction principle for permutations; removed add_perm construction
Christian Urban <urbanc@in.tum.de>
parents: 1777
diff changeset
   383
  assumes S: "supp p \<subseteq> S"
1930
f189cf2c0987 moved some lemmas into the right places
Christian Urban <urbanc@in.tum.de>
parents: 1923
diff changeset
   384
  and zero: "P 0"
f189cf2c0987 moved some lemmas into the right places
Christian Urban <urbanc@in.tum.de>
parents: 1923
diff changeset
   385
  and swap: "\<And>p a b. \<lbrakk>P p; supp p \<subseteq> S; a \<in> S; b \<in> S; a \<noteq> b; sort_of a = sort_of b\<rbrakk> \<Longrightarrow> P ((a \<rightleftharpoons> b) + p)"
1778
88ec05a09772 added an induction principle for permutations; removed add_perm construction
Christian Urban <urbanc@in.tum.de>
parents: 1777
diff changeset
   386
  shows "P p"
1777
4f41a0884b22 isarfied proof about existence of a permutation list
Christian Urban <urbanc@in.tum.de>
parents: 1774
diff changeset
   387
proof -
4f41a0884b22 isarfied proof about existence of a permutation list
Christian Urban <urbanc@in.tum.de>
parents: 1774
diff changeset
   388
  have "finite (supp p)" by (simp add: finite_supp)
1918
e2e963f4e90d added an improved version of the induction principle for permutations
Christian Urban <urbanc@in.tum.de>
parents: 1879
diff changeset
   389
  then show "P p" using S
1778
88ec05a09772 added an induction principle for permutations; removed add_perm construction
Christian Urban <urbanc@in.tum.de>
parents: 1777
diff changeset
   390
  proof(induct A\<equiv>"supp p" arbitrary: p rule: finite_psubset_induct)
1777
4f41a0884b22 isarfied proof about existence of a permutation list
Christian Urban <urbanc@in.tum.de>
parents: 1774
diff changeset
   391
    case (psubset p)
1778
88ec05a09772 added an induction principle for permutations; removed add_perm construction
Christian Urban <urbanc@in.tum.de>
parents: 1777
diff changeset
   392
    then have ih: "\<And>q. supp q \<subset> supp p \<Longrightarrow> P q" by auto
88ec05a09772 added an induction principle for permutations; removed add_perm construction
Christian Urban <urbanc@in.tum.de>
parents: 1777
diff changeset
   393
    have as: "supp p \<subseteq> S" by fact
1777
4f41a0884b22 isarfied proof about existence of a permutation list
Christian Urban <urbanc@in.tum.de>
parents: 1774
diff changeset
   394
    { assume "supp p = {}"
4f41a0884b22 isarfied proof about existence of a permutation list
Christian Urban <urbanc@in.tum.de>
parents: 1774
diff changeset
   395
      then have "p = 0" by (simp add: supp_perm expand_perm_eq)
1778
88ec05a09772 added an induction principle for permutations; removed add_perm construction
Christian Urban <urbanc@in.tum.de>
parents: 1777
diff changeset
   396
      then have "P p" using zero by simp
1777
4f41a0884b22 isarfied proof about existence of a permutation list
Christian Urban <urbanc@in.tum.de>
parents: 1774
diff changeset
   397
    }
4f41a0884b22 isarfied proof about existence of a permutation list
Christian Urban <urbanc@in.tum.de>
parents: 1774
diff changeset
   398
    moreover
4f41a0884b22 isarfied proof about existence of a permutation list
Christian Urban <urbanc@in.tum.de>
parents: 1774
diff changeset
   399
    { assume "supp p \<noteq> {}"
4f41a0884b22 isarfied proof about existence of a permutation list
Christian Urban <urbanc@in.tum.de>
parents: 1774
diff changeset
   400
      then obtain a where a0: "a \<in> supp p" by blast
2372
Christian Urban <urbanc@in.tum.de>
parents: 2033
diff changeset
   401
      then have a1: "p \<bullet> a \<in> S" "a \<in> S" "sort_of (p \<bullet> a) = sort_of a" "p \<bullet> a \<noteq> a"
Christian Urban <urbanc@in.tum.de>
parents: 2033
diff changeset
   402
        using as by (auto simp add: supp_atom supp_perm swap_atom)
1918
e2e963f4e90d added an improved version of the induction principle for permutations
Christian Urban <urbanc@in.tum.de>
parents: 1879
diff changeset
   403
      let ?q = "(p \<bullet> a \<rightleftharpoons> a) + p"
1778
88ec05a09772 added an induction principle for permutations; removed add_perm construction
Christian Urban <urbanc@in.tum.de>
parents: 1777
diff changeset
   404
      have a2: "supp ?q \<subseteq> supp p" unfolding supp_perm by (auto simp add: swap_atom)
1777
4f41a0884b22 isarfied proof about existence of a permutation list
Christian Urban <urbanc@in.tum.de>
parents: 1774
diff changeset
   405
      moreover
4f41a0884b22 isarfied proof about existence of a permutation list
Christian Urban <urbanc@in.tum.de>
parents: 1774
diff changeset
   406
      have "a \<notin> supp ?q" by (simp add: supp_perm)
4f41a0884b22 isarfied proof about existence of a permutation list
Christian Urban <urbanc@in.tum.de>
parents: 1774
diff changeset
   407
      then have "supp ?q \<noteq> supp p" using a0 by auto
1918
e2e963f4e90d added an improved version of the induction principle for permutations
Christian Urban <urbanc@in.tum.de>
parents: 1879
diff changeset
   408
      ultimately have "supp ?q \<subset> supp p" using a2 by auto
1778
88ec05a09772 added an induction principle for permutations; removed add_perm construction
Christian Urban <urbanc@in.tum.de>
parents: 1777
diff changeset
   409
      then have "P ?q" using ih by simp
88ec05a09772 added an induction principle for permutations; removed add_perm construction
Christian Urban <urbanc@in.tum.de>
parents: 1777
diff changeset
   410
      moreover
88ec05a09772 added an induction principle for permutations; removed add_perm construction
Christian Urban <urbanc@in.tum.de>
parents: 1777
diff changeset
   411
      have "supp ?q \<subseteq> S" using as a2 by simp
1918
e2e963f4e90d added an improved version of the induction principle for permutations
Christian Urban <urbanc@in.tum.de>
parents: 1879
diff changeset
   412
      ultimately  have "P ((p \<bullet> a \<rightleftharpoons> a) + ?q)" using as a1 swap by simp 
1777
4f41a0884b22 isarfied proof about existence of a permutation list
Christian Urban <urbanc@in.tum.de>
parents: 1774
diff changeset
   413
      moreover 
1918
e2e963f4e90d added an improved version of the induction principle for permutations
Christian Urban <urbanc@in.tum.de>
parents: 1879
diff changeset
   414
      have "p = (p \<bullet> a \<rightleftharpoons> a) + ?q" by (simp add: expand_perm_eq)
1778
88ec05a09772 added an induction principle for permutations; removed add_perm construction
Christian Urban <urbanc@in.tum.de>
parents: 1777
diff changeset
   415
      ultimately have "P p" by simp
1777
4f41a0884b22 isarfied proof about existence of a permutation list
Christian Urban <urbanc@in.tum.de>
parents: 1774
diff changeset
   416
    }
1778
88ec05a09772 added an induction principle for permutations; removed add_perm construction
Christian Urban <urbanc@in.tum.de>
parents: 1777
diff changeset
   417
    ultimately show "P p" by blast
1777
4f41a0884b22 isarfied proof about existence of a permutation list
Christian Urban <urbanc@in.tum.de>
parents: 1774
diff changeset
   418
  qed
4f41a0884b22 isarfied proof about existence of a permutation list
Christian Urban <urbanc@in.tum.de>
parents: 1774
diff changeset
   419
qed
1062
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
   420
1930
f189cf2c0987 moved some lemmas into the right places
Christian Urban <urbanc@in.tum.de>
parents: 1923
diff changeset
   421
lemma perm_simple_struct_induct[case_names zero swap]:
1923
289988027abf added a variant of the induction principle for permutations
Christian Urban <urbanc@in.tum.de>
parents: 1918
diff changeset
   422
  assumes zero: "P 0"
1930
f189cf2c0987 moved some lemmas into the right places
Christian Urban <urbanc@in.tum.de>
parents: 1923
diff changeset
   423
  and     swap: "\<And>p a b. \<lbrakk>P p; a \<noteq> b; sort_of a = sort_of b\<rbrakk> \<Longrightarrow> P ((a \<rightleftharpoons> b) + p)"
1923
289988027abf added a variant of the induction principle for permutations
Christian Urban <urbanc@in.tum.de>
parents: 1918
diff changeset
   424
  shows "P p"
289988027abf added a variant of the induction principle for permutations
Christian Urban <urbanc@in.tum.de>
parents: 1918
diff changeset
   425
by (rule_tac S="supp p" in perm_struct_induct)
289988027abf added a variant of the induction principle for permutations
Christian Urban <urbanc@in.tum.de>
parents: 1918
diff changeset
   426
   (auto intro: zero swap)
289988027abf added a variant of the induction principle for permutations
Christian Urban <urbanc@in.tum.de>
parents: 1918
diff changeset
   427
1930
f189cf2c0987 moved some lemmas into the right places
Christian Urban <urbanc@in.tum.de>
parents: 1923
diff changeset
   428
lemma perm_subset_induct[consumes 1, case_names zero swap plus]:
1778
88ec05a09772 added an induction principle for permutations; removed add_perm construction
Christian Urban <urbanc@in.tum.de>
parents: 1777
diff changeset
   429
  assumes S: "supp p \<subseteq> S"
88ec05a09772 added an induction principle for permutations; removed add_perm construction
Christian Urban <urbanc@in.tum.de>
parents: 1777
diff changeset
   430
  assumes zero: "P 0"
88ec05a09772 added an induction principle for permutations; removed add_perm construction
Christian Urban <urbanc@in.tum.de>
parents: 1777
diff changeset
   431
  assumes swap: "\<And>a b. \<lbrakk>sort_of a = sort_of b; a \<noteq> b; a \<in> S; b \<in> S\<rbrakk> \<Longrightarrow> P (a \<rightleftharpoons> b)"
88ec05a09772 added an induction principle for permutations; removed add_perm construction
Christian Urban <urbanc@in.tum.de>
parents: 1777
diff changeset
   432
  assumes plus: "\<And>p1 p2. \<lbrakk>P p1; P p2; supp p1 \<subseteq> S; supp p2 \<subseteq> S\<rbrakk> \<Longrightarrow> P (p1 + p2)"
88ec05a09772 added an induction principle for permutations; removed add_perm construction
Christian Urban <urbanc@in.tum.de>
parents: 1777
diff changeset
   433
  shows "P p"
1918
e2e963f4e90d added an improved version of the induction principle for permutations
Christian Urban <urbanc@in.tum.de>
parents: 1879
diff changeset
   434
using S
e2e963f4e90d added an improved version of the induction principle for permutations
Christian Urban <urbanc@in.tum.de>
parents: 1879
diff changeset
   435
by (induct p rule: perm_struct_induct)
e2e963f4e90d added an improved version of the induction principle for permutations
Christian Urban <urbanc@in.tum.de>
parents: 1879
diff changeset
   436
   (auto intro: zero plus swap simp add: supp_swap)
1563
eb60f360a200 moved lemmas supp_perm_eq and exists_perm to Nominal2_Supp
Christian Urban <urbanc@in.tum.de>
parents: 1506
diff changeset
   437
eb60f360a200 moved lemmas supp_perm_eq and exists_perm to Nominal2_Supp
Christian Urban <urbanc@in.tum.de>
parents: 1506
diff changeset
   438
lemma supp_perm_eq:
1778
88ec05a09772 added an induction principle for permutations; removed add_perm construction
Christian Urban <urbanc@in.tum.de>
parents: 1777
diff changeset
   439
  assumes "(supp x) \<sharp>* p"
1563
eb60f360a200 moved lemmas supp_perm_eq and exists_perm to Nominal2_Supp
Christian Urban <urbanc@in.tum.de>
parents: 1506
diff changeset
   440
  shows "p \<bullet> x = x"
eb60f360a200 moved lemmas supp_perm_eq and exists_perm to Nominal2_Supp
Christian Urban <urbanc@in.tum.de>
parents: 1506
diff changeset
   441
proof -
1778
88ec05a09772 added an induction principle for permutations; removed add_perm construction
Christian Urban <urbanc@in.tum.de>
parents: 1777
diff changeset
   442
  from assms have "supp p \<subseteq> {a. a \<sharp> x}"
88ec05a09772 added an induction principle for permutations; removed add_perm construction
Christian Urban <urbanc@in.tum.de>
parents: 1777
diff changeset
   443
    unfolding supp_perm fresh_star_def fresh_def by auto
88ec05a09772 added an induction principle for permutations; removed add_perm construction
Christian Urban <urbanc@in.tum.de>
parents: 1777
diff changeset
   444
  then show "p \<bullet> x = x"
1918
e2e963f4e90d added an improved version of the induction principle for permutations
Christian Urban <urbanc@in.tum.de>
parents: 1879
diff changeset
   445
  proof (induct p rule: perm_struct_induct)
e2e963f4e90d added an improved version of the induction principle for permutations
Christian Urban <urbanc@in.tum.de>
parents: 1879
diff changeset
   446
    case zero
e2e963f4e90d added an improved version of the induction principle for permutations
Christian Urban <urbanc@in.tum.de>
parents: 1879
diff changeset
   447
    show "0 \<bullet> x = x" by simp
e2e963f4e90d added an improved version of the induction principle for permutations
Christian Urban <urbanc@in.tum.de>
parents: 1879
diff changeset
   448
  next
e2e963f4e90d added an improved version of the induction principle for permutations
Christian Urban <urbanc@in.tum.de>
parents: 1879
diff changeset
   449
    case (swap p a b)
e2e963f4e90d added an improved version of the induction principle for permutations
Christian Urban <urbanc@in.tum.de>
parents: 1879
diff changeset
   450
    then have "a \<sharp> x" "b \<sharp> x" "p \<bullet> x = x" by simp_all
e2e963f4e90d added an improved version of the induction principle for permutations
Christian Urban <urbanc@in.tum.de>
parents: 1879
diff changeset
   451
    then show "((a \<rightleftharpoons> b) + p) \<bullet> x = x" by (simp add: swap_fresh_fresh)
e2e963f4e90d added an improved version of the induction principle for permutations
Christian Urban <urbanc@in.tum.de>
parents: 1879
diff changeset
   452
  qed
e2e963f4e90d added an improved version of the induction principle for permutations
Christian Urban <urbanc@in.tum.de>
parents: 1879
diff changeset
   453
qed
e2e963f4e90d added an improved version of the induction principle for permutations
Christian Urban <urbanc@in.tum.de>
parents: 1879
diff changeset
   454
e2e963f4e90d added an improved version of the induction principle for permutations
Christian Urban <urbanc@in.tum.de>
parents: 1879
diff changeset
   455
lemma supp_perm_eq_test:
e2e963f4e90d added an improved version of the induction principle for permutations
Christian Urban <urbanc@in.tum.de>
parents: 1879
diff changeset
   456
  assumes "(supp x) \<sharp>* p"
e2e963f4e90d added an improved version of the induction principle for permutations
Christian Urban <urbanc@in.tum.de>
parents: 1879
diff changeset
   457
  shows "p \<bullet> x = x"
e2e963f4e90d added an improved version of the induction principle for permutations
Christian Urban <urbanc@in.tum.de>
parents: 1879
diff changeset
   458
proof -
e2e963f4e90d added an improved version of the induction principle for permutations
Christian Urban <urbanc@in.tum.de>
parents: 1879
diff changeset
   459
  from assms have "supp p \<subseteq> {a. a \<sharp> x}"
e2e963f4e90d added an improved version of the induction principle for permutations
Christian Urban <urbanc@in.tum.de>
parents: 1879
diff changeset
   460
    unfolding supp_perm fresh_star_def fresh_def by auto
e2e963f4e90d added an improved version of the induction principle for permutations
Christian Urban <urbanc@in.tum.de>
parents: 1879
diff changeset
   461
  then show "p \<bullet> x = x"
1778
88ec05a09772 added an induction principle for permutations; removed add_perm construction
Christian Urban <urbanc@in.tum.de>
parents: 1777
diff changeset
   462
  proof (induct p rule: perm_subset_induct)
88ec05a09772 added an induction principle for permutations; removed add_perm construction
Christian Urban <urbanc@in.tum.de>
parents: 1777
diff changeset
   463
    case zero
88ec05a09772 added an induction principle for permutations; removed add_perm construction
Christian Urban <urbanc@in.tum.de>
parents: 1777
diff changeset
   464
    show "0 \<bullet> x = x" by simp
88ec05a09772 added an induction principle for permutations; removed add_perm construction
Christian Urban <urbanc@in.tum.de>
parents: 1777
diff changeset
   465
  next
88ec05a09772 added an induction principle for permutations; removed add_perm construction
Christian Urban <urbanc@in.tum.de>
parents: 1777
diff changeset
   466
    case (swap a b)
88ec05a09772 added an induction principle for permutations; removed add_perm construction
Christian Urban <urbanc@in.tum.de>
parents: 1777
diff changeset
   467
    then have "a \<sharp> x" "b \<sharp> x" by simp_all
88ec05a09772 added an induction principle for permutations; removed add_perm construction
Christian Urban <urbanc@in.tum.de>
parents: 1777
diff changeset
   468
    then show "(a \<rightleftharpoons> b) \<bullet> x = x" by (simp add: swap_fresh_fresh)
88ec05a09772 added an induction principle for permutations; removed add_perm construction
Christian Urban <urbanc@in.tum.de>
parents: 1777
diff changeset
   469
  next
88ec05a09772 added an induction principle for permutations; removed add_perm construction
Christian Urban <urbanc@in.tum.de>
parents: 1777
diff changeset
   470
    case (plus p1 p2)
88ec05a09772 added an induction principle for permutations; removed add_perm construction
Christian Urban <urbanc@in.tum.de>
parents: 1777
diff changeset
   471
    have "p1 \<bullet> x = x" "p2 \<bullet> x = x" by fact+
88ec05a09772 added an induction principle for permutations; removed add_perm construction
Christian Urban <urbanc@in.tum.de>
parents: 1777
diff changeset
   472
    then show "(p1 + p2) \<bullet> x = x" by simp
88ec05a09772 added an induction principle for permutations; removed add_perm construction
Christian Urban <urbanc@in.tum.de>
parents: 1777
diff changeset
   473
  qed
1563
eb60f360a200 moved lemmas supp_perm_eq and exists_perm to Nominal2_Supp
Christian Urban <urbanc@in.tum.de>
parents: 1506
diff changeset
   474
qed
eb60f360a200 moved lemmas supp_perm_eq and exists_perm to Nominal2_Supp
Christian Urban <urbanc@in.tum.de>
parents: 1506
diff changeset
   475
2003
b53e98bfb298 added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents: 1930
diff changeset
   476
b53e98bfb298 added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents: 1930
diff changeset
   477
section {* Support of Finite Sets of Finitely Supported Elements *}
b53e98bfb298 added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents: 1930
diff changeset
   478
b53e98bfb298 added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents: 1930
diff changeset
   479
lemma Union_fresh:
b53e98bfb298 added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents: 1930
diff changeset
   480
  shows "a \<sharp> S \<Longrightarrow> a \<sharp> (\<Union>x \<in> S. supp x)"
b53e98bfb298 added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents: 1930
diff changeset
   481
  unfolding Union_image_eq[symmetric]
b53e98bfb298 added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents: 1930
diff changeset
   482
  apply(rule_tac f="\<lambda>S. \<Union> supp ` S" in fresh_fun_eqvt_app)
b53e98bfb298 added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents: 1930
diff changeset
   483
  apply(perm_simp)
b53e98bfb298 added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents: 1930
diff changeset
   484
  apply(rule refl)
b53e98bfb298 added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents: 1930
diff changeset
   485
  apply(assumption)
b53e98bfb298 added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents: 1930
diff changeset
   486
  done
b53e98bfb298 added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents: 1930
diff changeset
   487
b53e98bfb298 added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents: 1930
diff changeset
   488
lemma Union_supports_set:
b53e98bfb298 added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents: 1930
diff changeset
   489
  shows "(\<Union>x \<in> S. supp x) supports S"
2012
a48a6f88f76e simplified the supp-of-finite-sets proof
Christian Urban <urbanc@in.tum.de>
parents: 2003
diff changeset
   490
proof -
a48a6f88f76e simplified the supp-of-finite-sets proof
Christian Urban <urbanc@in.tum.de>
parents: 2003
diff changeset
   491
  { fix a b
a48a6f88f76e simplified the supp-of-finite-sets proof
Christian Urban <urbanc@in.tum.de>
parents: 2003
diff changeset
   492
    have "\<forall>x \<in> S. (a \<rightleftharpoons> b) \<bullet> x = x \<Longrightarrow> (a \<rightleftharpoons> b) \<bullet> S = S"
a48a6f88f76e simplified the supp-of-finite-sets proof
Christian Urban <urbanc@in.tum.de>
parents: 2003
diff changeset
   493
      unfolding permute_set_eq by force
a48a6f88f76e simplified the supp-of-finite-sets proof
Christian Urban <urbanc@in.tum.de>
parents: 2003
diff changeset
   494
  }
a48a6f88f76e simplified the supp-of-finite-sets proof
Christian Urban <urbanc@in.tum.de>
parents: 2003
diff changeset
   495
  then show "(\<Union>x \<in> S. supp x) supports S"
a48a6f88f76e simplified the supp-of-finite-sets proof
Christian Urban <urbanc@in.tum.de>
parents: 2003
diff changeset
   496
    unfolding supports_def 
a48a6f88f76e simplified the supp-of-finite-sets proof
Christian Urban <urbanc@in.tum.de>
parents: 2003
diff changeset
   497
    by (simp add: fresh_def[symmetric] swap_fresh_fresh)
a48a6f88f76e simplified the supp-of-finite-sets proof
Christian Urban <urbanc@in.tum.de>
parents: 2003
diff changeset
   498
qed
2003
b53e98bfb298 added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents: 1930
diff changeset
   499
b53e98bfb298 added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents: 1930
diff changeset
   500
lemma Union_of_fin_supp_sets:
b53e98bfb298 added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents: 1930
diff changeset
   501
  fixes S::"('a::fs set)"
b53e98bfb298 added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents: 1930
diff changeset
   502
  assumes fin: "finite S"   
b53e98bfb298 added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents: 1930
diff changeset
   503
  shows "finite (\<Union>x\<in>S. supp x)"
b53e98bfb298 added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents: 1930
diff changeset
   504
  using fin by (induct) (auto simp add: finite_supp)
b53e98bfb298 added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents: 1930
diff changeset
   505
b53e98bfb298 added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents: 1930
diff changeset
   506
lemma Union_included_in_supp:
b53e98bfb298 added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents: 1930
diff changeset
   507
  fixes S::"('a::fs set)"
b53e98bfb298 added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents: 1930
diff changeset
   508
  assumes fin: "finite S"
b53e98bfb298 added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents: 1930
diff changeset
   509
  shows "(\<Union>x\<in>S. supp x) \<subseteq> supp S"
b53e98bfb298 added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents: 1930
diff changeset
   510
proof -
b53e98bfb298 added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents: 1930
diff changeset
   511
  have "(\<Union>x\<in>S. supp x) = supp (\<Union>x\<in>S. supp x)"
2372
Christian Urban <urbanc@in.tum.de>
parents: 2033
diff changeset
   512
    by (rule supp_finite_atom_set[symmetric])
Christian Urban <urbanc@in.tum.de>
parents: 2033
diff changeset
   513
       (rule Union_of_fin_supp_sets[OF fin])
2003
b53e98bfb298 added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents: 1930
diff changeset
   514
  also have "\<dots> \<subseteq> supp S"
2372
Christian Urban <urbanc@in.tum.de>
parents: 2033
diff changeset
   515
    by (rule supp_subset_fresh)
Christian Urban <urbanc@in.tum.de>
parents: 2033
diff changeset
   516
       (simp add: Union_fresh)
Christian Urban <urbanc@in.tum.de>
parents: 2033
diff changeset
   517
  finally show "(\<Union>x\<in>S. supp x) \<subseteq> supp S" .
2003
b53e98bfb298 added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents: 1930
diff changeset
   518
qed
b53e98bfb298 added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents: 1930
diff changeset
   519
b53e98bfb298 added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents: 1930
diff changeset
   520
lemma supp_of_fin_sets:
b53e98bfb298 added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents: 1930
diff changeset
   521
  fixes S::"('a::fs set)"
b53e98bfb298 added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents: 1930
diff changeset
   522
  assumes fin: "finite S"
b53e98bfb298 added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents: 1930
diff changeset
   523
  shows "(supp S) = (\<Union>x\<in>S. supp x)"
b53e98bfb298 added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents: 1930
diff changeset
   524
apply(rule subset_antisym)
b53e98bfb298 added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents: 1930
diff changeset
   525
apply(rule supp_is_subset)
b53e98bfb298 added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents: 1930
diff changeset
   526
apply(rule Union_supports_set)
b53e98bfb298 added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents: 1930
diff changeset
   527
apply(rule Union_of_fin_supp_sets[OF fin])
b53e98bfb298 added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents: 1930
diff changeset
   528
apply(rule Union_included_in_supp[OF fin])
b53e98bfb298 added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents: 1930
diff changeset
   529
done
b53e98bfb298 added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents: 1930
diff changeset
   530
b53e98bfb298 added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents: 1930
diff changeset
   531
lemma supp_of_fin_union:
b53e98bfb298 added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents: 1930
diff changeset
   532
  fixes S T::"('a::fs) set"
b53e98bfb298 added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents: 1930
diff changeset
   533
  assumes fin1: "finite S"
b53e98bfb298 added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents: 1930
diff changeset
   534
  and     fin2: "finite T"
b53e98bfb298 added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents: 1930
diff changeset
   535
  shows "supp (S \<union> T) = supp S \<union> supp T"
b53e98bfb298 added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents: 1930
diff changeset
   536
  using fin1 fin2
b53e98bfb298 added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents: 1930
diff changeset
   537
  by (simp add: supp_of_fin_sets)
b53e98bfb298 added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents: 1930
diff changeset
   538
b53e98bfb298 added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents: 1930
diff changeset
   539
lemma supp_of_fin_insert:
b53e98bfb298 added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents: 1930
diff changeset
   540
  fixes S::"('a::fs) set"
b53e98bfb298 added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents: 1930
diff changeset
   541
  assumes fin:  "finite S"
b53e98bfb298 added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents: 1930
diff changeset
   542
  shows "supp (insert x S) = supp x \<union> supp S"
b53e98bfb298 added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents: 1930
diff changeset
   543
  using fin
b53e98bfb298 added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents: 1930
diff changeset
   544
  by (simp add: supp_of_fin_sets)
b53e98bfb298 added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents: 1930
diff changeset
   545
2462
937b6088a3a0 added supp_set lemma
Christian Urban <urbanc@in.tum.de>
parents: 2388
diff changeset
   546
lemma supp_set:
937b6088a3a0 added supp_set lemma
Christian Urban <urbanc@in.tum.de>
parents: 2388
diff changeset
   547
  fixes xs :: "('a::fs) list"
937b6088a3a0 added supp_set lemma
Christian Urban <urbanc@in.tum.de>
parents: 2388
diff changeset
   548
  shows "supp (set xs) = supp xs"
937b6088a3a0 added supp_set lemma
Christian Urban <urbanc@in.tum.de>
parents: 2388
diff changeset
   549
apply(induct xs)
937b6088a3a0 added supp_set lemma
Christian Urban <urbanc@in.tum.de>
parents: 2388
diff changeset
   550
apply(simp add: supp_set_empty supp_Nil)
937b6088a3a0 added supp_set lemma
Christian Urban <urbanc@in.tum.de>
parents: 2388
diff changeset
   551
apply(simp add: supp_Cons finite_set supp_of_fin_insert)
937b6088a3a0 added supp_set lemma
Christian Urban <urbanc@in.tum.de>
parents: 2388
diff changeset
   552
done
2033
74bd7bfb484b some preliminary changes to the pearl-jv paper
Christian Urban <urbanc@in.tum.de>
parents: 2012
diff changeset
   553
1567
8f28e749d92b Fixed missing colon.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1564
diff changeset
   554
end