Nominal/Ex/Foo1.thy
author Christian Urban <urbanc@in.tum.de>
Sun, 28 Nov 2010 16:37:34 +0000
changeset 2588 8f5420681039
parent 2586 3ebc7ecfb0dd
child 2593 25dcb2b1329e
permissions -rw-r--r--
completed the strong exhausts rules for Foo2 using general lemmas
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2494
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     1
theory Foo1
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     2
imports "../Nominal2" 
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     3
begin
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     4
2564
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
     5
text {* 
2494
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     6
  Contrived example that has more than one
2564
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
     7
  binding function
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
     8
*}
2494
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     9
2571
f0252365936c proved that bn functions return a finite set
Christian Urban <urbanc@in.tum.de>
parents: 2564
diff changeset
    10
2494
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    11
atom_decl name
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    12
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    13
nominal_datatype foo: trm =
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    14
  Var "name"
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    15
| App "trm" "trm"
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    16
| Lam x::"name" t::"trm"  bind x in t
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    17
| Let1 a::"assg" t::"trm"  bind "bn1 a" in t
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    18
| Let2 a::"assg" t::"trm"  bind "bn2 a" in t
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    19
| Let3 a::"assg" t::"trm"  bind "bn3 a" in t
2564
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    20
| Let4 a::"assg'" t::"trm"  bind (set) "bn4 a" in t
2494
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    21
and assg =
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    22
  As "name" "name" "trm"
2564
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    23
and assg' =
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    24
  BNil
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    25
| BAs "name" "assg'"
2494
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    26
binder
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    27
  bn1::"assg \<Rightarrow> atom list" and
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    28
  bn2::"assg \<Rightarrow> atom list" and
2564
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    29
  bn3::"assg \<Rightarrow> atom list" and
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    30
  bn4::"assg' \<Rightarrow> atom set"
2494
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    31
where
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    32
  "bn1 (As x y t) = [atom x]"
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    33
| "bn2 (As x y t) = [atom y]"
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    34
| "bn3 (As x y t) = [atom x, atom y]"
2564
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    35
| "bn4 (BNil) = {}"
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    36
| "bn4 (BAs a as) = {atom a} \<union> bn4 as"
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    37
2494
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    38
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    39
thm foo.distinct
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    40
thm foo.induct
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    41
thm foo.inducts
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    42
thm foo.exhaust
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    43
thm foo.fv_defs
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    44
thm foo.bn_defs
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    45
thm foo.perm_simps
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    46
thm foo.eq_iff
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    47
thm foo.fv_bn_eqvt
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    48
thm foo.size_eqvt
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    49
thm foo.supports
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    50
thm foo.fsupp
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    51
thm foo.supp
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    52
thm foo.fresh
2571
f0252365936c proved that bn functions return a finite set
Christian Urban <urbanc@in.tum.de>
parents: 2564
diff changeset
    53
thm foo.bn_finite
2494
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    54
2500
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
    55
lemma uu1:
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
    56
  shows "alpha_bn1 as (permute_bn1 p as)"
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
    57
apply(induct as rule: foo.inducts(2))
2564
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    58
apply(auto)[7]
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    59
apply(simp add: foo.perm_bn_simps)
2500
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
    60
apply(simp add: foo.eq_iff)
2564
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    61
apply(auto)
2500
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
    62
done
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
    63
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
    64
lemma uu2:
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
    65
  shows "alpha_bn2 as (permute_bn2 p as)"
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
    66
apply(induct as rule: foo.inducts(2))
2564
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    67
apply(auto)[7]
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    68
apply(simp add: foo.perm_bn_simps)
2500
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
    69
apply(simp add: foo.eq_iff)
2564
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    70
apply(auto)
2500
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
    71
done
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
    72
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
    73
lemma uu3:
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
    74
  shows "alpha_bn3 as (permute_bn3 p as)"
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
    75
