Quot/Nominal/LFex.thy
author Cezary Kaliszyk <kaliszyk@in.tum.de>
Wed, 24 Feb 2010 10:59:31 +0100
changeset 1241 ab1aa1b48547
parent 1240 9348581d7d92
child 1242 76de3440887c
permissions -rw-r--r--
Define the constants automatically.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
985
ef8a2b0b237a Ported existing part of LF to new permutations and alphas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     1
theory LFex
1241
ab1aa1b48547 Define the constants automatically.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1240
diff changeset
     2
imports "Nominal2_Atoms" "Nominal2_Eqvt" "Nominal2_Supp" "Abs" "Perm" "Fv" "Rsp"
985
ef8a2b0b237a Ported existing part of LF to new permutations and alphas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     3
begin
ef8a2b0b237a Ported existing part of LF to new permutations and alphas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     4
ef8a2b0b237a Ported existing part of LF to new permutations and alphas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     5
atom_decl name
ef8a2b0b237a Ported existing part of LF to new permutations and alphas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     6
atom_decl ident
ef8a2b0b237a Ported existing part of LF to new permutations and alphas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     7
1234
1240d5eb275d LF renaming part1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1219
diff changeset
     8
datatype rkind =
985
ef8a2b0b237a Ported existing part of LF to new permutations and alphas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     9
    Type
1234
1240d5eb275d LF renaming part1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1219
diff changeset
    10
  | KPi "rty" "name" "rkind"
1240d5eb275d LF renaming part1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1219
diff changeset
    11
and rty =
985
ef8a2b0b237a Ported existing part of LF to new permutations and alphas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    12
    TConst "ident"
1234
1240d5eb275d LF renaming part1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1219
diff changeset
    13
  | TApp "rty" "rtrm"
1240d5eb275d LF renaming part1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1219
diff changeset
    14
  | TPi "rty" "name" "rty"
1240d5eb275d LF renaming part1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1219
diff changeset
    15
and rtrm =
985
ef8a2b0b237a Ported existing part of LF to new permutations and alphas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    16
    Const "ident"
ef8a2b0b237a Ported existing part of LF to new permutations and alphas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    17
  | Var "name"
1234
1240d5eb275d LF renaming part1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1219
diff changeset
    18
  | App "rtrm" "rtrm"
1240d5eb275d LF renaming part1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1219
diff changeset
    19
  | Lam "rty" "name" "rtrm"
985
ef8a2b0b237a Ported existing part of LF to new permutations and alphas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    20
1234
1240d5eb275d LF renaming part1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1219
diff changeset
    21
1239
ae73578feb64 Use the infrastructure in LF. Much shorter :).
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1238
diff changeset
    22
setup {* snd o define_raw_perms ["rkind", "rty", "rtrm"] ["LFex.rkind", "LFex.rty", "LFex.rtrm"] *}
985
ef8a2b0b237a Ported existing part of LF to new permutations and alphas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    23
1219
c74c8ba46db7 All works in LF but will require renaming.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1218
diff changeset
    24
local_setup {*
1234
1240d5eb275d LF renaming part1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1219
diff changeset
    25
  snd o define_fv_alpha "LFex.rkind"
1219
c74c8ba46db7 All works in LF but will require renaming.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1218
diff changeset
    26
  [[ [], [[], [(NONE, 1)], [(NONE, 1)]] ],
c74c8ba46db7 All works in LF but will require renaming.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1218
diff changeset
    27
   [ [[]], [[], []], [[], [(NONE, 1)], [(NONE, 1)]] ],
c74c8ba46db7 All works in LF but will require renaming.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1218
diff changeset
    28
   [ [[]], [[]], [[], []], [[], [(NONE, 1)], [(NONE, 1)]]]] *}
c74c8ba46db7 All works in LF but will require renaming.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1218
diff changeset
    29
notation
1234
1240d5eb275d LF renaming part1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1219
diff changeset
    30
    alpha_rkind  ("_ \<approx>ki _" [100, 100] 100)
1237
38eb2bd9ad3a LF renaming part 3 (proper names of alpha equvalences)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1236
diff changeset
    31
and alpha_rty    ("_ \<approx>ty _" [100, 100] 100)
1234
1240d5eb275d LF renaming part1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1219
diff changeset
    32
and alpha_rtrm   ("_ \<approx>tr _" [100, 100] 100)
1240d5eb275d LF renaming part1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1219
diff changeset
    33
thm fv_rkind_fv_rty_fv_rtrm.simps alpha_rkind_alpha_rty_alpha_rtrm.intros
1238
c88159ffa7a3 Final synchronization of names.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1237
diff changeset
    34
local_setup {* (fn ctxt => snd (Local_Theory.note ((@{binding alpha_rkind_alpha_rty_alpha_rtrm_inj}, []), (build_alpha_inj @{thms alpha_rkind_alpha_rty_alpha_rtrm.intros} @{thms rkind.distinct rty.distinct rtrm.distinct rkind.inject rty.inject rtrm.inject} @{thms alpha_rkind.cases alpha_rty.cases alpha_rtrm.cases} ctxt)) ctxt)) *}
c88159ffa7a3 Final synchronization of names.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1237
diff changeset
    35
thm alpha_rkind_alpha_rty_alpha_rtrm_inj
1219
c74c8ba46db7 All works in LF but will require renaming.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1218
diff changeset
    36
992
74e9a580448c equivariance of rfv and alpha.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 991
diff changeset
    37
lemma rfv_eqvt[eqvt]:
1236
ca3c69545a78 LF renaming part 2 (proper fv functions)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1234
diff changeset
    38
  "((pi\<bullet>fv_rkind t1) = fv_rkind (pi\<bullet>t1))"
ca3c69545a78 LF renaming part 2 (proper fv functions)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1234
diff changeset
    39
  "((pi\<bullet>fv_rty t2) = fv_rty (pi\<bullet>t2))"
ca3c69545a78 LF renaming part 2 (proper fv functions)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1234
diff changeset
    40
  "((pi\<bullet>fv_rtrm t3) = fv_rtrm (pi\<bullet>t3))"
1234
1240d5eb275d LF renaming part1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1219
diff changeset
    41
