src/ZF/AC/AC7_AC9.ML
author paulson
Mon, 29 Sep 1997 11:48:48 +0200
changeset 3731 71366483323b
parent 2873 5f0599e15448
child 4091 771b1f6422a8
permissions -rw-r--r--
result() -> qed; Step_tac -> Safe_tac
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
     1
(*  Title:      ZF/AC/AC7-AC9.ML
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
     2
    ID:         $Id$
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
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 proofs needed to state that AC7, AC8 and AC9 are equivalent to the previous
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
     6
instances of AC.
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
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
     9
(* ********************************************************************** *)
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
    10
(* Lemmas used in the proofs AC7 ==> AC6 and AC9 ==> AC1                  *)
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
    11
(*  - Sigma_fun_space_not0                                                *)
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
    12
(*  - all_eqpoll_imp_pair_eqpoll                                          *)
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
    13
(*  - Sigma_fun_space_eqpoll                                              *)
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    14
(* ********************************************************************** *)
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    15
2873
5f0599e15448 Converted back from upair.thy to ZF.thy
paulson
parents: 2469
diff changeset
    16
goal ZF.thy "!!A. [| C~:A; B:A |] ==> B~=C";
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1461
diff changeset
    17
by (Fast_tac 1);
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
    18
qed "mem_not_eq_not_mem";
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    19
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    20
goal thy "!!A. [| 0~:A; B:A |] ==> (nat->Union(A))*B ~= 0";
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1461
diff changeset
    21
by (fast_tac (!claset addSDs [Sigma_empty_iff RS iffD1]
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
    22
                addDs [fun_space_emptyD, mem_not_eq_not_mem]
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
    23
                addEs [equals0D]
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
    24
                addSIs [equals0I,UnionI]) 1);
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
    25
qed "Sigma_fun_space_not0";
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    26
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    27
goal thy "!!A C. (ALL B:A. B eqpoll C) ==> (ALL B1:A. ALL B2:A. B1 eqpoll B2)";
1207
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1196
diff changeset
    28
by (REPEAT (rtac ballI 1));
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    29
by (resolve_tac [bspec RS (bspec RSN (2, eqpoll_sym RSN (2, eqpoll_trans)))] 1
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
    30
        THEN REPEAT (assume_tac 1));
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
    31
qed "all_eqpoll_imp_pair_eqpoll";
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    32
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    33
goal thy "!!A. [| ALL a:A. if(a=b, P(a), Q(a)) = if(a=b, R(a), S(a)); b:A   \
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
    34
\       |] ==> P(b)=R(b)";
1207
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1196
diff changeset
    35
by (dtac bspec 1 THEN (assume_tac 1));
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1461
diff changeset
    36
by (Asm_full_simp_tac 1);
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
    37
qed "if_eqE1";
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    38
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    39
goal thy "!!A. ALL a:A. if(a=b, P(a), Q(a)) = if(a=b, R(a), S(a))  \
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
    40
\       ==> ALL a:A. a~=b --> Q(a)=S(a)";
1207
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1196
diff changeset
    41
by (rtac ballI 1);
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1196
diff changeset
    42
by (rtac impI 1);
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1196
diff changeset
    43
by (dtac bspec 1 THEN (assume_tac 1));
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1461
diff changeset
    44
by (Asm_full_simp_tac 1);
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
    45
qed "if_eqE2";
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
goal thy "!!A. [| (lam x:A. f(x))=(lam x:A. g(x)); a:A |] ==> f(a)=g(a)";
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1461
diff changeset
    48
by (fast_tac (!claset addDs [subsetD]
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
    49
                addSIs [lamI]
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
    50
                addEs [equalityE, lamE]) 1);
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
    51
qed "lam_eqE";
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    52
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    53
goalw thy [inj_def]
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
    54
        "!!A. C:A ==> (lam g:(nat->Union(A))*C.  \
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
    55