apply(induct as rule: foo.inducts(2))
2564
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    76
apply(auto)[7]
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    77
apply(simp add: foo.perm_bn_simps)
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    78
apply(simp add: foo.eq_iff)
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    79
apply(auto)
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    80
done
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    81
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    82
lemma uu4:
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    83
  shows "alpha_bn4 as (permute_bn4 p as)"
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    84
apply(induct as rule: foo.inducts(3))
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    85
apply(auto)[8]
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    86
apply(simp add: foo.perm_bn_simps)
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    87
apply(simp add: foo.eq_iff)
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    88
apply(simp add: foo.perm_bn_simps)
2500
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
    89
apply(simp add: foo.eq_iff)
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
    90
done
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
    91
2564
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    92
2500
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
    93
lemma tt1:
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
    94
  shows "(p \<bullet> bn1 as) = bn1 (permute_bn1 p as)"
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
    95
apply(induct as rule: foo.inducts(2))
2564
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    96
apply(auto)[7]
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    97
apply(simp add: foo.perm_bn_simps foo.bn_defs)
2500
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
    98
apply(simp add: atom_eqvt)
2564
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    99
apply(auto)
2500
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   100
done
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   101
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   102
lemma tt2:
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   103
  shows "(p \<bullet> bn2 as) = bn2 (permute_bn2 p as)"
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   104
apply(induct as rule: foo.inducts(2))
2564
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   105
apply(auto)[7]
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   106
apply(simp add: foo.perm_bn_simps foo.bn_defs)
2500
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   107
apply(simp add: atom_eqvt)
2564
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   108
apply(auto)
2500
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   109
done
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   110
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   111
lemma tt3:
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   112
  shows "(p \<bullet> bn3 as) = bn3 (permute_bn3 p as)"
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   113
apply(induct as rule: foo.inducts(2))
2564
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   114
apply(auto)[7]
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   115
apply(simp add: foo.perm_bn_simps foo.bn_defs)
2500
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   116
apply(simp add: atom_eqvt)
2564
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   117
apply(auto)
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   118
done
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   119
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   120
lemma tt4:
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   121
  shows "(p \<bullet> bn4 as) = bn4 (permute_bn4 p as)"
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   122
apply(induct as rule: foo.inducts(3))
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   123
apply(auto)[8]
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   124
apply(simp add: foo.perm_bn_simps foo.bn_defs permute_set_eq)
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   125
apply(simp add: foo.perm_bn_simps foo.bn_defs)
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   126
apply(simp add: atom_eqvt insert_eqvt)
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   127
done
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   128
2500
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   129
2573
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents: 2572
diff changeset
   130
lemma Let1_rename:
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents: 2572
diff changeset
   131
  assumes "supp ([bn1 assn]lst. trm) \<sharp>* p"
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents: 2572
diff changeset
   132
  shows "Let1 assn trm = Let1 (permute_bn1 p assn) (p \<bullet> trm)"
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents: 2572
diff changeset
   133
using assms
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents: 2572
diff changeset
   134
apply -
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents: 2572
diff changeset
   135
apply(drule supp_perm_eq[symmetric])
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents: 2572
diff changeset
   136
apply(simp only: permute_Abs)
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents: 2572
diff changeset
   137
apply(simp only: tt1)
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents: 2572
diff changeset
   138
apply(simp only: foo.eq_iff)
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents: 2572
diff changeset
   139
apply(rule conjI)
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents: 2572
diff changeset
   140
apply(rule refl)
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents: 2572
diff changeset
   141
apply(rule uu1)
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents: 2572
diff changeset
   142
done
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents: 2572
diff changeset
   143
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents: 2572
diff changeset
   144
lemma Let1_rename_a:
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents: 2572
diff changeset
   145
  fixes c::"'a::fs"
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents: 2572
diff changeset
   146
  assumes "y =  Let1 assn trm"
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents: 2572
diff changeset
   147
  shows "\<exists>p. (p \<bullet> (set (bn1 assn))) \<sharp>* c \<and> y = Let1 (permute_bn1 p assn) (p \<bullet> trm)"
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents: 2572
diff changeset
   148