apply(induct t1 and t2 and t3 rule: rkind_rty_rtrm.inducts)
1239
ae73578feb64 Use the infrastructure in LF. Much shorter :).
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1238
diff changeset
    42
apply(simp_all add: union_eqvt Diff_eqvt)
993
5c0d9a507bcb Fixed the induction problem + some more proofs.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 992
diff changeset
    43
apply(simp_all add: permute_set_eq atom_eqvt)
992
74e9a580448c equivariance of rfv and alpha.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 991
diff changeset
    44
done
74e9a580448c equivariance of rfv and alpha.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 991
diff changeset
    45
74e9a580448c equivariance of rfv and alpha.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 991
diff changeset
    46
lemma alpha_eqvt:
74e9a580448c equivariance of rfv and alpha.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 991
diff changeset
    47
  "t1 \<approx>ki s1 \<Longrightarrow> (pi \<bullet> t1) \<approx>ki (pi \<bullet> s1)"
1237
38eb2bd9ad3a LF renaming part 3 (proper names of alpha equvalences)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1236
diff changeset
    48
  "t2 \<approx>ty s2 \<Longrightarrow> (pi \<bullet> t2) \<approx>ty (pi \<bullet> s2)"
992
74e9a580448c equivariance of rfv and alpha.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 991
diff changeset
    49
  "t3 \<approx>tr s3 \<Longrightarrow> (pi \<bullet> t3) \<approx>tr (pi \<bullet> s3)"
1237
38eb2bd9ad3a LF renaming part 3 (proper names of alpha equvalences)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1236
diff changeset
    50
apply(induct rule: alpha_rkind_alpha_rty_alpha_rtrm.inducts)
38eb2bd9ad3a LF renaming part 3 (proper names of alpha equvalences)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1236
diff changeset
    51
apply (simp_all add: alpha_rkind_alpha_rty_alpha_rtrm.intros)
38eb2bd9ad3a LF renaming part 3 (proper names of alpha equvalences)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1236
diff changeset
    52
apply (simp_all add: alpha_rkind_alpha_rty_alpha_rtrm_inj)
1027
163d6917af62 LF ported to alpha_gen, equivp solved and one of the missing proofs in support<-> fv solved. Still some supp properties left.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1022
diff changeset
    53
apply (rule alpha_gen_atom_eqvt)
163d6917af62 LF ported to alpha_gen, equivp solved and one of the missing proofs in support<-> fv solved. Still some supp properties left.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1022
diff changeset
    54
apply (simp add: rfv_eqvt)
163d6917af62 LF ported to alpha_gen, equivp solved and one of the missing proofs in support<-> fv solved. Still some supp properties left.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1022
diff changeset
    55
apply assumption
163d6917af62 LF ported to alpha_gen, equivp solved and one of the missing proofs in support<-> fv solved. Still some supp properties left.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1022
diff changeset
    56
apply (rule alpha_gen_atom_eqvt)
163d6917af62 LF ported to alpha_gen, equivp solved and one of the missing proofs in support<-> fv solved. Still some supp properties left.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1022
diff changeset
    57
apply (simp add: rfv_eqvt)
163d6917af62 LF ported to alpha_gen, equivp solved and one of the missing proofs in support<-> fv solved. Still some supp properties left.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1022
diff changeset
    58
apply assumption
163d6917af62 LF ported to alpha_gen, equivp solved and one of the missing proofs in support<-> fv solved. Still some supp properties left.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1022
diff changeset
    59
apply (rule alpha_gen_atom_eqvt)
163d6917af62 LF ported to alpha_gen, equivp solved and one of the missing proofs in support<-> fv solved. Still some supp properties left.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1022
diff changeset
    60
apply (simp add: rfv_eqvt)
163d6917af62 LF ported to alpha_gen, equivp solved and one of the missing proofs in support<-> fv solved. Still some supp properties left.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1022
diff changeset
    61
apply assumption
992
74e9a580448c equivariance of rfv and alpha.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 991
diff changeset
    62
done
74e9a580448c equivariance of rfv and alpha.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 991
diff changeset
    63
1239
ae73578feb64 Use the infrastructure in LF. Much shorter :).
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1238
diff changeset
    64
local_setup {* (fn ctxt => snd (Local_Theory.note ((@{binding alpha_equivps}, []),
ae73578feb64 Use the infrastructure in LF. Much shorter :).
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1238
diff changeset
    65
  (build_equivps [@{term alpha_rkind}, @{term alpha_rty}, @{term alpha_rtrm}]
ae73578feb64 Use the infrastructure in LF. Much shorter :).
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1238
diff changeset
    66
     @{thm rkind_rty_rtrm.induct} @{thm alpha_rkind_alpha_rty_alpha_rtrm.induct} 
ae73578feb64 Use the infrastructure in LF. Much shorter :).
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1238
diff changeset
    67
     @{thms rkind.inject rty.inject rtrm.inject} @{thms alpha_rkind_alpha_rty_alpha_rtrm_inj}
ae73578feb64 Use the infrastructure in LF. Much shorter :).
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1238
diff changeset
    68
     @{thms rkind.distinct rty.distinct rtrm.distinct}
ae73578feb64 Use the infrastructure in LF. Much shorter :).
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1238
diff changeset
    69
     @{thms alpha_rkind.cases alpha_rty.cases alpha_rtrm.cases}
ae73578feb64 Use the infrastructure in LF. Much shorter :).
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1238
diff changeset
    70
     @{thms alpha_eqvt} ctxt)) ctxt)) *}
ae73578feb64 Use the infrastructure in LF. Much shorter :).
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1238
diff changeset
    71
thm alpha_equivps
985
ef8a2b0b237a Ported existing part of LF to new permutations and alphas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    72
1241
ab1aa1b48547 Define the constants automatically.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1240
diff changeset
    73
