src/ZF/ex/Comb.ML
author paulson
Mon, 21 May 2001 14:36:24 +0200
changeset 11316 b4e71bd751e4
parent 6144 7d38744313c8
permissions -rw-r--r--
X-symbols for set theory
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 782
diff changeset
     1
(*  Title:      ZF/ex/comb.ML
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     2
    ID:         $Id$
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 782
diff changeset
     3
    Author:     Lawrence C Paulson
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     4
    Copyright   1993  University of Cambridge
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     5
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
     6
Combinatory Logic example: the Church-Rosser Theorem
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
     7
Curiously, combinators do not include free variables.
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
     8
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
     9
Example taken from
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
    10
    J. Camilleri and T. F. Melham.
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
    11
    Reasoning with Inductively Defined Relations in the HOL Theorem Prover.
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
    12
    Report 265, University of Cambridge Computer Laboratory, 1992.
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
    13
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
    14
HOL system proofs may be found in
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
    15
/usr/groups/theory/hvg-aftp/contrib/rule-induction/cl.ml
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
    16
*)
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
    17
3014
f5554654d211 Moved diamond_trancl (which is independent of the rest) to the top
paulson
parents: 2954
diff changeset
    18
(*** Transitive closure preserves the Church-Rosser property ***)
f5554654d211 Moved diamond_trancl (which is independent of the rest) to the top
paulson
parents: 2954
diff changeset
    19
5068
fb28eaa07e01 isatool fixgoal;
wenzelm
parents: 4091
diff changeset
    20
Goalw [diamond_def]
3014
f5554654d211 Moved diamond_trancl (which is independent of the rest) to the top
paulson
parents: 2954
diff changeset
    21
    "!!x y r. [| diamond(r);  <x,y>:r^+ |] ==> \
11316
b4e71bd751e4 X-symbols for set theory
paulson
parents: 6144
diff changeset
    22
