src/ZF/AC/AC18_AC19.ML
author paulson
Wed, 15 Jul 1998 14:13:18 +0200
changeset 5147 825877190618
parent 5137 60205b0de9b9
child 5241 e5129172cb2b
permissions -rw-r--r--
More tidying and removal of "\!\!... from Goal commands
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1206
diff changeset
     1
(*  Title:      ZF/AC/AC18_AC19.ML
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
     2
    ID:         $Id$
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1206
diff changeset
     3
    Author:     Krzysztof Grabczewski
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
     4
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
     5
The proof of AC1 ==> AC18 ==> AC19 ==> AC1
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
     6
*)
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
     7
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
     8
open AC18_AC19;
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
     9
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    10
(* ********************************************************************** *)
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1206
diff changeset
    11
(* AC1 ==> AC18                                                           *)
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    12
(* ********************************************************************** *)
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    13
5137
60205b0de9b9 Huge tidy-up: removal of leading \!\!
paulson
parents: 5116
diff changeset
    14
Goal "[| f: (PROD b:{P(a). a:A}. b); ALL a:A. P(a)<=Q(a) |]  \
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1206
diff changeset
    15
\               ==> (lam a:A. f`P(a)):(PROD a:A. Q(a))";
1206
30df104ceb91 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1196
diff changeset
    16
by (rtac lam_type 1);
30df104ceb91 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1196
diff changeset
    17
by (dtac apply_type 1);
30df104ceb91 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1196
diff changeset
    18
by (rtac RepFunI 1 THEN (assume_tac 1));
30df104ceb91 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1196
diff changeset
    19
by (dtac bspec 1 THEN (assume_tac 1));
30df104ceb91 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1196
diff changeset
    20
by (etac subsetD 1 THEN (assume_tac 1));
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2845
diff changeset
    21
qed "PROD_subsets";
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    22
5137
60205b0de9b9 Huge tidy-up: removal of leading \!\!
paulson
parents: 5116
diff changeset
    23
Goal "[| ALL A. 0 ~: A --> (EX f. f : (PROD X:A. X)); A ~= 0 |] ==>  \
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    24
\  (INT a:A. UN b:B(a). X(a, b)) <= (UN f:PROD a:A. B(a). INT a:A. X(a, f`a))";
1206
30df104ceb91 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1196
diff changeset
    25
by (rtac subsetI 1);
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    26
by (eres_inst_tac [("x","{{b:B(a). x:X(a,b)}. a:A}")] allE 1);
1206
30df104ceb91 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1196
diff changeset
    27
by (etac impE 1);
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
    28
by (fast_tac (claset() addSEs [RepFunE] addSDs [INT_E]
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1206
diff changeset
    29
                addEs [UN_E, sym RS equals0D]) 1);
1206
30df104ceb91 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1196
diff changeset
    30
by (etac exE 1);
30df104ceb91 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1196
diff changeset
    31
by (rtac UN_I 1);
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
    32
by (fast_tac (claset() addSEs [PROD_subsets]) 1);
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1461
diff changeset
    33
by (Simp_tac 1);
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
    34
by (fast_tac (claset() addSEs [not_emptyE] addDs [RepFunI RSN (2, apply_type)]
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1206
diff changeset
    35
                addEs [CollectD2] addSIs [INT_I]) 1);
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2845
diff changeset
    36
qed "lemma_AC18";
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    37
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    38
val [prem] = goalw thy (AC18_def::AC_defs) "AC1 ==> AC18";
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    39
by (resolve_tac [prem RS revcut_rl] 1);
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
    40
by (fast_tac (claset() addSEs [lemma_AC18, not_emptyE, apply_type]
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1206
diff changeset
    41
                addSIs [equalityI, INT_I, UN_I]) 1);
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents: 1123
diff changeset
    42
qed "AC1_AC18";
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    43
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    44
(* ********************************************************************** *)
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1206
diff changeset
    45
(* AC18 ==> AC19                                                          *)
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    46
(* ********************************************************************** *)
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    47
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    48
val [prem] = goalw thy [AC18_def, AC19_def] "AC18 ==> AC19";
1206
30df104ceb91 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1196
diff changeset
    49
by (rtac allI 1);
3840
e0baea4d485a fixed dots;
wenzelm
parents: 3731
diff changeset
    50
by (res_inst_tac [("B1","%x. x")] (forall_elim_vars 0 prem RS revcut_rl) 1);
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1461
diff changeset
    51
by (Fast_tac 1);
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents: 1123
diff changeset
    52
qed "AC18_AC19";
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    53
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    54
(* ********************************************************************** *)
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1206
diff changeset
    55
(* AC19 ==> AC1                                                           *)
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    56
(* ********************************************************************** *)
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    57
5068
fb28eaa07e01 isatool fixgoal;
wenzelm
parents: 4091
diff changeset
    58
Goalw [u_def]
5147
825877190618 More tidying and removal of "\!\!... from Goal commands
paulson
parents: 5137
diff changeset
    59
        "[| A ~= 0; 0 ~: A |] ==> {u_(a). a:A} ~= 0 & 0 ~: {u_(a). a:A}";
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
    60
by (fast_tac (claset() addSIs [not_emptyI, RepFunI]
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1206
diff changeset
    61
                addSEs [not_emptyE, RepFunE]
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1206
diff changeset
    62
                addSDs [sym RS (RepFun_eq_0_iff RS iffD1)]) 1);
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2845
diff changeset
    63
