src/HOL/Lambda/Eta.ML
author nipkow
Tue, 02 Jan 1996 14:08:04 +0100
changeset 1431 be7c6d77e19c
parent 1302 ddfdcc9ce667
child 1465 5d7a7e439cec
permissions -rw-r--r--
Polished proofs.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1269
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
     1
(*  Title:      HOL/Lambda/Eta.ML
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
     2
    ID:         $Id$
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
     3
    Author:     Tobias Nipkow
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
     4
    Copyright   1995 TU Muenchen
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
     5
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
     6
Eta reduction,
1302
ddfdcc9ce667 Moved some thms to Arith and to Trancl.
nipkow
parents: 1269
diff changeset
     7
confluence of eta,
1269
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
     8
commutation of beta/eta,
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
     9
confluence of beta+eta
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    10
*)
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    11
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    12
open Eta;
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    13
1302
ddfdcc9ce667 Moved some thms to Arith and to Trancl.
nipkow
parents: 1269
diff changeset
    14
Addsimps eta.intrs;
1269
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    15
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    16
val eta_cases = map (eta.mk_cases db.simps)
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    17
    ["Fun s -e> z","s @ t -e> u","Var i -e> t"];
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    18
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    19
val beta_cases = map (beta.mk_cases db.simps)
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    20
    ["s @ t -> u","Var i -> t"];
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    21
1302
ddfdcc9ce667 Moved some thms to Arith and to Trancl.
nipkow
parents: 1269
diff changeset
    22
val eta_cs = lambda_cs addIs eta.intrs
1269
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    23
                       addSEs (beta_cases@eta_cases);
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    24
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    25
(*** Arithmetic lemmas ***)
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    26
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    27
goal HOL.thy "!!P. P ==> P=True";
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    28
by(fast_tac HOL_cs 1);
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    29
qed "True_eq";
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    30
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    31
Addsimps [less_not_sym RS True_eq];
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    32
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    33
goal Arith.thy "i < j --> pred i < j";
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    34
by(nat_ind_tac "j" 1);
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    35
by(ALLGOALS(asm_simp_tac(simpset_of "Arith")));
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    36
by(nat_ind_tac "j1" 1);
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    37
by(ALLGOALS(asm_simp_tac(simpset_of "Arith")));
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    38
bind_thm("less_imp_pred_less",result() RS mp);
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    39
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    40
goal Arith.thy "i<j --> ~ pred j < i";
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    41
by(nat_ind_tac "j" 1);
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    42
by(ALLGOALS(asm_simp_tac(simpset_of "Arith")));
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    43
by(fast_tac (HOL_cs addDs [less_imp_pred_less]) 1);
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    44
bind_thm("less_imp_not_pred_less", result() RS mp);
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    45
Addsimps [less_imp_not_pred_less];
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    46
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    47
goal Nat.thy "i < j --> j < Suc(Suc i) --> j = Suc i";
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    48
by(nat_ind_tac "j" 1);
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    49
by(ALLGOALS(simp_tac(simpset_of "Nat")));
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    50
by(fast_tac (HOL_cs addDs [less_not_sym]) 1);
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    51
bind_thm("less_interval1", result() RS mp RS mp);
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    52
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    53
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    54
(*** decr and free ***)
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    55
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    56
goal Eta.thy "!i k. free (lift t k) i = \
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    57
\                   (i < k & free t i | k < i & free t (pred i))";
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    58
by(db.induct_tac "t" 1);
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    59
by(ALLGOALS(asm_full_simp_tac (addsplit (!simpset) addcongs [conj_cong])));
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    60
by(fast_tac HOL_cs 2);
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    61
by(safe_tac (HOL_cs addSIs [iffI]));
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    62
bd Suc_mono 1;
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    63
by(ALLGOALS(Asm_full_simp_tac));
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    64
by(dtac less_trans_Suc 1 THEN atac 1);
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    65
by(dtac less_trans_Suc 2 THEN atac 2);
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    66
by(ALLGOALS(Asm_full_simp_tac));
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    67
qed "free_lift";
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    68
Addsimps [free_lift];
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    69
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    70
goal Eta.thy "!i k t. free (s[t/k]) i = \
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    71
\              (free s k & free t i | free s (if i<k then i else Suc i))";
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    72
by(db.induct_tac "s" 1);
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    73
by(ALLGOALS(asm_full_simp_tac (addsplit (!simpset) addsimps
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    74
[less_not_refl2,less_not_refl2 RS not_sym])));
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    75
by(fast_tac HOL_cs 2);
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    76
by(safe_tac (HOL_cs addSIs [iffI]));
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    77
by(ALLGOALS(Asm_simp_tac));
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    78
by(fast_tac (HOL_cs addEs [less_imp_not_pred_less RS notE]) 1);
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    79
by(fast_tac (HOL_cs addDs [less_not_sym]) 1);
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    80
bd Suc_mono 1;
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    81
by(dtac less_interval1 1 THEN atac 1);
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    82
by(asm_full_simp_tac (simpset_of "Nat" addsimps [eq_sym_conv]) 1);
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    83
by(dtac less_trans_Suc 1 THEN atac 1);
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    84
by(Asm_full_simp_tac 1);
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    85
qed "free_subst";
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    86
Addsimps [free_subst];
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    87
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    88
goal Eta.thy "!!s. s -e> t ==> !i. free t i = free s i";
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    89
be (eta.mutual_induct RS spec RS spec RSN (2,rev_mp)) 1;
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    90
by(ALLGOALS(asm_simp_tac (!simpset addsimps [decr_def] addcongs [conj_cong])));
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    91
bind_thm("free_eta",result() RS spec);
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    92
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    93
goal Eta.thy "!!s. [| s -e> t; ~free s i |] ==> ~free t i";
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    94
by(asm_simp_tac (!simpset addsimps [free_eta]) 1);
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    95
qed "not_free_eta";
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    96
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    97
goal Eta.thy "!i t u. ~free s i --> s[t/i] = s[u/i]";
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    98
by(db.induct_tac "s" 1);
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    99
by(ALLGOALS(simp_tac (addsplit (!simpset))));
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   100
by(fast_tac HOL_cs 1);
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   101
by(fast_tac HOL_cs 1);
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   102
bind_thm("subst_not_free", result() RS spec RS spec RS spec RS mp);
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   103
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   104
goalw Eta.thy [decr_def] "!!s. ~free s i ==> s[t/i] = decr s i";
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   105
be subst_not_free 1;
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   106
qed "subst_decr";
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   107
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   108
goal Eta.thy "!!s. s -e> t ==> !u i. s[u/i] -e> t[u/i]";
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   109
be (eta.mutual_induct RS spec RS spec RSN (2,rev_mp)) 1;
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   110
by(ALLGOALS(asm_simp_tac (!simpset addsimps [subst_subst RS sym,decr_def])));
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   111
by(asm_simp_tac (!simpset addsimps [subst_decr]) 1);
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   112
bind_thm("eta_subst",result() RS spec RS spec);
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   113
Addsimps [eta_subst];
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   114
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   115
goalw Eta.thy [decr_def] "!!s. s -e> t ==> decr s i -e> decr t i";
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   116
be eta_subst 1;
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   117
qed "eta_decr";
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   118
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   119
(*** Confluence of eta ***)
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   120
1431
be7c6d77e19c Polished proofs.
nipkow
parents: 1302
diff changeset
   121