\               (lam n:nat. if(n=0, snd(g), fst(g)`(n #- 1))))  \
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
    56
\               : inj((nat->Union(A))*C, (nat->Union(A)) ) ";
1207
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1196
diff changeset
    57
by (rtac CollectI 1);
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1461
diff changeset
    58
by (fast_tac (!claset addSIs [lam_type,RepFunI,if_type,snd_type,apply_type,
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
    59
                                fst_type,diff_type,nat_succI,nat_0I]) 1);
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    60
by (REPEAT (resolve_tac [ballI, impI] 1));
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1461
diff changeset
    61
by (Asm_full_simp_tac 1);
1207
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1196
diff changeset
    62
by (REPEAT (etac SigmaE 1));
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    63
by (REPEAT (hyp_subst_tac 1));
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1461
diff changeset
    64
by (Asm_full_simp_tac 1);
1207
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1196
diff changeset
    65
by (rtac conjI 1);
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    66
by (dresolve_tac [nat_0I RSN (2, lam_eqE)] 2);
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1461
diff changeset
    67
by (Asm_full_simp_tac 2);
1207
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1196
diff changeset
    68
by (rtac fun_extension 1 THEN  REPEAT (assume_tac 1));
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents: 1123
diff changeset
    69
by (dresolve_tac [nat_succI RSN (2, lam_eqE)] 1 THEN (assume_tac 1));
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1461
diff changeset
    70
by (asm_full_simp_tac (!simpset addsimps [succ_not_0 RS if_not_P]) 1);
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    71
val lemma = result();
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    72
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    73
goal thy "!!A. [| C:A; 0~:A |] ==> (nat->Union(A)) * C eqpoll (nat->Union(A))";
1207
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1196
diff changeset
    74
by (rtac eqpollI 1);
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1461
diff changeset
    75
by (fast_tac (!claset addSEs [prod_lepoll_self, not_sym RS not_emptyE,
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
    76
                subst_elem] addEs [swap]) 2);
1207
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1196
diff changeset
    77
by (rewtac lepoll_def);
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1461
diff changeset
    78
by (fast_tac (!claset addSIs [lemma]) 1);
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
    79
qed "Sigma_fun_space_eqpoll";
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    80
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    81
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    82
(* ********************************************************************** *)
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
    83
(* AC6 ==> AC7                                                            *)
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    84
(* ********************************************************************** *)
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    85
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    86
goalw thy AC_defs "!!Z. AC6 ==> AC7";
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1461
diff changeset
    87
by (Fast_tac 1);
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents: 1123
diff changeset
    88
qed "AC6_AC7";
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    89
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    90
(* ********************************************************************** *)
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
    91
(* AC7 ==> AC6, Rubin & Rubin p. 12, Theorem 2.8                          *)
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
    92
(* The case of the empty family of sets added in order to complete        *)
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
    93
(* the proof.                                                             *)
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    94
(* ********************************************************************** *)
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    95
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    96
goal thy "!!y. y: (PROD B:A. Y*B) ==> (lam B:A. snd(y`B)): (PROD B:A. B)";
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1461
diff changeset
    97
by (fast_tac (!claset addSIs [lam_type, snd_type, apply_type]) 1);
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    98
val lemma1_1 = result();
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
    99
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   100
goal thy "!!A. y: (PROD B:{Y*C. C:A}. B)  \
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
   101