using assms
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents: 2572
diff changeset
   149
apply(simp only: foo.eq_iff uu1 tt1[symmetric] permute_Abs[symmetric])
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents: 2572
diff changeset
   150
apply(simp del: permute_Abs)
2586
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   151
sorry
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   152
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   153
lemma strong_exhaust1:
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   154
  fixes c::"'a::fs"
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   155
  assumes "\<exists>name. y = Var name \<Longrightarrow> P" 
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   156
  and     "\<exists>trm1 trm2. y = App trm1 trm2 \<Longrightarrow> P"
2588
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   157
  and     "\<exists>name trm.  {atom name} \<sharp>* c \<and> y = Lam name trm \<Longrightarrow> P" 
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   158
  and     "\<exists>(c::'a::fs) assn trm. set (bn1 assn) \<sharp>* c \<and> y = Let1 assn trm \<Longrightarrow> P"
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   159
  and     "\<exists>(c::'a::fs) assn trm. set (bn2 assn) \<sharp>* c \<and> y = Let2 assn trm \<Longrightarrow> P"
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   160
  and     "\<exists>(c::'a::fs) assn trm. set (bn3 assn) \<sharp>* c \<and> y = Let3 assn trm \<Longrightarrow> P"
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   161
  and     "\<exists>(c::'a::fs) assn' trm. (bn4 assn') \<sharp>* c \<and> y = Let4 assn' trm \<Longrightarrow> P"