qed "RepRep_conj";
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    64
5137
60205b0de9b9 Huge tidy-up: removal of leading \!\!
paulson
parents: 5116
diff changeset
    65
Goal "[|c : a; x = c Un {0}; x ~: a |] ==> x - {0} : a";
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    66
by (hyp_subst_tac 1);
1206
30df104ceb91 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1196
diff changeset
    67
by (rtac subst_elem 1 THEN (assume_tac 1));
30df104ceb91 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1196
diff changeset
    68
by (rtac equalityI 1);
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1461
diff changeset
    69
by (Fast_tac 1);
1206
30df104ceb91 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1196
diff changeset
    70
by (rtac subsetI 1);
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    71
by (excluded_middle_tac "x=0" 1);
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1461
diff changeset
    72
by (Fast_tac 1);
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
    73
by (fast_tac (claset() addEs [notE, subst_elem])  1);
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    74
val lemma1_1 = result();
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    75
5068
fb28eaa07e01 isatool fixgoal;
wenzelm
parents: 4091
diff changeset
    76
Goalw [u_def]
5147
825877190618 More tidying and removal of "\!\!... from Goal commands
paulson
parents: 5137
diff changeset
    77
        "[| f`(u_(a)) ~: a; f: (PROD B:{u_(a). a:A}. B); a:A |]  \
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1206
diff changeset
    78
\               ==> f`(u_(a))-{0} : a";
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
    79
by (fast_tac (claset() addSEs [RepFunI, RepFunE, lemma1_1]
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1206
diff changeset
    80
                addSDs [apply_type]) 1);
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    81
val lemma1_2 = result();
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    82
5137
60205b0de9b9 Huge tidy-up: removal of leading \!\!
paulson
parents: 5116
diff changeset
    83
Goal  "EX f. f: (PROD B:{u_(a). a:A}. B) ==> EX f. f: (PROD B:A. B)";
1206
30df104ceb91 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1196
diff changeset
    84
by (etac exE 1);
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    85
by (res_inst_tac
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1206
diff changeset
    86
        [("x","lam a:A. if(f`(u_(a)) : a, f`(u_(a)), f`(u_(a))-{0})")] exI 1);
1206
30df104ceb91 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1196
diff changeset
    87
by (rtac lam_type 1);
5116
8eb343ab5748 Renamed expand_if to split_if and setloop split_tac to addsplits,
paulson
parents: 5068
diff changeset
    88
by (split_tac [split_if] 1);
1206
30df104ceb91 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1196
diff changeset
    89
by (rtac conjI 1);
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1461
diff changeset
    90
by (Fast_tac 1);
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
    91
by (fast_tac (claset() addSEs [lemma1_2]) 1);
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    92
val lemma1 = result();
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    93
5137
60205b0de9b9 Huge tidy-up: removal of leading \!\!
paulson
parents: 5116
diff changeset
    94
Goalw [u_def] "a~=0 ==> 0: (UN b:u_(a). b)";
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
    95
by (fast_tac (claset() addSEs [not_emptyE] addSIs [UN_I, RepFunI]) 1);
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    96
val lemma2_1 = result();
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    97
5137
60205b0de9b9 Huge tidy-up: removal of leading \!\!
paulson
parents: 5116
diff changeset
    98
Goal "[| A~=0; 0~:A |] ==> (INT x:{u_(a). a:A}. UN b:x. b) ~= 0";
1206
30df104ceb91 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1196
diff changeset
    99
by (etac not_emptyE 1);
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   100
by (res_inst_tac [("a","0")] not_emptyI 1);
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
   101
by (fast_tac (claset() addSIs [INT_I, RepFunI, lemma2_1] addSEs [RepFunE]) 1);
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   102
val lemma2 = result();
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   103
5137
60205b0de9b9 Huge tidy-up: removal of leading \!\!
paulson
parents: 5116
diff changeset
   104
Goal "(UN f:F. P(f)) ~= 0 ==> F ~= 0";
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
   105
by (fast_tac (claset() addSEs [not_emptyE]) 1);
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   106
val lemma3 = result();
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   107
5137
60205b0de9b9 Huge tidy-up: removal of leading \!\!
paulson
parents: 5116
diff changeset
   108
Goalw AC_defs "AC19 ==> AC1";
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   109
by (REPEAT (resolve_tac [allI,impI] 1));
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   110
by (excluded_middle_tac "A=0" 1);
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
   111
by (fast_tac (claset() addSIs [exI, empty_fun]) 2);
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   112
by (eres_inst_tac [("x","{u_(a). a:A}")] allE 1);
1206
30df104ceb91 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1196
diff changeset
   113
by (etac impE 1);
30df104ceb91 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1196
diff changeset
   114
by (etac RepRep_conj 1 THEN (assume_tac 1));
30df104ceb91 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1196
diff changeset
   115
by (rtac lemma1 1);
30df104ceb91 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1196
diff changeset
   116
by (dtac lemma2 1 THEN (assume_tac 1));
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   117
by (dres_inst_tac [("P","%x. x~=0")] subst 1 THEN (assume_tac 1));
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
   118
by (fast_tac (claset() addSEs [lemma3 RS not_emptyE]) 1);
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents: 1123
diff changeset
   119
qed "AC19_AC1";
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   120
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   121