Nominal/Ex/SingleLet.thy
author Christian Urban <urbanc@in.tum.de>
Fri, 16 Jul 2010 05:09:45 +0100
changeset 2364 2bf351f09317
parent 2361 d73d4d151cce
child 2365 467123396e5a
permissions -rw-r--r--
submitted version
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1911
60b5c61d3de2 renamed Ex1.thy to SingleLet.thy
Christian Urban <urbanc@in.tum.de>
parents: 1773
diff changeset
     1
theory SingleLet
2024
d974059827ad Equivariance fails for single let?
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1911
diff changeset
     2
imports "../NewParser"
1596
c69d9fb16785 Move Ex1 and Ex2 out of Test
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     3
begin
c69d9fb16785 Move Ex1 and Ex2 out of Test
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     4
c69d9fb16785 Move Ex1 and Ex2 out of Test
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     5
atom_decl name
c69d9fb16785 Move Ex1 and Ex2 out of Test
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     6
2338
e1764a73c292 slight cleaning
Christian Urban <urbanc@in.tum.de>
parents: 2336
diff changeset
     7
declare [[STEPS = 16]]
2294
72ad4e766acf properly exported bn_descr
Christian Urban <urbanc@in.tum.de>
parents: 2293
diff changeset
     8
2336
f2d545b77b31 added definition of the quotient types
Christian Urban <urbanc@in.tum.de>
parents: 2330
diff changeset
     9
nominal_datatype trm  =
1911
60b5c61d3de2 renamed Ex1.thy to SingleLet.thy
Christian Urban <urbanc@in.tum.de>
parents: 1773
diff changeset
    10
  Var "name"
60b5c61d3de2 renamed Ex1.thy to SingleLet.thy
Christian Urban <urbanc@in.tum.de>
parents: 1773
diff changeset
    11
| App "trm" "trm"
2024
d974059827ad Equivariance fails for single let?
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1911
diff changeset
    12
| Lam x::"name" t::"trm"  bind_set x in t
d974059827ad Equivariance fails for single let?
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1911
diff changeset
    13
| Let a::"assg" t::"trm"  bind_set "bn a" in t
2311
4da5c5c29009 work on transitivity proof
Christian Urban <urbanc@in.tum.de>
parents: 2308
diff changeset
    14
| Foo x::"name" y::"name" t::"trm" t1::"trm" t2::"trm" bind_set x in y t t1 t2
2296
45a69c9cc4cc alpha works now
Christian Urban <urbanc@in.tum.de>
parents: 2295
diff changeset
    15
| Bar x::"name" y::"name" t::"trm" bind y x in t x y
2316
08bbde090a17 also symmetry
Christian Urban <urbanc@in.tum.de>
parents: 2313
diff changeset
    16
| Baz x::"name" t1::"trm" t2::"trm" bind x in t1, bind x in t2 
1911
60b5c61d3de2 renamed Ex1.thy to SingleLet.thy
Christian Urban <urbanc@in.tum.de>
parents: 1773
diff changeset
    17
and assg =
2320
d835a2771608 prove that alpha implies alpha_bn (needed for rsp proofs)
Christian Urban <urbanc@in.tum.de>
parents: 2318
diff changeset
    18
  As "name" x::"name" t::"trm" bind x in t
1596
c69d9fb16785 Move Ex1 and Ex2 out of Test
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    19
binder
1911
60b5c61d3de2 renamed Ex1.thy to SingleLet.thy
Christian Urban <urbanc@in.tum.de>
parents: 1773
diff changeset
    20
  bn::"assg \<Rightarrow> atom set"
1596
c69d9fb16785 Move Ex1 and Ex2 out of Test
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    21
where
2320
d835a2771608 prove that alpha implies alpha_bn (needed for rsp proofs)
Christian Urban <urbanc@in.tum.de>
parents: 2318
diff changeset
    22
  "bn (As x y t) = {atom x}"