2586
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   162
  shows "P"
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   163
apply(rule_tac y="y" in foo.exhaust(1))
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   164
apply(rule assms(1))
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   165
apply(rule exI)
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   166
apply(assumption)
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   167
apply(rule assms(2))
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   168
apply(rule exI)+
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   169
apply(assumption)
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   170
apply(rule assms(3))
2588
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   171
apply(subgoal_tac "\<exists>p::perm. (p \<bullet> {atom name}) \<sharp>* (c, name, trm)")
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   172
apply(erule exE)
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   173
apply(perm_simp)
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   174
apply(rule_tac exI)+
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   175
apply(rule conjI)
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   176
apply(simp add: fresh_star_prod)
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   177
apply(erule conjE)+
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   178
apply(assumption)
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   179
apply(simp)
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   180
apply(simp add: foo.eq_iff)
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   181
(* HERE *)
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   182
defer
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   183
defer
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   184
apply(rule assms(4))
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   185
apply(subgoal_tac "\<exists>p::perm. (p \<bullet> (set (bn1 assg))) \<sharp>* (c, assg, trm)")
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   186
apply(erule exE)
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   187
apply(perm_simp add: tt1)
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   188
apply(simp only: fresh_star_prod)
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   189
apply(erule conjE)+
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   190
apply(rule_tac exI)+
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   191
apply(rule conjI)
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   192
apply(assumption)
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   193
apply(simp add: foo.eq_iff)
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   194
apply(rule conjI)
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   195
apply(simp only: tt1[symmetric])
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   196
defer
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   197
apply(rule uu1)
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   198
defer
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   199
apply(rule assms(5))
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   200
apply(subgoal_tac "\<exists>p::perm. (p \<bullet> (set (bn2 assg))) \<sharp>* (c, assg, trm)")
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   201
apply(erule exE)
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   202
apply(perm_simp add: tt2)
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   203
apply(simp only: fresh_star_prod)
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   204
apply(erule conjE)+
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   205
apply(rule_tac exI)+
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   206
apply(rule conjI)
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   207
apply(assumption)
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   208
apply(simp add: foo.eq_iff)
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   209
apply(rule conjI)
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   210
apply(simp only: tt2[symmetric])
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   211
defer
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   212
apply(rule uu2)
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   213
defer
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   214
apply(rule refl)
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   215
apply(subst (asm) fresh_star_supp_conv)
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   216
apply(simp)
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   217
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   218
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   219
lemma strong_exhaust2:
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   220
  fixes c::"'a::fs"
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   221
  assumes "\<And>name. y = Var name \<Longrightarrow> P" 
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   222
  and     "\<And>trm1 trm2. y = App trm1 trm2 \<Longrightarrow> P"
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   223
  and     "\<And>name trm. \<lbrakk>{atom name} \<sharp>* c; y = Lam name trm\<rbrakk> \<Longrightarrow> P" 
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   224
  and     "\<And>assn trm. \<lbrakk>set (bn1 assn) \<sharp>* c; y = Let1 assn trm\<rbrakk> \<Longrightarrow> P"
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   225
  and     "\<And>assn trm. \<lbrakk>set (bn2 assn) \<sharp>* c; y = Let2 assn trm\<rbrakk> \<Longrightarrow> P"
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   226
  and     "\<And>assn trm. \<lbrakk>set (bn3 assn) \<sharp>* c; y = Let3 assn trm\<rbrakk> \<Longrightarrow> P"
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   227
  and     "\<And>assn' trm. \<lbrakk>(bn4 assn') \<sharp>* c; y = Let4 assn' trm\<rbrakk> \<Longrightarrow> P"
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   228
  shows "P"
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   229
apply(rule strong_exhaust1[where y="y"])
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   230
apply(erule exE)+
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   231
apply(rule assms(1))
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   232
apply(assumption)
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   233
apply(erule exE)+
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   234
apply(rule assms(2))
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   235
apply(assumption)
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   236
apply(erule exE | erule conjE)?
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   237
apply(rule assms(3))
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   238
apply(drule_tac x="c" in spec)
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   239
apply(erule exE | erule conjE)+
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   240
apply(assumption)+
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   241
apply(drule_tac x="c" in spec)
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   242
apply(erule exE | erule conjE)+
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   243
apply(assumption)+
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   244
apply(erule exE | erule conjE)+
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   245
apply(rule assms(4))
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   246
apply(assumption)+
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   247
apply(erule exE | erule conjE)+
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   248
apply(rule assms(5))
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   249
apply(assumption)+
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   250
apply(erule exE | erule conjE)+
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   251
apply(rule assms(6))
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   252
apply(assumption)+
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   253
apply(erule exE | erule conjE)+
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   254
apply(rule assms(7))
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   255
apply(assumption)+
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   256
done
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   257
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   258
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   259
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   260
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   261
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   262
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   263
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   264
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   265
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   266
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   267
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   268
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   269
apply(rule_tac y="y" in foo.exhaust(1))
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   270
apply(rule assms(1))
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   271
apply(rule exI)
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   272
apply(assumption)
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   273
apply(rule assms(2))
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   274
apply(rule exI)+
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   275
apply(assumption)
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   276
apply(rule assms(3))
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   277
apply(rule_tac p="p" in permute_boolE)
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   278
apply(perm_simp)
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   279
apply(simp)
2586
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   280
apply(subgoal_tac "\<exists>q. (q \<bullet> {atom name}) \<sharp>* c \<and> supp (Lam name trm) \<sharp>* q")
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   281
apply(erule exE)
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   282
apply(erule conjE)
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   283
apply(rule assms(3))
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   284
apply(perm_simp)
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   285
apply(assumption)
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   286
apply(simp)
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   287
apply(drule supp_perm_eq[symmetric])
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   288
apply(perm_simp)
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   289
apply(simp)
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   290
apply(rule at_set_avoiding2)
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   291
apply(simp add: finite_supp)
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   292
apply(simp add: finite_supp)
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   293
apply(simp add: finite_supp)
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   294
apply(simp add: foo.fresh fresh_star_def)
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   295
apply(drule Let1_rename_a)
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   296
apply(erule exE)
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   297
apply(erule conjE)
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   298
apply(rule assms(4))
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   299
apply(simp only: set_eqvt tt1)
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   300
apply(assumption)
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   301
(*
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   302
apply(subgoal_tac "\<exists>q. (q \<bullet> (set (bn2 assg))) \<sharp>* c \<and> supp ([bn2 assg]lst.trm) \<sharp>* q")
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   303
apply(erule exE)
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   304
apply(erule conjE)
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   305
*)
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   306
thm assms(5)
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   307
apply(rule assms(5))
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   308
prefer 2
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   309
apply(clarify)
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   310
unfolding foo.eq_iff
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   311
apply
2500
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   312
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   313
lemma strong_exhaust1:
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   314
  fixes c::"'a::fs"