local_setup  {* define_quotient_type
ab1aa1b48547 Define the constants automatically.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1240
diff changeset
    74
  [(([], @{binding kind}, NoSyn), (@{typ rkind}, @{term alpha_rkind})),
ab1aa1b48547 Define the constants automatically.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1240
diff changeset
    75
   (([], @{binding ty},   NoSyn), (@{typ rty},   @{term alpha_rty}  )),
ab1aa1b48547 Define the constants automatically.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1240
diff changeset
    76
   (([], @{binding trm},  NoSyn), (@{typ rtrm},  @{term alpha_rtrm} ))]
ab1aa1b48547 Define the constants automatically.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1240
diff changeset
    77
  (ALLGOALS (resolve_tac @{thms alpha_equivps}))
ab1aa1b48547 Define the constants automatically.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1240
diff changeset
    78
*}
985
ef8a2b0b237a Ported existing part of LF to new permutations and alphas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    79
1241
ab1aa1b48547 Define the constants automatically.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1240
diff changeset
    80
local_setup {*
ab1aa1b48547 Define the constants automatically.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1240
diff changeset
    81
(fn ctxt => ctxt
ab1aa1b48547 Define the constants automatically.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1240
diff changeset
    82
 |> snd o (Quotient_Def.quotient_lift_const ("TYP", @{term Type}))
ab1aa1b48547 Define the constants automatically.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1240
diff changeset
    83
 |> snd o (Quotient_Def.quotient_lift_const ("KPI", @{term KPi}))
ab1aa1b48547 Define the constants automatically.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1240
diff changeset
    84
 |> snd o (Quotient_Def.quotient_lift_const ("TCONST", @{term TConst}))
ab1aa1b48547 Define the constants automatically.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1240
diff changeset
    85
 |> snd o (Quotient_Def.quotient_lift_const ("TAPP", @{term TApp}))
ab1aa1b48547 Define the constants automatically.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1240
diff changeset
    86
 |> snd o (Quotient_Def.quotient_lift_const ("TPI", @{term TPi}))
ab1aa1b48547 Define the constants automatically.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1240
diff changeset
    87
 |> snd o (Quotient_Def.quotient_lift_const ("CONS", @{term Const}))
ab1aa1b48547 Define the constants automatically.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1240
diff changeset
    88
 |> snd o (Quotient_Def.quotient_lift_const ("VAR", @{term Var}))
ab1aa1b48547 Define the constants automatically.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1240
diff changeset
    89
 |> snd o (Quotient_Def.quotient_lift_const ("APP", @{term App}))
ab1aa1b48547 Define the constants automatically.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1240
diff changeset
    90
 |> snd o (Quotient_Def.quotient_lift_const ("LAM", @{term Lam}))
ab1aa1b48547 Define the constants automatically.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1240
diff changeset
    91
 |> snd o (Quotient_Def.quotient_lift_const ("fv_kind", @{term fv_rkind}))
ab1aa1b48547 Define the constants automatically.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1240
diff changeset
    92
 |> snd o (Quotient_Def.quotient_lift_const ("fv_ty", @{term fv_rty}))
ab1aa1b48547 Define the constants automatically.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1240
diff changeset
    93
 |> snd o (Quotient_Def.quotient_lift_const ("fv_trm", @{term fv_rtrm}))) *}
ab1aa1b48547 Define the constants automatically.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1240
diff changeset
    94
print_theorems
985
ef8a2b0b237a Ported existing part of LF to new permutations and alphas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    95
ef8a2b0b237a Ported existing part of LF to new permutations and alphas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    96
lemma alpha_rfv:
1236
ca3c69545a78 LF renaming part 2 (proper fv functions)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1234
diff changeset
    97
  shows "(t \<approx>ki s \<longrightarrow> fv_rkind t = fv_rkind s) \<and>
1237
38eb2bd9ad3a LF renaming part 3 (proper names of alpha equvalences)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1236
diff changeset
    98
     (t1 \<approx>ty s1 \<longrightarrow> fv_rty t1 = fv_rty s1) \<and>
1236
ca3c69545a78 LF renaming part 2 (proper fv functions)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1234
diff changeset
    99
     (t2 \<approx>tr s2 \<longrightarrow> fv_rtrm t2 = fv_rtrm s2)"
1237
38eb2bd9ad3a LF renaming part 3 (proper names of alpha equvalences)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1236
diff changeset
   100
  apply(rule alpha_rkind_alpha_rty_alpha_rtrm.induct)
1027
163d6917af62 LF ported to alpha_gen, equivp solved and one of the missing proofs in support<-> fv solved. Still some supp properties left.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1022
diff changeset
   101
  apply(simp_all add: alpha_gen)
985
ef8a2b0b237a Ported existing part of LF to new permutations and alphas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   102
  done
ef8a2b0b237a Ported existing part of LF to new permutations and alphas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   103
ef8a2b0b237a Ported existing part of LF to new permutations and alphas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   104
lemma perm_rsp[quot_respect]:
1237
38eb2bd9ad3a LF renaming part 3 (proper names of alpha equvalences)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1236
diff changeset
   105
  "(op = ===> alpha_rkind ===> alpha_rkind) permute permute"
38eb2bd9ad3a LF renaming part 3 (proper names of alpha equvalences)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1236
diff changeset
   106
  "(op = ===> alpha_rty ===> alpha_rty) permute permute"
38eb2bd9ad3a LF renaming part 3 (proper names of alpha equvalences)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1236
diff changeset
   107
  "(op = ===> alpha_rtrm ===> alpha_rtrm) permute permute"
992
74e9a580448c equivariance of rfv and alpha.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 991
diff changeset
   108
  by (simp_all add:alpha_eqvt)
985
ef8a2b0b237a Ported existing part of LF to new permutations and alphas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   109
ef8a2b0b237a Ported existing part of LF to new permutations and alphas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   110
lemma tconst_rsp[quot_respect]: 
1237
38eb2bd9ad3a LF renaming part 3 (proper names of alpha equvalences)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1236
diff changeset
   111
  "(op = ===> alpha_rty) TConst TConst"
38eb2bd9ad3a LF renaming part 3 (proper names of alpha equvalences)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1236
diff changeset
   112
  apply (auto intro: alpha_rkind_alpha_rty_alpha_rtrm.intros) done