1911
60b5c61d3de2 renamed Ex1.thy to SingleLet.thy
Christian Urban <urbanc@in.tum.de>
parents: 1773
diff changeset
    23
2359
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2339
diff changeset
    24
typ trm
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2339
diff changeset
    25
typ assg
2338
e1764a73c292 slight cleaning
Christian Urban <urbanc@in.tum.de>
parents: 2336
diff changeset
    26
term Var 
e1764a73c292 slight cleaning
Christian Urban <urbanc@in.tum.de>
parents: 2336
diff changeset
    27
term App
e1764a73c292 slight cleaning
Christian Urban <urbanc@in.tum.de>
parents: 2336
diff changeset
    28
term Baz
2339
1e0b3992189c more quotient-definitions
Christian Urban <urbanc@in.tum.de>
parents: 2338
diff changeset
    29
term bn
1e0b3992189c more quotient-definitions
Christian Urban <urbanc@in.tum.de>
parents: 2338
diff changeset
    30
term fv_trm
2338
e1764a73c292 slight cleaning
Christian Urban <urbanc@in.tum.de>
parents: 2336
diff changeset
    31
2361
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
    32
lemma a1:
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
    33
  shows "alpha_trm_raw x1 y1 \<Longrightarrow> True"
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
    34
  and   "alpha_assg_raw x2 y2 \<Longrightarrow> alpha_bn_raw x2 y2"
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
    35
  and   "alpha_bn_raw x3 y3 \<Longrightarrow> True"
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
    36
apply(induct rule: alpha_trm_raw_alpha_assg_raw_alpha_bn_raw.inducts)
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
    37
apply(simp_all)
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
    38
apply(rule alpha_trm_raw_alpha_assg_raw_alpha_bn_raw.intros)
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
    39
apply(assumption)
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
    40
done
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
    41
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
    42
lemma a2:
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
    43
  shows "alpha_trm_raw x1 y1 \<Longrightarrow> fv_trm_raw x1 = fv_trm_raw y1"
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
    44
  and   "alpha_assg_raw x2 y2 \<Longrightarrow> fv_assg_raw x2 = fv_assg_raw y2 \<and> bn_raw x2 = bn_raw y2"
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
    45
  and   "alpha_bn_raw x3 y3 \<Longrightarrow>  fv_bn_raw x3 = fv_bn_raw y3"
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
    46
apply(induct rule: alpha_trm_raw_alpha_assg_raw_alpha_bn_raw.inducts)
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
    47
apply(simp_all add: alphas a1 prod_alpha_def)
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
    48
apply(auto)
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
    49
done
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
    50
2359
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2339
diff changeset
    51
lemma [quot_respect]: 
2361
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
    52
  "(op= ===> alpha_trm_raw) Var_raw Var_raw"
2359
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2339
diff changeset
    53
  "(alpha_trm_raw ===> alpha_trm_raw ===> alpha_trm_raw) App_raw App_raw"
2361
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
    54
  "(op= ===> alpha_trm_raw ===> alpha_trm_raw) Lam_raw Lam_raw"
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
    55
  "(alpha_assg_raw ===> alpha_trm_raw ===> alpha_trm_raw) Let_raw Let_raw"
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
    56
  "(op= ===> op= ===> alpha_trm_raw ===> alpha_trm_raw ===> alpha_trm_raw ===> alpha_trm_raw) 
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
    57
     Foo_raw Foo_raw"
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
    58
  "(op= ===> op= ===> alpha_trm_raw ===> alpha_trm_raw) Bar_raw Bar_raw"
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
    59
  "(op= ===> alpha_trm_raw ===> alpha_trm_raw ===> alpha_trm_raw) Baz_raw Baz_raw"
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
    60
  "(op = ===> op = ===> alpha_trm_raw ===> alpha_assg_raw) As_raw As_raw"
2359
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2339
diff changeset
    61
apply(auto)
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2339
diff changeset
    62
apply(rule alpha_trm_raw_alpha_assg_raw_alpha_bn_raw.intros)
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2339
diff changeset
    63