2503
cc5d23547341 simplified exhaust proofs
Christian Urban <urbanc@in.tum.de>
parents: 2500
diff changeset
   315
  assumes "\<And>name. y = Var name \<Longrightarrow> P" 
cc5d23547341 simplified exhaust proofs
Christian Urban <urbanc@in.tum.de>
parents: 2500
diff changeset
   316
  and     "\<And>trm1 trm2. y = App trm1 trm2 \<Longrightarrow> P"
cc5d23547341 simplified exhaust proofs
Christian Urban <urbanc@in.tum.de>
parents: 2500
diff changeset
   317
  and     "\<And>name trm. \<lbrakk>{atom name} \<sharp>* c; y = Lam name trm\<rbrakk> \<Longrightarrow> P" 
cc5d23547341 simplified exhaust proofs
Christian Urban <urbanc@in.tum.de>
parents: 2500
diff changeset
   318
  and     "\<And>assn trm. \<lbrakk>set (bn1 assn) \<sharp>* c; y = Let1 assn trm\<rbrakk> \<Longrightarrow> P"
cc5d23547341 simplified exhaust proofs
Christian Urban <urbanc@in.tum.de>
parents: 2500
diff changeset
   319
  and     "\<And>assn trm. \<lbrakk>set (bn2 assn) \<sharp>* c; y = Let2 assn trm\<rbrakk> \<Longrightarrow> P"
cc5d23547341 simplified exhaust proofs
Christian Urban <urbanc@in.tum.de>
parents: 2500
diff changeset
   320
  and     "\<And>assn trm. \<lbrakk>set (bn3 assn) \<sharp>* c; y = Let3 assn trm\<rbrakk> \<Longrightarrow> P"
2564
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   321
  and     "\<And>assn' trm. \<lbrakk>(bn4 assn') \<sharp>* c; y = Let4 assn' trm\<rbrakk> \<Longrightarrow> P"
2500
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   322
  shows "P"
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   323
apply(rule_tac y="y" in foo.exhaust(1))
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   324
apply(rule assms(1))
2503
cc5d23547341 simplified exhaust proofs
Christian Urban <urbanc@in.tum.de>
parents: 2500
diff changeset
   325
apply(assumption)
2500
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   326
apply(rule assms(2))
2503
cc5d23547341 simplified exhaust proofs
Christian Urban <urbanc@in.tum.de>
parents: 2500
diff changeset
   327
apply(assumption)
2500
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   328
apply(subgoal_tac "\<exists>q. (q \<bullet> {atom name}) \<sharp>* c \<and> supp (Lam name trm) \<sharp>* q")
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   329
apply(erule exE)
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   330
apply(erule conjE)
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   331
apply(rule assms(3))
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   332
apply(perm_simp)
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   333
apply(assumption)
2571
f0252365936c proved that bn functions return a finite set
Christian Urban <urbanc@in.tum.de>
parents: 2564
diff changeset
   334
apply(simp)
2500
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   335
apply(drule supp_perm_eq[symmetric])
2503
cc5d23547341 simplified exhaust proofs
Christian Urban <urbanc@in.tum.de>
parents: 2500
diff changeset
   336
apply(perm_simp)
2500
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   337
apply(simp)
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   338
apply(rule at_set_avoiding2)
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   339
apply(simp add: finite_supp)
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   340
apply(simp add: finite_supp)
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   341
apply(simp add: finite_supp)
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   342
apply(simp add: foo.fresh fresh_star_def)
2573
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents: 2572
diff changeset
   343