985
ef8a2b0b237a Ported existing part of LF to new permutations and alphas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   113
lemma tapp_rsp[quot_respect]: 
1237
38eb2bd9ad3a LF renaming part 3 (proper names of alpha equvalences)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1236
diff changeset
   114
  "(alpha_rty ===> alpha_rtrm ===> alpha_rty) TApp TApp" 
38eb2bd9ad3a LF renaming part 3 (proper names of alpha equvalences)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1236
diff changeset
   115
  apply (auto intro: alpha_rkind_alpha_rty_alpha_rtrm.intros) done
985
ef8a2b0b237a Ported existing part of LF to new permutations and alphas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   116
lemma var_rsp[quot_respect]: 
1237
38eb2bd9ad3a LF renaming part 3 (proper names of alpha equvalences)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1236
diff changeset
   117
  "(op = ===> alpha_rtrm) Var Var"
38eb2bd9ad3a LF renaming part 3 (proper names of alpha equvalences)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1236
diff changeset
   118
  apply (auto intro: alpha_rkind_alpha_rty_alpha_rtrm.intros) done
985
ef8a2b0b237a Ported existing part of LF to new permutations and alphas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   119
lemma app_rsp[quot_respect]: 
1237
38eb2bd9ad3a LF renaming part 3 (proper names of alpha equvalences)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1236
diff changeset
   120
  "(alpha_rtrm ===> alpha_rtrm ===> alpha_rtrm) App App"
38eb2bd9ad3a LF renaming part 3 (proper names of alpha equvalences)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1236
diff changeset
   121
  apply (auto intro: alpha_rkind_alpha_rty_alpha_rtrm.intros) done
985
ef8a2b0b237a Ported existing part of LF to new permutations and alphas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   122
lemma const_rsp[quot_respect]: 
1237
38eb2bd9ad3a LF renaming part 3 (proper names of alpha equvalences)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1236
diff changeset
   123
  "(op = ===> alpha_rtrm) Const Const"
38eb2bd9ad3a LF renaming part 3 (proper names of alpha equvalences)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1236
diff changeset
   124
  apply (auto intro: alpha_rkind_alpha_rty_alpha_rtrm.intros) done
992
74e9a580448c equivariance of rfv and alpha.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 991
diff changeset
   125
74e9a580448c equivariance of rfv and alpha.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 991
diff changeset
   126
lemma kpi_rsp[quot_respect]: 
1237
38eb2bd9ad3a LF renaming part 3 (proper names of alpha equvalences)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1236
diff changeset
   127
  "(alpha_rty ===> op = ===> alpha_rkind ===> alpha_rkind) KPi KPi"
38eb2bd9ad3a LF renaming part 3 (proper names of alpha equvalences)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1236
diff changeset
   128
  apply (auto intro: alpha_rkind_alpha_rty_alpha_rtrm.intros)
38eb2bd9ad3a LF renaming part 3 (proper names of alpha equvalences)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1236
diff changeset
   129
  apply (rule alpha_rkind_alpha_rty_alpha_rtrm.intros(2)) apply simp_all
993
5c0d9a507bcb Fixed the induction problem + some more proofs.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 992
diff changeset
   130
  apply (rule_tac x="0" in exI)
1027
163d6917af62 LF ported to alpha_gen, equivp solved and one of the missing proofs in support<-> fv solved. Still some supp properties left.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1022
diff changeset
   131
  apply (simp add: fresh_star_def fresh_zero_perm alpha_rfv alpha_gen)
993
5c0d9a507bcb Fixed the induction problem + some more proofs.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 992
diff changeset
   132
  done
5c0d9a507bcb Fixed the induction problem + some more proofs.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 992
diff changeset
   133
992
74e9a580448c equivariance of rfv and alpha.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 991
diff changeset
   134
lemma tpi_rsp[quot_respect]: 
1237
38eb2bd9ad3a LF renaming part 3 (proper names of alpha equvalences)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1236
diff changeset
   135
  "(alpha_rty ===> op = ===> alpha_rty ===> alpha_rty) TPi TPi"
38eb2bd9ad3a LF renaming part 3 (proper names of alpha equvalences)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1236
diff changeset
   136
  apply (auto intro: alpha_rkind_alpha_rty_alpha_rtrm.intros)
38eb2bd9ad3a LF renaming part 3 (proper names of alpha equvalences)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1236
diff changeset
   137
  apply (rule alpha_rkind_alpha_rty_alpha_rtrm.intros(5)) apply simp_all
993
5c0d9a507bcb Fixed the induction problem + some more proofs.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 992
diff changeset
   138
  apply (rule_tac x="0" in exI)
1027
163d6917af62 LF ported to alpha_gen, equivp solved and one of the missing proofs in support<-> fv solved. Still some supp properties left.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1022
diff changeset
   139
  apply (simp add: fresh_star_def fresh_zero_perm alpha_rfv alpha_gen)
993
5c0d9a507bcb Fixed the induction problem + some more proofs.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 992
diff changeset
   140
  done
985
ef8a2b0b237a Ported existing part of LF to new permutations and alphas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   141
lemma lam_rsp[quot_respect]: 
1237
38eb2bd9ad3a LF renaming part 3 (proper names of alpha equvalences)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1236
diff changeset
   142
  "(alpha_rty ===> op = ===> alpha_rtrm ===> alpha_rtrm) Lam Lam"
38eb2bd9ad3a LF renaming part 3 (proper names of alpha equvalences)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1236
diff changeset
   143
  apply (auto intro: alpha_rkind_alpha_rty_alpha_rtrm.intros)
38eb2bd9ad3a LF renaming part 3 (proper names of alpha equvalences)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1236
diff changeset
   144
  apply (rule alpha_rkind_alpha_rty_alpha_rtrm.intros(9)) apply simp_all
993
5c0d9a507bcb Fixed the induction problem + some more proofs.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 992
diff changeset
   145
  apply (rule_tac x="0" in exI)
1027
163d6917af62 LF ported to alpha_gen, equivp solved and one of the missing proofs in support<-> fv solved. Still some supp properties left.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1022
diff changeset
   146
  apply (simp add: fresh_star_def fresh_zero_perm alpha_rfv alpha_gen)
993
5c0d9a507bcb Fixed the induction problem + some more proofs.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 992
diff changeset
   147
  done
