Nominal-General/Nominal2_Supp.thy
author Christian Urban <urbanc@in.tum.de>
Sat, 04 Sep 2010 07:28:35 +0800
changeset 2470 bdb1eab47161
parent 2467 67b3933c3190
permissions -rw-r--r--
moved everything out of Nominal_Supp
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
2467
67b3933c3190 got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents: 2466
diff changeset
     8
imports Nominal2_Base Nominal2_Eqvt 
1062
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
1930
f189cf2c0987 moved some lemmas into the right places
Christian Urban <urbanc@in.tum.de>
parents: 1923
diff changeset
    11
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
    12
1918
e2e963f4e90d added an improved version of the induction principle for permutations
Christian Urban <urbanc@in.tum.de>
parents: 1879
diff changeset
    13
e2e963f4e90d added an improved version of the induction principle for permutations
Christian Urban <urbanc@in.tum.de>
parents: 1879
diff changeset
    14
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
    15
  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
    16
  and zero: "P 0"
f189cf2c0987 moved some lemmas into the right places
Christian Urban <urbanc@in.tum.de>
parents: 1923
diff changeset
    17
  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
    18
  shows "P p"
1777
4f41a0884b22 isarfied proof about existence of a permutation list
Christian Urban <urbanc@in.tum.de>
parents: 1774
diff changeset
    19
proof -
4f41a0884b22 isarfied proof about existence of a permutation list
Christian Urban <urbanc@in.tum.de>
parents: 1774
diff changeset
    20
  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
    21
  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
    22
  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
    23
    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
    24
    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
    25
    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
    26
    { assume "supp p = {}"
4f41a0884b22 isarfied proof about existence of a permutation list
Christian Urban <urbanc@in.tum.de>
parents: 1774
diff changeset
    27
      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
    28
      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
    29
    }
4f41a0884b22 isarfied proof about existence of a permutation list
Christian Urban <urbanc@in.tum.de>
parents: 1774
diff changeset
    30
    moreover
4f41a0884b22 isarfied proof about existence of a permutation list
Christian Urban <urbanc@in.tum.de>
parents: 1774
diff changeset
    31
    { assume "supp p \<noteq> {}"
4f41a0884b22 isarfied proof about existence of a permutation list
Christian Urban <urbanc@in.tum.de>
parents: 1774
diff changeset
    32
      then obtain a where a0: "a \<in> supp p" by blast
2372
Christian Urban <urbanc@in.tum.de>
parents: 2033
diff changeset
    33
      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
    34
        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
    35
      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
    36
      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
    37
      moreover
4f41a0884b22 isarfied proof about existence of a permutation list
Christian Urban <urbanc@in.tum.de>
parents: 1774
diff changeset
    38
      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
    39
      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
    40
      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
    41
      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
    42
      moreover
88ec05a09772 added an induction principle for permutations; removed add_perm construction
Christian Urban <urbanc@in.tum.de>
parents: 1777
diff changeset
    43
      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
    44
      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
    45
      moreover 
1918
e2e963f4e90d added an improved version of the induction principle for permutations
Christian Urban <urbanc@in.tum.de>
parents: 1879
diff changeset
    46
      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
    47
      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
    48
    }
1778
88ec05a09772 added an induction principle for permutations; removed add_perm construction
Christian Urban <urbanc@in.tum.de>
parents: 1777
diff changeset
    49
    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
    50
  qed
4f41a0884b22 isarfied proof about existence of a permutation list
Christian Urban <urbanc@in.tum.de>
parents: 1774
diff changeset
    51
qed
1062
dfea9e739231 rollback of the test
Christian Urban <urbanc@in.tum.de>
parents: 1061
diff changeset
    52
1930
f189cf2c0987 moved some lemmas into the right places
Christian Urban <urbanc@in.tum.de>
parents: 1923
diff changeset
    53
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
    54
  assumes zero: "P 0"
1930
f189cf2c0987 moved some lemmas into the right places
Christian Urban <urbanc@in.tum.de>
parents: 1923
diff changeset
    55
  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
    56
  shows "P p"
289988027abf added a variant of the induction principle for permutations
Christian Urban <urbanc@in.tum.de>
parents: 1918
diff changeset
    57
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
    58
   (auto intro: zero swap)
289988027abf added a variant of the induction principle for permutations
Christian Urban <urbanc@in.tum.de>
parents: 1918
diff changeset
    59
1930
f189cf2c0987 moved some lemmas into the right places
Christian Urban <urbanc@in.tum.de>
parents: 1923
diff changeset
    60
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
    61
  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
    62
  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
    63
  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
    64
  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
    65
  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
    66
using S
e2e963f4e90d added an improved version of the induction principle for permutations
Christian Urban <urbanc@in.tum.de>
parents: 1879
diff changeset
    67
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
    68
   (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
    69
eb60f360a200 moved lemmas supp_perm_eq and exists_perm to Nominal2_Supp
Christian Urban <urbanc@in.tum.de>
parents: 1506
diff changeset
    70
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
    71
  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
    72
  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
    73
proof -
1778
88ec05a09772 added an induction principle for permutations; removed add_perm construction
Christian Urban <urbanc@in.tum.de>
parents: 1777
diff changeset
    74
  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
    75
    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
    76
  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
    77
  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
    78
    case zero
e2e963f4e90d added an improved version of the induction principle for permutations
Christian Urban <urbanc@in.tum.de>
parents: 1879
diff changeset
    79
    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
    80
  next
e2e963f4e90d added an improved version of the induction principle for permutations
Christian Urban <urbanc@in.tum.de>
parents: 1879
diff changeset
    81
    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
    82
    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
    83
    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
    84
  qed
e2e963f4e90d added an improved version of the induction principle for permutations
Christian Urban <urbanc@in.tum.de>
parents: 1879
diff changeset
    85
qed
e2e963f4e90d added an improved version of the induction principle for permutations
Christian Urban <urbanc@in.tum.de>
parents: 1879
diff changeset
    86
e2e963f4e90d added an improved version of the induction principle for permutations
Christian Urban <urbanc@in.tum.de>
parents: 1879
diff changeset
    87
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
    88
  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
    89
  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
    90
proof -
e2e963f4e90d added an improved version of the induction principle for permutations
Christian Urban <urbanc@in.tum.de>
parents: 1879
diff changeset
    91
  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
    92
    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
    93
  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
    94
  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
    95
    case zero
88ec05a09772 added an induction principle for permutations; removed add_perm construction
Christian Urban <urbanc@in.tum.de>
parents: 1777
diff changeset
    96
    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
    97
  next
88ec05a09772 added an induction principle for permutations; removed add_perm construction
Christian Urban <urbanc@in.tum.de>
parents: 1777
diff changeset
    98
    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
    99
    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
   100
    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
   101
  next
88ec05a09772 added an induction principle for permutations; removed add_perm construction
Christian Urban <urbanc@in.tum.de>
parents: 1777
diff changeset
   102
    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
   103
    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
   104
    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
   105
  qed
1563
eb60f360a200 moved lemmas supp_perm_eq and exists_perm to Nominal2_Supp
Christian Urban <urbanc@in.tum.de>
parents: 1506
diff changeset
   106
qed
eb60f360a200 moved lemmas supp_perm_eq and exists_perm to Nominal2_Supp
Christian Urban <urbanc@in.tum.de>
parents: 1506
diff changeset
   107
2003
b53e98bfb298 added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents: 1930
diff changeset
   108
1567
8f28e749d92b Fixed missing colon.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1564
diff changeset
   109
end