Quot/Nominal/LamEx.thy
author Cezary Kaliszyk <kaliszyk@in.tum.de>
Mon, 01 Feb 2010 15:45:40 +0100
changeset 1009 2ebfbd861846
parent 997 b7d259ded92e
child 1011 1dd314a00b0c
permissions -rw-r--r--
Lambda based on alpha_gen, under construction.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
947
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     1
theory LamEx
1009
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
     2
imports "Nominal2_Atoms" "Nominal2_Eqvt" "Nominal2_Supp" "../QuotMain" "Abs" "../QuotProd"
947
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     3
begin
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     4
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     5
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     6
(* lemmas that should be in Nominal \<dots>\<dots>must be cleaned *)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     7
lemma in_permute_iff:
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     8
  shows "(p \<bullet> x) \<in> (p \<bullet> X) \<longleftrightarrow> x \<in> X"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     9
apply(unfold mem_def permute_fun_def)[1]
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    10
apply(simp add: permute_bool_def) 
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    11
done
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    12
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    13
lemma fresh_star_permute_iff:
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    14
  shows "(p \<bullet> a) \<sharp>* (p \<bullet> x) \<longleftrightarrow> a \<sharp>* x"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    15
apply(simp add: fresh_star_def)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    16
apply(auto)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    17
apply(drule_tac x="p \<bullet> xa" in bspec)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    18
apply(unfold mem_def permute_fun_def)[1] 
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    19
apply(simp add: eqvts)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    20
apply(simp add: fresh_permute_iff)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    21
apply(rule_tac ?p1="- p" in fresh_permute_iff[THEN iffD1])
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    22
apply(simp)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    23
apply(drule_tac x="- p \<bullet> xa" in bspec)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    24
apply(rule_tac ?p1="p" in in_permute_iff[THEN iffD1])
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    25
apply(simp)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    26
apply(simp)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    27
done
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    28
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    29
lemma fresh_plus:
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    30
  fixes p q::perm
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    31
  shows "\<lbrakk>a \<sharp> p;  a \<sharp> q\<rbrakk> \<Longrightarrow> a \<sharp> (p + q)"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    32
unfolding fresh_def
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    33
using supp_plus_perm
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    34
apply(auto)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    35
done
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    36
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    37
lemma fresh_star_plus:
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    38
  fixes p q::perm
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    39
  shows "\<lbrakk>a \<sharp>* p;  a \<sharp>* q\<rbrakk> \<Longrightarrow> a \<sharp>* (p + q)"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    40
unfolding fresh_star_def
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    41
by (simp add: fresh_plus)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    42
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents: 983
diff changeset
    43
lemma supp_finite_set:
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents: 983
diff changeset
    44
  fixes S::"atom set"
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents: 983
diff changeset
    45
  assumes "finite S"
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents: 983
diff changeset
    46
  shows "supp S = S"
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents: 983
diff changeset
    47
  apply(rule finite_supp_unique)
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents: 983
diff changeset
    48
  apply(simp add: supports_def)
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents: 983
diff changeset
    49
  apply(auto simp add: permute_set_eq swap_atom)[1]
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents: 983
diff changeset
    50
  apply(metis)
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents: 983
diff changeset
    51
  apply(rule assms)
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents: 983
diff changeset
    52
  apply(auto simp add: permute_set_eq swap_atom)[1]
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents: 983
diff changeset
    53
done
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents: 983
diff changeset
    54
  
947
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    55
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    56
atom_decl name
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    57
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    58
datatype rlam =
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    59
  rVar "name"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    60
| rApp "rlam" "rlam"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    61
| rLam "name" "rlam"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    62
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    63
fun
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    64
  rfv :: "rlam \<Rightarrow> atom set"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    65
where
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    66
  rfv_var: "rfv (rVar a) = {atom a}"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    67
| rfv_app: "rfv (rApp t1 t2) = (rfv t1) \<union> (rfv t2)"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    68
| rfv_lam: "rfv (rLam a t) = (rfv t) - {atom a}"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    69
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    70
instantiation rlam :: pt
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    71
begin
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    72
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    73
primrec
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    74
  permute_rlam
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    75
where
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    76
  "permute_rlam pi (rVar a) = rVar (pi \<bullet> a)"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    77
| "permute_rlam pi (rApp t1 t2) = rApp (permute_rlam pi t1) (permute_rlam pi t2)"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    78
| "permute_rlam pi (rLam a t) = rLam (pi \<bullet> a) (permute_rlam pi t)"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    79
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    80
instance
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    81
apply default
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    82
apply(induct_tac [!] x)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    83
apply(simp_all)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    84
done
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    85
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    86
end
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    87
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    88
instantiation rlam :: fs
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    89
begin
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    90
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    91
lemma neg_conj:
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    92
  "\<not>(P \<and> Q) \<longleftrightarrow> (\<not>P) \<or> (\<not>Q)"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    93
  by simp
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    94
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    95
lemma infinite_Un:
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    96
  "infinite (S \<union> T) \<longleftrightarrow> infinite S \<or> infinite T"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    97
  by simp
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    98
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    99
instance
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   100
apply default
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   101
apply(induct_tac x)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   102
(* var case *)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   103
apply(simp add: supp_def)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   104
apply(fold supp_def)[1]
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   105
apply(simp add: supp_at_base)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   106
(* app case *)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   107
apply(simp only: supp_def)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   108
apply(simp only: permute_rlam.simps) 
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   109
apply(simp only: rlam.inject) 
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   110
apply(simp only: neg_conj)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   111
apply(simp only: Collect_disj_eq)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   112
apply(simp only: infinite_Un)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   113
apply(simp only: Collect_disj_eq)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   114
apply(simp)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   115
(* lam case *)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   116
apply(simp only: supp_def)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   117
apply(simp only: permute_rlam.simps) 
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   118
apply(simp only: rlam.inject) 
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   119
apply(simp only: neg_conj)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   120
apply(simp only: Collect_disj_eq)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   121
apply(simp only: infinite_Un)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   122
apply(simp only: Collect_disj_eq)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   123
apply(simp)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   124
apply(fold supp_def)[1]
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   125
apply(simp add: supp_at_base)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   126
done
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   127
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   128
end
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   129
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   130
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   131
(* for the eqvt proof of the alpha-equivalence *)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   132
declare permute_rlam.simps[eqvt]
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   133
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   134
lemma rfv_eqvt[eqvt]:
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   135
  shows "(pi\<bullet>rfv t) = rfv (pi\<bullet>t)"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   136