992
74e9a580448c equivariance of rfv and alpha.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 991
diff changeset
   148
1236
ca3c69545a78 LF renaming part 2 (proper fv functions)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1234
diff changeset
   149
lemma fv_rty_rsp[quot_respect]: 
1237
38eb2bd9ad3a LF renaming part 3 (proper names of alpha equvalences)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1236
diff changeset
   150
  "(alpha_rty ===> op =) fv_rty fv_rty"
985
ef8a2b0b237a Ported existing part of LF to new permutations and alphas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   151
  by (simp add: alpha_rfv)
1236
ca3c69545a78 LF renaming part 2 (proper fv functions)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1234
diff changeset
   152
lemma fv_rkind_rsp[quot_respect]:
1237
38eb2bd9ad3a LF renaming part 3 (proper names of alpha equvalences)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1236
diff changeset
   153
  "(alpha_rkind ===> op =) fv_rkind fv_rkind"
985
ef8a2b0b237a Ported existing part of LF to new permutations and alphas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   154
  by (simp add: alpha_rfv)
1236
ca3c69545a78 LF renaming part 2 (proper fv functions)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1234
diff changeset
   155
lemma fv_rtrm_rsp[quot_respect]:
1237
38eb2bd9ad3a LF renaming part 3 (proper names of alpha equvalences)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1236
diff changeset
   156
  "(alpha_rtrm ===> op =) fv_rtrm fv_rtrm"
985
ef8a2b0b237a Ported existing part of LF to new permutations and alphas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   157
  by (simp add: alpha_rfv)
ef8a2b0b237a Ported existing part of LF to new permutations and alphas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   158
1234
1240d5eb275d LF renaming part1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1219
diff changeset
   159
thm rkind_rty_rtrm.induct
1240
9348581d7d92 Rename also the lifted types to non-capital.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1239
diff changeset
   160
lemmas kind_ty_trm_induct = rkind_rty_rtrm.induct[quot_lifted]
985
ef8a2b0b237a Ported existing part of LF to new permutations and alphas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   161
1234
1240d5eb275d LF renaming part1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1219
diff changeset
   162
thm rkind_rty_rtrm.inducts
1240
9348581d7d92 Rename also the lifted types to non-capital.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1239
diff changeset
   163
lemmas kind_ty_trm_inducts = rkind_rty_rtrm.inducts[quot_lifted]
994
333c24bd595d More in the LF example in the new nominal way, all is clear until support.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 993
diff changeset
   164
1240
9348581d7d92 Rename also the lifted types to non-capital.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1239
diff changeset
   165
instantiation kind and ty and trm :: pt
985
ef8a2b0b237a Ported existing part of LF to new permutations and alphas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   166
begin
ef8a2b0b237a Ported existing part of LF to new permutations and alphas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   167
ef8a2b0b237a Ported existing part of LF to new permutations and alphas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   168
quotient_definition
1240
9348581d7d92 Rename also the lifted types to non-capital.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1239
diff changeset
   169
  "permute_kind :: perm \<Rightarrow> kind \<Rightarrow> kind"
1139
c4001cda9da3 renamed 'as' to 'is' everywhere.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1129
diff changeset
   170
is
1234
1240d5eb275d LF renaming part1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1219
diff changeset
   171
  "permute :: perm \<Rightarrow> rkind \<Rightarrow> rkind"
985
ef8a2b0b237a Ported existing part of LF to new permutations and alphas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   172
ef8a2b0b237a Ported existing part of LF to new permutations and alphas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   173
quotient_definition
1240
9348581d7d92 Rename also the lifted types to non-capital.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1239
diff changeset
   174
  "permute_ty :: perm \<Rightarrow> ty \<Rightarrow> ty"
1139
c4001cda9da3 renamed 'as' to 'is' everywhere.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1129
diff changeset
   175
is
1234
1240d5eb275d LF renaming part1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1219
diff changeset
   176
  "permute :: perm \<Rightarrow> rty \<Rightarrow> rty"
985
ef8a2b0b237a Ported existing part of LF to new permutations and alphas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   177
ef8a2b0b237a Ported existing part of LF to new permutations and alphas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   178
quotient_definition
1240
9348581d7d92 Rename also the lifted types to non-capital.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1239
diff changeset
   179
  "permute_trm :: perm \<Rightarrow> trm \<Rightarrow> trm"
1139
c4001cda9da3 renamed 'as' to 'is' everywhere.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1129
diff changeset
   180
is
1234
1240d5eb275d LF renaming part1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1219
diff changeset
   181
  "permute :: perm \<Rightarrow> rtrm \<Rightarrow> rtrm"
985
ef8a2b0b237a Ported existing part of LF to new permutations and alphas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   182
1234
1240d5eb275d LF renaming part1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1219
diff changeset
   183
lemmas permute_ktt[simp] = permute_rkind_permute_rty_permute_rtrm.simps[quot_lifted]
1083
30550327651a Proper context fixes lifting inside instantiations.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1082
diff changeset
   184
1240
9348581d7d92 Rename also the lifted types to non-capital.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1239
diff changeset
   185
lemma perm_zero_ok: "0 \<bullet> (x :: kind) = x \<and> 0 \<bullet> (y :: ty) = y \<and> 0 \<bullet> (z :: trm) = z"
9348581d7d92 Rename also the lifted types to non-capital.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1239
diff changeset
   186
apply (induct rule: kind_ty_trm_induct)
1083
30550327651a Proper context fixes lifting inside instantiations.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1082
diff changeset
   187
apply (simp_all)
985
ef8a2b0b237a Ported existing part of LF to new permutations and alphas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   188
done
ef8a2b0b237a Ported existing part of LF to new permutations and alphas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   189
1082
f8029d8c88a9 Fixed the context import/export and simplified LFex.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1045
diff changeset
   190
lemma perm_add_ok:
1240
9348581d7d92 Rename also the lifted types to non-capital.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1239
diff changeset
   191
  "((p + q) \<bullet> (x1 :: kind) = (p \<bullet> q \<bullet> x1))"