\               ==> (lam B:A. y`(Y*B)): (PROD B:A. Y*B)";
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1461
diff changeset
   102
by (fast_tac (!claset addSIs [lam_type, apply_type]) 1);
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   103
val lemma1_2 = result();
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   104
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   105
goal thy "!!A. (PROD B:{(nat->Union(A))*C. C:A}. B) ~= 0  \
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
   106
\               ==> (PROD B:A. B) ~= 0";
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1461
diff changeset
   107
by (fast_tac (!claset addSIs [equals0I,lemma1_1, lemma1_2]
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
   108
                addSEs [equals0D]) 1);
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   109
val lemma1 = result();
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   110
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   111
goal thy "!!A. 0 ~: A ==> 0 ~: {(nat -> Union(A)) * C. C:A}";
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1461
diff changeset
   112
by (fast_tac (!claset addEs [RepFunE,
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
   113
                Sigma_fun_space_not0 RS not_sym RS notE]) 1);
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   114
val lemma2 = result();
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   115
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   116
goalw thy AC_defs "!!Z. AC7 ==> AC6";
1207
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1196
diff changeset
   117
by (rtac allI 1);
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1196
diff changeset
   118
by (rtac impI 1);
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   119
by (excluded_middle_tac "A=0" 1);
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1461
diff changeset
   120
by (fast_tac (!claset addSIs [not_emptyI, empty_fun]) 2);
1207
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1196
diff changeset
   121
by (rtac lemma1 1);
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1196
diff changeset
   122
by (etac allE 1);
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1196
diff changeset
   123
by (etac impE 1 THEN (assume_tac 2));
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1461
diff changeset
   124
by (fast_tac (!claset addSEs [RepFunE]
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
   125
        addSIs [lemma2, all_eqpoll_imp_pair_eqpoll,
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
   126
                Sigma_fun_space_eqpoll]) 1);
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents: 1123
diff changeset
   127
qed "AC7_AC6";
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   128
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   129
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   130
(* ********************************************************************** *)
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
   131
(* AC1 ==> AC8                                                            *)
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   132
(* ********************************************************************** *)
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   133
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   134
goalw thy [eqpoll_def]
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
   135
        "!!A. ALL B:A. EX B1 B2. B=<B1,B2> & B1 eqpoll B2  \
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
   136
\       ==> 0 ~: { bij(fst(B),snd(B)). B:A }";
1207
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1196
diff changeset
   137
by (rtac notI 1);
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1196
diff changeset
   138
by (etac RepFunE 1);
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1196
diff changeset
   139
by (dtac bspec 1 THEN (assume_tac 1));
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   140
by (REPEAT (eresolve_tac [exE,conjE] 1));
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   141
by (hyp_subst_tac 1);
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1461
diff changeset
   142
by (Asm_full_simp_tac 1);
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1461
diff changeset
   143
by (fast_tac (!claset addSEs [sym RS equals0D]) 1);
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   144
val lemma1 = result();
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   145
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   146
goal thy "!!A. [| f: (PROD X:RepFun(A,p). X); D:A |]  \
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
   147
\               ==> (lam x:A. f`p(x))`D : p(D)";
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents: 1123
diff changeset
   148
by (resolve_tac [beta RS ssubst] 1 THEN (assume_tac 1));
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1461
diff changeset
   149
by (fast_tac (!claset addSEs [apply_type]) 1);
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   150
val lemma2 = result();
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   151
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   152
goalw thy AC_defs "!!Z. AC1 ==> AC8";
1207
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1196
diff changeset
   153
by (rtac allI 1);
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1196
diff changeset
   154
by (etac allE 1);
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1196
diff changeset
   155
by (rtac impI 1);
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1196
diff changeset
   156
by (etac impE 1);
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1196
diff changeset
   157
by (etac lemma1 1);
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1461
diff changeset
   158
by (fast_tac (!claset addSEs [lemma2]) 1);
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents: 1123
diff changeset
   159
qed "AC1_AC8";
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   160
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   161
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   162
(* ********************************************************************** *)
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
   163
(* AC8 ==> AC9                                                            *)
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
   164
(*  - this proof replaces the following two from Rubin & Rubin:           *)
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
   165
(*    AC8 ==> AC1 and AC1 ==> AC9                                         *)
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   166
(* ********************************************************************** *)
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   167
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   168
goal thy "!!A. ALL B1:A. ALL B2:A. B1 eqpoll B2 ==>  \
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
   169
\               ALL B:A*A. EX B1 B2. B=<B1,B2> & B1 eqpoll B2";
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1461
diff changeset
   170
by (Fast_tac 1);
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   171
val lemma1 = result();
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   172
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   173
goal thy "!!f. f:bij(fst(<a,b>),snd(<a,b>)) ==> f:bij(a,b)";
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1461
diff changeset
   174
by (Asm_full_simp_tac 1);
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   175
val lemma2 = result();
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   176
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   177
goalw thy AC_defs "!!Z. AC8 ==> AC9";
1207
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1196
diff changeset
   178
by (rtac allI 1);
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1196
diff changeset
   179
by (rtac impI 1);
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1196
diff changeset
   180
by (etac allE 1);
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1196
diff changeset
   181
by (etac impE 1);
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1196
diff changeset
   182
by (etac lemma1 1);
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1461
diff changeset
   183
by (fast_tac (!claset addSEs [lemma2]) 1);
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents: 1123
diff changeset
   184
qed "AC8_AC9";
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   185
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   186
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   187
(* ********************************************************************** *)
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
   188
(* AC9 ==> AC1                                                            *)
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   189
(* The idea of this proof comes from "Equivalents of the Axiom of Choice" *)
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
   190
(* by Rubin & Rubin. But (x * y) is not necessarily equipollent to        *)
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
   191
(* (x * y) Un {0} when y is a set of total functions acting from nat to   *)
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
   192
(* Union(A) -- therefore we have used the set (y * nat) instead of y.     *)
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   193
(* ********************************************************************** *)
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   194
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   195
(* Rules nedded to prove lemma1 *)
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   196
val snd_lepoll_SigmaI = prod_lepoll_self RS 
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   197
        ((prod_commute_eqpoll RS eqpoll_imp_lepoll) RSN (2,lepoll_trans));
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1461
diff changeset
   198
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   199
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   200
goal thy "!!A. [| 0~:A; A~=0 |]  \
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
   201
\       ==> ALL B1: ({((nat->Union(A))*B)*nat. B:A}  \
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
   202
\               Un {cons(0,((nat->Union(A))*B)*nat). B:A}).  \
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
   203
\       ALL B2: ({((nat->Union(A))*B)*nat. B:A}  \
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
   204
\               Un {cons(0,((nat->Union(A))*B)*nat). B:A}).  \
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
   205
\       B1 eqpoll B2";
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1461
diff changeset
   206
by (fast_tac (!claset addSIs [all_eqpoll_imp_pair_eqpoll, ballI,
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1461
diff changeset
   207
                        nat_cons_eqpoll RS eqpoll_trans]
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1461
diff changeset
   208
                addEs [Sigma_fun_space_not0 RS not_emptyE]
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1461
diff changeset
   209
                addIs [snd_lepoll_SigmaI, eqpoll_refl RSN 
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1461
diff changeset
   210
                        (2, prod_eqpoll_cong), Sigma_fun_space_eqpoll]) 1);
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   211
val lemma1 = result();
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   212
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   213
goal thy "!!A. ALL B1:{(F*B)*N. B:A} Un {cons(0,(F*B)*N). B:A}.  \
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
   214
\       ALL B2:{(F*B)*N. B:A}  \
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
   215
\       Un {cons(0,(F*B)*N). B:A}. f`<B1,B2> : bij(B1, B2)  \
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
   216
