21 |
21 |
22 Goal "f: Pi(A,B) ==> function(f)"; |
22 Goal "f: Pi(A,B) ==> function(f)"; |
23 by (asm_full_simp_tac (FOL_ss addsimps [Pi_iff]) 1); |
23 by (asm_full_simp_tac (FOL_ss addsimps [Pi_iff]) 1); |
24 qed "fun_is_function"; |
24 qed "fun_is_function"; |
25 |
25 |
26 (**Two "destruct" rules for Pi **) |
26 (*Functions are relations*) |
27 |
|
28 Goalw [Pi_def] "f: Pi(A,B) ==> f <= Sigma(A,B)"; |
27 Goalw [Pi_def] "f: Pi(A,B) ==> f <= Sigma(A,B)"; |
29 by (Blast_tac 1); |
28 by (Blast_tac 1); |
30 qed "fun_is_rel"; |
29 qed "fun_is_rel"; |
31 |
|
32 Goal "[| f: Pi(A,B); a:A |] ==> EX! y. <a,y>: f"; |
|
33 by (blast_tac (claset() addSDs [Pi_iff_old RS iffD1]) 1); |
|
34 qed "fun_unique_Pair"; |
|
35 |
30 |
36 val prems = Goalw [Pi_def] |
31 val prems = Goalw [Pi_def] |
37 "[| A=A'; !!x. x:A' ==> B(x)=B'(x) |] ==> Pi(A,B) = Pi(A',B')"; |
32 "[| A=A'; !!x. x:A' ==> B(x)=B'(x) |] ==> Pi(A,B) = Pi(A',B')"; |
38 by (simp_tac (FOL_ss addsimps prems addcongs [Sigma_cong]) 1); |
33 by (simp_tac (FOL_ss addsimps prems addcongs [Sigma_cong]) 1); |
39 qed "Pi_cong"; |
34 qed "Pi_cong"; |
70 Goal "[| f: Pi(A,B); c: f |] ==> EX x:A. c = <x,f`x>"; |
65 Goal "[| f: Pi(A,B); c: f |] ==> EX x:A. c = <x,f`x>"; |
71 by (ftac fun_is_rel 1); |
66 by (ftac fun_is_rel 1); |
72 by (blast_tac (claset() addDs [apply_equality]) 1); |
67 by (blast_tac (claset() addDs [apply_equality]) 1); |
73 qed "Pi_memberD"; |
68 qed "Pi_memberD"; |
74 |
69 |
|
70 Goal "[| function(f); a : domain(f)|] ==> <a,f`a>: f"; |
|
71 by (asm_full_simp_tac (simpset() addsimps [function_def, apply_def]) 1); |
|
72 by (rtac theI2 1); |
|
73 by Auto_tac; |
|
74 qed "function_apply_Pair"; |
|
75 |
75 Goal "[| f: Pi(A,B); a:A |] ==> <a,f`a>: f"; |
76 Goal "[| f: Pi(A,B); a:A |] ==> <a,f`a>: f"; |
76 by (rtac (fun_unique_Pair RS ex1E) 1); |
77 by (asm_full_simp_tac (simpset() addsimps [Pi_iff]) 1); |
77 by (resolve_tac [apply_equality RS ssubst] 3); |
78 by (blast_tac (claset() addIs [function_apply_Pair]) 1); |
78 by (REPEAT (assume_tac 1)); |
|
79 qed "apply_Pair"; |
79 qed "apply_Pair"; |
80 |
80 |
81 (*Conclusion is flexible -- use res_inst_tac or else apply_funtype below!*) |
81 (*Conclusion is flexible -- use res_inst_tac or else apply_funtype below!*) |
82 Goal "[| f: Pi(A,B); a:A |] ==> f`a : B(a)"; |
82 Goal "[| f: Pi(A,B); a:A |] ==> f`a : B(a)"; |
83 by (rtac (fun_is_rel RS subsetD RS SigmaE2) 1); |
83 by (rtac (fun_is_rel RS subsetD RS SigmaE2) 1); |