\    \\<forall>y'. <x,y'>:r --> (\\<exists>z. <y',z>: r^+ & <y,z>: r)";
3014
f5554654d211 Moved diamond_trancl (which is independent of the rest) to the top
paulson
parents: 2954
diff changeset
    23
by (etac trancl_induct 1);
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3014
diff changeset
    24
by (blast_tac (claset() addIs [r_into_trancl]) 1);
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3014
diff changeset
    25
by (slow_best_tac (claset() addSDs [spec RS mp]
3014
f5554654d211 Moved diamond_trancl (which is independent of the rest) to the top
paulson
parents: 2954
diff changeset
    26
                           addIs  [r_into_trancl, trans_trancl RS transD]) 1);
f5554654d211 Moved diamond_trancl (which is independent of the rest) to the top
paulson
parents: 2954
diff changeset
    27
val diamond_strip_lemmaE = result() RS spec RS mp RS exE;
f5554654d211 Moved diamond_trancl (which is independent of the rest) to the top
paulson
parents: 2954
diff changeset
    28
f5554654d211 Moved diamond_trancl (which is independent of the rest) to the top
paulson
parents: 2954
diff changeset
    29
val [major] = goal Comb.thy "diamond(r) ==> diamond(r^+)";
f5554654d211 Moved diamond_trancl (which is independent of the rest) to the top
paulson
parents: 2954
diff changeset
    30
by (rewtac diamond_def);  (*unfold only in goal, not in premise!*)
f5554654d211 Moved diamond_trancl (which is independent of the rest) to the top
paulson
parents: 2954
diff changeset
    31
by (rtac (impI RS allI RS allI) 1);
f5554654d211 Moved diamond_trancl (which is independent of the rest) to the top
paulson
parents: 2954
diff changeset
    32
by (etac trancl_induct 1);
f5554654d211 Moved diamond_trancl (which is independent of the rest) to the top
paulson
parents: 2954
diff changeset
    33
by (ALLGOALS (*Seems to be a brittle, undirected search*)
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3014
diff changeset
    34
    (slow_best_tac (claset() addIs [r_into_trancl, trans_trancl RS transD]
3014
f5554654d211 Moved diamond_trancl (which is independent of the rest) to the top
paulson
parents: 2954
diff changeset
    35
                            addEs [major RS diamond_strip_lemmaE])));
f5554654d211 Moved diamond_trancl (which is independent of the rest) to the top
paulson
parents: 2954
diff changeset
    36
qed "diamond_trancl";
f5554654d211 Moved diamond_trancl (which is independent of the rest) to the top
paulson
parents: 2954
diff changeset
    37
f5554654d211 Moved diamond_trancl (which is independent of the rest) to the top
paulson
parents: 2954
diff changeset
    38
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
    39
val [_,_,comb_Ap] = comb.intrs;
11316
b4e71bd751e4 X-symbols for set theory
paulson
parents: 6144
diff changeset
    40
val Ap_E = comb.mk_cases "p#q \\<in> comb";
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
    41
3014
f5554654d211 Moved diamond_trancl (which is independent of the rest) to the top
paulson
parents: 2954
diff changeset
    42
AddSIs comb.intrs;
f5554654d211 Moved diamond_trancl (which is independent of the rest) to the top
paulson
parents: 2954
diff changeset
    43
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
    44
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
    45
(*** Results about Contraction ***)
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
    46
11316
b4e71bd751e4 X-symbols for set theory
paulson
parents: 6144
diff changeset
    47
(*For type checking: replaces a-1->b by a,b \\<in> comb *)
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
    48
val contract_combE2 = contract.dom_subset RS subsetD RS SigmaE2;
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
    49
val contract_combD1 = contract.dom_subset RS subsetD RS SigmaD1;
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
    50
val contract_combD2 = contract.dom_subset RS subsetD RS SigmaD2;
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
    51
5068
fb28eaa07e01 isatool fixgoal;
wenzelm
parents: 4091
diff changeset
    52
Goal "field(contract) = comb";
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3014
diff changeset
    53
by (blast_tac (claset() addIs [contract.K] addSEs [contract_combE2]) 1);
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 515
diff changeset
    54
qed "field_contract_eq";
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
    55
782
200a16083201 added bind_thm for theorems defined by "standard ..."
clasohm
parents: 760
diff changeset
    56
bind_thm ("reduction_refl",
200a16083201 added bind_thm for theorems defined by "standard ..."
clasohm
parents: 760
diff changeset
    57
    (field_contract_eq RS equalityD2 RS subsetD RS rtrancl_refl));
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
    58
782
200a16083201 added bind_thm for theorems defined by "standard ..."
clasohm
parents: 760
diff changeset
    59
bind_thm ("rtrancl_into_rtrancl2",
200a16083201 added bind_thm for theorems defined by "standard ..."
clasohm
parents: 760
diff changeset
    60
    (r_into_rtrancl RS (trans_rtrancl RS transD)));
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
    61
3014
f5554654d211 Moved diamond_trancl (which is independent of the rest) to the top
paulson
parents: 2954
diff changeset
    62
AddSIs [reduction_refl, contract.K, contract.S];
f5554654d211 Moved diamond_trancl (which is independent of the rest) to the top
paulson
parents: 2954
diff changeset
    63
f5554654d211 Moved diamond_trancl (which is independent of the rest) to the top
paulson
parents: 2954
diff changeset
    64
val reduction_rls = [contract.K RS rtrancl_into_rtrancl2,
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 782
diff changeset
    65
                     contract.S RS rtrancl_into_rtrancl2,
6bcb44e4d6e5 expanded tabs
clasohm
parents: 782
diff changeset
    66
                     contract.Ap1 RS rtrancl_into_rtrancl2,
6bcb44e4d6e5 expanded tabs
clasohm
parents: 782
diff changeset
    67
                     contract.Ap2 RS rtrancl_into_rtrancl2];
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
    68
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
    69
(*Example only: not used*)
11316
b4e71bd751e4 X-symbols for set theory
paulson
parents: 6144
diff changeset
    70
Goalw [I_def] "p \\<in> comb ==> I#p ---> p";
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3014
diff changeset
    71
by (blast_tac (claset() addIs reduction_rls) 1);
782
200a16083201 added bind_thm for theorems defined by "standard ..."
clasohm
parents: 760
diff changeset
    72
qed "reduce_I";
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
    73
11316
b4e71bd751e4 X-symbols for set theory
paulson
parents: 6144
diff changeset
    74
Goalw [I_def] "I \\<in> comb";
3014
f5554654d211 Moved diamond_trancl (which is independent of the rest) to the top
paulson
parents: 2954
diff changeset
    75
by (Blast_tac 1);
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 515
diff changeset
    76
qed "comb_I";
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
    77
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
    78
(** Non-contraction results **)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    79
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
    80
(*Derive a case for each combinator constructor*)
6141
a6922171b396 removal of the (thm list) argument of mk_cases
paulson
parents: 5268
diff changeset
    81
val K_contractE = contract.mk_cases "K -1-> r";
a6922171b396 removal of the (thm list) argument of mk_cases
paulson
parents: 5268
diff changeset
    82
val S_contractE = contract.mk_cases "S -1-> r";
a6922171b396 removal of the (thm list) argument of mk_cases
paulson
parents: 5268
diff changeset
    83
val Ap_contractE = contract.mk_cases "p#q -1-> r";
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
    84
3014
f5554654d211 Moved diamond_trancl (which is independent of the rest) to the top
paulson
parents: 2954
diff changeset
    85
AddIs  [contract.Ap1, contract.Ap2];
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1732
diff changeset
    86
AddSEs [K_contractE, S_contractE, Ap_contractE];
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
    87
5137
60205b0de9b9 Huge tidy-up: removal of leading \!\!
paulson
parents: 5068
diff changeset
    88
Goalw [I_def] "I -1-> r ==> P";
6144
7d38744313c8 tidied freeness reasoning
paulson
parents: 6141
diff changeset
    89
by Auto_tac;
782
200a16083201 added bind_thm for theorems defined by "standard ..."
clasohm
parents: 760
diff changeset
    90
qed "I_contract_E";
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
    91
11316
b4e71bd751e4 X-symbols for set theory
paulson
parents: 6144
diff changeset
    92
Goal "K#p -1-> r ==> (\\<exists>q. r = K#q & p -1-> q)";
6144
7d38744313c8 tidied freeness reasoning
paulson
parents: 6141
diff changeset
    93
by Auto_tac;
782
200a16083201 added bind_thm for theorems defined by "standard ..."
clasohm
parents: 760
diff changeset
    94
qed "K1_contractD";
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
    95
11316
b4e71bd751e4 X-symbols for set theory
paulson
parents: 6144
diff changeset
    96
Goal "[| p ---> q;  r \\<in> comb |] ==> p#r ---> q#r";
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
    97
by (forward_tac [rtrancl_type RS subsetD RS SigmaD1] 1);
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
    98
by (dtac (field_contract_eq RS equalityD1 RS subsetD) 1);
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
    99
by (etac rtrancl_induct 1);
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3014
diff changeset
   100
by (blast_tac (claset() addIs reduction_rls) 1);
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   101
by (etac (trans_rtrancl RS transD) 1);
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3014
diff changeset
   102
by (blast_tac (claset() addIs (contract_combD2::reduction_rls)) 1);
782
200a16083201 added bind_thm for theorems defined by "standard ..."
clasohm
parents: 760
diff changeset
   103
qed "Ap_reduce1";
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   104
11316
b4e71bd751e4 X-symbols for set theory
paulson
parents: 6144
diff changeset
   105
Goal "[| p ---> q;  r \\<in> comb |] ==> r#p ---> r#q";
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   106
by (forward_tac [rtrancl_type RS subsetD RS SigmaD1] 1);
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   107
by (dtac (field_contract_eq RS equalityD1 RS subsetD) 1);
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   108
by (etac rtrancl_induct 1);
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3014
diff changeset
   109
by (blast_tac (claset() addIs reduction_rls) 1);
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   110
by (etac (trans_rtrancl RS transD) 1);
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3014
diff changeset
   111
by (blast_tac (claset() addIs (contract_combD2::reduction_rls)) 1);
782
200a16083201 added bind_thm for theorems defined by "standard ..."
clasohm
parents: 760
diff changeset
   112
qed "Ap_reduce2";
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   113
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   114
(** Counterexample to the diamond property for -1-> **)
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   115
5068
fb28eaa07e01 isatool fixgoal;
wenzelm
parents: 4091
diff changeset
   116
Goal "K#I#(I#I) -1-> I";
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   117
by (REPEAT (ares_tac [contract.K, comb_I, comb_Ap] 1));
782
200a16083201 added bind_thm for theorems defined by "standard ..."
clasohm
parents: 760
diff changeset
   118
qed "KIII_contract1";
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   119
5068
fb28eaa07e01 isatool fixgoal;
wenzelm
parents: 4091
diff changeset
   120
Goalw [I_def] "K#I#(I#I) -1-> K#I#((K#I)#(K#I))";
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   121
by (DEPTH_SOLVE (resolve_tac (comb.intrs @ contract.intrs) 1));
782
200a16083201 added bind_thm for theorems defined by "standard ..."
clasohm
parents: 760
diff changeset
   122
qed "KIII_contract2";
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   123
5068
fb28eaa07e01 isatool fixgoal;
wenzelm
parents: 4091
diff changeset
   124
Goal "K#I#((K#I)#(K#I)) -1-> I";
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   125
by (REPEAT (ares_tac (comb.intrs @ [contract.K, comb_I]) 1));
782
200a16083201 added bind_thm for theorems defined by "standard ..."
clasohm
parents: 760
diff changeset
   126
qed "KIII_contract3";
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   127
5068
fb28eaa07e01 isatool fixgoal;
wenzelm
parents: 4091
diff changeset
   128
Goalw [diamond_def] "~ diamond(contract)";
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3014
diff changeset
   129
by (blast_tac (claset() addIs [KIII_contract1,KIII_contract2,KIII_contract3]
3014
f5554654d211 Moved diamond_trancl (which is independent of the rest) to the top
paulson
parents: 2954
diff changeset
   130
                       addSEs [I_contract_E]) 1);
782
200a16083201 added bind_thm for theorems defined by "standard ..."
clasohm
parents: 760
diff changeset
   131
qed "not_diamond_contract";
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   132
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   133
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   134
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   135
(*** Results about Parallel Contraction ***)
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   136
11316
b4e71bd751e4 X-symbols for set theory
paulson
parents: 6144
diff changeset
   137
(*For type checking: replaces a=1=>b by a,b \\<in> comb *)
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   138
val parcontract_combE2 = parcontract.dom_subset RS subsetD RS SigmaE2;
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   139
val parcontract_combD1 = parcontract.dom_subset RS subsetD RS SigmaD1;
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   140
val parcontract_combD2 = parcontract.dom_subset RS subsetD RS SigmaD2;
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   141
5068
fb28eaa07e01 isatool fixgoal;
wenzelm
parents: 4091
diff changeset
   142
Goal "field(parcontract) = comb";
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3014
diff changeset
   143
by (blast_tac (claset() addIs [parcontract.K] 
2496
40efb87985b5 Removal of needless "addIs [equality]", etc.
paulson
parents: 2469
diff changeset
   144
                      addSEs [parcontract_combE2]) 1);
782
200a16083201 added bind_thm for theorems defined by "standard ..."
clasohm
parents: 760
diff changeset
   145
qed "field_parcontract_eq";
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   146
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   147
(*Derive a case for each combinator constructor*)
6141
a6922171b396 removal of the (thm list) argument of mk_cases
paulson
parents: 5268
diff changeset
   148
val K_parcontractE = parcontract.mk_cases "K =1=> r";
a6922171b396 removal of the (thm list) argument of mk_cases
paulson
parents: 5268
diff changeset
   149
val S_parcontractE = parcontract.mk_cases "S =1=> r";
a6922171b396 removal of the (thm list) argument of mk_cases
paulson
parents: 5268
diff changeset
   150
val Ap_parcontractE = parcontract.mk_cases "p#q =1=> r";
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   151
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1732
diff changeset
   152
AddIs  parcontract.intrs;
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1732
diff changeset
   153
AddSEs [Ap_E, K_parcontractE, S_parcontractE, Ap_parcontractE];
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   154
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   155
(*** Basic properties of parallel contraction ***)
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   156
11316
b4e71bd751e4 X-symbols for set theory
paulson
parents: 6144
diff changeset
   157
Goal "K#p =1=> r ==> (\\<exists>p'. r = K#p' & p =1=> p')";
6144
7d38744313c8 tidied freeness reasoning
paulson
parents: 6141
diff changeset
   158
by Auto_tac;
782
200a16083201 added bind_thm for theorems defined by "standard ..."
clasohm
parents: 760
diff changeset
   159
qed "K1_parcontractD";
6144
7d38744313c8 tidied freeness reasoning
paulson
parents: 6141
diff changeset
   160
AddSDs [K1_parcontractD];
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   161
11316
b4e71bd751e4 X-symbols for set theory
paulson
parents: 6144
diff changeset
   162
Goal "S#p =1=> r ==> (\\<exists>p'. r = S#p' & p =1=> p')";
6144
7d38744313c8 tidied freeness reasoning
paulson
parents: 6141
diff changeset
   163
by Auto_tac;
782
200a16083201 added bind_thm for theorems defined by "standard ..."
clasohm
parents: 760
diff changeset
   164
qed "S1_parcontractD";
6144
7d38744313c8 tidied freeness reasoning
paulson
parents: 6141
diff changeset
   165
AddSDs [S1_parcontractD];
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   166
11316
b4e71bd751e4 X-symbols for set theory
paulson
parents: 6144
diff changeset
   167
Goal "S#p#q =1=> r ==> (\\<exists>p' q'. r = S#p'#q' & p =1=> p' & q =1=> q')";
6144
7d38744313c8 tidied freeness reasoning
paulson
parents: 6141
diff changeset
   168
by Auto_tac;
782
200a16083201 added bind_thm for theorems defined by "standard ..."
clasohm
parents: 760
diff changeset
   169
qed "S2_parcontractD";
6144
7d38744313c8 tidied freeness reasoning
paulson
parents: 6141
diff changeset
   170
AddSDs [S2_parcontractD];
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   171
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   172
(*Church-Rosser property for parallel contraction*)
5068
fb28eaa07e01 isatool fixgoal;
wenzelm
parents: 4091
diff changeset
   173
Goalw [diamond_def] "diamond(parcontract)";
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   174
by (rtac (impI RS allI RS allI) 1);
1732
38776e927da8 Updated for new form of induction rules
paulson
parents: 1692
diff changeset
   175
by (etac parcontract.induct 1);
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   176
by (ALLGOALS 
6144
7d38744313c8 tidied freeness reasoning
paulson
parents: 6141
diff changeset
   177
    (blast_tac (claset() addSEs comb.free_SEs
7d38744313c8 tidied freeness reasoning
paulson
parents: 6141
diff changeset
   178
			 addIs [parcontract_combD2])));
782
200a16083201 added bind_thm for theorems defined by "standard ..."
clasohm
parents: 760
diff changeset
   179
qed "diamond_parcontract";
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   180
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   181
(*** Equivalence of p--->q and p===>q ***)
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   182
5137
60205b0de9b9 Huge tidy-up: removal of leading \!\!
paulson
parents: 5068
diff changeset
   183
Goal "p-1->q ==> p=1=>q";
1732
38776e927da8 Updated for new form of induction rules
paulson
parents: 1692
diff changeset
   184
by (etac contract.induct 1);
6144
7d38744313c8 tidied freeness reasoning
paulson
parents: 6141
diff changeset
   185
by Auto_tac;
782
200a16083201 added bind_thm for theorems defined by "standard ..."
clasohm
parents: 760
diff changeset
   186
qed "contract_imp_parcontract";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   187
5137
60205b0de9b9 Huge tidy-up: removal of leading \!\!
paulson
parents: 5068
diff changeset
   188
Goal "p--->q ==> p===>q";
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   189
by (forward_tac [rtrancl_type RS subsetD RS SigmaD1] 1);
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   190
by (dtac (field_contract_eq RS equalityD1 RS subsetD) 1);
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   191
by (etac rtrancl_induct 1);
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3014
diff changeset
   192
by (blast_tac (claset() addIs [r_into_trancl]) 1);
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3014
diff changeset
   193
by (blast_tac (claset() addIs [contract_imp_parcontract, 
6144
7d38744313c8 tidied freeness reasoning
paulson
parents: 6141
diff changeset
   194
			       r_into_trancl, trans_trancl RS transD]) 1);
782
200a16083201 added bind_thm for theorems defined by "standard ..."
clasohm
parents: 760
diff changeset
   195
qed "reduce_imp_parreduce";
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   196
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   197
5137
60205b0de9b9 Huge tidy-up: removal of leading \!\!
paulson
parents: 5068
diff changeset
   198
Goal "p=1=>q ==> p--->q";
1732
38776e927da8 Updated for new form of induction rules
paulson
parents: 1692
diff changeset
   199
by (etac parcontract.induct 1);
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3014
diff changeset
   200
by (blast_tac (claset() addIs reduction_rls) 1);
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3014
diff changeset
   201
by (blast_tac (claset() addIs reduction_rls) 1);
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3014
diff changeset
   202
by (blast_tac (claset() addIs reduction_rls) 1);
3014
f5554654d211 Moved diamond_trancl (which is independent of the rest) to the top
paulson
parents: 2954
diff changeset
   203
by (blast_tac 
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3014
diff changeset
   204
    (claset() addIs [trans_rtrancl RS transD,
6144
7d38744313c8 tidied freeness reasoning
paulson
parents: 6141
diff changeset
   205
		     Ap_reduce1, Ap_reduce2, parcontract_combD1,
7d38744313c8 tidied freeness reasoning
paulson
parents: 6141
diff changeset
   206
		     parcontract_combD2]) 1);
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 515
diff changeset
   207
qed "parcontract_imp_reduce";
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   208
5137
60205b0de9b9 Huge tidy-up: removal of leading \!\!
paulson
parents: 5068
diff changeset
   209
Goal "p===>q ==> p--->q";
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   210
by (forward_tac [trancl_type RS subsetD RS SigmaD1] 1);
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   211
by (dtac (field_parcontract_eq RS equalityD1 RS subsetD) 1);
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   212
by (etac trancl_induct 1);
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   213
by (etac parcontract_imp_reduce 1);
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   214
by (etac (trans_rtrancl RS transD) 1);
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   215
by (etac parcontract_imp_reduce 1);
782
200a16083201 added bind_thm for theorems defined by "standard ..."
clasohm
parents: 760
diff changeset
   216
qed "parreduce_imp_reduce";
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   217
5068
fb28eaa07e01 isatool fixgoal;
wenzelm
parents: 4091
diff changeset
   218
Goal "p===>q <-> p--->q";
6144
7d38744313c8 tidied freeness reasoning
paulson
parents: 6141
diff changeset
   219
by (blast_tac (claset() addIs [parreduce_imp_reduce, reduce_imp_parreduce]) 1);
782
200a16083201 added bind_thm for theorems defined by "standard ..."
clasohm
parents: 760
diff changeset
   220
qed "parreduce_iff_reduce";
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   221
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   222
writeln"Reached end of file.";