9348581d7d92 Rename also the lifted types to non-capital.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1239
diff changeset
   192
  "((p + q) \<bullet> (x2 :: ty) = p \<bullet> q \<bullet> x2)"
9348581d7d92 Rename also the lifted types to non-capital.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1239
diff changeset
   193
  "((p + q) \<bullet> (x3 :: trm) = p \<bullet> q \<bullet> x3)"
9348581d7d92 Rename also the lifted types to non-capital.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1239
diff changeset
   194
apply (induct x1 and x2 and x3 rule: kind_ty_trm_inducts)
1083
30550327651a Proper context fixes lifting inside instantiations.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1082
diff changeset
   195
apply (simp_all)
994
333c24bd595d More in the LF example in the new nominal way, all is clear until support.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 993
diff changeset
   196
done
985
ef8a2b0b237a Ported existing part of LF to new permutations and alphas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   197
ef8a2b0b237a Ported existing part of LF to new permutations and alphas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   198
instance
ef8a2b0b237a Ported existing part of LF to new permutations and alphas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   199
apply default
ef8a2b0b237a Ported existing part of LF to new permutations and alphas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   200
apply (simp_all add: perm_zero_ok perm_add_ok)
ef8a2b0b237a Ported existing part of LF to new permutations and alphas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   201
done
ef8a2b0b237a Ported existing part of LF to new permutations and alphas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   202
ef8a2b0b237a Ported existing part of LF to new permutations and alphas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   203
end
ef8a2b0b237a Ported existing part of LF to new permutations and alphas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   204
1240
9348581d7d92 Rename also the lifted types to non-capital.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1239
diff changeset
   205
lemmas ALPHA_kind_ALPHA_ty_ALPHA_trm_inducts = alpha_rkind_alpha_rty_alpha_rtrm.inducts[unfolded alpha_gen, quot_lifted, folded alpha_gen]
994
333c24bd595d More in the LF example in the new nominal way, all is clear until support.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 993
diff changeset
   206
1240
9348581d7d92 Rename also the lifted types to non-capital.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1239
diff changeset
   207
lemmas kind_ty_trm_INJECT = alpha_rkind_alpha_rty_alpha_rtrm_inj[unfolded alpha_gen, quot_lifted, folded alpha_gen]
994
333c24bd595d More in the LF example in the new nominal way, all is clear until support.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 993
diff changeset
   208
1236
ca3c69545a78 LF renaming part 2 (proper fv functions)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1234
diff changeset
   209
lemmas fv_kind_ty_trm = fv_rkind_fv_rty_fv_rtrm.simps[quot_lifted]
994
333c24bd595d More in the LF example in the new nominal way, all is clear until support.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 993
diff changeset
   210
1082
f8029d8c88a9 Fixed the context import/export and simplified LFex.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1045
diff changeset
   211
lemmas fv_eqvt = rfv_eqvt[quot_lifted]
994
333c24bd595d More in the LF example in the new nominal way, all is clear until support.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 993
diff changeset
   212
1234
1240d5eb275d LF renaming part1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1219
diff changeset
   213
lemma supp_rkind_rty_rtrm_easy:
1002
3f227ed7e3e5 More proofs in the LF example.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   214
 "supp TYP = {}"
3f227ed7e3e5 More proofs in the LF example.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   215
 "supp (TCONST i) = {atom i}"
3f227ed7e3e5 More proofs in the LF example.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   216
 "supp (TAPP A M) = supp A \<union> supp M"
3f227ed7e3e5 More proofs in the LF example.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   217
 "supp (CONS i) = {atom i}"
3f227ed7e3e5 More proofs in the LF example.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   218
 "supp (VAR x) = {atom x}"
3f227ed7e3e5 More proofs in the LF example.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   219
 "supp (APP M N) = supp M \<union> supp N"
1239
ae73578feb64 Use the infrastructure in LF. Much shorter :).
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1238
diff changeset
   220
apply (simp_all add: supp_def permute_ktt)
1240
9348581d7d92 Rename also the lifted types to non-capital.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1239
diff changeset
   221
apply (simp_all only: kind_ty_trm_INJECT)
1002
3f227ed7e3e5 More proofs in the LF example.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   222
apply (simp_all only: supp_at_base[simplified supp_def])
3f227ed7e3e5 More proofs in the LF example.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   223
apply (simp_all add: Collect_imp_eq Collect_neg_eq)
3f227ed7e3e5 More proofs in the LF example.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   224
done
3f227ed7e3e5 More proofs in the LF example.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   225
3f227ed7e3e5 More proofs in the LF example.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   226
lemma supp_bind:
3f227ed7e3e5 More proofs in the LF example.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   227
  "(supp (atom na, (ty, ki))) supports (KPI ty na ki)"
3f227ed7e3e5 More proofs in the LF example.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   228
  "(supp (atom na, (ty, ty2))) supports (TPI ty na ty2)"
1234
1240d5eb275d LF renaming part1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1219
diff changeset
   229
  "(supp (atom na, (ty, rtrm))) supports (LAM ty na rtrm)"
1002
3f227ed7e3e5 More proofs in the LF example.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   230
apply(simp_all add: supports_def)
3f227ed7e3e5 More proofs in the LF example.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   231
apply(fold fresh_def)
3f227ed7e3e5 More proofs in the LF example.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   232
apply(simp_all add: fresh_Pair swap_fresh_fresh)
3f227ed7e3e5 More proofs in the LF example.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   233
apply(clarify)
3f227ed7e3e5 More proofs in the LF example.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   234
apply(subst swap_at_base_simps(3))
3f227ed7e3e5 More proofs in the LF example.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   235
apply(simp_all add: fresh_atom)
3f227ed7e3e5 More proofs in the LF example.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   236
apply(clarify)
3f227ed7e3e5 More proofs in the LF example.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   237
apply(subst swap_at_base_simps(3))
3f227ed7e3e5 More proofs in the LF example.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   238
apply(simp_all add: fresh_atom)
3f227ed7e3e5 More proofs in the LF example.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   239
apply(clarify)
3f227ed7e3e5 More proofs in the LF example.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   240
apply(subst swap_at_base_simps(3))
3f227ed7e3e5 More proofs in the LF example.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   241
apply(simp_all add: fresh_atom)
3f227ed7e3e5 More proofs in the LF example.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   242
done
3f227ed7e3e5 More proofs in the LF example.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   243
1240
9348581d7d92 Rename also the lifted types to non-capital.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1239
diff changeset
   244