\       ==> (lam B:A. snd(fst((f`<cons(0,(F*B)*N),(F*B)*N>)`0))) :  \
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
   217
\               (PROD X:A. X)";
1207
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1196
diff changeset
   218
by (rtac lam_type 1);
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1196
diff changeset
   219
by (rtac snd_type 1);
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1196
diff changeset
   220
by (rtac fst_type 1);
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   221
by (resolve_tac [consI1 RSN (2, apply_type)] 1);
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1461
diff changeset
   222
by (fast_tac (!claset addSIs [fun_weaken_type, bij_is_fun]) 1);
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   223
val lemma2 = result();
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   224
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents: 1123
diff changeset
   225
goalw thy AC_defs "!!Z. AC9 ==> AC1";
1207
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1196
diff changeset
   226
by (rtac allI 1);
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1196
diff changeset
   227
by (rtac impI 1);
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1196
diff changeset
   228
by (etac allE 1);
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents:
diff changeset
   229
by (excluded_middle_tac "A=0" 1);
1207
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1196
diff changeset
   230
by (etac impE 1);
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1196
diff changeset
   231
by (rtac lemma1 1 THEN (REPEAT (assume_tac 1)));
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1461
diff changeset
   232
by (fast_tac (!claset addSEs [lemma2]) 1);
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1461
diff changeset
   233
by (fast_tac (!claset addSIs [empty_fun]) 1);
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents: 1123
diff changeset
   234
qed "AC9_AC1";