src/HOL/Lambda/Eta.ML
author nipkow
Mon, 08 Mar 1999 13:49:53 +0100
changeset 6307 fdf236c98914
parent 6301 08245f5a436d
child 8423 3c19160b6432
permissions -rw-r--r--
Suc -> +1
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
1302
ddfdcc9ce667 Moved some thms to Arith and to Trancl.
nipkow
parents: 1269
diff changeset
    12
Addsimps eta.intrs;
5261
ce3c25c8a694 First steps towards termination of simply typed terms.
nipkow
parents: 5184
diff changeset
    13
AddIs eta.intrs;
1269
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    14
6141
a6922171b396 removal of the (thm list) argument of mk_cases
paulson
parents: 6128
diff changeset
    15
val eta_cases = map eta.mk_cases ["Abs s -e> z", "s $ t -e> u", "Var i -e> t"];
5261
ce3c25c8a694 First steps towards termination of simply typed terms.
nipkow
parents: 5184
diff changeset
    16
AddSEs eta_cases;
1269
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    17
2159
e650a3f6f600 Used nat_trans_tac. New Eta. various smaller changes.
nipkow
parents: 2116
diff changeset
    18
section "eta, subst and free";
e650a3f6f600 Used nat_trans_tac. New Eta. various smaller changes.
nipkow
parents: 2116
diff changeset
    19
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4831
diff changeset
    20
Goal "!i t u. ~free s i --> s[t/i] = s[u/i]";
5184
9b8547a9496a Adapted to new datatype package.
berghofe
parents: 5146
diff changeset
    21
by (induct_tac "s" 1);
4089
96fba19bcbe2 isatool fixclasimp;
wenzelm
parents: 3919
diff changeset
    22
by (ALLGOALS(simp_tac (addsplit (simpset()))));
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2159
diff changeset
    23
by (Blast_tac 1);
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2159
diff changeset
    24
by (Blast_tac 1);
2159
e650a3f6f600 Used nat_trans_tac. New Eta. various smaller changes.
nipkow
parents: 2116
diff changeset
    25
qed_spec_mp "subst_not_free";
e650a3f6f600 Used nat_trans_tac. New Eta. various smaller changes.
nipkow
parents: 2116
diff changeset
    26
Addsimps [subst_not_free RS eqTrueI];
1269
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    27
5117
7b5efef2ca74 Removed leading !! in goals.
nipkow
parents: 5069
diff changeset
    28
Goal "!i k. free (lift t k) i = (i < k & free t i | k < i & free t (i-1))";
5184
9b8547a9496a Adapted to new datatype package.
berghofe
parents: 5146
diff changeset
    29
by (induct_tac "t" 1);
6079
4f7975c74cdf More arith simplifications.
nipkow
parents: 5983
diff changeset
    30
  by (ALLGOALS(asm_full_simp_tac (addsplit (simpset()) addcongs [conj_cong])));
6301
08245f5a436d expandshort
paulson
parents: 6141
diff changeset
    31
 by (arith_tac 1);
08245f5a436d expandshort
paulson
parents: 6141
diff changeset
    32
by (Auto_tac);
1269
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    33
qed "free_lift";
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    34
Addsimps [free_lift];
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    35
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4831
diff changeset
    36
Goal "!i k t. free (s[t/k]) i = \
6307
fdf236c98914 Suc -> +1
nipkow
parents: 6301
diff changeset
    37
\              (free s k & free t i | free s (if i<k then i else i+1))";
5184
9b8547a9496a Adapted to new datatype package.
berghofe
parents: 5146
diff changeset
    38
by (induct_tac "s" 1);
2116
73bbf2cc7651 Used trans_tac (see Provers/nat_transitive.ML) to automate arithmetic.
nipkow
parents: 2083
diff changeset
    39
by (Asm_simp_tac 2);
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2159
diff changeset
    40