lemma kind_ty_trm_fs:
9348581d7d92 Rename also the lifted types to non-capital.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1239
diff changeset
   245
  "finite (supp (x\<Colon>kind))"
9348581d7d92 Rename also the lifted types to non-capital.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1239
diff changeset
   246
  "finite (supp (y\<Colon>ty))"
9348581d7d92 Rename also the lifted types to non-capital.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1239
diff changeset
   247
  "finite (supp (z\<Colon>trm))"
9348581d7d92 Rename also the lifted types to non-capital.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1239
diff changeset
   248
apply(induct x and y and z rule: kind_ty_trm_inducts)
1234
1240d5eb275d LF renaming part1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1219
diff changeset
   249
apply(simp_all add: supp_rkind_rty_rtrm_easy)
1002
3f227ed7e3e5 More proofs in the LF example.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   250
apply(rule supports_finite)
3f227ed7e3e5 More proofs in the LF example.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   251
apply(rule supp_bind(1))
3f227ed7e3e5 More proofs in the LF example.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   252
apply(simp add: supp_Pair supp_atom)
3f227ed7e3e5 More proofs in the LF example.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   253
apply(rule supports_finite)
3f227ed7e3e5 More proofs in the LF example.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   254
apply(rule supp_bind(2))
3f227ed7e3e5 More proofs in the LF example.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   255
apply(simp add: supp_Pair supp_atom)
3f227ed7e3e5 More proofs in the LF example.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   256
apply(rule supports_finite)
3f227ed7e3e5 More proofs in the LF example.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   257
apply(rule supp_bind(3))
3f227ed7e3e5 More proofs in the LF example.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   258
apply(simp add: supp_Pair supp_atom)
3f227ed7e3e5 More proofs in the LF example.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   259
done
3f227ed7e3e5 More proofs in the LF example.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   260
1240
9348581d7d92 Rename also the lifted types to non-capital.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1239
diff changeset
   261
instance kind and ty and trm :: fs
1002
3f227ed7e3e5 More proofs in the LF example.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   262
apply(default)
1240
9348581d7d92 Rename also the lifted types to non-capital.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1239
diff changeset
   263
apply(simp_all only: kind_ty_trm_fs)
1002
3f227ed7e3e5 More proofs in the LF example.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   264
done
3f227ed7e3e5 More proofs in the LF example.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   265
994
333c24bd595d More in the LF example in the new nominal way, all is clear until support.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 993
diff changeset
   266
lemma supp_fv:
1236
ca3c69545a78 LF renaming part 2 (proper fv functions)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1234
diff changeset
   267
 "supp t1 = fv_kind t1"
ca3c69545a78 LF renaming part 2 (proper fv functions)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1234
diff changeset
   268
 "supp t2 = fv_ty t2"
ca3c69545a78 LF renaming part 2 (proper fv functions)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1234
diff changeset
   269
 "supp t3 = fv_trm t3"
1240
9348581d7d92 Rename also the lifted types to non-capital.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1239
diff changeset
   270
apply(induct t1 and t2 and t3 rule: kind_ty_trm_inducts)
1234
1240d5eb275d LF renaming part1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1219
diff changeset
   271
apply (simp_all add: supp_rkind_rty_rtrm_easy)
1236
ca3c69545a78 LF renaming part 2 (proper fv functions)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1234
diff changeset
   272
apply (simp_all add: fv_kind_ty_trm)
1234
1240d5eb275d LF renaming part1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1219
diff changeset
   273
apply(subgoal_tac "supp (KPI rty name rkind) = supp rty \<union> supp (Abs {atom name} rkind)")
1027
163d6917af62 LF ported to alpha_gen, equivp solved and one of the missing proofs in support<-> fv solved. Still some supp properties left.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1022
diff changeset
   274
apply(simp add: supp_Abs Set.Un_commute)
1002
3f227ed7e3e5 More proofs in the LF example.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   275
apply(simp (no_asm) add: supp_def)
1240
9348581d7d92 Rename also the lifted types to non-capital.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1239
diff changeset
   276
apply(simp add: kind_ty_trm_INJECT)
1036
aaac8274f08c The alpha-equivalence relation for let-rec. Not sure if correct...
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1027
diff changeset
   277
apply(simp add: Abs_eq_iff)
aaac8274f08c The alpha-equivalence relation for let-rec. Not sure if correct...
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1027
diff changeset
   278
apply(simp add: alpha_gen)
1045
7a975641efbc another adaptation for the eqvt-change
Christian Urban <urbanc@in.tum.de>
parents: 1036
diff changeset
   279
apply(simp add: Collect_imp_eq Collect_neg_eq Set.Un_commute insert_eqvt empty_eqvt atom_eqvt)
7a975641efbc another adaptation for the eqvt-change
Christian Urban <urbanc@in.tum.de>
parents: 1036
diff changeset
   280
apply(simp add: supp_eqvt[symmetric] fv_eqvt[symmetric])
1234
1240d5eb275d LF renaming part1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1219
diff changeset
   281
apply(subgoal_tac "supp (TPI rty1 name rty2) = supp rty1 \<union> supp (Abs {atom name} rty2)")
1036
aaac8274f08c The alpha-equivalence relation for let-rec. Not sure if correct...
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1027
diff changeset
   282
apply(simp add: supp_Abs Set.Un_commute)
aaac8274f08c The alpha-equivalence relation for let-rec. Not sure if correct...
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1027
diff changeset
   283
apply(simp (no_asm) add: supp_def)
1240
9348581d7d92 Rename also the lifted types to non-capital.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1239
diff changeset
   284
apply(simp add: kind_ty_trm_INJECT)
1036
aaac8274f08c The alpha-equivalence relation for let-rec. Not sure if correct...
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1027
diff changeset
   285
apply(simp add: Abs_eq_iff)
aaac8274f08c The alpha-equivalence relation for let-rec. Not sure if correct...
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1027
diff changeset
   286