apply(induct t)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   137
apply(simp_all)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   138
apply(simp add: permute_set_eq atom_eqvt)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   139
apply(simp add: union_eqvt)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   140
apply(simp add: Diff_eqvt)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   141
apply(simp add: permute_set_eq atom_eqvt)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   142
done
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   143
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   144
inductive
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   145
    alpha :: "rlam \<Rightarrow> rlam \<Rightarrow> bool" ("_ \<approx> _" [100, 100] 100)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   146
where
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   147
  a1: "a = b \<Longrightarrow> (rVar a) \<approx> (rVar b)"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   148
| a2: "\<lbrakk>t1 \<approx> t2; s1 \<approx> s2\<rbrakk> \<Longrightarrow> rApp t1 s1 \<approx> rApp t2 s2"
1009
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   149
| a3: "\<exists>pi. (({atom a}, t) \<approx>gen alpha rfv pi ({atom b}, s)) \<Longrightarrow> rLam a t \<approx> rLam b s"
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   150
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   151
thm alpha.induct
947
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   152
989
af02b193a19a the supp of a lambda can now be characterised, *provided* the notion of free variables coincides with support on lambda terms
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   153
lemma a3_inverse:
af02b193a19a the supp of a lambda can now be characterised, *provided* the notion of free variables coincides with support on lambda terms
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   154
  assumes "rLam a t \<approx> rLam b s"
1009
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   155
  shows "\<exists>pi. (({atom a}, t) \<approx>gen alpha rfv pi ({atom b}, s))"
989
af02b193a19a the supp of a lambda can now be characterised, *provided* the notion of free variables coincides with support on lambda terms
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   156
using assms
af02b193a19a the supp of a lambda can now be characterised, *provided* the notion of free variables coincides with support on lambda terms
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   157
apply(erule_tac alpha.cases)
af02b193a19a the supp of a lambda can now be characterised, *provided* the notion of free variables coincides with support on lambda terms
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   158
apply(auto)
af02b193a19a the supp of a lambda can now be characterised, *provided* the notion of free variables coincides with support on lambda terms
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   159
done
af02b193a19a the supp of a lambda can now be characterised, *provided* the notion of free variables coincides with support on lambda terms
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   160
947
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   161
text {* should be automatic with new version of eqvt-machinery *}
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   162
lemma alpha_eqvt:
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   163
  shows "t \<approx> s \<Longrightarrow> (pi \<bullet> t) \<approx> (pi \<bullet> s)"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   164
apply(induct rule: alpha.induct)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   165
apply(simp add: a1)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   166
apply(simp add: a2)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   167
apply(simp)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   168
apply(rule a3)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   169
apply(erule exE)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   170
apply(rule_tac x="pi \<bullet> pia" in exI)
1009
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   171
apply(simp add: alpha_gen.simps)
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   172
apply(erule conjE)+
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   173
apply(rule conjI)+
947
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   174
apply(rule_tac ?p1="- pi" in permute_eq_iff[THEN iffD1])
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   175
apply(simp add: eqvts atom_eqvt)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   176
apply(rule conjI)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   177
apply(rule_tac ?p1="- pi" in fresh_star_permute_iff[THEN iffD1])
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   178
apply(simp add: eqvts atom_eqvt)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   179
apply(subst permute_eqvt[symmetric])
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   180
apply(simp)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   181
done
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   182
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   183
lemma alpha_refl:
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   184
  shows "t \<approx> t"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   185
apply(induct t rule: rlam.induct)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   186
apply(simp add: a1)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   187
apply(simp add: a2)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   188
apply(rule a3)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   189
apply(rule_tac x="0" in exI)
1009
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   190
apply(rule alpha_gen_refl)
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   191
apply(assumption)
947
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   192
done
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   193
1009
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   194
lemma fresh_minus_perm:
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   195
  fixes p::perm
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   196
  shows "a \<sharp> (- p) \<longleftrightarrow> a \<sharp> p"
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   197
  apply(simp add: fresh_def)
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   198
  apply(simp only: supp_minus_perm)
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   199
  done
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   200
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   201
lemma alpha_gen_atom_sym:
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   202
  assumes a: "\<And>pi t s. (R t s \<Longrightarrow> R (pi \<bullet> t) (pi \<bullet> s))"
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   203
  shows "\<exists>pi. ({atom a}, t) \<approx>gen \<lambda>x1 x2. R x1 x2 \<and> R x2 x1 f pi ({atom b}, s) \<Longrightarrow>
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   204
       \<exists>pi. ({atom b}, s) \<approx>gen R f pi ({atom a}, t)"
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   205
  apply(erule exE)
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   206
  apply(rule_tac x="- pi" in exI)
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   207
  apply(simp add: alpha_gen.simps)
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   208
  apply(erule conjE)+
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   209
  apply(rule conjI)
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   210
  apply(simp add: fresh_star_def fresh_minus_perm)
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   211
  apply(subgoal_tac "R (- pi \<bullet> s) ((- pi) \<bullet> (pi \<bullet> t))")
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   212
  apply simp
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   213
  apply(rule a)
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   214
  apply assumption
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   215
  done
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   216
947
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   217
lemma alpha_sym:
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   218
  shows "t \<approx> s \<Longrightarrow> s \<approx> t"
