6 Ordered pairs in Zermelo-Fraenkel Set Theory |
6 Ordered pairs in Zermelo-Fraenkel Set Theory |
7 *) |
7 *) |
8 |
8 |
9 (** Lemmas for showing that <a,b> uniquely determines a and b **) |
9 (** Lemmas for showing that <a,b> uniquely determines a and b **) |
10 |
10 |
11 qed_goal "doubleton_iff" ZF.thy |
11 qed_goal "singleton_eq_iff" ZF.thy |
|
12 "{a} = {b} <-> a=b" |
|
13 (fn _=> [ (resolve_tac [extension RS iff_trans] 1), |
|
14 (fast_tac upair_cs 1) ]); |
|
15 |
|
16 qed_goal "doubleton_eq_iff" ZF.thy |
12 "{a,b} = {c,d} <-> (a=c & b=d) | (a=d & b=c)" |
17 "{a,b} = {c,d} <-> (a=c & b=d) | (a=d & b=c)" |
13 (fn _=> [ (resolve_tac [extension RS iff_trans] 1), |
18 (fn _=> [ (resolve_tac [extension RS iff_trans] 1), |
14 (fast_tac upair_cs 1) ]); |
19 (fast_tac upair_cs 1) ]); |
15 |
20 |
16 qed_goalw "Pair_iff" ZF.thy [Pair_def] |
21 qed_goalw "Pair_iff" ZF.thy [Pair_def] |
17 "<a,b> = <c,d> <-> a=c & b=d" |
22 "<a,b> = <c,d> <-> a=c & b=d" |
18 (fn _=> [ (simp_tac (FOL_ss addsimps [doubleton_iff]) 1), |
23 (fn _=> [ (simp_tac (FOL_ss addsimps [doubleton_eq_iff]) 1), |
19 (fast_tac FOL_cs 1) ]); |
24 (fast_tac FOL_cs 1) ]); |
20 |
25 |
21 bind_thm ("Pair_inject", (Pair_iff RS iffD1 RS conjE)); |
26 bind_thm ("Pair_inject", (Pair_iff RS iffD1 RS conjE)); |
22 |
27 |
23 qed_goal "Pair_inject1" ZF.thy "<a,b> = <c,d> ==> a=c" |
28 qed_goal "Pair_inject1" ZF.thy "<a,b> = <c,d> ==> a=c" |
130 (fn _=> [ (rtac split 1) ]); |
135 (fn _=> [ (rtac split 1) ]); |
131 |
136 |
132 qed_goalw "snd_conv" ZF.thy [snd_def] "snd(<a,b>) = b" |
137 qed_goalw "snd_conv" ZF.thy [snd_def] "snd(<a,b>) = b" |
133 (fn _=> [ (rtac split 1) ]); |
138 (fn _=> [ (rtac split 1) ]); |
134 |
139 |
|
140 qed_goalw "fst_type" ZF.thy [fst_def] |
|
141 "!!p. p:Sigma(A,B) ==> fst(p) : A" |
|
142 (fn _=> [ (etac split_type 1), (assume_tac 1) ]); |
|
143 |
|
144 qed_goalw "snd_type" ZF.thy [snd_def] |
|
145 "!!p. p:Sigma(A,B) ==> snd(p) : B(fst(p))" |
|
146 (fn _=> [ (etac split_type 1), |
|
147 (asm_simp_tac (FOL_ss addsimps [fst_conv]) 1) ]); |
|
148 |
|
149 |
|
150 goal ZF.thy "!!a A B. a: Sigma(A,B) ==> <fst(a),snd(a)> = a"; |
|
151 by (etac SigmaE 1); |
|
152 by (asm_simp_tac (FOL_ss addsimps [fst_conv,snd_conv]) 1); |
|
153 qed "Pair_fst_snd_eq"; |
|
154 |
135 |
155 |
136 (*** split for predicates: result type o ***) |
156 (*** split for predicates: result type o ***) |
137 |
157 |
138 goalw ZF.thy [fsplit_def] "!!R a b. R(a,b) ==> fsplit(R, <a,b>)"; |
158 goalw ZF.thy [fsplit_def] "!!R a b. R(a,b) ==> fsplit(R, <a,b>)"; |
139 by (REPEAT (ares_tac [refl,exI,conjI] 1)); |
159 by (REPEAT (ares_tac [refl,exI,conjI] 1)); |