8 Note: Could omit proving the algebraic laws for cardinal addition and |
8 Note: Could omit proving the algebraic laws for cardinal addition and |
9 multiplication. On finite cardinals these operations coincide with |
9 multiplication. On finite cardinals these operations coincide with |
10 addition and multiplication of natural numbers; on infinite cardinals they |
10 addition and multiplication of natural numbers; on infinite cardinals they |
11 coincide with union (maximum). Either way we get most laws for free. |
11 coincide with union (maximum). Either way we get most laws for free. |
12 *) |
12 *) |
13 |
|
14 open CardinalArith; |
|
15 |
13 |
16 (*** Cardinal addition ***) |
14 (*** Cardinal addition ***) |
17 |
15 |
18 (** Cardinal addition is commutative **) |
16 (** Cardinal addition is commutative **) |
19 |
17 |
63 |
61 |
64 (** Addition by another cardinal **) |
62 (** Addition by another cardinal **) |
65 |
63 |
66 Goalw [lepoll_def, inj_def] "A lepoll A+B"; |
64 Goalw [lepoll_def, inj_def] "A lepoll A+B"; |
67 by (res_inst_tac [("x", "lam x:A. Inl(x)")] exI 1); |
65 by (res_inst_tac [("x", "lam x:A. Inl(x)")] exI 1); |
68 by (asm_simp_tac (simpset() addsimps [lam_type]) 1); |
66 by (Asm_simp_tac 1); |
69 qed "sum_lepoll_self"; |
67 qed "sum_lepoll_self"; |
70 |
68 |
71 (*Could probably weaken the premises to well_ord(K,r), or removing using AC*) |
69 (*Could probably weaken the premises to well_ord(K,r), or removing using AC*) |
72 Goalw [cadd_def] |
70 Goalw [cadd_def] |
73 "[| Card(K); Ord(L) |] ==> K le (K |+| L)"; |
71 "[| Card(K); Ord(L) |] ==> K le (K |+| L)"; |
84 by (res_inst_tac [("x", "lam z:A+B. case(%w. Inl(f`w), %y. Inr(fa`y), z)")] |
82 by (res_inst_tac [("x", "lam z:A+B. case(%w. Inl(f`w), %y. Inr(fa`y), z)")] |
85 exI 1); |
83 exI 1); |
86 by (res_inst_tac |
84 by (res_inst_tac |
87 [("d", "case(%w. Inl(converse(f)`w), %y. Inr(converse(fa)`y))")] |
85 [("d", "case(%w. Inl(converse(f)`w), %y. Inr(converse(fa)`y))")] |
88 lam_injective 1); |
86 lam_injective 1); |
89 by (typechk_tac ([inj_is_fun, case_type, InlI, InrI] @ ZF_typechecks)); |
87 by (typecheck_tac (tcset() addTCs [inj_is_fun])); |
90 by (etac sumE 1); |
88 by (etac sumE 1); |
91 by (ALLGOALS (asm_simp_tac (simpset() addsimps [left_inverse]))); |
89 by (ALLGOALS (asm_simp_tac (simpset() addsimps [left_inverse]))); |
92 qed "sum_lepoll_mono"; |
90 qed "sum_lepoll_mono"; |
93 |
91 |
94 Goalw [cadd_def] |
92 Goalw [cadd_def] |
214 |
212 |
215 (*** Some inequalities for multiplication ***) |
213 (*** Some inequalities for multiplication ***) |
216 |
214 |
217 Goalw [lepoll_def, inj_def] "A lepoll A*A"; |
215 Goalw [lepoll_def, inj_def] "A lepoll A*A"; |
218 by (res_inst_tac [("x", "lam x:A. <x,x>")] exI 1); |
216 by (res_inst_tac [("x", "lam x:A. <x,x>")] exI 1); |
219 by (simp_tac (simpset() addsimps [lam_type]) 1); |
217 by (Simp_tac 1); |
220 qed "prod_square_lepoll"; |
218 qed "prod_square_lepoll"; |
221 |
219 |
222 (*Could probably weaken the premise to well_ord(K,r), or remove using AC*) |
220 (*Could probably weaken the premise to well_ord(K,r), or remove using AC*) |
223 Goalw [cmult_def] "Card(K) ==> K le K |*| K"; |
221 Goalw [cmult_def] "Card(K) ==> K le K |*| K"; |
224 by (rtac le_trans 1); |
222 by (rtac le_trans 1); |
231 |
229 |
232 (** Multiplication by a non-zero cardinal **) |
230 (** Multiplication by a non-zero cardinal **) |
233 |
231 |
234 Goalw [lepoll_def, inj_def] "b: B ==> A lepoll A*B"; |
232 Goalw [lepoll_def, inj_def] "b: B ==> A lepoll A*B"; |
235 by (res_inst_tac [("x", "lam x:A. <x,b>")] exI 1); |
233 by (res_inst_tac [("x", "lam x:A. <x,b>")] exI 1); |
236 by (asm_simp_tac (simpset() addsimps [lam_type]) 1); |
234 by (Asm_simp_tac 1); |
237 qed "prod_lepoll_self"; |
235 qed "prod_lepoll_self"; |
238 |
236 |
239 (*Could probably weaken the premises to well_ord(K,r), or removing using AC*) |
237 (*Could probably weaken the premises to well_ord(K,r), or removing using AC*) |
240 Goalw [cmult_def] |
238 Goalw [cmult_def] |
241 "[| Card(K); Ord(L); 0<L |] ==> K le (K |*| L)"; |
239 "[| Card(K); Ord(L); 0<L |] ==> K le (K |*| L)"; |
250 "[| A lepoll C; B lepoll D |] ==> A * B lepoll C * D"; |
248 "[| A lepoll C; B lepoll D |] ==> A * B lepoll C * D"; |
251 by (REPEAT (etac exE 1)); |
249 by (REPEAT (etac exE 1)); |
252 by (res_inst_tac [("x", "lam <w,y>:A*B. <f`w, fa`y>")] exI 1); |
250 by (res_inst_tac [("x", "lam <w,y>:A*B. <f`w, fa`y>")] exI 1); |
253 by (res_inst_tac [("d", "%<w,y>.<converse(f)`w, converse(fa)`y>")] |
251 by (res_inst_tac [("d", "%<w,y>.<converse(f)`w, converse(fa)`y>")] |
254 lam_injective 1); |
252 lam_injective 1); |
255 by (typechk_tac (inj_is_fun::ZF_typechecks)); |
253 by (typecheck_tac (tcset() addTCs [inj_is_fun])); |
256 by (etac SigmaE 1); |
254 by (etac SigmaE 1); |
257 by (asm_simp_tac (simpset() addsimps [left_inverse]) 1); |
255 by (asm_simp_tac (simpset() addsimps [left_inverse]) 1); |
258 qed "prod_lepoll_mono"; |
256 qed "prod_lepoll_mono"; |
259 |
257 |
260 Goalw [cmult_def] |
258 Goalw [cmult_def] |
293 nat_cadd_eq_add]) 1); |
291 nat_cadd_eq_add]) 1); |
294 qed "nat_cmult_eq_mult"; |
292 qed "nat_cmult_eq_mult"; |
295 |
293 |
296 Goal "Card(n) ==> 2 |*| n = n |+| n"; |
294 Goal "Card(n) ==> 2 |*| n = n |+| n"; |
297 by (asm_simp_tac |
295 by (asm_simp_tac |
298 (simpset() addsimps [Ord_0, Ord_succ, cmult_succ_lemma, Card_is_Ord, |
296 (simpset() addsimps [cmult_succ_lemma, Card_is_Ord, |
299 read_instantiate [("j","0")] cadd_commute]) 1); |
297 read_instantiate [("j","0")] cadd_commute]) 1); |
300 qed "cmult_2"; |
298 qed "cmult_2"; |
301 |
299 |
302 |
300 |
303 val sum_lepoll_prod = [sum_eq_2_times RS equalityD1 RS subset_imp_lepoll, |
301 val sum_lepoll_prod = [sum_eq_2_times RS equalityD1 RS subset_imp_lepoll, |
550 qed "InfCard_le_cmult_eq"; |
548 qed "InfCard_le_cmult_eq"; |
551 |
549 |
552 (*Corollary 10.13 (1), for cardinal multiplication*) |
550 (*Corollary 10.13 (1), for cardinal multiplication*) |
553 Goal "[| InfCard(K); InfCard(L) |] ==> K |*| L = K Un L"; |
551 Goal "[| InfCard(K); InfCard(L) |] ==> K |*| L = K Un L"; |
554 by (res_inst_tac [("i","K"),("j","L")] Ord_linear_le 1); |
552 by (res_inst_tac [("i","K"),("j","L")] Ord_linear_le 1); |
555 by (typechk_tac [InfCard_is_Card, Card_is_Ord]); |
553 by (typecheck_tac (tcset() addTCs [InfCard_is_Card, Card_is_Ord])); |
556 by (resolve_tac [cmult_commute RS ssubst] 1); |
554 by (resolve_tac [cmult_commute RS ssubst] 1); |
557 by (resolve_tac [Un_commute RS ssubst] 1); |
555 by (resolve_tac [Un_commute RS ssubst] 1); |
558 by (ALLGOALS |
556 by (ALLGOALS |
559 (asm_simp_tac |
557 (asm_simp_tac |
560 (simpset() addsimps [InfCard_is_Limit RS Limit_has_0, InfCard_le_cmult_eq, |
558 (simpset() addsimps [InfCard_is_Limit RS Limit_has_0, InfCard_le_cmult_eq, |
561 subset_Un_iff2 RS iffD1, le_imp_subset]))); |
559 subset_Un_iff2 RS iffD1, le_imp_subset]))); |
562 qed "InfCard_cmult_eq"; |
560 qed "InfCard_cmult_eq"; |
563 |
561 |
564 (*This proof appear to be the simplest!*) |
|
565 Goal "InfCard(K) ==> K |+| K = K"; |
562 Goal "InfCard(K) ==> K |+| K = K"; |
566 by (asm_simp_tac |
563 by (asm_simp_tac |
567 (simpset() addsimps [cmult_2 RS sym, InfCard_is_Card, cmult_commute]) 1); |
564 (simpset() addsimps [cmult_2 RS sym, InfCard_is_Card, cmult_commute]) 1); |
568 by (rtac InfCard_le_cmult_eq 1); |
565 by (asm_simp_tac |
569 by (typechk_tac [Ord_0, le_refl, leI]); |
566 (simpset() addsimps [InfCard_le_cmult_eq, InfCard_is_Limit, |
570 by (typechk_tac [InfCard_is_Limit, Limit_has_0, Limit_has_succ]); |
567 Limit_has_0, Limit_has_succ]) 1); |
571 qed "InfCard_cdouble_eq"; |
568 qed "InfCard_cdouble_eq"; |
572 |
569 |
573 (*Corollary 10.13 (1), for cardinal addition*) |
570 (*Corollary 10.13 (1), for cardinal addition*) |
574 Goal "[| InfCard(K); L le K |] ==> K |+| L = K"; |
571 Goal "[| InfCard(K); L le K |] ==> K |+| L = K"; |
575 by (rtac le_anti_sym 1); |
572 by (rtac le_anti_sym 1); |
580 by (asm_simp_tac (simpset() addsimps [InfCard_cdouble_eq]) 1); |
577 by (asm_simp_tac (simpset() addsimps [InfCard_cdouble_eq]) 1); |
581 qed "InfCard_le_cadd_eq"; |
578 qed "InfCard_le_cadd_eq"; |
582 |
579 |
583 Goal "[| InfCard(K); InfCard(L) |] ==> K |+| L = K Un L"; |
580 Goal "[| InfCard(K); InfCard(L) |] ==> K |+| L = K Un L"; |
584 by (res_inst_tac [("i","K"),("j","L")] Ord_linear_le 1); |
581 by (res_inst_tac [("i","K"),("j","L")] Ord_linear_le 1); |
585 by (typechk_tac [InfCard_is_Card, Card_is_Ord]); |
582 by (typecheck_tac (tcset() addTCs [InfCard_is_Card, Card_is_Ord])); |
586 by (resolve_tac [cadd_commute RS ssubst] 1); |
583 by (resolve_tac [cadd_commute RS ssubst] 1); |
587 by (resolve_tac [Un_commute RS ssubst] 1); |
584 by (resolve_tac [Un_commute RS ssubst] 1); |
588 by (ALLGOALS |
585 by (ALLGOALS |
589 (asm_simp_tac |
586 (asm_simp_tac |
590 (simpset() addsimps [InfCard_le_cadd_eq, |
587 (simpset() addsimps [InfCard_le_cadd_eq, |