1009
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   219
  apply(induct rule: alpha.induct)
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   220
  apply(simp add: a1)
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   221
  apply(simp add: a2)
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   222
  apply(rule a3)
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   223
  apply(rule alpha_gen_atom_sym)
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   224
  apply(rule alpha_eqvt)
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   225
  apply(assumption)+
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   226
  done
947
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   227
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   228
lemma alpha_trans:
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   229
  shows "t1 \<approx> t2 \<Longrightarrow> t2 \<approx> t3 \<Longrightarrow> t1 \<approx> t3"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   230
apply(induct arbitrary: t3 rule: alpha.induct)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   231
apply(erule alpha.cases)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   232
apply(simp_all)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   233
apply(simp add: a1)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   234
apply(rotate_tac 4)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   235
apply(erule alpha.cases)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   236
apply(simp_all)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   237
apply(simp add: a2)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   238
apply(rotate_tac 1)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   239
apply(erule alpha.cases)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   240
apply(simp_all)
1009
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   241
apply(simp add: alpha_gen.simps)
947
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   242
apply(erule conjE)+
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   243
apply(erule exE)+
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   244
apply(erule conjE)+
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   245
apply(rule a3)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   246
apply(rule_tac x="pia + pi" in exI)
1009
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   247
apply(simp add: alpha_gen.simps)
947
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   248
apply(simp add: fresh_star_plus)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   249
apply(drule_tac x="- pia \<bullet> sa" in spec)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   250
apply(drule mp)
989
af02b193a19a the supp of a lambda can now be characterised, *provided* the notion of free variables coincides with support on lambda terms
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   251
apply(rotate_tac 7)
947
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   252
apply(drule_tac pi="- pia" in alpha_eqvt)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   253
apply(simp)
989
af02b193a19a the supp of a lambda can now be characterised, *provided* the notion of free variables coincides with support on lambda terms
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   254
apply(rotate_tac 9)
947
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   255
apply(drule_tac pi="pia" in alpha_eqvt)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   256
apply(simp)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   257
done
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   258
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   259
lemma alpha_equivp:
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   260
  shows "equivp alpha"
981
bc739536b715 Minor when looking at lam.distinct and lam.inject
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 975
diff changeset
   261
  apply(rule equivpI)
bc739536b715 Minor when looking at lam.distinct and lam.inject
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 975
diff changeset
   262
  unfolding reflp_def symp_def transp_def
bc739536b715 Minor when looking at lam.distinct and lam.inject
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 975
diff changeset
   263
  apply(auto intro: alpha_refl alpha_sym alpha_trans)
bc739536b715 Minor when looking at lam.distinct and lam.inject
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 975
diff changeset
   264
  done
947
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   265
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   266
lemma alpha_rfv:
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   267
  shows "t \<approx> s \<Longrightarrow> rfv t = rfv s"
981
bc739536b715 Minor when looking at lam.distinct and lam.inject
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 975
diff changeset
   268
  apply(induct rule: alpha.induct)
1009
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   269
  apply(simp_all add: alpha_gen.simps)
981
bc739536b715 Minor when looking at lam.distinct and lam.inject
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 975
diff changeset
   270
  done
947
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   271
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   272
quotient_type lam = rlam / alpha
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   273
  by (rule alpha_equivp)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   274
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   275
quotient_definition
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   276
  "Var :: name \<Rightarrow> lam"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   277
as
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   278
  "rVar"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   279
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   280
quotient_definition
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   281
   "App :: lam \<Rightarrow> lam \<Rightarrow> lam"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   282
as
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   283
  "rApp"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   284
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   285
quotient_definition
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   286
  "Lam :: name \<Rightarrow> lam \<Rightarrow> lam"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   287
as
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   288
  "rLam"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   289
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   290
quotient_definition
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   291
  "fv :: lam \<Rightarrow> atom set"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   292
as
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   293
  "rfv"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   294
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   295
lemma perm_rsp[quot_respect]:
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   296
  "(op = ===> alpha ===> alpha) permute permute"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   297
  apply(auto)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   298
  apply(rule alpha_eqvt)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   299
  apply(simp)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   300
  done
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   301
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   302
lemma rVar_rsp[quot_respect]:
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   303
  "(op = ===> alpha) rVar rVar"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   304
  by (auto intro: a1)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   305
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   306
lemma rApp_rsp[quot_respect]: 
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   307
  "(alpha ===> alpha ===> alpha) rApp rApp"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   308
  by (auto intro: a2)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   309
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   310
lemma rLam_rsp[quot_respect]: 
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   311
  "(op = ===> alpha ===> alpha) rLam rLam"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   312
  apply(auto)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   313
  apply(rule a3)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   314
  apply(rule_tac x="0" in exI)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   315
  unfolding fresh_star_def 