by (Blast_tac 2);
4089
96fba19bcbe2 isatool fixclasimp;
wenzelm
parents: 3919
diff changeset
    41
by (asm_full_simp_tac (addsplit (simpset())) 2);
4360
40e5c97e988d pred n -> n-1
nipkow
parents: 4162
diff changeset
    42
by (simp_tac (simpset() addsimps [diff_Suc,subst_Var]
5184
9b8547a9496a Adapted to new datatype package.
berghofe
parents: 5146
diff changeset
    43
                      addsplits [nat.split]) 1);
5625
77e9ab9cd7b1 polymorphic versions of nat_neq_iff and nat_neqE
paulson
parents: 5261
diff changeset
    44
by (safe_tac (HOL_cs addSEs [linorder_neqE]));
5983
79e301a6a51b At last: linear arithmetic for nat!
nipkow
parents: 5625
diff changeset
    45
by (ALLGOALS Simp_tac);
1269
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    46
qed "free_subst";
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    47
Addsimps [free_subst];
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    48
5117
7b5efef2ca74 Removed leading !! in goals.
nipkow
parents: 5069
diff changeset
    49
Goal "s -e> t ==> !i. free t i = free s i";
1730
1c7f793fc374 Updated for new form of induction rules
paulson
parents: 1673
diff changeset
    50
by (etac eta.induct 1);
4089
96fba19bcbe2 isatool fixclasimp;
wenzelm
parents: 3919
diff changeset
    51
by (ALLGOALS(asm_simp_tac (simpset() addcongs [conj_cong])));
1486
7b95d7b49f7a Introduced qed_spec_mp.
nipkow
parents: 1465
diff changeset
    52
qed_spec_mp "free_eta";
1269
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    53
5117
7b5efef2ca74 Removed leading !! in goals.
nipkow
parents: 5069
diff changeset
    54
Goal "[| s -e> t; ~free s i |] ==> ~free t i";
4089
96fba19bcbe2 isatool fixclasimp;
wenzelm
parents: 3919
diff changeset
    55
by (asm_simp_tac (simpset() addsimps [free_eta]) 1);
1269
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    56
qed "not_free_eta";
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    57
5117
7b5efef2ca74 Removed leading !! in goals.
nipkow
parents: 5069
diff changeset
    58
Goal "s -e> t ==> !u i. s[u/i] -e> t[u/i]";
1730
1c7f793fc374 Updated for new form of induction rules
paulson
parents: 1673
diff changeset
    59
by (etac eta.induct 1);
4089
96fba19bcbe2 isatool fixclasimp;
wenzelm
parents: 3919
diff changeset
    60
by (ALLGOALS(asm_simp_tac (simpset() addsimps [subst_subst RS sym])));
1486
7b95d7b49f7a Introduced qed_spec_mp.
nipkow
parents: 1465
diff changeset
    61
qed_spec_mp "eta_subst";
1269
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    62
Addsimps [eta_subst];
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    63
1759
a42d6c537f4a Added comparison with implicit rule Fun(lift s 0 @ Var 0) -e> s
nipkow
parents: 1730
diff changeset
    64
section "Confluence of -e>";
1269
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    65
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4831
diff changeset
    66
Goalw [square_def,id_def]  "square eta eta (eta^=) (eta^=)";
1730
1c7f793fc374 Updated for new form of induction rules
paulson
parents: 1673
diff changeset
    67
by (rtac (impI RS allI RS allI) 1);
2057
4d7a4b25a11f Ran expandshort
paulson
parents: 2031
diff changeset
    68
by (Simp_tac 1);
1730
1c7f793fc374 Updated for new form of induction rules
paulson
parents: 1673
diff changeset
    69
by (etac eta.induct 1);
4089
96fba19bcbe2 isatool fixclasimp;
wenzelm
parents: 3919
diff changeset
    70