goalw Eta.thy [square_def,id_def]  "square eta eta (eta^=) (eta^=)";
1269
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   122
br eta.mutual_induct 1;
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   123
by(ALLGOALS(fast_tac (eta_cs addSEs [eta_decr,not_free_eta] addss !simpset)));
1431
be7c6d77e19c Polished proofs.
nipkow
parents: 1302
diff changeset
   124
val lemma = result();
1269
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   125
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   126
goal Eta.thy "confluent(eta)";
1431
be7c6d77e19c Polished proofs.
nipkow
parents: 1302
diff changeset
   127
by(rtac (lemma RS square_reflcl_confluent) 1);
1269
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   128
qed "eta_confluent";
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   129
1431
be7c6d77e19c Polished proofs.
nipkow
parents: 1302
diff changeset
   130
(*** Congruence rules for -e>> ***)
1269
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   131
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   132
goal Eta.thy "!!s. s -e>> s' ==> Fun s -e>> Fun s'";
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   133
be rtrancl_induct 1;
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   134
by (ALLGOALS(fast_tac (eta_cs addIs [rtrancl_refl,rtrancl_into_rtrancl])));
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   135
qed "rtrancl_eta_Fun";
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   136
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   137
goal Eta.thy "!!s. s -e>> s' ==> s @ t -e>> s' @ t";
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   138
be rtrancl_induct 1;
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   139
by (ALLGOALS(fast_tac (eta_cs addIs [rtrancl_refl,rtrancl_into_rtrancl])));
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   140
qed "rtrancl_eta_AppL";
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   141
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   142
goal Eta.thy "!!s. t -e>> t' ==> s @ t -e>> s @ t'";
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   143
be rtrancl_induct 1;
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   144
by (ALLGOALS(fast_tac (eta_cs addIs [rtrancl_refl,rtrancl_into_rtrancl])));
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   145
qed "rtrancl_eta_AppR";
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   146
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   147
goal Eta.thy "!!s. [| s -e>> s'; t -e>> t' |] ==> s @ t -e>> s' @ t'";
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   148
by (fast_tac (eta_cs addSIs [rtrancl_eta_AppL,rtrancl_eta_AppR]
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   149
                     addIs [rtrancl_trans]) 1);
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   150
qed "rtrancl_eta_App";
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   151
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   152
(*** Commutation of beta and eta ***)
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   153
1431
be7c6d77e19c Polished proofs.
nipkow
parents: 1302
diff changeset
   154