apply(rule refl)
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2339
diff changeset
    64
apply(rule alpha_trm_raw_alpha_assg_raw_alpha_bn_raw.intros)
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2339
diff changeset
    65
apply(assumption)
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2339
diff changeset
    66
apply(assumption)
2361
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
    67
apply(rule alpha_trm_raw_alpha_assg_raw_alpha_bn_raw.intros)
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
    68
apply(rule_tac x="0" in exI)
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
    69
apply(simp add: alphas fresh_star_def fresh_zero_perm a2)
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
    70
apply(rule alpha_trm_raw_alpha_assg_raw_alpha_bn_raw.intros)
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
    71
apply(rule_tac x="0" in exI)
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
    72
apply(simp add: alphas fresh_star_def fresh_zero_perm a2)
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
    73
apply(simp add: a1)
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
    74
apply(rule alpha_trm_raw_alpha_assg_raw_alpha_bn_raw.intros)
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
    75
apply(rule_tac x="0" in exI)
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
    76
apply(simp add: alphas fresh_star_def fresh_zero_perm a2 prod_alpha_def)
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
    77
apply(rule alpha_trm_raw_alpha_assg_raw_alpha_bn_raw.intros)
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
    78
apply(rule_tac x="0" in exI)
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
    79
apply(simp add: alphas fresh_star_def fresh_zero_perm a2 prod_alpha_def)
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
    80
apply(rule alpha_trm_raw_alpha_assg_raw_alpha_bn_raw.intros)
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
    81
apply(rule_tac x="0" in exI)
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
    82
apply(simp add: alphas fresh_star_def fresh_zero_perm a2 prod_alpha_def)
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
    83
apply(rule_tac x="0" in exI)
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
    84
apply(simp add: alphas fresh_star_def fresh_zero_perm a2 prod_alpha_def)
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
    85
apply(rule alpha_trm_raw_alpha_assg_raw_alpha_bn_raw.intros)
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
    86
apply(rule_tac x="0" in exI)
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
    87
apply(simp add: alphas fresh_star_def fresh_zero_perm a2 prod_alpha_def)
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
    88
apply(rule refl)
2359
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2339
diff changeset
    89
done
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2339
diff changeset
    90
2361
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
    91
lemma [quot_respect]:
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
    92
  "(alpha_trm_raw ===> op =) fv_trm_raw fv_trm_raw"
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
    93
  "(alpha_assg_raw ===> op =) fv_bn_raw fv_bn_raw"
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
    94
  "(alpha_assg_raw ===> op =) bn_raw bn_raw"
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
    95
  "(alpha_assg_raw ===> op =) fv_assg_raw fv_assg_raw"
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
    96
  "(op = ===> alpha_trm_raw ===> alpha_trm_raw) permute permute"
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
    97
apply(simp_all add: a2 a1)
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
    98