1009
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   316
  apply(simp add: fresh_star_def fresh_zero_perm alpha_gen.simps)
947
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   317
  apply(simp add: alpha_rfv)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   318
  done
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   319
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   320
lemma rfv_rsp[quot_respect]: 
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   321
  "(alpha ===> op =) rfv rfv"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   322
apply(simp add: alpha_rfv)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   323
done
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   324
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   325
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   326
section {* lifted theorems *}
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   327
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   328
lemma lam_induct:
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   329
  "\<lbrakk>\<And>name. P (Var name);
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   330
    \<And>lam1 lam2. \<lbrakk>P lam1; P lam2\<rbrakk> \<Longrightarrow> P (App lam1 lam2);
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   331
    \<And>name lam. P lam \<Longrightarrow> P (Lam name lam)\<rbrakk> 
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   332
    \<Longrightarrow> P lam"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   333
  apply (lifting rlam.induct)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   334
  done
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   335
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   336
instantiation lam :: pt
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   337
begin
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   338
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   339
quotient_definition
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   340
  "permute_lam :: perm \<Rightarrow> lam \<Rightarrow> lam"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   341
as
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   342
  "permute :: perm \<Rightarrow> rlam \<Rightarrow> rlam"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   343
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   344
lemma permute_lam [simp]:
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   345
  shows "pi \<bullet> Var a = Var (pi \<bullet> a)"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   346
  and   "pi \<bullet> App t1 t2 = App (pi \<bullet> t1) (pi \<bullet> t2)"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   347
  and   "pi \<bullet> Lam a t = Lam (pi \<bullet> a) (pi \<bullet> t)"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   348
apply(lifting permute_rlam.simps)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   349
done
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   350
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   351
instance
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   352
apply default
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   353
apply(induct_tac [!] x rule: lam_induct)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   354
apply(simp_all)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   355
done
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   356
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   357
end
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   358
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   359
lemma fv_lam [simp]: 
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   360
  shows "fv (Var a) = {atom a}"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   361
  and   "fv (App t1 t2) = fv t1 \<union> fv t2"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   362
  and   "fv (Lam a t) = fv t - {atom a}"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   363
apply(lifting rfv_var rfv_app rfv_lam)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   364
done
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   365
990
c25ff084868f now also final step is proved - the supp of lambdas is now completely characterised
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   366
lemma fv_eqvt:
c25ff084868f now also final step is proved - the supp of lambdas is now completely characterised
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   367
  shows "(p \<bullet> fv t) = fv (p \<bullet> t)"
c25ff084868f now also final step is proved - the supp of lambdas is now completely characterised
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   368
apply(lifting rfv_eqvt)
c25ff084868f now also final step is proved - the supp of lambdas is now completely characterised
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   369
done
c25ff084868f now also final step is proved - the supp of lambdas is now completely characterised
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   370
947
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   371
lemma a1: 
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   372
  "a = b \<Longrightarrow> Var a = Var b"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   373
  by  (lifting a1)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   374
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   375
lemma a2: 
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   376
  "\<lbrakk>x = xa; xb = xc\<rbrakk> \<Longrightarrow> App x xb = App xa xc"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   377
  by  (lifting a2)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   378
1009
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   379
lemma alpha_gen_rsp_pre:
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   380
  assumes a5: "\<And>t s. R t s \<Longrightarrow> R (pi \<bullet> t) (pi \<bullet> s)"
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   381
  and     a1: "R s1 t1"
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   382
  and     a2: "R s2 t2"
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   383
  and     a3: "\<And>a b c d. R a b \<Longrightarrow> R c d \<Longrightarrow> R1 a c = R2 b d"
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   384
  and     a4: "\<And>x y. R x y \<Longrightarrow> fv1 x = fv2 y"
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   385
  shows   "(a, s1) \<approx>gen R1 fv1 pi (b, s2) = (a, t1) \<approx>gen R2 fv2 pi (b, t2)"
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   386
apply (simp add: alpha_gen.simps)
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   387
apply (simp only: a4[symmetric, OF a1] a4[symmetric, OF a2])
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   388
apply auto
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   389
apply (subst a3[symmetric])
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   390
apply (rule a5)
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   391
apply (rule a1)
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   392
apply (rule a2)
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   393
apply (assumption)
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   394
apply (subst a3)
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   395
apply (rule a5)
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   396
apply (rule a1)
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   397
apply (rule a2)
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   398
apply (assumption)
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   399
done
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   400
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   401
lemma [quot_respect]: "(prod_rel op = alpha ===>
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   402
           (alpha ===> alpha ===> op =) ===> (alpha ===> op =) ===> op = ===> prod_rel op = alpha ===> op =)
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   403
           alpha_gen alpha_gen"
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   404
apply simp
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   405
apply clarify
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   406
apply (rule alpha_gen_rsp_pre[of "alpha",OF alpha_eqvt])
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   407
apply auto
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   408
done
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   409
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   410
lemma pi_rep: "pi \<bullet> (rep_lam x) = rep_lam (pi \<bullet> x)"
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   411
apply (unfold rep_lam_def)
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   412
sorry
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   413
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   414
lemma [quot_preserve]: "(prod_fun id rep_lam --->
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   415
           (abs_lam ---> abs_lam ---> id) ---> (abs_lam ---> id) ---> id ---> (prod_fun id rep_lam) ---> id)
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   416
           alpha_gen = alpha_gen"
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   417
apply (simp add: expand_fun_eq)
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   418
apply (simp add: alpha_gen.simps)
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   419
apply (simp add: pi_rep)
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   420
apply (simp only: Quotient_abs_rep[OF Quotient_lam])
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   421
apply auto
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   422
done
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   423
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   424
lemma alpha_prs [quot_preserve]: "(rep_lam ---> rep_lam ---> id) alpha = (op =)"
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   425
apply (simp add: expand_fun_eq)
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   426
sledgehammer
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   427
sorry
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   428
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   429
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   430
lemma a3:
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   431
  "\<exists>pi. ({atom a}, t) \<approx>gen (op =) fv pi ({atom b}, s) \<Longrightarrow> Lam a t = Lam b s"
