Quot/Nominal/LamEx.thy
author Christian Urban <urbanc@in.tum.de>
Sat, 30 Jan 2010 11:44:25 +0100
changeset 995 ee0619b5adff
parent 990 c25ff084868f
child 997 b7d259ded92e
permissions -rw-r--r--
introduced a generic alpha (but not sure whether it is helpful)
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
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
     2
imports "Nominal2_Atoms" "Nominal2_Eqvt" "Nominal2_Supp" "../QuotMain" "Abs"
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_minus_perm:
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    30
  fixes p::perm
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    31
  shows "a \<sharp> (- p) \<longleftrightarrow> a \<sharp> p"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    32
  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
    33
  apply(simp only: supp_minus_perm)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    34
  done
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    35
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    36
lemma fresh_plus:
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    37
  fixes p q::perm
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    38
  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
    39
unfolding fresh_def
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    40
using supp_plus_perm
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    41
apply(auto)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    42
done
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    43
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    44
lemma fresh_star_plus:
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    45
  fixes p q::perm
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    46
  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
    47
unfolding fresh_star_def
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    48
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
    49
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents: 983
diff changeset
    50
lemma supp_finite_set:
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents: 983
diff changeset
    51
  fixes S::"atom set"
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents: 983
diff changeset
    52
  assumes "finite S"
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents: 983
diff changeset
    53
  shows "supp S = S"
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents: 983
diff changeset
    54
  apply(rule finite_supp_unique)
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents: 983
diff changeset
    55
  apply(simp add: supports_def)
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents: 983
diff changeset
    56
  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
    57
  apply(metis)
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents: 983
diff changeset
    58
  apply(rule assms)
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents: 983
diff changeset
    59
  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
    60
done
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents: 983
diff changeset
    61
  
947
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
atom_decl name
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    64
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    65
datatype rlam =
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    66
  rVar "name"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    67
| rApp "rlam" "rlam"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    68
| rLam "name" "rlam"
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
fun
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    71
  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
    72
where
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    73
  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
    74
| 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
    75
| 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
    76
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    77
instantiation rlam :: pt
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    78
begin
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
primrec
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    81
  permute_rlam
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    82
where
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    83
  "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
    84
| "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
    85
| "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
    86
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    87
instance
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    88
apply default
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    89
apply(induct_tac [!] x)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    90
apply(simp_all)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    91
done
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    92
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    93
end
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
instantiation rlam :: fs
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    96
begin
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    97
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    98
lemma neg_conj:
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    99
  "\<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
   100
  by simp
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   101
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   102
lemma infinite_Un:
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   103
  "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
   104
  by simp
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   105
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   106
instance
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   107
apply default
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   108
apply(induct_tac x)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   109
(* var case *)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   110
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
   111
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
   112
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
   113
(* app case *)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   114
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
   115
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
   116
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
   117
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
   118
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
   119
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
   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)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   122
(* lam case *)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   123
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
   124
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
   125
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
   126
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
   127
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
   128
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
   129
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
   130
apply(simp)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   131
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
   132
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
   133