apply(simp add: alpha_gen)
1045
7a975641efbc another adaptation for the eqvt-change
Christian Urban <urbanc@in.tum.de>
parents: 1036
diff changeset
   287
apply(simp add: supp_eqvt[symmetric] fv_eqvt[symmetric] insert_eqvt empty_eqvt atom_eqvt)
1002
3f227ed7e3e5 More proofs in the LF example.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   288
apply(simp add: Collect_imp_eq Collect_neg_eq Set.Un_commute)
1234
1240d5eb275d LF renaming part1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1219
diff changeset
   289
apply(subgoal_tac "supp (LAM rty name rtrm) = supp rty \<union> supp (Abs {atom name} rtrm)")
1036
aaac8274f08c The alpha-equivalence relation for let-rec. Not sure if correct...
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1027
diff changeset
   290
apply(simp add: supp_Abs Set.Un_commute)
aaac8274f08c The alpha-equivalence relation for let-rec. Not sure if correct...
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1027
diff changeset
   291
apply(simp (no_asm) add: supp_def)
1240
9348581d7d92 Rename also the lifted types to non-capital.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1239
diff changeset
   292
apply(simp add: kind_ty_trm_INJECT)
1036
aaac8274f08c The alpha-equivalence relation for let-rec. Not sure if correct...
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1027
diff changeset
   293
apply(simp add: Abs_eq_iff)
aaac8274f08c The alpha-equivalence relation for let-rec. Not sure if correct...
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1027
diff changeset
   294
apply(simp add: alpha_gen)
1045
7a975641efbc another adaptation for the eqvt-change
Christian Urban <urbanc@in.tum.de>
parents: 1036
diff changeset
   295
apply(simp add: supp_eqvt[symmetric] fv_eqvt[symmetric] insert_eqvt empty_eqvt atom_eqvt)
1036
aaac8274f08c The alpha-equivalence relation for let-rec. Not sure if correct...
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1027
diff changeset
   296
apply(simp add: Collect_imp_eq Collect_neg_eq Set.Un_commute)
aaac8274f08c The alpha-equivalence relation for let-rec. Not sure if correct...
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1027
diff changeset
   297
done
994
333c24bd595d More in the LF example in the new nominal way, all is clear until support.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 993
diff changeset
   298
1036
aaac8274f08c The alpha-equivalence relation for let-rec. Not sure if correct...
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1027
diff changeset
   299
(* Not needed anymore *)
1027
163d6917af62 LF ported to alpha_gen, equivp solved and one of the missing proofs in support<-> fv solved. Still some supp properties left.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1022
diff changeset
   300
lemma supp_kpi_pre: "supp (KPI A x K) = (supp (Abs {atom x} K)) \<union> supp A"
1240
9348581d7d92 Rename also the lifted types to non-capital.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1239
diff changeset
   301
apply (simp add: permute_set_eq supp_def Abs_eq_iff kind_ty_trm_INJECT)
1036
aaac8274f08c The alpha-equivalence relation for let-rec. Not sure if correct...
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1027
diff changeset
   302
apply (simp add: alpha_gen supp_fv)
aaac8274f08c The alpha-equivalence relation for let-rec. Not sure if correct...
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1027
diff changeset
   303
apply (simp add: Collect_imp_eq Collect_neg_eq add: atom_eqvt Set.Un_commute)
997
b7d259ded92e Ported LF to the generic lambda and solved the simpler _supp cases.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 994
diff changeset
   304
done
994
333c24bd595d More in the LF example in the new nominal way, all is clear until support.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 993
diff changeset
   305
1234
1240d5eb275d LF renaming part1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1219
diff changeset
   306
lemma supp_rkind_rty_rtrm:
994
333c24bd595d More in the LF example in the new nominal way, all is clear until support.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 993
diff changeset
   307
 "supp TYP = {}"
333c24bd595d More in the LF example in the new nominal way, all is clear until support.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 993
diff changeset
   308
 "supp (KPI A x K) = supp A \<union> (supp K - {atom x})"
333c24bd595d More in the LF example in the new nominal way, all is clear until support.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 993
diff changeset
   309
 "supp (TCONST i) = {atom i}"
333c24bd595d More in the LF example in the new nominal way, all is clear until support.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 993
diff changeset
   310
 "supp (TAPP A M) = supp A \<union> supp M"
333c24bd595d More in the LF example in the new nominal way, all is clear until support.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 993
diff changeset
   311
 "supp (TPI A x B) = supp A \<union> (supp B - {atom x})"
333c24bd595d More in the LF example in the new nominal way, all is clear until support.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 993
diff changeset
   312
 "supp (CONS i) = {atom i}"
333c24bd595d More in the LF example in the new nominal way, all is clear until support.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 993
diff changeset
   313
 "supp (VAR x) = {atom x}"
333c24bd595d More in the LF example in the new nominal way, all is clear until support.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 993
diff changeset
   314
 "supp (APP M N) = supp M \<union> supp N"
333c24bd595d More in the LF example in the new nominal way, all is clear until support.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 993
diff changeset
   315
 "supp (LAM A x M) = supp A \<union> (supp M - {atom x})"
1234
1240d5eb275d LF renaming part1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1219
diff changeset
   316
apply (simp_all only: supp_rkind_rty_rtrm_easy)
1236
ca3c69545a78 LF renaming part 2 (proper fv functions)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1234
diff changeset
   317
apply (simp_all only: supp_fv fv_kind_ty_trm)
1036
aaac8274f08c The alpha-equivalence relation for let-rec. Not sure if correct...
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1027
diff changeset
   318
done
994
333c24bd595d More in the LF example in the new nominal way, all is clear until support.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 993
diff changeset
   319
985
ef8a2b0b237a Ported existing part of LF to new permutations and alphas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   320
end
ef8a2b0b237a Ported existing part of LF to new permutations and alphas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   321
ef8a2b0b237a Ported existing part of LF to new permutations and alphas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   322
ef8a2b0b237a Ported existing part of LF to new permutations and alphas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   323
ef8a2b0b237a Ported existing part of LF to new permutations and alphas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   324