2ebfbd861846 Lambda based on alpha_gen, under construction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 997
diff changeset
   432
  apply (lifting a3)
947
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   433
  done
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   434
989
af02b193a19a the supp of a lambda can now be characterised, *provided* the notion of free variables coincides with support on lambda terms
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   435
lemma a3_inv:
af02b193a19a the supp of a lambda can now be characterised, *provided* the notion of free variables coincides with support on lambda terms
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   436
  assumes "Lam a t = Lam b s"
af02b193a19a the supp of a lambda can now be characterised, *provided* the notion of free variables coincides with support on lambda terms
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   437
  shows "\<exists>pi. (fv t - {atom a} = fv s - {atom b} \<and> (fv t - {atom a})\<sharp>* pi \<and> (pi \<bullet> t) = s)"
af02b193a19a the supp of a lambda can now be characterised, *provided* the notion of free variables coincides with support on lambda terms
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   438
using assms
af02b193a19a the supp of a lambda can now be characterised, *provided* the notion of free variables coincides with support on lambda terms
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   439
apply(lifting a3_inverse)
af02b193a19a the supp of a lambda can now be characterised, *provided* the notion of free variables coincides with support on lambda terms
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   440
done
af02b193a19a the supp of a lambda can now be characterised, *provided* the notion of free variables coincides with support on lambda terms
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   441
947
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   442
lemma alpha_cases: 
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   443
  "\<lbrakk>a1 = a2; \<And>a b. \<lbrakk>a1 = Var a; a2 = Var b; a = b\<rbrakk> \<Longrightarrow> P;
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   444
    \<And>x xa xb xc. \<lbrakk>a1 = App x xb; a2 = App xa xc; x = xa; xb = xc\<rbrakk> \<Longrightarrow> P;
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   445
    \<And>t a s b. \<lbrakk>a1 = Lam a t; a2 = Lam b s; 
989
af02b193a19a the supp of a lambda can now be characterised, *provided* the notion of free variables coincides with support on lambda terms
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   446
         \<exists>pi. fv t - {atom a} = fv s - {atom b} \<and> (fv t - {atom a}) \<sharp>* pi \<and> (pi \<bullet> t) = s\<rbrakk> 
947
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   447
   \<Longrightarrow> P\<rbrakk>
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   448
    \<Longrightarrow> P"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   449
  by (lifting alpha.cases)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   450
975
513ebe332964 test about supp/freshness for lam (old proofs work in principle - for single binders)
Christian Urban <urbanc@in.tum.de>
parents: 947
diff changeset
   451
(* not sure whether needed *)
947
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   452
lemma alpha_induct: 
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   453
  "\<lbrakk>qx = qxa; \<And>a b. a = b \<Longrightarrow> qxb (Var a) (Var b);
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   454
    \<And>x xa xb xc. \<lbrakk>x = xa; qxb x xa; xb = xc; qxb xb xc\<rbrakk> \<Longrightarrow> qxb (App x xb) (App xa xc);
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   455
     \<And>t a s b.
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   456
        \<lbrakk>\<exists>pi. fv t - {atom a} = fv s - {atom b} \<and>
989
af02b193a19a the supp of a lambda can now be characterised, *provided* the notion of free variables coincides with support on lambda terms
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   457
         (fv t - {atom a}) \<sharp>* pi \<and> ((pi \<bullet> t) = s \<and> qxb (pi \<bullet> t) s)\<rbrakk> 
947
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   458
     \<Longrightarrow> qxb (Lam a t) (Lam b s)\<rbrakk>
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   459
    \<Longrightarrow> qxb qx qxa"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   460
  by (lifting alpha.induct)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   461
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   462
(* should they lift automatically *)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   463
lemma lam_inject [simp]: 
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   464
  shows "(Var a = Var b) = (a = b)"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   465
  and   "(App t1 t2 = App s1 s2) = (t1 = s1 \<and> t2 = s2)"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   466
apply(lifting rlam.inject(1) rlam.inject(2))
981
bc739536b715 Minor when looking at lam.distinct and lam.inject
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 975
diff changeset
   467
apply(regularize)
bc739536b715 Minor when looking at lam.distinct and lam.inject
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 975
diff changeset
   468
prefer 2
bc739536b715 Minor when looking at lam.distinct and lam.inject
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 975
diff changeset
   469
apply(regularize)
bc739536b715 Minor when looking at lam.distinct and lam.inject
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 975
diff changeset
   470
prefer 2
947
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   471
apply(auto)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   472
apply(drule alpha.cases)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   473
apply(simp_all)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   474
apply(simp add: alpha.a1)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   475
apply(drule alpha.cases)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   476
apply(simp_all)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   477
apply(drule alpha.cases)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   478
apply(simp_all)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   479
apply(rule alpha.a2)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   480
apply(simp_all)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   481
done
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   482
989
af02b193a19a the supp of a lambda can now be characterised, *provided* the notion of free variables coincides with support on lambda terms
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   483
lemma Lam_pseudo_inject:
af02b193a19a the supp of a lambda can now be characterised, *provided* the notion of free variables coincides with support on lambda terms
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   484
  shows "(Lam a t = Lam b s) = 