by (slow_tac (claset() addIs [subst_not_free,eta_subst]
96fba19bcbe2 isatool fixclasimp;
wenzelm
parents: 3919
diff changeset
    71
                      addIs [free_eta RS iffD1] addss simpset()) 1);
4162
4c2da701b801 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4089
diff changeset
    72
by Safe_tac;
4089
96fba19bcbe2 isatool fixclasimp;
wenzelm
parents: 3919
diff changeset
    73
by (blast_tac (claset() addSIs [eta_subst] addIs [free_eta RS iffD1]) 5);
2922
580647a879cf Using Blast_tac
paulson
parents: 2891
diff changeset
    74
by (ALLGOALS Blast_tac);
2159
e650a3f6f600 Used nat_trans_tac. New Eta. various smaller changes.
nipkow
parents: 2116
diff changeset
    75
qed "square_eta";
1269
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    76
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4831
diff changeset
    77
Goal "confluent(eta)";
2159
e650a3f6f600 Used nat_trans_tac. New Eta. various smaller changes.
nipkow
parents: 2116
diff changeset
    78
by (rtac (square_eta RS square_reflcl_confluent) 1);
1269
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    79
qed "eta_confluent";
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    80
1759
a42d6c537f4a Added comparison with implicit rule Fun(lift s 0 @ Var 0) -e> s
nipkow
parents: 1730
diff changeset
    81
section "Congruence rules for -e>>";
1269
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    82
5117
7b5efef2ca74 Removed leading !! in goals.
nipkow
parents: 5069
diff changeset
    83
Goal "s -e>> s' ==> Abs s -e>> Abs s'";
1465
5d7a7e439cec expanded tabs
clasohm
parents: 1431
diff changeset
    84
by (etac rtrancl_induct 1);
4089
96fba19bcbe2 isatool fixclasimp;
wenzelm
parents: 3919
diff changeset
    85
by (ALLGOALS(blast_tac (claset() addIs [rtrancl_refl,rtrancl_into_rtrancl])));
2159
e650a3f6f600 Used nat_trans_tac. New Eta. various smaller changes.
nipkow
parents: 2116
diff changeset
    86
qed "rtrancl_eta_Abs";
1269
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    87
5146
nipkow
parents: 5117
diff changeset
    88
Goal "s -e>> s' ==> s $ t -e>> s' $ t";
1465
5d7a7e439cec expanded tabs
clasohm
parents: 1431
diff changeset
    89
by (etac rtrancl_induct 1);
4089
96fba19bcbe2 isatool fixclasimp;
wenzelm
parents: 3919
diff changeset
    90
by (ALLGOALS(blast_tac (claset() addIs [rtrancl_refl,rtrancl_into_rtrancl])));
1269
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    91
qed "rtrancl_eta_AppL";
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    92
5146
nipkow
parents: 5117
diff changeset
    93
Goal "t -e>> t' ==> s $ t -e>> s $ t'";
1465
5d7a7e439cec expanded tabs
clasohm
parents: 1431
diff changeset
    94
by (etac rtrancl_induct 1);
4089
96fba19bcbe2 isatool fixclasimp;
wenzelm
parents: 3919
diff changeset
    95
by (ALLGOALS(blast_tac (claset() addIs [rtrancl_refl,rtrancl_into_rtrancl])));
1269
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    96
qed "rtrancl_eta_AppR";
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
    97
5146
nipkow
parents: 5117
diff changeset
    98
Goal "[| s -e>> s'; t -e>> t' |] ==> s $ t -e>> s' $ t'";
4089
96fba19bcbe2 isatool fixclasimp;
wenzelm
parents: 3919
diff changeset
    99
by (blast_tac (claset() addSIs [rtrancl_eta_AppL, rtrancl_eta_AppR]
2922
580647a879cf Using Blast_tac
paulson
parents: 2891
diff changeset
   100
                       addIs [rtrancl_trans]) 1);
