1461
|
1 |
(* Title: ZF/AC/AC18_AC19.ML
|
1123
|
2 |
ID: $Id$
|
1461
|
3 |
Author: Krzysztof Grabczewski
|
1123
|
4 |
|
|
5 |
The proof of AC1 ==> AC18 ==> AC19 ==> AC1
|
|
6 |
*)
|
|
7 |
|
|
8 |
open AC18_AC19;
|
|
9 |
|
|
10 |
(* ********************************************************************** *)
|
1461
|
11 |
(* AC1 ==> AC18 *)
|
1123
|
12 |
(* ********************************************************************** *)
|
|
13 |
|
|
14 |
goal thy "!!f. [| f: (PROD b:{P(a). a:A}. b); ALL a:A. P(a)<=Q(a) |] \
|
1461
|
15 |
\ ==> (lam a:A. f`P(a)):(PROD a:A. Q(a))";
|
1206
|
16 |
by (rtac lam_type 1);
|
|
17 |
by (dtac apply_type 1);
|
|
18 |
by (rtac RepFunI 1 THEN (assume_tac 1));
|
|
19 |
by (dtac bspec 1 THEN (assume_tac 1));
|
|
20 |
by (etac subsetD 1 THEN (assume_tac 1));
|
1123
|
21 |
val PROD_subsets = result();
|
|
22 |
|
|
23 |
goal thy "!!X. [| ALL A. 0 ~: A --> (EX f. f : (PROD X:A. X)); A ~= 0 |] ==> \
|
|
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
|
25 |
by (rtac subsetI 1);
|
1123
|
26 |
by (eres_inst_tac [("x","{{b:B(a). x:X(a,b)}. a:A}")] allE 1);
|
1206
|
27 |
by (etac impE 1);
|
1123
|
28 |
by (fast_tac (AC_cs addSEs [RepFunE] addSDs [INT_E]
|
1461
|
29 |
addEs [UN_E, sym RS equals0D]) 1);
|
1206
|
30 |
by (etac exE 1);
|
|
31 |
by (rtac UN_I 1);
|
1123
|
32 |
by (fast_tac (AC_cs addSEs [PROD_subsets]) 1);
|
|
33 |
by (simp_tac AC_ss 1);
|
|
34 |
by (fast_tac (FOL_cs addSEs [not_emptyE] addDs [RepFunI RSN (2, apply_type)]
|
1461
|
35 |
addEs [CollectD2] addSIs [INT_I]) 1);
|
1123
|
36 |
val lemma_AC18 = result();
|
|
37 |
|
|
38 |
val [prem] = goalw thy (AC18_def::AC_defs) "AC1 ==> AC18";
|
|
39 |
by (resolve_tac [prem RS revcut_rl] 1);
|
|
40 |
by (fast_tac (AC_cs addSEs [lemma_AC18, UN_E, not_emptyE, apply_type]
|
1461
|
41 |
addSIs [equalityI, INT_I, UN_I]) 1);
|
1196
|
42 |
qed "AC1_AC18";
|
1123
|
43 |
|
|
44 |
(* ********************************************************************** *)
|
1461
|
45 |
(* AC18 ==> AC19 *)
|
1123
|
46 |
(* ********************************************************************** *)
|
|
47 |
|
|
48 |
val [prem] = goalw thy [AC18_def, AC19_def] "AC18 ==> AC19";
|
1206
|
49 |
by (rtac allI 1);
|
1123
|
50 |
by (res_inst_tac [("B1","%x.x")] (forall_elim_vars 0 prem RS revcut_rl) 1);
|
|
51 |
by (fast_tac AC_cs 1);
|
1196
|
52 |
qed "AC18_AC19";
|
1123
|
53 |
|
|
54 |
(* ********************************************************************** *)
|
1461
|
55 |
(* AC19 ==> AC1 *)
|
1123
|
56 |
(* ********************************************************************** *)
|
|
57 |
|
|
58 |
goalw thy [u_def]
|
1461
|
59 |
"!!A. [| A ~= 0; 0 ~: A |] ==> {u_(a). a:A} ~= 0 & 0 ~: {u_(a). a:A}";
|
1123
|
60 |
by (fast_tac (AC_cs addSIs [not_emptyI, RepFunI]
|
1461
|
61 |
addSEs [not_emptyE, RepFunE]
|
|
62 |
addSDs [sym RS (RepFun_eq_0_iff RS iffD1)]) 1);
|
1123
|
63 |
val RepRep_conj = result();
|
|
64 |
|
|
65 |
goal thy "!!c. [|c : a; x = c Un {0}; x ~: a |] ==> x - {0} : a";
|
|
66 |
by (hyp_subst_tac 1);
|
1206
|
67 |
by (rtac subst_elem 1 THEN (assume_tac 1));
|
|
68 |
by (rtac equalityI 1);
|
1123
|
69 |
by (fast_tac AC_cs 1);
|
1206
|
70 |
by (rtac subsetI 1);
|
1123
|
71 |
by (excluded_middle_tac "x=0" 1);
|
|
72 |
by (fast_tac AC_cs 1);
|
|
73 |
by (fast_tac (AC_cs addEs [notE, subst_elem] addSIs [equalityI]) 1);
|
|
74 |
val lemma1_1 = result();
|
|
75 |
|
|
76 |
goalw thy [u_def]
|
1461
|
77 |
"!!a. [| f`(u_(a)) ~: a; f: (PROD B:{u_(a). a:A}. B); a:A |] \
|
|
78 |
\ ==> f`(u_(a))-{0} : a";
|
1123
|
79 |
by (fast_tac (AC_cs addSEs [RepFunI, RepFunE, lemma1_1]
|
1461
|
80 |
addSDs [apply_type]) 1);
|
1123
|
81 |
val lemma1_2 = result();
|
|
82 |
|
|
83 |
goal thy "!!A. EX f. f: (PROD B:{u_(a). a:A}. B) ==> EX f. f: (PROD B:A. B)";
|
1206
|
84 |
by (etac exE 1);
|
1123
|
85 |
by (res_inst_tac
|
1461
|
86 |
[("x","lam a:A. if(f`(u_(a)) : a, f`(u_(a)), f`(u_(a))-{0})")] exI 1);
|
1206
|
87 |
by (rtac lam_type 1);
|
1123
|
88 |
by (split_tac [expand_if] 1);
|
1206
|
89 |
by (rtac conjI 1);
|
1123
|
90 |
by (fast_tac AC_cs 1);
|
|
91 |
by (fast_tac (AC_cs addSEs [lemma1_2]) 1);
|
|
92 |
val lemma1 = result();
|
|
93 |
|
|
94 |
goalw thy [u_def] "!!a. a~=0 ==> 0: (UN b:u_(a). b)";
|
|
95 |
by (fast_tac (AC_cs addSEs [not_emptyE] addSIs [UN_I, RepFunI]) 1);
|
|
96 |
val lemma2_1 = result();
|
|
97 |
|
|
98 |
goal thy "!!A C. [| A~=0; 0~:A |] ==> (INT x:{u_(a). a:A}. UN b:x. b) ~= 0";
|
1206
|
99 |
by (etac not_emptyE 1);
|
1123
|
100 |
by (res_inst_tac [("a","0")] not_emptyI 1);
|
|
101 |
by (fast_tac (AC_cs addSIs [INT_I, RepFunI, lemma2_1] addSEs [RepFunE]) 1);
|
|
102 |
val lemma2 = result();
|
|
103 |
|
|
104 |
goal thy "!!F. (UN f:F. P(f)) ~= 0 ==> F ~= 0";
|
|
105 |
by (fast_tac (AC_cs addSEs [not_emptyE]) 1);
|
|
106 |
val lemma3 = result();
|
|
107 |
|
|
108 |
goalw thy AC_defs "!!Z. AC19 ==> AC1";
|
|
109 |
by (REPEAT (resolve_tac [allI,impI] 1));
|
|
110 |
by (excluded_middle_tac "A=0" 1);
|
|
111 |
by (fast_tac (AC_cs addSIs [empty_fun]) 2);
|
|
112 |
by (eres_inst_tac [("x","{u_(a). a:A}")] allE 1);
|
1206
|
113 |
by (etac impE 1);
|
|
114 |
by (etac RepRep_conj 1 THEN (assume_tac 1));
|
|
115 |
by (rtac lemma1 1);
|
|
116 |
by (dtac lemma2 1 THEN (assume_tac 1));
|
1123
|
117 |
by (dres_inst_tac [("P","%x. x~=0")] subst 1 THEN (assume_tac 1));
|
|
118 |
by (fast_tac (AC_cs addSEs [lemma3 RS not_emptyE]) 1);
|
1196
|
119 |
qed "AC19_AC1";
|
1123
|
120 |
|
|
121 |
|