af02b193a19a the supp of a lambda can now be characterised, *provided* the notion of free variables coincides with support on lambda terms
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   485
      (\<exists>pi. (fv t - {atom a} = fv s - {atom b} \<and> (fv t - {atom a})\<sharp>* pi \<and> (pi \<bullet> t) = s))"
af02b193a19a the supp of a lambda can now be characterised, *provided* the notion of free variables coincides with support on lambda terms
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   486
apply(rule iffI)
af02b193a19a the supp of a lambda can now be characterised, *provided* the notion of free variables coincides with support on lambda terms
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   487
apply(rule a3_inv)
af02b193a19a the supp of a lambda can now be characterised, *provided* the notion of free variables coincides with support on lambda terms
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   488
apply(assumption)
af02b193a19a the supp of a lambda can now be characterised, *provided* the notion of free variables coincides with support on lambda terms
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   489
apply(rule a3)
af02b193a19a the supp of a lambda can now be characterised, *provided* the notion of free variables coincides with support on lambda terms
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   490
apply(assumption)
af02b193a19a the supp of a lambda can now be characterised, *provided* the notion of free variables coincides with support on lambda terms
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   491
done
af02b193a19a the supp of a lambda can now be characterised, *provided* the notion of free variables coincides with support on lambda terms
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   492
947
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   493
lemma rlam_distinct:
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   494
  shows "\<not>(rVar nam \<approx> rApp rlam1' rlam2')"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   495
  and   "\<not>(rApp rlam1' rlam2' \<approx> rVar nam)"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   496
  and   "\<not>(rVar nam \<approx> rLam nam' rlam')"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   497
  and   "\<not>(rLam nam' rlam' \<approx> rVar nam)"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   498
  and   "\<not>(rApp rlam1 rlam2 \<approx> rLam nam' rlam')"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   499
  and   "\<not>(rLam nam' rlam' \<approx> rApp rlam1 rlam2)"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   500
apply auto
981
bc739536b715 Minor when looking at lam.distinct and lam.inject
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 975
diff changeset
   501
apply (erule alpha.cases)
bc739536b715 Minor when looking at lam.distinct and lam.inject
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 975
diff changeset
   502
apply (simp_all only: rlam.distinct)
bc739536b715 Minor when looking at lam.distinct and lam.inject
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 975
diff changeset
   503
apply (erule alpha.cases)
bc739536b715 Minor when looking at lam.distinct and lam.inject
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 975
diff changeset
   504
apply (simp_all only: rlam.distinct)
bc739536b715 Minor when looking at lam.distinct and lam.inject
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 975
diff changeset
   505
apply (erule alpha.cases)
bc739536b715 Minor when looking at lam.distinct and lam.inject
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 975
diff changeset
   506
apply (simp_all only: rlam.distinct)
bc739536b715 Minor when looking at lam.distinct and lam.inject
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 975
diff changeset
   507
apply (erule alpha.cases)
bc739536b715 Minor when looking at lam.distinct and lam.inject
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 975
diff changeset
   508
apply (simp_all only: rlam.distinct)
bc739536b715 Minor when looking at lam.distinct and lam.inject
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 975
diff changeset
   509
apply (erule alpha.cases)
bc739536b715 Minor when looking at lam.distinct and lam.inject
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 975
diff changeset
   510
apply (simp_all only: rlam.distinct)
bc739536b715 Minor when looking at lam.distinct and lam.inject
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 975
diff changeset
   511
apply (erule alpha.cases)
bc739536b715 Minor when looking at lam.distinct and lam.inject
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 975
diff changeset
   512
apply (simp_all only: rlam.distinct)
947
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   513
done
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   514
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   515
lemma lam_distinct[simp]:
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   516
  shows "Var nam \<noteq> App lam1' lam2'"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   517
  and   "App lam1' lam2' \<noteq> Var nam"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   518
  and   "Var nam \<noteq> Lam nam' lam'"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   519
  and   "Lam nam' lam' \<noteq> Var nam"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   520
  and   "App lam1 lam2 \<noteq> Lam nam' lam'"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   521
  and   "Lam nam' lam' \<noteq> App lam1 lam2"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   522
apply(lifting rlam_distinct(1) rlam_distinct(2) rlam_distinct(3) rlam_distinct(4) rlam_distinct(5) rlam_distinct(6))
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   523
done
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   524
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   525
lemma var_supp1:
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   526
  shows "(supp (Var a)) = (supp a)"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   527
  apply (simp add: supp_def)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   528
  done
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   529
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   530
lemma var_supp:
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   531
  shows "(supp (Var a)) = {a:::name}"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   532
  using var_supp1 by (simp add: supp_at_base)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   533
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   534
lemma app_supp:
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   535
  shows "supp (App t1 t2) = (supp t1) \<union> (supp t2)"
997
b7d259ded92e Ported LF to the generic lambda and solved the simpler _supp cases.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 995
diff changeset
   536
apply(simp only: supp_def lam_inject)
947
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   537
apply(simp add: Collect_imp_eq Collect_neg_eq)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   538
done
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   539
990
c25ff084868f now also final step is proved - the supp of lambdas is now completely characterised
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   540
(* supp for lam *)
975
513ebe332964 test about supp/freshness for lam (old proofs work in principle - for single binders)
Christian Urban <urbanc@in.tum.de>
parents: 947
diff changeset
   541