1269
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   101
qed "rtrancl_eta_App";
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   102
1759
a42d6c537f4a Added comparison with implicit rule Fun(lift s 0 @ Var 0) -e> s
nipkow
parents: 1730
diff changeset
   103
section "Commutation of -> and -e>";
1269
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   104
5117
7b5efef2ca74 Removed leading !! in goals.
nipkow
parents: 5069
diff changeset
   105
Goal "s -> t ==> (!i. free t i --> free s i)";
1730
1c7f793fc374 Updated for new form of induction rules
paulson
parents: 1673
diff changeset
   106
by (etac beta.induct 1);
2031
03a843f0f447 Ran expandshort
paulson
parents: 1974
diff changeset
   107
by (ALLGOALS(Asm_full_simp_tac));
1486
7b95d7b49f7a Introduced qed_spec_mp.
nipkow
parents: 1465
diff changeset
   108
qed_spec_mp "free_beta";
1269
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   109
5117
7b5efef2ca74 Removed leading !! in goals.
nipkow
parents: 5069
diff changeset
   110
Goal "s -> t ==> !u i. s[u/i] -> t[u/i]";
1730
1c7f793fc374 Updated for new form of induction rules
paulson
parents: 1673
diff changeset
   111
by (etac beta.induct 1);
4089
96fba19bcbe2 isatool fixclasimp;
wenzelm
parents: 3919
diff changeset
   112
by (ALLGOALS(asm_full_simp_tac (simpset() addsimps [subst_subst RS sym])));
2159
e650a3f6f600 Used nat_trans_tac. New Eta. various smaller changes.
nipkow
parents: 2116
diff changeset
   113
qed_spec_mp "beta_subst";
e650a3f6f600 Used nat_trans_tac. New Eta. various smaller changes.
nipkow
parents: 2116
diff changeset
   114
AddIs [beta_subst];
1269
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   115
6307
fdf236c98914 Suc -> +1
nipkow
parents: 6301
diff changeset
   116
Goal "!i. t[Var i/i] = t[Var(i)/i+1]";
5184
9b8547a9496a Adapted to new datatype package.
berghofe
parents: 5146
diff changeset
   117
by (induct_tac "t" 1);
6301
08245f5a436d expandshort
paulson
parents: 6141
diff changeset
   118
by (auto_tac (claset() addSEs [linorder_neqE], addsplit (simpset())));
2159
e650a3f6f600 Used nat_trans_tac. New Eta. various smaller changes.
nipkow
parents: 2116
diff changeset
   119
qed_spec_mp "subst_Var_Suc";
e650a3f6f600 Used nat_trans_tac. New Eta. various smaller changes.
nipkow
parents: 2116
diff changeset
   120
Addsimps [subst_Var_Suc];
1269
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   121
5117
7b5efef2ca74 Removed leading !! in goals.
nipkow
parents: 5069
diff changeset
   122
Goal "s -e> t ==> (!i. lift s i -e> lift t i)";
1730
1c7f793fc374 Updated for new form of induction rules
paulson
parents: 1673
diff changeset
   123
by (etac eta.induct 1);
4089
96fba19bcbe2 isatool fixclasimp;
wenzelm
parents: 3919
diff changeset
   124
by (ALLGOALS(asm_simp_tac (addsplit (simpset()))));
1486
7b95d7b49f7a Introduced qed_spec_mp.
nipkow
parents: 1465
diff changeset
   125
qed_spec_mp "eta_lift";
1269
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   126
Addsimps [eta_lift];
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   127
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4831
diff changeset
   128
Goal "!s t i. s -e> t --> u[s/i] -e>> u[t/i]";
5184
9b8547a9496a Adapted to new datatype package.
berghofe
parents: 5146
diff changeset
   129
by (induct_tac "u" 1);
4089
96fba19bcbe2 isatool fixclasimp;
wenzelm
parents: 3919
diff changeset
   130