sorry
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
    99
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   100
ML {*
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   101
  val thms_d = map (lift_thm [@{typ trm}, @{typ assg}] @{context}) @{thms distinct}
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   102
*}
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   103
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   104
ML {* 
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   105
  val thms_i = map (lift_thm [@{typ trm}, @{typ assg}] @{context}) @{thms trm_raw_assg_raw.inducts}
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   106
*}
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   107
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   108
ML {*
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   109
  val thms_f = map (lift_thm [@{typ trm}, @{typ assg}] @{context}) @{thms fv_defs}
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   110
*}
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   111
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   112
thm perm_defs[no_vars]
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   113
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   114
instance trm :: pt sorry
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   115
instance assg :: pt sorry
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   116
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   117
lemma
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   118
  "p \<bullet> Var name = Var (p \<bullet> name)"
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   119
  "p \<bullet> App trm1 trm2 = App (p \<bullet> trm1) (p \<bullet> trm2)"
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   120
  "p \<bullet> Lam name trm = Lam (p \<bullet> name) (p \<bullet> trm)"
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   121
  "p \<bullet> Let assg trm = Let (p \<bullet> assg) (p \<bullet> trm)"
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   122
  "p \<bullet> Foo name1 name2 trm1 trm2 trm3 =
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   123
     Foo (p \<bullet> name1) (p \<bullet> name2) (p \<bullet> trm1) (p \<bullet> trm2) (p \<bullet> trm3)"
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   124
  "p \<bullet> Bar name1 name2 trm = Bar (p \<bullet> name1) (p \<bullet> name2) (p \<bullet> trm)"
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   125
  "p \<bullet> Baz name trm1 trm2 = Baz (p \<bullet> name) (p \<bullet> trm1) (p \<bullet> trm2)"
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   126
  "p \<bullet> As name1 name2 trm = As (p \<bullet> name1) (p \<bullet> name2) (p \<bullet> trm)"
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   127
sorry
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   128
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   129
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   130
(*
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   131
ML {*
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   132
  val thms_p = map (lift_thm [@{typ trm}, @{typ assg}] @{context}) @{thms perm_defs}
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   133
*}
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   134
*)
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   135
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   136
local_setup {* Local_Theory.note ((@{binding d1}, []), thms_d) #> snd *}
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   137
local_setup {* Local_Theory.note ((@{binding i1}, []), thms_i) #> snd *}
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   138
local_setup {* Local_Theory.note ((@{binding f1}, []), thms_f) #> snd *}
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   139
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   140
thm perm_defs
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   141
thm perm_simps
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   142
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   143
instance trm :: pt sorry
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   144
instance assg :: pt sorry
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   145
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   146
lemma supp_fv:
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   147
  "supp t = fv_trm t"
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   148
  "supp b = fv_bn b"
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   149
apply(induct t and b rule: i1)
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   150
apply(simp_all add: f1)
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   151
apply(simp_all add: supp_def)
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   152
apply(simp add: supp_def permute_trm1 alpha1_INJ fv_trm1)
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   153
apply(simp only: supp_at_base[simplified supp_def])
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   154
apply(simp add: supp_def permute_trm1 alpha1_INJ fv_trm1)
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   155
apply(simp add: Collect_imp_eq Collect_neg_eq Un_commute)
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   156
apply(subgoal_tac "supp (Lm1 name rtrm1) = supp (Abs {atom name} rtrm1)")
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   157
apply(simp add: supp_Abs fv_trm1)
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   158
apply(simp (no_asm) add: supp_def permute_set_eq atom_eqvt permute_trm1)
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   159
apply(simp add: alpha1_INJ)
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   160
apply(simp add: Abs_eq_iff)
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   161
apply(simp add: alpha_gen.simps)
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   162
apply(simp add: supp_eqvt[symmetric] fv_trm1_eqvt[symmetric])
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   163
apply(simp add: supp_fv_let fv_trm1 fv_eq_bv supp_Pair)
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   164
apply blast
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   165
apply(simp add: supp_def permute_trm1 alpha1_INJ fv_trm1)
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   166
apply(simp add: supp_def permute_trm1 alpha1_INJ fv_trm1)
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   167
apply(simp only: supp_at_base[simplified supp_def])
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   168
apply(simp (no_asm) only: supp_def permute_set_eq atom_eqvt permute_trm1 alpha1_INJ[simplified alpha_bp_eq])
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   169
apply(simp add: Collect_imp_eq Collect_neg_eq[symmetric])
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   170
apply(fold supp_def)
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   171
apply simp
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   172
done
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   173
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   174
ML {*
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   175
  map (lift_thm [@{typ trm}, @{typ assg}] @{context}) @{thms eq_iff}
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   176
*}
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   177
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   178
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
   179
2359
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2339
diff changeset
   180
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2339
diff changeset
   181
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2339
diff changeset
   182
lemma "Var x \<noteq> App y1 y2"
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2339
diff changeset
   183
apply(descending)
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2339
diff changeset
   184
apply(simp add: trm_raw.distinct)
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2339
diff changeset
   185
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2339
diff changeset
   186
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2339
diff changeset
   187
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2339
diff changeset
   188
ML {*
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2339
diff changeset
   189
  map (lift_thm [@{typ trm}, @{typ assg}] @{context}) @{thms trm_raw.distinct(1)}
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2339
diff changeset
   190
*}
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2339
diff changeset
   191
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2339
diff changeset
   192
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2339
diff changeset
   193
2338
e1764a73c292 slight cleaning
Christian Urban <urbanc@in.tum.de>
parents: 2336
diff changeset
   194
2336
f2d545b77b31 added definition of the quotient types
Christian Urban <urbanc@in.tum.de>
parents: 2330
diff changeset
   195
typ trm
f2d545b77b31 added definition of the quotient types
Christian Urban <urbanc@in.tum.de>
parents: 2330
diff changeset
   196
typ assg
f2d545b77b31 added definition of the quotient types
Christian Urban <urbanc@in.tum.de>
parents: 2330
diff changeset
   197
1911
60b5c61d3de2 renamed Ex1.thy to SingleLet.thy
Christian Urban <urbanc@in.tum.de>
parents: 1773
diff changeset
   198
thm trm_assg.fv
60b5c61d3de2 renamed Ex1.thy to SingleLet.thy
Christian Urban <urbanc@in.tum.de>
parents: 1773
diff changeset
   199
thm trm_assg.supp
2024
d974059827ad Equivariance fails for single let?
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1911
diff changeset
   200
thm trm_assg.eq_iff
1911
60b5c61d3de2 renamed Ex1.thy to SingleLet.thy
Christian Urban <urbanc@in.tum.de>
parents: 1773
diff changeset
   201
thm trm_assg.bn
60b5c61d3de2 renamed Ex1.thy to SingleLet.thy
Christian Urban <urbanc@in.tum.de>
parents: 1773
diff changeset
   202
thm trm_assg.perm
60b5c61d3de2 renamed Ex1.thy to SingleLet.thy
Christian Urban <urbanc@in.tum.de>
parents: 1773
diff changeset
   203
thm trm_assg.induct
60b5c61d3de2 renamed Ex1.thy to SingleLet.thy
Christian Urban <urbanc@in.tum.de>
parents: 1773
diff changeset
   204
thm trm_assg.inducts
60b5c61d3de2 renamed Ex1.thy to SingleLet.thy
Christian Urban <urbanc@in.tum.de>
parents: 1773
diff changeset
   205
thm trm_assg.distinct
60b5c61d3de2 renamed Ex1.thy to SingleLet.thy
Christian Urban <urbanc@in.tum.de>
parents: 1773
diff changeset
   206
ML {* Sign.of_sort @{theory} (@{typ trm}, @{sort fs}) *}
2024
d974059827ad Equivariance fails for single let?
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1911
diff changeset
   207
2288
3b83960f9544 new fv/fv_bn function (supp breaks now); exported raw perms and raw funs into separate ML-files
Christian Urban <urbanc@in.tum.de>
parents: 2146
diff changeset
   208
(* TEMPORARY
2024
d974059827ad Equivariance fails for single let?
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1911
diff changeset
   209
thm trm_assg.fv[simplified trm_assg.supp(1-2)]
2288
3b83960f9544 new fv/fv_bn function (supp breaks now); exported raw perms and raw funs into separate ML-files
Christian Urban <urbanc@in.tum.de>
parents: 2146
diff changeset
   210
*)
2064
2725853f43b9 solved the problem with equivariance by first eta-normalising the goal
Christian Urban <urbanc@in.tum.de>
parents: 2028
diff changeset
   211
1596
c69d9fb16785 Move Ex1 and Ex2 out of Test
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   212
end
c69d9fb16785 Move Ex1 and Ex2 out of Test
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   213
c69d9fb16785 Move Ex1 and Ex2 out of Test
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   214
c69d9fb16785 Move Ex1 and Ex2 out of Test
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   215