lemma lam_supp1:
513ebe332964 test about supp/freshness for lam (old proofs work in principle - for single binders)
Christian Urban <urbanc@in.tum.de>
parents: 947
diff changeset
   542
  shows "(supp (atom x, t)) supports (Lam x t) "
513ebe332964 test about supp/freshness for lam (old proofs work in principle - for single binders)
Christian Urban <urbanc@in.tum.de>
parents: 947
diff changeset
   543
apply(simp add: supports_def)
513ebe332964 test about supp/freshness for lam (old proofs work in principle - for single binders)
Christian Urban <urbanc@in.tum.de>
parents: 947
diff changeset
   544
apply(fold fresh_def)
513ebe332964 test about supp/freshness for lam (old proofs work in principle - for single binders)
Christian Urban <urbanc@in.tum.de>
parents: 947
diff changeset
   545
apply(simp add: fresh_Pair swap_fresh_fresh)
513ebe332964 test about supp/freshness for lam (old proofs work in principle - for single binders)
Christian Urban <urbanc@in.tum.de>
parents: 947
diff changeset
   546
apply(clarify)
513ebe332964 test about supp/freshness for lam (old proofs work in principle - for single binders)
Christian Urban <urbanc@in.tum.de>
parents: 947
diff changeset
   547
apply(subst swap_at_base_simps(3))
513ebe332964 test about supp/freshness for lam (old proofs work in principle - for single binders)
Christian Urban <urbanc@in.tum.de>
parents: 947
diff changeset
   548
apply(simp_all add: fresh_atom)
513ebe332964 test about supp/freshness for lam (old proofs work in principle - for single binders)
Christian Urban <urbanc@in.tum.de>
parents: 947
diff changeset
   549
done
947
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   550
975
513ebe332964 test about supp/freshness for lam (old proofs work in principle - for single binders)
Christian Urban <urbanc@in.tum.de>
parents: 947
diff changeset
   551
lemma lam_fsupp1:
513ebe332964 test about supp/freshness for lam (old proofs work in principle - for single binders)
Christian Urban <urbanc@in.tum.de>
parents: 947
diff changeset
   552
  assumes a: "finite (supp t)"
513ebe332964 test about supp/freshness for lam (old proofs work in principle - for single binders)
Christian Urban <urbanc@in.tum.de>
parents: 947
diff changeset
   553
  shows "finite (supp (Lam x t))"
513ebe332964 test about supp/freshness for lam (old proofs work in principle - for single binders)
Christian Urban <urbanc@in.tum.de>
parents: 947
diff changeset
   554
apply(rule supports_finite)
513ebe332964 test about supp/freshness for lam (old proofs work in principle - for single binders)
Christian Urban <urbanc@in.tum.de>
parents: 947
diff changeset
   555
apply(rule lam_supp1)
513ebe332964 test about supp/freshness for lam (old proofs work in principle - for single binders)
Christian Urban <urbanc@in.tum.de>
parents: 947
diff changeset
   556
apply(simp add: a supp_Pair supp_atom)
513ebe332964 test about supp/freshness for lam (old proofs work in principle - for single binders)
Christian Urban <urbanc@in.tum.de>
parents: 947
diff changeset
   557
done
947
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   558
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   559
instance lam :: fs
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   560
apply(default)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   561
apply(induct_tac x rule: lam_induct)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   562
apply(simp add: var_supp)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   563
apply(simp add: app_supp)
975
513ebe332964 test about supp/freshness for lam (old proofs work in principle - for single binders)
Christian Urban <urbanc@in.tum.de>
parents: 947
diff changeset
   564
apply(simp add: lam_fsupp1)
947
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   565
done
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   566
990
c25ff084868f now also final step is proved - the supp of lambdas is now completely characterised
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   567
lemma supp_fv:
c25ff084868f now also final step is proved - the supp of lambdas is now completely characterised
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   568
  shows "supp t = fv t"
c25ff084868f now also final step is proved - the supp of lambdas is now completely characterised
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   569
apply(induct t rule: lam_induct)
c25ff084868f now also final step is proved - the supp of lambdas is now completely characterised
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   570
apply(simp add: var_supp)
c25ff084868f now also final step is proved - the supp of lambdas is now completely characterised
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   571
apply(simp add: app_supp)
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 990
diff changeset
   572
apply(subgoal_tac "supp (Lam name lam) = supp (Abst {atom name} lam)")
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 990
diff changeset
   573
apply(simp add: supp_Abst)
990
c25ff084868f now also final step is proved - the supp of lambdas is now completely characterised
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   574
apply(simp (no_asm) add: supp_def permute_set_eq atom_eqvt)
c25ff084868f now also final step is proved - the supp of lambdas is now completely characterised
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   575
apply(simp add: Lam_pseudo_inject)
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 990
diff changeset
   576
apply(simp add: abs_eq alpha_gen)
990
c25ff084868f now also final step is proved - the supp of lambdas is now completely characterised
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   577
apply(simp add: supp_eqvt[symmetric] fv_eqvt[symmetric])
c25ff084868f now also final step is proved - the supp of lambdas is now completely characterised
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   578
done
c25ff084868f now also final step is proved - the supp of lambdas is now completely characterised
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   579
989
af02b193a19a the supp of a lambda can now be characterised, *provided* the notion of free variables coincides with support on lambda terms
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   580
lemma lam_supp2:
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 990
diff changeset
   581
  shows "supp (Lam x t) = supp (Abst {atom x} t)"