done
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   134
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   135
end
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   136
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   137
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   138
(* 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
   139
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
   140
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   141
lemma rfv_eqvt[eqvt]:
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   142
  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
   143
apply(induct t)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   144
apply(simp_all)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   145
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
   146
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
   147
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
   148
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
   149
done
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   150
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   151
inductive
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   152
    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
   153
where
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   154
  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
   155
| a2: "\<lbrakk>t1 \<approx> t2; s1 \<approx> s2\<rbrakk> \<Longrightarrow> rApp t1 s1 \<approx> rApp t2 s2"
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
| a3: "\<exists>pi. (rfv t - {atom a} = rfv s - {atom b} \<and> (rfv t - {atom a})\<sharp>* pi \<and> (pi \<bullet> t) \<approx> s)
947
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   157
       \<Longrightarrow> rLam a t \<approx> rLam b s"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   158
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
   159
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
   160
  assumes "rLam a t \<approx> rLam 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
   161
  shows "\<exists>pi. (rfv t - {atom a} = rfv s - {atom b} \<and> (rfv t - {atom a})\<sharp>* pi \<and> (pi \<bullet> t) \<approx> 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
   162
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
   163
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
   164
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
   165
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
   166
947
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   167
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
   168
lemma alpha_eqvt:
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   169
  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
   170
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
   171
apply(simp add: a1)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   172
apply(simp add: a2)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   173
apply(simp)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   174
apply(rule a3)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   175
apply(erule conjE)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   176
apply(erule exE)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   177
apply(erule conjE)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   178
apply(rule_tac x="pi \<bullet> pia" in exI)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   179
apply(rule conjI)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   180
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
   181
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
   182
apply(rule conjI)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   183
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
   184
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
   185
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
   186
apply(simp)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   187
done
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   188
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   189
lemma alpha_refl:
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   190
  shows "t \<approx> t"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   191
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
   192
apply(simp add: a1)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   193
apply(simp add: a2)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   194
apply(rule a3)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   195
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
   196
apply(simp_all add: fresh_star_def fresh_zero_perm)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   197
done
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   198
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   199
lemma alpha_sym:
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   200
  shows "t \<approx> s \<Longrightarrow> s \<approx> t"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   201
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
   202
apply(simp add: a1)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   203
apply(simp add: a2)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   204
apply(rule a3)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   205
apply(erule exE)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   206
apply(rule_tac x="- pi" in exI)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   207
apply(simp)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   208
apply(simp add: fresh_star_def fresh_minus_perm)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   209
apply(erule conjE)+
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   210
apply(rotate_tac 3)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   211
apply(drule_tac pi="- pi" in alpha_eqvt)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   212
apply(simp)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   213
done
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   214
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   215
lemma alpha_trans:
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   216
  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
   217
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
   218
apply(erule alpha.cases)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   219
apply(simp_all)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   220
apply(simp add: a1)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   221
apply(rotate_tac 4)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   222
apply(erule alpha.cases)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   223
apply(simp_all)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   224
apply(simp add: a2)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   225
apply(rotate_tac 1)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   226
apply(erule alpha.cases)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   227
apply(simp_all)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   228
apply(erule conjE)+
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   229
apply(erule exE)+
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   230
apply(erule conjE)+
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   231
apply(rule a3)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   232
apply(rule_tac x="pia + pi" in exI)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   233
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
   234
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
   235
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
   236
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
   237
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
   238
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
   239
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
   240
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
   241
apply(simp)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   242
done
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   243
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   244
lemma alpha_equivp:
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   245
  shows "equivp alpha"
981
bc739536b715 Minor when looking at lam.distinct and lam.inject
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 975
diff changeset
   246
  apply(rule equivpI)
bc739536b715 Minor when looking at lam.distinct and lam.inject
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 975
diff changeset
   247
  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
   248
  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
   249
  done
947
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   250
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   251
lemma alpha_rfv:
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   252
  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
   253
  apply(induct rule: alpha.induct)
bc739536b715 Minor when looking at lam.distinct and lam.inject
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 975
diff changeset
   254
  apply(simp_all)
bc739536b715 Minor when looking at lam.distinct and lam.inject
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 975
diff changeset
   255
  done
947
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   256
983
31b4ac97cfea attempt to prove equivalence between alpha definitions
Christian Urban <urbanc@in.tum.de>
parents: 981
diff changeset
   257
inductive
31b4ac97cfea attempt to prove equivalence between alpha definitions
Christian Urban <urbanc@in.tum.de>
parents: 981
diff changeset
   258
    alpha2 :: "rlam \<Rightarrow> rlam \<Rightarrow> bool" ("_ \<approx>2 _" [100, 100] 100)
31b4ac97cfea attempt to prove equivalence between alpha definitions
Christian Urban <urbanc@in.tum.de>
parents: 981
diff changeset
   259
where
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents: 983
diff changeset
   260
  a21: "a = b \<Longrightarrow> (rVar a) \<approx>2 (rVar b)"
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents: 983
diff changeset
   261
| a22: "\<lbrakk>t1 \<approx>2 t2; s1 \<approx>2 s2\<rbrakk> \<Longrightarrow> rApp t1 s1 \<approx>2 rApp t2 s2"
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents: 983
diff changeset
   262
| a23: "(a = b \<and> t \<approx>2 s) \<or> (a \<noteq> b \<and> ((a \<leftrightarrow> b) \<bullet> t) \<approx>2 s \<and> atom b \<notin> rfv t)\<Longrightarrow> rLam a t \<approx>2 rLam b s"
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents: 983
diff changeset
   263
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents: 983
diff changeset
   264
lemma fv_vars:
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents: 983
diff changeset
   265
  fixes a::name
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents: 983
diff changeset
   266
  assumes a1: "\<forall>x \<in> rfv t - {atom a}. pi \<bullet> x = x"
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents: 983
diff changeset
   267
  shows "(pi \<bullet> t) \<approx>2 ((a \<leftrightarrow> (pi \<bullet> a)) \<bullet> t)"
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents: 983
diff changeset
   268
using a1
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents: 983
diff changeset
   269
apply(induct t)
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents: 983
diff changeset
   270
apply(auto)
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents: 983
diff changeset
   271
apply(rule a21)
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents: 983
diff changeset
   272
apply(case_tac "name = a")
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents: 983
diff changeset
   273
apply(simp)
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents: 983
diff changeset
   274
apply(simp)
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents: 983
diff changeset
   275
defer
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents: 983
diff changeset
   276
apply(rule a22)
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents: 983
diff changeset
   277
apply(simp)
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents: 983
diff changeset
   278
apply(simp)
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents: 983
diff changeset
   279
apply(rule a23)
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents: 983
diff changeset
   280
apply(case_tac "a = name")
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents: 983
diff changeset
   281
apply(simp)
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents: 983
diff changeset
   282
oops
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents: 983
diff changeset
   283
983
31b4ac97cfea attempt to prove equivalence between alpha definitions
Christian Urban <urbanc@in.tum.de>
parents: 981
diff changeset
   284
31b4ac97cfea attempt to prove equivalence between alpha definitions
Christian Urban <urbanc@in.tum.de>
parents: 981
diff changeset
   285
lemma 
31b4ac97cfea attempt to prove equivalence between alpha definitions
Christian Urban <urbanc@in.tum.de>
parents: 981
diff changeset
   286
  assumes a1: "t \<approx>2 s"
31b4ac97cfea attempt to prove equivalence between alpha definitions
Christian Urban <urbanc@in.tum.de>
parents: 981
diff changeset
   287
  shows "t \<approx> s"
31b4ac97cfea attempt to prove equivalence between alpha definitions
Christian Urban <urbanc@in.tum.de>
parents: 981
diff changeset
   288
using a1
31b4ac97cfea attempt to prove equivalence between alpha definitions
Christian Urban <urbanc@in.tum.de>
parents: 981
diff changeset
   289
apply(induct)
31b4ac97cfea attempt to prove equivalence between alpha definitions
Christian Urban <urbanc@in.tum.de>
parents: 981
diff changeset
   290
apply(rule alpha.intros)
31b4ac97cfea attempt to prove equivalence between alpha definitions
Christian Urban <urbanc@in.tum.de>
parents: 981
diff changeset
   291
apply(simp)
31b4ac97cfea attempt to prove equivalence between alpha definitions
Christian Urban <urbanc@in.tum.de>
parents: 981
diff changeset
   292
apply(rule alpha.intros)
31b4ac97cfea attempt to prove equivalence between alpha definitions
Christian Urban <urbanc@in.tum.de>
parents: 981
diff changeset
   293
apply(simp)
31b4ac97cfea attempt to prove equivalence between alpha definitions
Christian Urban <urbanc@in.tum.de>
parents: 981
diff changeset
   294
apply(simp)
31b4ac97cfea attempt to prove equivalence between alpha definitions
Christian Urban <urbanc@in.tum.de>
parents: 981
diff changeset
   295
apply(rule alpha.intros)
31b4ac97cfea attempt to prove equivalence between alpha definitions
Christian Urban <urbanc@in.tum.de>
parents: 981
diff changeset
   296
apply(erule disjE)
31b4ac97cfea attempt to prove equivalence between alpha definitions
Christian Urban <urbanc@in.tum.de>
parents: 981
diff changeset
   297
apply(rule_tac x="0" in exI)
31b4ac97cfea attempt to prove equivalence between alpha definitions
Christian Urban <urbanc@in.tum.de>
parents: 981
diff changeset
   298
apply(simp add: fresh_star_def fresh_zero_perm)
31b4ac97cfea attempt to prove equivalence between alpha definitions
Christian Urban <urbanc@in.tum.de>
parents: 981
diff changeset
   299
apply(erule conjE)+
31b4ac97cfea attempt to prove equivalence between alpha definitions
Christian Urban <urbanc@in.tum.de>
parents: 981
diff changeset
   300
apply(drule alpha_rfv)
31b4ac97cfea attempt to prove equivalence between alpha definitions
Christian Urban <urbanc@in.tum.de>
parents: 981
diff changeset
   301
apply(simp)
31b4ac97cfea attempt to prove equivalence between alpha definitions
Christian Urban <urbanc@in.tum.de>
parents: 981
diff changeset
   302
apply(rule_tac x="(a \<leftrightarrow> b)" in exI)
31b4ac97cfea attempt to prove equivalence between alpha definitions
Christian Urban <urbanc@in.tum.de>
parents: 981
diff changeset
   303
apply(simp)
31b4ac97cfea attempt to prove equivalence between alpha definitions
Christian Urban <urbanc@in.tum.de>
parents: 981
diff changeset
   304
apply(erule conjE)+
31b4ac97cfea attempt to prove equivalence between alpha definitions
Christian Urban <urbanc@in.tum.de>
parents: 981
diff changeset
   305
apply(rule conjI)
31b4ac97cfea attempt to prove equivalence between alpha definitions
Christian Urban <urbanc@in.tum.de>
parents: 981
diff changeset
   306
apply(drule alpha_rfv)
31b4ac97cfea attempt to prove equivalence between alpha definitions
Christian Urban <urbanc@in.tum.de>
parents: 981
diff changeset
   307
apply(drule sym)
31b4ac97cfea attempt to prove equivalence between alpha definitions
Christian Urban <urbanc@in.tum.de>
parents: 981
diff changeset
   308
apply(simp)
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents: 983
diff changeset
   309
apply(simp add: rfv_eqvt[symmetric])
983
31b4ac97cfea attempt to prove equivalence between alpha definitions
Christian Urban <urbanc@in.tum.de>
parents: 981
diff changeset
   310
defer
31b4ac97cfea attempt to prove equivalence between alpha definitions
Christian Urban <urbanc@in.tum.de>
parents: 981
diff changeset
   311
apply(subgoal_tac "atom a \<sharp> (rfv t - {atom a})")
31b4ac97cfea attempt to prove equivalence between alpha definitions
Christian Urban <urbanc@in.tum.de>
parents: 981
diff changeset
   312
apply(subgoal_tac "atom b \<sharp> (rfv t - {atom a})")
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents: 983
diff changeset
   313
983
31b4ac97cfea attempt to prove equivalence between alpha definitions
Christian Urban <urbanc@in.tum.de>
parents: 981
diff changeset
   314
defer
31b4ac97cfea attempt to prove equivalence between alpha definitions
Christian Urban <urbanc@in.tum.de>
parents: 981
diff changeset
   315
sorry
31b4ac97cfea attempt to prove equivalence between alpha definitions
Christian Urban <urbanc@in.tum.de>
parents: 981
diff changeset
   316
31b4ac97cfea attempt to prove equivalence between alpha definitions
Christian Urban <urbanc@in.tum.de>
parents: 981
diff changeset
   317
lemma 
31b4ac97cfea attempt to prove equivalence between alpha definitions
Christian Urban <urbanc@in.tum.de>
parents: 981
diff changeset
   318
  assumes a1: "t \<approx> s"
31b4ac97cfea attempt to prove equivalence between alpha definitions
Christian Urban <urbanc@in.tum.de>
parents: 981
diff changeset
   319
  shows "t \<approx>2 s"
31b4ac97cfea attempt to prove equivalence between alpha definitions
Christian Urban <urbanc@in.tum.de>
parents: 981
diff changeset
   320
using a1
31b4ac97cfea attempt to prove equivalence between alpha definitions
Christian Urban <urbanc@in.tum.de>
parents: 981
diff changeset
   321
apply(induct)
31b4ac97cfea attempt to prove equivalence between alpha definitions
Christian Urban <urbanc@in.tum.de>
parents: 981
diff changeset
   322
apply(rule alpha2.intros)
31b4ac97cfea attempt to prove equivalence between alpha definitions
Christian Urban <urbanc@in.tum.de>
parents: 981
diff changeset
   323
apply(simp)
31b4ac97cfea attempt to prove equivalence between alpha definitions
Christian Urban <urbanc@in.tum.de>
parents: 981
diff changeset
   324
apply(rule alpha2.intros)
31b4ac97cfea attempt to prove equivalence between alpha definitions
Christian Urban <urbanc@in.tum.de>
parents: 981
diff changeset
   325
apply(simp)
31b4ac97cfea attempt to prove equivalence between alpha definitions
Christian Urban <urbanc@in.tum.de>
parents: 981
diff changeset
   326
apply(simp)
31b4ac97cfea attempt to prove equivalence between alpha definitions
Christian Urban <urbanc@in.tum.de>
parents: 981
diff changeset
   327
apply(clarify)
31b4ac97cfea attempt to prove equivalence between alpha definitions
Christian Urban <urbanc@in.tum.de>
parents: 981
diff changeset
   328
apply(rule alpha2.intros)
31b4ac97cfea attempt to prove equivalence between alpha definitions
Christian Urban <urbanc@in.tum.de>
parents: 981
diff changeset
   329
apply(frule alpha_rfv)
31b4ac97cfea attempt to prove equivalence between alpha definitions
Christian Urban <urbanc@in.tum.de>
parents: 981
diff changeset
   330
apply(rotate_tac 4)
31b4ac97cfea attempt to prove equivalence between alpha definitions
Christian Urban <urbanc@in.tum.de>
parents: 981
diff changeset
   331
apply(drule sym)
31b4ac97cfea attempt to prove equivalence between alpha definitions
Christian Urban <urbanc@in.tum.de>
parents: 981
diff changeset
   332
apply(simp)
31b4ac97cfea attempt to prove equivalence between alpha definitions
Christian Urban <urbanc@in.tum.de>
parents: 981
diff changeset
   333
apply(drule sym)
31b4ac97cfea attempt to prove equivalence between alpha definitions
Christian Urban <urbanc@in.tum.de>
parents: 981
diff changeset
   334
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
   335
oops
947
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   336
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   337
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
   338
  by (rule alpha_equivp)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   339
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   340
quotient_definition
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   341
  "Var :: name \<Rightarrow> lam"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   342
as
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   343
  "rVar"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   344
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   345
quotient_definition
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   346
   "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
   347
as
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   348
  "rApp"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   349
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   350
quotient_definition
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   351
  "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
   352
as
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   353
  "rLam"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   354
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   355
quotient_definition
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   356
  "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
   357
as
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   358
  "rfv"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   359
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   360
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
   361
  "(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
   362
  apply(auto)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   363
  apply(rule alpha_eqvt)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   364
  apply(simp)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   365
  done
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   366
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   367
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
   368
  "(op = ===> alpha) rVar rVar"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   369
  by (auto intro: a1)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   370
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   371
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
   372
  "(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
   373
  by (auto intro: a2)
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 rLam_rsp[quot_respect]: 
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   376
  "(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
   377
  apply(auto)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   378
  apply(rule a3)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   379
  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
   380
  unfolding fresh_star_def 
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   381
  apply(simp add: fresh_star_def fresh_zero_perm)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   382
  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
   383
  done
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   384
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   385
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
   386
  "(alpha ===> op =) rfv rfv"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   387
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
   388
done
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   389
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   390
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   391
section {* lifted theorems *}
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   392
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   393
lemma lam_induct:
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   394
  "\<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
   395
    \<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
   396
    \<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
   397
    \<Longrightarrow> P lam"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   398
  apply (lifting rlam.induct)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   399
  done
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   400
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   401
instantiation lam :: pt
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   402
begin
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   403
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   404
quotient_definition
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   405
  "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
   406
as
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   407
  "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
   408
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   409
lemma permute_lam [simp]:
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   410
  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
   411
  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
   412
  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
   413
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
   414
done
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   415
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   416
instance
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   417
apply default
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   418
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
   419
apply(simp_all)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   420
done
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   421
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   422
end
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   423
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   424
lemma fv_lam [simp]: 
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   425
  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
   426
  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
   427
  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
   428
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
   429
done
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   430
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
   431
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
   432
  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
   433
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
   434
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
   435
947
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   436
lemma a1: 
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   437
  "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
   438
  by  (lifting a1)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   439
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   440
lemma a2: 
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   441
  "\<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
   442
  by  (lifting a2)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   443
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   444
lemma a3: 
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
   445
  "\<lbrakk>\<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
   446
   \<Longrightarrow> Lam a t = Lam b s"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   447
  apply  (lifting a3)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   448
  done
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   449
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
   450
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
   451
  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
   452
  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
   453
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
   454
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
   455
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
   456
947
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   457
lemma alpha_cases: 
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   458
  "\<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
   459
    \<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
   460
    \<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
   461
         \<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
   462
   \<Longrightarrow> P\<rbrakk>
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   463
    \<Longrightarrow> P"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   464
  by (lifting alpha.cases)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   465
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
   466
(* 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
   467
lemma alpha_induct: 
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   468
  "\<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
   469
    \<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
   470
     \<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
   471
        \<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
   472
         (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
   473
     \<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
   474
    \<Longrightarrow> qxb qx qxa"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   475
  by (lifting alpha.induct)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   476
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   477
(* should they lift automatically *)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   478
lemma lam_inject [simp]: 
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   479
  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
   480
  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
   481
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
   482
apply(regularize)
bc739536b715 Minor when looking at lam.distinct and lam.inject
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 975
diff changeset
   483
prefer 2
bc739536b715 Minor when looking at lam.distinct and lam.inject
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 975
diff changeset
   484
apply(regularize)
bc739536b715 Minor when looking at lam.distinct and lam.inject
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 975
diff changeset
   485
prefer 2
947
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   486
apply(auto)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   487
apply(drule alpha.cases)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   488
apply(simp_all)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   489
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
   490
apply(drule alpha.cases)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   491
apply(simp_all)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   492
apply(drule alpha.cases)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   493
apply(simp_all)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   494
apply(rule alpha.a2)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   495
apply(simp_all)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   496
done
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   497
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
   498
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
   499
  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
   500
      (\<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
   501
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
   502
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
   503
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
   504
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
   505
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
   506
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
   507
947
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   508
lemma rlam_distinct:
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   509
  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
   510
  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
   511
  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
   512
  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
   513
  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
   514
  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
   515
apply auto
981
bc739536b715 Minor when looking at lam.distinct and lam.inject
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 975
diff changeset
   516
apply (erule alpha.cases)
bc739536b715 Minor when looking at lam.distinct and lam.inject
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 975
diff changeset
   517
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
   518
apply (erule alpha.cases)
bc739536b715 Minor when looking at lam.distinct and lam.inject
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 975
diff changeset
   519
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
   520
apply (erule alpha.cases)
bc739536b715 Minor when looking at lam.distinct and lam.inject
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 975
diff changeset
   521
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
   522
apply (erule alpha.cases)
bc739536b715 Minor when looking at lam.distinct and lam.inject
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 975
diff changeset
   523
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
   524
apply (erule alpha.cases)
bc739536b715 Minor when looking at lam.distinct and lam.inject
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 975
diff changeset
   525
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
   526
apply (erule alpha.cases)
bc739536b715 Minor when looking at lam.distinct and lam.inject
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 975
diff changeset
   527
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
   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 lam_distinct[simp]:
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   531
  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
   532
  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
   533
  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
   534
  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
   535
  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
   536
  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
   537
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
   538
done
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   539
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   540
lemma var_supp1:
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   541
  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
   542
  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
   543
  done
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   544
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   545
lemma var_supp:
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   546
  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
   547
  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
   548
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   549
lemma app_supp:
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   550
  shows "supp (App t1 t2) = (supp t1) \<union> (supp t2)"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   551
apply(simp only: permute_lam supp_def lam_inject)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   552
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
   553
done
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   554
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
   555
(* 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
   556
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
   557
  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
   558
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
   559
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
   560
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
   561
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
   562
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
   563
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
   564
done
947
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   565
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
   566
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
   567
  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
   568
  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
   569
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
   570
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
   571
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
   572
done
947
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   573
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   574
instance lam :: fs
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   575
apply(default)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   576
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
   577
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
   578
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
   579
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
   580
done
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   581
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
   582
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
   583
  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
   584
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
   585
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
   586
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
   587
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
   588
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
   589
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
   590
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
   591
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
   592
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
   593
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
   594
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
   595
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
   596
  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
   597
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
   598
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
   599
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
   600
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
   601
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
   602
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
   603
  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
   604
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
   605
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
   606
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
   607
947
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   608
lemma fresh_lam:
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   609
  "(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
   610
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
   611
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
   612
apply(auto)
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
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   615
lemma lam_induct_strong:
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   616
  fixes a::"'a::fs"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   617
  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
   618
  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
   619
  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
   620
  shows "P a lam"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   621
proof -
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   622
  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
   623
  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
   624
    case (1 name pi)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   625
    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
   626
      apply (simp)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   627
      apply (rule a1)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   628
      done
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   629
  next
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   630
    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
   631
    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
   632
    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
   633
    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
   634
      apply (simp)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   635
      apply (rule a2)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   636
      apply (rule b1)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   637
      apply (rule b2)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   638
      done
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   639
  next
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   640
    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
   641
    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
   642
    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
   643
      apply(rule obtain_atom)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   644
      apply(auto)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   645
      sorry
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   646
    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
   647
      apply -
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   648
      apply(rule a3)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   649
      apply(blast)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   650
      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
   651
      done
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   652
    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
   653
      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
   654
      using fr
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   655
      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
   656
      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
   657
      done
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   658
    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
   659
      apply (simp)
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   660
      apply(subst eq[symmetric])
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   661
      using p
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   662
      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
   663
      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
   664
      done
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   665
  qed
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   666
  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
   667
  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
   668
qed
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   669
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   670
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   671
lemma var_fresh:
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   672
  fixes a::"name"
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   673
  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
   674
  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
   675
  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
   676
  done
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   677
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   678
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   679
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   680
end
fa810f01f7b5 added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   681