by (ALLGOALS(asm_simp_tac (addsplit (simpset()))));
96fba19bcbe2 isatool fixclasimp;
wenzelm
parents: 3919
diff changeset
   131
by (blast_tac (claset() addIs [r_into_rtrancl]) 1);
96fba19bcbe2 isatool fixclasimp;
wenzelm
parents: 3919
diff changeset
   132
by (blast_tac (claset() addSIs [rtrancl_eta_App]) 1);
96fba19bcbe2 isatool fixclasimp;
wenzelm
parents: 3919
diff changeset
   133
by (blast_tac (claset() addSIs [rtrancl_eta_Abs,eta_lift]) 1);
1486
7b95d7b49f7a Introduced qed_spec_mp.
nipkow
parents: 1465
diff changeset
   134
qed_spec_mp "rtrancl_eta_subst";
1269
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   135
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4831
diff changeset
   136
Goalw [square_def] "square beta eta (eta^*) (beta^=)";
1730
1c7f793fc374 Updated for new form of induction rules
paulson
parents: 1673
diff changeset
   137
by (rtac (impI RS allI RS allI) 1);
1c7f793fc374 Updated for new form of induction rules
paulson
parents: 1673
diff changeset
   138
by (etac beta.induct 1);
4089
96fba19bcbe2 isatool fixclasimp;
wenzelm
parents: 3919
diff changeset
   139
by (slow_tac (claset() addIs [r_into_rtrancl,rtrancl_eta_subst,eta_subst]
96fba19bcbe2 isatool fixclasimp;
wenzelm
parents: 3919
diff changeset
   140
                      addss simpset()) 1);
96fba19bcbe2 isatool fixclasimp;
wenzelm
parents: 3919
diff changeset
   141
by (blast_tac (claset() addIs [r_into_rtrancl,rtrancl_eta_AppL]) 1);
96fba19bcbe2 isatool fixclasimp;
wenzelm
parents: 3919
diff changeset
   142
by (blast_tac (claset() addIs [r_into_rtrancl,rtrancl_eta_AppR]) 1);
2922
580647a879cf Using Blast_tac
paulson
parents: 2891
diff changeset
   143
(*23 seconds?*)
2931
8658bf6c1a5b Mod because of "Turned Addsimps into AddIffs for datatype laws."
nipkow
parents: 2922
diff changeset
   144
DelIffs dB.distinct;
8658bf6c1a5b Mod because of "Turned Addsimps into AddIffs for datatype laws."
nipkow
parents: 2922
diff changeset
   145
Addsimps dB.distinct;
4089
96fba19bcbe2 isatool fixclasimp;
wenzelm
parents: 3919
diff changeset
   146
by (slow_tac (claset() addIs [r_into_rtrancl,rtrancl_eta_Abs,free_beta]
96fba19bcbe2 isatool fixclasimp;
wenzelm
parents: 3919
diff changeset
   147
                      addss simpset()) 1);
1269
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   148
qed "square_beta_eta";
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   149
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4831
diff changeset
   150
Goal "confluent(beta Un eta)";
2031
03a843f0f447 Ran expandshort
paulson
parents: 1974
diff changeset
   151
by (REPEAT(ares_tac [square_rtrancl_reflcl_commute,confluent_Un,
1269
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   152
                    beta_confluent,eta_confluent,square_beta_eta] 1));
ee011b365770 New version with eta reduction.
nipkow
parents:
diff changeset
   153
qed "confluent_beta_eta";
1759
a42d6c537f4a Added comparison with implicit rule Fun(lift s 0 @ Var 0) -e> s
nipkow
parents: 1730
diff changeset
   154
5146
nipkow
parents: 5117
diff changeset
   155
section "Implicit definition of -e>: Abs(lift s 0 $ Var 0) -e> s";
1759
a42d6c537f4a Added comparison with implicit rule Fun(lift s 0 @ Var 0) -e> s
nipkow
parents: 1730
diff changeset
   156
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4831
diff changeset
   157