goal Eta.thy "!s t. s -> t --> (!i. free t i --> free s i)";
be7c6d77e19c Polished proofs.
nipkow
parents: 1302
diff changeset
   155
br beta.mutual_induct 1;
1269
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   156
by(ALLGOALS(Asm_full_simp_tac));
1431
be7c6d77e19c Polished proofs.
nipkow
parents: 1302
diff changeset
   157
bind_thm("free_beta", result() RS spec RS spec RS mp RS spec RS mp);
1269
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   158
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   159
goalw Eta.thy [decr_def] "!s t. s -> t --> (!i. decr s i -> decr t i)";
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   160
br beta.mutual_induct 1;
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   161
by(ALLGOALS(asm_full_simp_tac (!simpset addsimps [subst_subst RS sym])));
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   162
bind_thm("beta_decr", result() RS spec RS spec RS mp RS spec);
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   163
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   164
goalw Eta.thy [decr_def]
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   165
  "decr (Var i) k = (if i<=k then Var i else Var(pred i))";
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   166
by(simp_tac (addsplit (!simpset) addsimps [le_def]) 1);
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   167
qed "decr_Var";
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   168
Addsimps [decr_Var];
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   169
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   170
goalw Eta.thy [decr_def] "decr (s@t) i = (decr s i)@(decr t i)";
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   171
by(Simp_tac 1);
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   172
qed "decr_App";
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   173
Addsimps [decr_App];
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   174
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   175
goalw Eta.thy [decr_def] "decr (Fun s) i = Fun (decr s (Suc i))";
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   176
by(Simp_tac 1);
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   177
qed "decr_Fun";
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   178
Addsimps [decr_Fun];
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   179
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   180
goal Eta.thy "!i. ~free t (Suc i) --> decr t i = decr t (Suc i)";
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   181
by(db.induct_tac "t" 1);
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   182
by(ALLGOALS(asm_simp_tac (addsplit (!simpset) addsimps [le_def])));
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   183
by(fast_tac (HOL_cs addDs [less_interval1]) 1);
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   184
by(fast_tac HOL_cs 1);
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   185
qed "decr_not_free";
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   186
Addsimps [decr_not_free];
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   187
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   188
goal Eta.thy "!s t. s -e> t --> (!i. lift s i -e> lift t i)";
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   189
br eta.mutual_induct 1;
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   190
by(ALLGOALS(asm_simp_tac (addsplit (!simpset) addsimps [decr_def])));
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   191
by(asm_simp_tac (addsplit (!simpset) addsimps [subst_decr]) 1);
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   192
bind_thm("eta_lift",result() RS spec RS spec RS mp RS spec);
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   193
Addsimps [eta_lift];
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   194
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   195
goal Eta.thy "!s t i. s -e> t --> u[s/i] -e>> u[t/i]";
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   196
by(db.induct_tac "u" 1);
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   197
by(ALLGOALS(asm_simp_tac (addsplit (!simpset))));
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   198
by(fast_tac (eta_cs addIs [r_into_rtrancl]) 1);
1302
ddfdcc9ce667 Moved some thms to Arith and to Trancl.
nipkow
parents: 1269
diff changeset
   199
by(fast_tac (eta_cs addSIs [rtrancl_eta_App]) 1);
1269
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   200
by(fast_tac (eta_cs addSIs [rtrancl_eta_Fun,eta_lift]) 1);
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   201
bind_thm("rtrancl_eta_subst", result() RS spec RS spec RS spec RS mp);
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   202
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   203
goalw Eta.thy [square_def] "square beta eta (eta^*) (beta^=)";
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   204
br beta.mutual_induct 1;
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   205
by(strip_tac 1);
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   206
bes eta_cases 1;
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   207
bes eta_cases 1;
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   208
by(fast_tac (eta_cs addss (!simpset addsimps [subst_decr])) 1);
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   209
by(fast_tac (eta_cs addIs [r_into_rtrancl,eta_subst]) 1);
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   210
by(fast_tac (eta_cs addIs [rtrancl_eta_subst]) 1);
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   211
by(fast_tac (eta_cs addIs [r_into_rtrancl,rtrancl_eta_AppL]) 1);
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   212
by(fast_tac (eta_cs addIs [r_into_rtrancl,rtrancl_eta_AppR]) 1);
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   213
by(fast_tac (eta_cs addIs [r_into_rtrancl,rtrancl_eta_Fun,free_beta,beta_decr]
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   214
                  addss (!simpset addsimps[subst_decr,symmetric decr_def])) 1);
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   215
qed "square_beta_eta";
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   216
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   217
goal Eta.thy "confluent(beta Un eta)";
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   218
by(REPEAT(ares_tac [square_rtrancl_reflcl_commute,confluent_Un,
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   219
                    beta_confluent,eta_confluent,square_beta_eta] 1));
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   220
qed "confluent_beta_eta";