apply(drule Let1_rename_a)
2500
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   344
apply(erule exE)
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   345
apply(erule conjE)
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   346
apply(rule assms(4))
2573
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents: 2572
diff changeset
   347
apply(simp only: set_eqvt tt1)
2503
cc5d23547341 simplified exhaust proofs
Christian Urban <urbanc@in.tum.de>
parents: 2500
diff changeset
   348
apply(assumption)
2586
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   349
(*
2500
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   350
apply(subgoal_tac "\<exists>q. (q \<bullet> (set (bn2 assg))) \<sharp>* c \<and> supp ([bn2 assg]lst.trm) \<sharp>* q")
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   351
apply(erule exE)
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   352
apply(erule conjE)
2586
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   353
*)
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   354
thm assms(5)
2500
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   355
apply(rule assms(5))
2586
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   356
prefer 2
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   357
apply(clarify)
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   358
unfolding foo.eq_iff
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   359
apply(rule conjI)
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   360
prefer 2
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   361
apply(rule uu2)
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   362
apply(simp only: tt2[symmetric])
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   363
prefer 2
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   364
apply(simp only: tt2[symmetric])
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   365
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   366
apply(simp_all only:)[2]
2500
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   367
apply(simp add: set_eqvt)
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   368
apply(simp add: tt2)
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   369
apply(simp add: foo.eq_iff)
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   370
apply(drule supp_perm_eq[symmetric])
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   371
apply(simp)
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   372
apply(simp add: tt2 uu2)
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   373
apply(rule at_set_avoiding2)
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   374
apply(simp add: finite_supp)
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   375
apply(simp add: finite_supp)
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   376
apply(simp add: finite_supp)
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   377
apply(simp add: Abs_fresh_star)
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   378
apply(subgoal_tac "\<exists>q. (q \<bullet> (set (bn3 assg))) \<sharp>* c \<and> supp ([bn3 assg]lst.trm) \<sharp>* q")
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   379
apply(erule exE)
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   380
apply(erule conjE)
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   381
apply(rule assms(6))
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   382
apply(simp add: set_eqvt)
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   383
apply(simp add: tt3)
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   384
apply(simp add: foo.eq_iff)
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   385
apply(drule supp_perm_eq[symmetric])
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   386
apply(simp)
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   387
apply(simp add: tt3 uu3)
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   388
apply(rule at_set_avoiding2)
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   389
apply(simp add: finite_supp)
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   390
apply(simp add: finite_supp)
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   391
apply(simp add: finite_supp)
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   392
apply(simp add: Abs_fresh_star)
2564
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   393
apply(subgoal_tac "\<exists>q. (q \<bullet> (bn4 assg')) \<sharp>* c \<and> supp ([bn4 assg']set.trm) \<sharp>* q")
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   394
apply(erule exE)
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   395
apply(erule conjE)
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   396
apply(rule assms(7))
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   397
apply(simp add: tt4)
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   398
apply(simp add: foo.eq_iff)
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   399
apply(drule supp_perm_eq[symmetric])
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   400
apply(simp)
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   401
apply(simp add: tt4 uu4)
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   402
apply(rule at_set_avoiding2)
2571
f0252365936c proved that bn functions return a finite set
Christian Urban <urbanc@in.tum.de>
parents: 2564
diff changeset
   403
apply(simp add: foo.bn_finite)
2564
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   404
apply(simp add: finite_supp)
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   405
apply(simp add: finite_supp)
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   406
apply(simp add: Abs_fresh_star)
2500
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   407
done
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   408
2572
73196608ec04 tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2571
diff changeset
   409
thm strong_exhaust1 foo.exhaust(1)
73196608ec04 tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2571
diff changeset
   410
73196608ec04 tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2571
diff changeset
   411
2571
f0252365936c proved that bn functions return a finite set
Christian Urban <urbanc@in.tum.de>
parents: 2564
diff changeset
   412
2500
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   413
lemma strong_exhaust2:
2503
cc5d23547341 simplified exhaust proofs
Christian Urban <urbanc@in.tum.de>
parents: 2500
diff changeset
   414
  assumes "\<And>x y t. as = As x y t \<Longrightarrow> P" 