Goal "!i. (~free s i) = (? t. s = lift t i)";
5184
9b8547a9496a Adapted to new datatype package.
berghofe
parents: 5146
diff changeset
   158
by (induct_tac "s" 1);
4686
74a12e86b20b Removed `addsplits [expand_if]'
nipkow
parents: 4360
diff changeset
   159
  by (Simp_tac 1);
2057
4d7a4b25a11f Ran expandshort
paulson
parents: 2031
diff changeset
   160
  by (SELECT_GOAL(safe_tac HOL_cs)1);
5625
77e9ab9cd7b1 polymorphic versions of nat_neq_iff and nat_neqE
paulson
parents: 5261
diff changeset
   161
   by (etac linorder_neqE 1);
2159
e650a3f6f600 Used nat_trans_tac. New Eta. various smaller changes.
nipkow
parents: 2116
diff changeset
   162
    by (res_inst_tac [("x","Var nat")] exI 1);
e650a3f6f600 Used nat_trans_tac. New Eta. various smaller changes.
nipkow
parents: 2116
diff changeset
   163
    by (Asm_simp_tac 1);
4360
40e5c97e988d pred n -> n-1
nipkow
parents: 4162
diff changeset
   164
   by (res_inst_tac [("x","Var(nat-1)")] exI 1);
2057
4d7a4b25a11f Ran expandshort
paulson
parents: 2031
diff changeset
   165
   by (Asm_simp_tac 1);
4d7a4b25a11f Ran expandshort
paulson
parents: 2031
diff changeset
   166
  by (rtac notE 1);
4d7a4b25a11f Ran expandshort
paulson
parents: 2031
diff changeset
   167
   by (assume_tac 2);
4d7a4b25a11f Ran expandshort
paulson
parents: 2031
diff changeset
   168
  by (etac thin_rl 1);
5261
ce3c25c8a694 First steps towards termination of simply typed terms.
nipkow
parents: 5184
diff changeset
   169
  by (exhaust_tac "t" 1);
ce3c25c8a694 First steps towards termination of simply typed terms.
nipkow
parents: 5184
diff changeset
   170
    by (Asm_simp_tac 1);
ce3c25c8a694 First steps towards termination of simply typed terms.
nipkow
parents: 5184
diff changeset
   171
   by (Asm_simp_tac 1);
ce3c25c8a694 First steps towards termination of simply typed terms.
nipkow
parents: 5184
diff changeset
   172
  by (Asm_simp_tac 1);
2116
73bbf2cc7651 Used trans_tac (see Provers/nat_transitive.ML) to automate arithmetic.
nipkow
parents: 2083
diff changeset
   173
 by (Asm_simp_tac 1);
2057
4d7a4b25a11f Ran expandshort
paulson
parents: 2031
diff changeset
   174
 by (etac thin_rl 1);
4d7a4b25a11f Ran expandshort
paulson
parents: 2031
diff changeset
   175
 by (etac thin_rl 1);
4d7a4b25a11f Ran expandshort
paulson
parents: 2031
diff changeset
   176
 by (rtac allI 1);
4d7a4b25a11f Ran expandshort
paulson
parents: 2031
diff changeset
   177
 by (rtac iffI 1);
4d7a4b25a11f Ran expandshort
paulson
parents: 2031
diff changeset
   178
  by (REPEAT(eresolve_tac [conjE,exE] 1));
4d7a4b25a11f Ran expandshort
paulson
parents: 2031
diff changeset
   179
  by (rename_tac "u1 u2" 1);
5146
nipkow
parents: 5117
diff changeset
   180
  by (res_inst_tac [("x","u1$u2")] exI 1);
2057
4d7a4b25a11f Ran expandshort
paulson
parents: 2031
diff changeset
   181
  by (Asm_simp_tac 1);
4d7a4b25a11f Ran expandshort
paulson
parents: 2031
diff changeset
   182
 by (etac exE 1);
4d7a4b25a11f Ran expandshort
paulson
parents: 2031
diff changeset
   183
 by (etac rev_mp 1);
5261
ce3c25c8a694 First steps towards termination of simply typed terms.
nipkow
parents: 5184
diff changeset
   184
 by (exhaust_tac "t" 1);
ce3c25c8a694 First steps towards termination of simply typed terms.
nipkow
parents: 5184
diff changeset
   185
   by (Asm_simp_tac 1);
ce3c25c8a694 First steps towards termination of simply typed terms.
nipkow
parents: 5184
diff changeset
   186
  by (Asm_simp_tac 1);
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2159
diff changeset
   187
  by (Blast_tac 1);
5261
ce3c25c8a694 First steps towards termination of simply typed terms.
nipkow
parents: 5184
diff changeset
   188
 by (Asm_simp_tac 1);
2031
03a843f0f447 Ran expandshort
paulson
parents: 1974
diff changeset
   189
by (Asm_simp_tac 1);
03a843f0f447 Ran expandshort
paulson
parents: 1974
diff changeset
   190
by (etac thin_rl 1);
03a843f0f447 Ran expandshort
paulson
parents: 1974
diff changeset
   191
by (rtac allI 1);
03a843f0f447 Ran expandshort
paulson
parents: 1974
diff changeset
   192
by (rtac iffI 1);
2057
4d7a4b25a11f Ran expandshort
paulson
parents: 2031
diff changeset
   193
 by (etac exE 1);
2159
e650a3f6f600 Used nat_trans_tac. New Eta. various smaller changes.
nipkow
parents: 2116
diff changeset
   194
 by (res_inst_tac [("x","Abs t")] exI 1);
2057
4d7a4b25a11f Ran expandshort
paulson
parents: 2031
diff changeset
   195
 by (Asm_simp_tac 1);
2031
03a843f0f447 Ran expandshort
paulson
parents: 1974
diff changeset
   196
by (etac exE 1);
03a843f0f447 Ran expandshort
paulson
parents: 1974
diff changeset
   197
by (etac rev_mp 1);
5261
ce3c25c8a694 First steps towards termination of simply typed terms.
nipkow
parents: 5184
diff changeset
   198
by (exhaust_tac "t" 1);
ce3c25c8a694 First steps towards termination of simply typed terms.
nipkow
parents: 5184
diff changeset
   199
  by (Asm_simp_tac 1);
ce3c25c8a694 First steps towards termination of simply typed terms.
nipkow
parents: 5184
diff changeset
   200
 by (Asm_simp_tac 1);
ce3c25c8a694 First steps towards termination of simply typed terms.
nipkow
parents: 5184
diff changeset
   201
by (Asm_simp_tac 1);
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2159
diff changeset
   202
by (Blast_tac 1);
1759
a42d6c537f4a Added comparison with implicit rule Fun(lift s 0 @ Var 0) -e> s
nipkow
parents: 1730
diff changeset
   203
qed_spec_mp "not_free_iff_lifted";
a42d6c537f4a Added comparison with implicit rule Fun(lift s 0 @ Var 0) -e> s
nipkow
parents: 1730
diff changeset
   204
5146
nipkow
parents: 5117
diff changeset
   205
Goal "(!s u. (~free s 0) --> R(Abs(s $ Var 0))(s[u/0])) = \
nipkow
parents: 5117
diff changeset
   206
\     (!s. R(Abs(lift s 0 $ Var 0))(s))";
4089
96fba19bcbe2 isatool fixclasimp;
wenzelm
parents: 3919
diff changeset
   207
by (fast_tac (HOL_cs addss (simpset() addsimps [not_free_iff_lifted])) 1);
1759
a42d6c537f4a Added comparison with implicit rule Fun(lift s 0 @ Var 0) -e> s
nipkow
parents: 1730
diff changeset
   208
qed "explicit_is_implicit";