989
af02b193a19a the supp of a lambda can now be characterised, *provided* the notion of free variables coincides with support on lambda terms
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   582
apply(simp add: supp_def permute_set_eq atom_eqvt)
af02b193a19a the supp of a lambda can now be characterised, *provided* the notion of free variables coincides with support on lambda terms
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   583
apply(simp add: Lam_pseudo_inject)
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 990
diff changeset
   584
apply(simp add: abs_eq supp_fv alpha_gen)
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 990
diff changeset
   585
done
975
513ebe332964 test about supp/freshness for lam (old proofs work in principle - for single binders)
Christian Urban <urbanc@in.tum.de>
parents: 947
diff changeset
   586
513ebe332964 test about supp/freshness for lam (old proofs work in principle - for single binders)
Christian Urban <urbanc@in.tum.de>
parents: 947
diff changeset
   587
lemma lam_supp:
513ebe332964 test about supp/freshness for lam (old proofs work in principle - for single binders)
Christian Urban <urbanc@in.tum.de>
parents: 947
diff changeset
   588
  shows "supp (Lam x t) = ((supp t) - {atom x})"
989
af02b193a19a the supp of a lambda can now be characterised, *provided* the notion of free variables coincides with support on lambda terms
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   589
apply(simp add: lam_supp2)
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 990
diff changeset
   590
apply(simp add: supp_Abst)
989
af02b193a19a the supp of a lambda can now be characterised, *provided* the notion of free variables coincides with support on lambda terms
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   591
done
975
513ebe332964 test about supp/freshness for lam (old proofs work in principle - for single binders)
Christian Urban <urbanc@in.tum.de>
parents: 947
diff changeset
   592
947
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   593
lemma fresh_lam:
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   594
  "(atom a \<sharp> Lam b t) \<longleftrightarrow> (a = b) \<or> (a \<noteq> b \<and> atom a \<sharp> t)"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   595
apply(simp add: fresh_def)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   596
apply(simp add: lam_supp)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   597
apply(auto)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   598
done
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   599
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   600
lemma lam_induct_strong:
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   601
  fixes a::"'a::fs"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   602
  assumes a1: "\<And>name b. P b (Var name)"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   603
  and     a2: "\<And>lam1 lam2 b. \<lbrakk>\<And>c. P c lam1; \<And>c. P c lam2\<rbrakk> \<Longrightarrow> P b (App lam1 lam2)"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   604
  and     a3: "\<And>name lam b. \<lbrakk>\<And>c. P c lam; (atom name) \<sharp> b\<rbrakk> \<Longrightarrow> P b (Lam name lam)"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   605
  shows "P a lam"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   606
proof -
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   607
  have "\<And>pi a. P a (pi \<bullet> lam)" 
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   608
  proof (induct lam rule: lam_induct)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   609
    case (1 name pi)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   610
    show "P a (pi \<bullet> Var name)"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   611
      apply (simp)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   612
      apply (rule a1)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   613
      done
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   614
  next
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   615
    case (2 lam1 lam2 pi)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   616
    have b1: "\<And>pi a. P a (pi \<bullet> lam1)" by fact
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   617
    have b2: "\<And>pi a. P a (pi \<bullet> lam2)" by fact
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   618
    show "P a (pi \<bullet> App lam1 lam2)"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   619
      apply (simp)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   620
      apply (rule a2)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   621
      apply (rule b1)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   622
      apply (rule b2)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   623
      done
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   624
  next
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   625
    case (3 name lam pi a)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   626
    have b: "\<And>pi a. P a (pi \<bullet> lam)" by fact
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   627
    obtain c::name where fr: "atom c\<sharp>(a, pi\<bullet>name, pi\<bullet>lam)"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   628
      apply(rule obtain_atom)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   629
      apply(auto)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   630
      sorry
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   631
    from b fr have p: "P a (Lam c (((c \<leftrightarrow> (pi \<bullet> name)) + pi)\<bullet>lam))" 
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   632
      apply -
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   633
      apply(rule a3)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   634
      apply(blast)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   635
      apply(simp add: fresh_Pair)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   636
      done
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   637
    have eq: "(atom c \<rightleftharpoons> atom (pi\<bullet>name)) \<bullet> Lam (pi \<bullet> name) (pi \<bullet> lam) = Lam (pi \<bullet> name) (pi \<bullet> lam)"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   638
      apply(rule swap_fresh_fresh)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   639
      using fr
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   640
      apply(simp add: fresh_lam fresh_Pair)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   641
      apply(simp add: fresh_lam fresh_Pair)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   642
      done
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   643
    show "P a (pi \<bullet> Lam name lam)" 
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   644
      apply (simp)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   645
      apply(subst eq[symmetric])
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   646
      using p
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   647
      apply(simp only: permute_lam)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   648
      apply(simp add: flip_def)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   649
      done
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   650
  qed
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   651
  then have "P a (0 \<bullet> lam)" by blast
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   652
  then show "P a lam" by simp 
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   653
qed
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   654
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   655
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   656
lemma var_fresh:
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   657
  fixes a::"name"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   658
  shows "(atom a \<sharp> (Var b)) = (atom a \<sharp> b)"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   659
  apply(simp add: fresh_def)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   660
  apply(simp add: var_supp1)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   661
  done
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   662
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   663
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   664
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   665
end
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   666