2500
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   415
  shows "P"
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   416
apply(rule_tac y="as" in foo.exhaust(2))
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   417
apply(rule assms(1))
2503
cc5d23547341 simplified exhaust proofs
Christian Urban <urbanc@in.tum.de>
parents: 2500
diff changeset
   418
apply(assumption)
2500
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   419
done
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   420
2564
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   421
lemma strong_exhaust3:
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   422
  assumes "as' = BNil \<Longrightarrow> P"
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   423
  and "\<And>a as. as' = BAs a as \<Longrightarrow> P" 
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   424
  shows "P"
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   425
apply(rule_tac y="as'" in foo.exhaust(3))
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   426
apply(rule assms(1))
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   427
apply(assumption)
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   428
apply(rule assms(2))
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   429
apply(assumption)
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   430
done
2500
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   431
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   432
lemma 
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   433
  fixes t::trm
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   434
  and   as::assg
2564
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   435
  and   as'::assg'
2500
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   436
  and   c::"'a::fs"
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   437
  assumes a1: "\<And>x c. P1 c (Var x)"
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   438
  and     a2: "\<And>t1 t2 c. \<lbrakk>\<And>d. P1 d t1; \<And>d. P1 d t2\<rbrakk> \<Longrightarrow> P1 c (App t1 t2)"
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   439
  and     a3: "\<And>x t c. \<lbrakk>{atom x} \<sharp>* c; \<And>d. P1 d t\<rbrakk> \<Longrightarrow> P1 c (Lam x t)"
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   440
  and     a4: "\<And>as t c. \<lbrakk>set (bn1 as) \<sharp>* c; \<And>d. P2 d as; \<And>d. P1 d t\<rbrakk> \<Longrightarrow> P1 c (Let1 as t)"
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   441
  and     a5: "\<And>as t c. \<lbrakk>set (bn2 as) \<sharp>* c; \<And>d. P2 d as; \<And>d. P1 d t\<rbrakk> \<Longrightarrow> P1 c (Let2 as t)"
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   442
  and     a6: "\<And>as t c. \<lbrakk>set (bn3 as) \<sharp>* c; \<And>d. P2 d as; \<And>d. P1 d t\<rbrakk> \<Longrightarrow> P1 c (Let3 as t)"
2564
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   443
  and     a7: "\<And>as' t c. \<lbrakk>(bn4 as') \<sharp>* c; \<And>d. P3 d as'; \<And>d. P1 d t\<rbrakk> \<Longrightarrow> P1 c (Let4 as' t)" 
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   444
  and     a8: "\<And>x y t c. \<And>d. P1 d t \<Longrightarrow> P2 c (As x y t)"
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   445
  and     a9: "\<And>c. P3 c (BNil)"
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   446
  and     a10: "\<And>c a as. \<And>d. P3 d as \<Longrightarrow> P3 c (BAs a as)"
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   447
  shows "P1 c t" "P2 c as" "P3 c as'"
2500
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   448
using assms
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   449
apply(induction_schema)
2503
cc5d23547341 simplified exhaust proofs
Christian Urban <urbanc@in.tum.de>
parents: 2500
diff changeset
   450
apply(rule_tac y="t" and c="c" in strong_exhaust1)
2564
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   451
apply(simp_all)[7]
2500
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   452
apply(rule_tac as="as" in strong_exhaust2)
2503
cc5d23547341 simplified exhaust proofs
Christian Urban <urbanc@in.tum.de>
parents: 2500
diff changeset
   453
apply(simp)
2564
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   454
apply(rule_tac as'="as'" in strong_exhaust3)
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   455
apply(simp_all)[2]
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   456
apply(relation "measure (sum_case (size o snd) (sum_case (\<lambda>y. size (snd y)) (\<lambda>z. size (snd z))))")
2500
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   457
apply(simp_all add: foo.size)
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   458
done
2494
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   459
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   460
end
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   461
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   462
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   463