| author | wenzelm | 
| Fri, 14 Dec 2012 16:33:22 +0100 | |
| changeset 50530 | 6266e44b3396 | 
| parent 47982 | 7aa35601ff65 | 
| child 51377 | 7da251a6c16e | 
| permissions | -rw-r--r-- | 
| 47455 | 1  | 
(* Title: HOL/Library/Quotient_Product.thy  | 
| 
47624
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
2  | 
Author: Cezary Kaliszyk, Christian Urban and Brian Huffman  | 
| 
35222
 
4f1fba00f66d
Initial version of HOL quotient package.
 
Cezary Kaliszyk <kaliszyk@in.tum.de> 
parents:  
diff
changeset
 | 
3  | 
*)  | 
| 35788 | 4  | 
|
5  | 
header {* Quotient infrastructure for the product type *}
 | 
|
6  | 
||
| 
35222
 
4f1fba00f66d
Initial version of HOL quotient package.
 
Cezary Kaliszyk <kaliszyk@in.tum.de> 
parents:  
diff
changeset
 | 
7  | 
theory Quotient_Product  | 
| 
 
4f1fba00f66d
Initial version of HOL quotient package.
 
Cezary Kaliszyk <kaliszyk@in.tum.de> 
parents:  
diff
changeset
 | 
8  | 
imports Main Quotient_Syntax  | 
| 
 
4f1fba00f66d
Initial version of HOL quotient package.
 
Cezary Kaliszyk <kaliszyk@in.tum.de> 
parents:  
diff
changeset
 | 
9  | 
begin  | 
| 
 
4f1fba00f66d
Initial version of HOL quotient package.
 
Cezary Kaliszyk <kaliszyk@in.tum.de> 
parents:  
diff
changeset
 | 
10  | 
|
| 
47624
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
11  | 
subsection {* Relator for product type *}
 | 
| 
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
12  | 
|
| 
40465
 
2989f9f3aa10
more appropriate specification packages; fun_rel_def is no simp rule by default
 
haftmann 
parents: 
39302 
diff
changeset
 | 
13  | 
definition  | 
| 
40541
 
7850b4cc1507
re-generalized type of prod_rel (accident from 2989f9f3aa10)
 
haftmann 
parents: 
40465 
diff
changeset
 | 
14  | 
  prod_rel :: "('a \<Rightarrow> 'b \<Rightarrow> bool) \<Rightarrow> ('c \<Rightarrow> 'd \<Rightarrow> bool) \<Rightarrow> 'a \<times> 'c \<Rightarrow> 'b \<times> 'd \<Rightarrow> bool"
 | 
| 
35222
 
4f1fba00f66d
Initial version of HOL quotient package.
 
Cezary Kaliszyk <kaliszyk@in.tum.de> 
parents:  
diff
changeset
 | 
15  | 
where  | 
| 
 
4f1fba00f66d
Initial version of HOL quotient package.
 
Cezary Kaliszyk <kaliszyk@in.tum.de> 
parents:  
diff
changeset
 | 
16  | 
"prod_rel R1 R2 = (\<lambda>(a, b) (c, d). R1 a c \<and> R2 b d)"  | 
| 
 
4f1fba00f66d
Initial version of HOL quotient package.
 
Cezary Kaliszyk <kaliszyk@in.tum.de> 
parents:  
diff
changeset
 | 
17  | 
|
| 
40465
 
2989f9f3aa10
more appropriate specification packages; fun_rel_def is no simp rule by default
 
haftmann 
parents: 
39302 
diff
changeset
 | 
18  | 
lemma prod_rel_apply [simp]:  | 
| 
 
2989f9f3aa10
more appropriate specification packages; fun_rel_def is no simp rule by default
 
haftmann 
parents: 
39302 
diff
changeset
 | 
19  | 
"prod_rel R1 R2 (a, b) (c, d) \<longleftrightarrow> R1 a c \<and> R2 b d"  | 
| 
 
2989f9f3aa10
more appropriate specification packages; fun_rel_def is no simp rule by default
 
haftmann 
parents: 
39302 
diff
changeset
 | 
20  | 
by (simp add: prod_rel_def)  | 
| 
35222
 
4f1fba00f66d
Initial version of HOL quotient package.
 
Cezary Kaliszyk <kaliszyk@in.tum.de> 
parents:  
diff
changeset
 | 
21  | 
|
| 
40820
 
fd9c98ead9a9
more systematic and compact proofs on type relation operators using natural deduction rules
 
haftmann 
parents: 
40607 
diff
changeset
 | 
22  | 
lemma map_pair_id [id_simps]:  | 
| 
 
fd9c98ead9a9
more systematic and compact proofs on type relation operators using natural deduction rules
 
haftmann 
parents: 
40607 
diff
changeset
 | 
23  | 
shows "map_pair id id = id"  | 
| 
 
fd9c98ead9a9
more systematic and compact proofs on type relation operators using natural deduction rules
 
haftmann 
parents: 
40607 
diff
changeset
 | 
24  | 
by (simp add: fun_eq_iff)  | 
| 
 
fd9c98ead9a9
more systematic and compact proofs on type relation operators using natural deduction rules
 
haftmann 
parents: 
40607 
diff
changeset
 | 
25  | 
|
| 
47624
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
26  | 
lemma prod_rel_eq [id_simps, relator_eq]:  | 
| 
40820
 
fd9c98ead9a9
more systematic and compact proofs on type relation operators using natural deduction rules
 
haftmann 
parents: 
40607 
diff
changeset
 | 
27  | 
shows "prod_rel (op =) (op =) = (op =)"  | 
| 
 
fd9c98ead9a9
more systematic and compact proofs on type relation operators using natural deduction rules
 
haftmann 
parents: 
40607 
diff
changeset
 | 
28  | 
by (simp add: fun_eq_iff)  | 
| 
 
fd9c98ead9a9
more systematic and compact proofs on type relation operators using natural deduction rules
 
haftmann 
parents: 
40607 
diff
changeset
 | 
29  | 
|
| 
47982
 
7aa35601ff65
prove reflexivity also for the quotient composition relation; reflp_preserve renamed to reflexivity_rule
 
kuncar 
parents: 
47936 
diff
changeset
 | 
30  | 
lemma prod_reflp [reflexivity_rule]:  | 
| 
47936
 
756f30eac792
infrastructure that makes possible to prove that a relation is reflexive
 
kuncar 
parents: 
47777 
diff
changeset
 | 
31  | 
assumes "reflp R1"  | 
| 
 
756f30eac792
infrastructure that makes possible to prove that a relation is reflexive
 
kuncar 
parents: 
47777 
diff
changeset
 | 
32  | 
assumes "reflp R2"  | 
| 
 
756f30eac792
infrastructure that makes possible to prove that a relation is reflexive
 
kuncar 
parents: 
47777 
diff
changeset
 | 
33  | 
shows "reflp (prod_rel R1 R2)"  | 
| 
 
756f30eac792
infrastructure that makes possible to prove that a relation is reflexive
 
kuncar 
parents: 
47777 
diff
changeset
 | 
34  | 
using assms by (auto intro!: reflpI elim: reflpE)  | 
| 
 
756f30eac792
infrastructure that makes possible to prove that a relation is reflexive
 
kuncar 
parents: 
47777 
diff
changeset
 | 
35  | 
|
| 
47982
 
7aa35601ff65
prove reflexivity also for the quotient composition relation; reflp_preserve renamed to reflexivity_rule
 
kuncar 
parents: 
47936 
diff
changeset
 | 
36  | 
lemma prod_left_total [reflexivity_rule]:  | 
| 
 
7aa35601ff65
prove reflexivity also for the quotient composition relation; reflp_preserve renamed to reflexivity_rule
 
kuncar 
parents: 
47936 
diff
changeset
 | 
37  | 
assumes "left_total R1"  | 
| 
 
7aa35601ff65
prove reflexivity also for the quotient composition relation; reflp_preserve renamed to reflexivity_rule
 
kuncar 
parents: 
47936 
diff
changeset
 | 
38  | 
assumes "left_total R2"  | 
| 
 
7aa35601ff65
prove reflexivity also for the quotient composition relation; reflp_preserve renamed to reflexivity_rule
 
kuncar 
parents: 
47936 
diff
changeset
 | 
39  | 
shows "left_total (prod_rel R1 R2)"  | 
| 
 
7aa35601ff65
prove reflexivity also for the quotient composition relation; reflp_preserve renamed to reflexivity_rule
 
kuncar 
parents: 
47936 
diff
changeset
 | 
40  | 
using assms by (auto intro!: left_totalI elim!: left_totalE)  | 
| 
 
7aa35601ff65
prove reflexivity also for the quotient composition relation; reflp_preserve renamed to reflexivity_rule
 
kuncar 
parents: 
47936 
diff
changeset
 | 
41  | 
|
| 
40820
 
fd9c98ead9a9
more systematic and compact proofs on type relation operators using natural deduction rules
 
haftmann 
parents: 
40607 
diff
changeset
 | 
42  | 
lemma prod_equivp [quot_equiv]:  | 
| 
 
fd9c98ead9a9
more systematic and compact proofs on type relation operators using natural deduction rules
 
haftmann 
parents: 
40607 
diff
changeset
 | 
43  | 
assumes "equivp R1"  | 
| 
 
fd9c98ead9a9
more systematic and compact proofs on type relation operators using natural deduction rules
 
haftmann 
parents: 
40607 
diff
changeset
 | 
44  | 
assumes "equivp R2"  | 
| 
35222
 
4f1fba00f66d
Initial version of HOL quotient package.
 
Cezary Kaliszyk <kaliszyk@in.tum.de> 
parents:  
diff
changeset
 | 
45  | 
shows "equivp (prod_rel R1 R2)"  | 
| 
40820
 
fd9c98ead9a9
more systematic and compact proofs on type relation operators using natural deduction rules
 
haftmann 
parents: 
40607 
diff
changeset
 | 
46  | 
using assms by (auto intro!: equivpI reflpI sympI transpI elim!: equivpE elim: reflpE sympE transpE)  | 
| 
 
fd9c98ead9a9
more systematic and compact proofs on type relation operators using natural deduction rules
 
haftmann 
parents: 
40607 
diff
changeset
 | 
47  | 
|
| 
47624
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
48  | 
lemma right_total_prod_rel [transfer_rule]:  | 
| 
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
49  | 
assumes "right_total R1" and "right_total R2"  | 
| 
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
50  | 
shows "right_total (prod_rel R1 R2)"  | 
| 
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
51  | 
using assms unfolding right_total_def prod_rel_def by auto  | 
| 
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
52  | 
|
| 
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
53  | 
lemma right_unique_prod_rel [transfer_rule]:  | 
| 
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
54  | 
assumes "right_unique R1" and "right_unique R2"  | 
| 
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
55  | 
shows "right_unique (prod_rel R1 R2)"  | 
| 
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
56  | 
using assms unfolding right_unique_def prod_rel_def by auto  | 
| 
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
57  | 
|
| 
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
58  | 
lemma bi_total_prod_rel [transfer_rule]:  | 
| 
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
59  | 
assumes "bi_total R1" and "bi_total R2"  | 
| 
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
60  | 
shows "bi_total (prod_rel R1 R2)"  | 
| 
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
61  | 
using assms unfolding bi_total_def prod_rel_def by auto  | 
| 
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
62  | 
|
| 
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
63  | 
lemma bi_unique_prod_rel [transfer_rule]:  | 
| 
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
64  | 
assumes "bi_unique R1" and "bi_unique R2"  | 
| 
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
65  | 
shows "bi_unique (prod_rel R1 R2)"  | 
| 
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
66  | 
using assms unfolding bi_unique_def prod_rel_def by auto  | 
| 
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
67  | 
|
| 
47635
 
ebb79474262c
rename 'correspondence' method to 'transfer_prover'
 
huffman 
parents: 
47634 
diff
changeset
 | 
68  | 
subsection {* Transfer rules for transfer package *}
 | 
| 
47624
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
69  | 
|
| 
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
70  | 
lemma Pair_transfer [transfer_rule]: "(A ===> B ===> prod_rel A B) Pair Pair"  | 
| 
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
71  | 
unfolding fun_rel_def prod_rel_def by simp  | 
| 
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
72  | 
|
| 
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
73  | 
lemma fst_transfer [transfer_rule]: "(prod_rel A B ===> A) fst fst"  | 
| 
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
74  | 
unfolding fun_rel_def prod_rel_def by simp  | 
| 
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
75  | 
|
| 
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
76  | 
lemma snd_transfer [transfer_rule]: "(prod_rel A B ===> B) snd snd"  | 
| 
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
77  | 
unfolding fun_rel_def prod_rel_def by simp  | 
| 
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
78  | 
|
| 
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
79  | 
lemma prod_case_transfer [transfer_rule]:  | 
| 
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
80  | 
"((A ===> B ===> C) ===> prod_rel A B ===> C) prod_case prod_case"  | 
| 
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
81  | 
unfolding fun_rel_def prod_rel_def by simp  | 
| 
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
82  | 
|
| 
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
83  | 
lemma curry_transfer [transfer_rule]:  | 
| 
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
84  | 
"((prod_rel A B ===> C) ===> A ===> B ===> C) curry curry"  | 
| 
47635
 
ebb79474262c
rename 'correspondence' method to 'transfer_prover'
 
huffman 
parents: 
47634 
diff
changeset
 | 
85  | 
unfolding curry_def by transfer_prover  | 
| 
47624
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
86  | 
|
| 
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
87  | 
lemma map_pair_transfer [transfer_rule]:  | 
| 
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
88  | 
"((A ===> C) ===> (B ===> D) ===> prod_rel A B ===> prod_rel C D)  | 
| 
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
89  | 
map_pair map_pair"  | 
| 
47635
 
ebb79474262c
rename 'correspondence' method to 'transfer_prover'
 
huffman 
parents: 
47634 
diff
changeset
 | 
90  | 
unfolding map_pair_def [abs_def] by transfer_prover  | 
| 
47624
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
91  | 
|
| 
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
92  | 
lemma prod_rel_transfer [transfer_rule]:  | 
| 
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
93  | 
"((A ===> B ===> op =) ===> (C ===> D ===> op =) ===>  | 
| 
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
94  | 
prod_rel A C ===> prod_rel B D ===> op =) prod_rel prod_rel"  | 
| 
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
95  | 
unfolding fun_rel_def by auto  | 
| 
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
96  | 
|
| 
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
97  | 
subsection {* Setup for lifting package *}
 | 
| 
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
98  | 
|
| 
47777
 
f29e7dcd7c40
use a quot_map theorem attribute instead of the complicated map attribute
 
kuncar 
parents: 
47635 
diff
changeset
 | 
99  | 
lemma Quotient_prod[quot_map]:  | 
| 
47624
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
100  | 
assumes "Quotient R1 Abs1 Rep1 T1"  | 
| 
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
101  | 
assumes "Quotient R2 Abs2 Rep2 T2"  | 
| 
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
102  | 
shows "Quotient (prod_rel R1 R2) (map_pair Abs1 Abs2)  | 
| 
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
103  | 
(map_pair Rep1 Rep2) (prod_rel T1 T2)"  | 
| 
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
104  | 
using assms unfolding Quotient_alt_def by auto  | 
| 
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
105  | 
|
| 
47634
 
091bcd569441
hide the invariant constant for relators: invariant_commute infrastracture
 
kuncar 
parents: 
47624 
diff
changeset
 | 
106  | 
definition prod_pred :: "('a \<Rightarrow> bool) \<Rightarrow> ('b \<Rightarrow> bool) \<Rightarrow> 'a \<times> 'b \<Rightarrow> bool"
 | 
| 
 
091bcd569441
hide the invariant constant for relators: invariant_commute infrastracture
 
kuncar 
parents: 
47624 
diff
changeset
 | 
107  | 
where "prod_pred R1 R2 = (\<lambda>(a, b). R1 a \<and> R2 b)"  | 
| 
 
091bcd569441
hide the invariant constant for relators: invariant_commute infrastracture
 
kuncar 
parents: 
47624 
diff
changeset
 | 
108  | 
|
| 
 
091bcd569441
hide the invariant constant for relators: invariant_commute infrastracture
 
kuncar 
parents: 
47624 
diff
changeset
 | 
109  | 
lemma prod_invariant_commute [invariant_commute]:  | 
| 
 
091bcd569441
hide the invariant constant for relators: invariant_commute infrastracture
 
kuncar 
parents: 
47624 
diff
changeset
 | 
110  | 
"prod_rel (Lifting.invariant P1) (Lifting.invariant P2) = Lifting.invariant (prod_pred P1 P2)"  | 
| 
 
091bcd569441
hide the invariant constant for relators: invariant_commute infrastracture
 
kuncar 
parents: 
47624 
diff
changeset
 | 
111  | 
apply (simp add: fun_eq_iff prod_rel_def prod_pred_def Lifting.invariant_def)  | 
| 
 
091bcd569441
hide the invariant constant for relators: invariant_commute infrastracture
 
kuncar 
parents: 
47624 
diff
changeset
 | 
112  | 
apply blast  | 
| 
 
091bcd569441
hide the invariant constant for relators: invariant_commute infrastracture
 
kuncar 
parents: 
47624 
diff
changeset
 | 
113  | 
done  | 
| 
 
091bcd569441
hide the invariant constant for relators: invariant_commute infrastracture
 
kuncar 
parents: 
47624 
diff
changeset
 | 
114  | 
|
| 
47624
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
115  | 
subsection {* Rules for quotient package *}
 | 
| 
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
116  | 
|
| 
40820
 
fd9c98ead9a9
more systematic and compact proofs on type relation operators using natural deduction rules
 
haftmann 
parents: 
40607 
diff
changeset
 | 
117  | 
lemma prod_quotient [quot_thm]:  | 
| 47308 | 118  | 
assumes "Quotient3 R1 Abs1 Rep1"  | 
119  | 
assumes "Quotient3 R2 Abs2 Rep2"  | 
|
120  | 
shows "Quotient3 (prod_rel R1 R2) (map_pair Abs1 Abs2) (map_pair Rep1 Rep2)"  | 
|
121  | 
apply (rule Quotient3I)  | 
|
| 41372 | 122  | 
apply (simp add: map_pair.compositionality comp_def map_pair.identity  | 
| 47308 | 123  | 
Quotient3_abs_rep [OF assms(1)] Quotient3_abs_rep [OF assms(2)])  | 
124  | 
apply (simp add: split_paired_all Quotient3_rel_rep [OF assms(1)] Quotient3_rel_rep [OF assms(2)])  | 
|
125  | 
using Quotient3_rel [OF assms(1)] Quotient3_rel [OF assms(2)]  | 
|
| 
40820
 
fd9c98ead9a9
more systematic and compact proofs on type relation operators using natural deduction rules
 
haftmann 
parents: 
40607 
diff
changeset
 | 
126  | 
apply (auto simp add: split_paired_all)  | 
| 
35222
 
4f1fba00f66d
Initial version of HOL quotient package.
 
Cezary Kaliszyk <kaliszyk@in.tum.de> 
parents:  
diff
changeset
 | 
127  | 
done  | 
| 
 
4f1fba00f66d
Initial version of HOL quotient package.
 
Cezary Kaliszyk <kaliszyk@in.tum.de> 
parents:  
diff
changeset
 | 
128  | 
|
| 47308 | 129  | 
declare [[mapQ3 prod = (prod_rel, prod_quotient)]]  | 
| 47094 | 130  | 
|
| 
40820
 
fd9c98ead9a9
more systematic and compact proofs on type relation operators using natural deduction rules
 
haftmann 
parents: 
40607 
diff
changeset
 | 
131  | 
lemma Pair_rsp [quot_respect]:  | 
| 47308 | 132  | 
assumes q1: "Quotient3 R1 Abs1 Rep1"  | 
133  | 
assumes q2: "Quotient3 R2 Abs2 Rep2"  | 
|
| 
35222
 
4f1fba00f66d
Initial version of HOL quotient package.
 
Cezary Kaliszyk <kaliszyk@in.tum.de> 
parents:  
diff
changeset
 | 
134  | 
shows "(R1 ===> R2 ===> prod_rel R1 R2) Pair Pair"  | 
| 
47624
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
135  | 
by (rule Pair_transfer)  | 
| 
35222
 
4f1fba00f66d
Initial version of HOL quotient package.
 
Cezary Kaliszyk <kaliszyk@in.tum.de> 
parents:  
diff
changeset
 | 
136  | 
|
| 
40820
 
fd9c98ead9a9
more systematic and compact proofs on type relation operators using natural deduction rules
 
haftmann 
parents: 
40607 
diff
changeset
 | 
137  | 
lemma Pair_prs [quot_preserve]:  | 
| 47308 | 138  | 
assumes q1: "Quotient3 R1 Abs1 Rep1"  | 
139  | 
assumes q2: "Quotient3 R2 Abs2 Rep2"  | 
|
| 40607 | 140  | 
shows "(Rep1 ---> Rep2 ---> (map_pair Abs1 Abs2)) Pair = Pair"  | 
| 
39302
 
d7728f65b353
renamed lemmas: ext_iff -> fun_eq_iff, set_ext_iff -> set_eq_iff, set_ext -> set_eqI
 
nipkow 
parents: 
39198 
diff
changeset
 | 
141  | 
apply(simp add: fun_eq_iff)  | 
| 47308 | 142  | 
apply(simp add: Quotient3_abs_rep[OF q1] Quotient3_abs_rep[OF q2])  | 
| 
35222
 
4f1fba00f66d
Initial version of HOL quotient package.
 
Cezary Kaliszyk <kaliszyk@in.tum.de> 
parents:  
diff
changeset
 | 
143  | 
done  | 
| 
 
4f1fba00f66d
Initial version of HOL quotient package.
 
Cezary Kaliszyk <kaliszyk@in.tum.de> 
parents:  
diff
changeset
 | 
144  | 
|
| 
40820
 
fd9c98ead9a9
more systematic and compact proofs on type relation operators using natural deduction rules
 
haftmann 
parents: 
40607 
diff
changeset
 | 
145  | 
lemma fst_rsp [quot_respect]:  | 
| 47308 | 146  | 
assumes "Quotient3 R1 Abs1 Rep1"  | 
147  | 
assumes "Quotient3 R2 Abs2 Rep2"  | 
|
| 
35222
 
4f1fba00f66d
Initial version of HOL quotient package.
 
Cezary Kaliszyk <kaliszyk@in.tum.de> 
parents:  
diff
changeset
 | 
148  | 
shows "(prod_rel R1 R2 ===> R1) fst fst"  | 
| 
40465
 
2989f9f3aa10
more appropriate specification packages; fun_rel_def is no simp rule by default
 
haftmann 
parents: 
39302 
diff
changeset
 | 
149  | 
by auto  | 
| 
35222
 
4f1fba00f66d
Initial version of HOL quotient package.
 
Cezary Kaliszyk <kaliszyk@in.tum.de> 
parents:  
diff
changeset
 | 
150  | 
|
| 
40820
 
fd9c98ead9a9
more systematic and compact proofs on type relation operators using natural deduction rules
 
haftmann 
parents: 
40607 
diff
changeset
 | 
151  | 
lemma fst_prs [quot_preserve]:  | 
| 47308 | 152  | 
assumes q1: "Quotient3 R1 Abs1 Rep1"  | 
153  | 
assumes q2: "Quotient3 R2 Abs2 Rep2"  | 
|
| 40607 | 154  | 
shows "(map_pair Rep1 Rep2 ---> Abs1) fst = fst"  | 
| 47308 | 155  | 
by (simp add: fun_eq_iff Quotient3_abs_rep[OF q1])  | 
| 
35222
 
4f1fba00f66d
Initial version of HOL quotient package.
 
Cezary Kaliszyk <kaliszyk@in.tum.de> 
parents:  
diff
changeset
 | 
156  | 
|
| 
40820
 
fd9c98ead9a9
more systematic and compact proofs on type relation operators using natural deduction rules
 
haftmann 
parents: 
40607 
diff
changeset
 | 
157  | 
lemma snd_rsp [quot_respect]:  | 
| 47308 | 158  | 
assumes "Quotient3 R1 Abs1 Rep1"  | 
159  | 
assumes "Quotient3 R2 Abs2 Rep2"  | 
|
| 
35222
 
4f1fba00f66d
Initial version of HOL quotient package.
 
Cezary Kaliszyk <kaliszyk@in.tum.de> 
parents:  
diff
changeset
 | 
160  | 
shows "(prod_rel R1 R2 ===> R2) snd snd"  | 
| 
40465
 
2989f9f3aa10
more appropriate specification packages; fun_rel_def is no simp rule by default
 
haftmann 
parents: 
39302 
diff
changeset
 | 
161  | 
by auto  | 
| 
35222
 
4f1fba00f66d
Initial version of HOL quotient package.
 
Cezary Kaliszyk <kaliszyk@in.tum.de> 
parents:  
diff
changeset
 | 
162  | 
|
| 
40820
 
fd9c98ead9a9
more systematic and compact proofs on type relation operators using natural deduction rules
 
haftmann 
parents: 
40607 
diff
changeset
 | 
163  | 
lemma snd_prs [quot_preserve]:  | 
| 47308 | 164  | 
assumes q1: "Quotient3 R1 Abs1 Rep1"  | 
165  | 
assumes q2: "Quotient3 R2 Abs2 Rep2"  | 
|
| 40607 | 166  | 
shows "(map_pair Rep1 Rep2 ---> Abs2) snd = snd"  | 
| 47308 | 167  | 
by (simp add: fun_eq_iff Quotient3_abs_rep[OF q2])  | 
| 
35222
 
4f1fba00f66d
Initial version of HOL quotient package.
 
Cezary Kaliszyk <kaliszyk@in.tum.de> 
parents:  
diff
changeset
 | 
168  | 
|
| 
40820
 
fd9c98ead9a9
more systematic and compact proofs on type relation operators using natural deduction rules
 
haftmann 
parents: 
40607 
diff
changeset
 | 
169  | 
lemma split_rsp [quot_respect]:  | 
| 
35222
 
4f1fba00f66d
Initial version of HOL quotient package.
 
Cezary Kaliszyk <kaliszyk@in.tum.de> 
parents:  
diff
changeset
 | 
170  | 
shows "((R1 ===> R2 ===> (op =)) ===> (prod_rel R1 R2) ===> (op =)) split split"  | 
| 
47624
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
171  | 
by (rule prod_case_transfer)  | 
| 
35222
 
4f1fba00f66d
Initial version of HOL quotient package.
 
Cezary Kaliszyk <kaliszyk@in.tum.de> 
parents:  
diff
changeset
 | 
172  | 
|
| 
40820
 
fd9c98ead9a9
more systematic and compact proofs on type relation operators using natural deduction rules
 
haftmann 
parents: 
40607 
diff
changeset
 | 
173  | 
lemma split_prs [quot_preserve]:  | 
| 47308 | 174  | 
assumes q1: "Quotient3 R1 Abs1 Rep1"  | 
175  | 
and q2: "Quotient3 R2 Abs2 Rep2"  | 
|
| 40607 | 176  | 
shows "(((Abs1 ---> Abs2 ---> id) ---> map_pair Rep1 Rep2 ---> id) split) = split"  | 
| 47308 | 177  | 
by (simp add: fun_eq_iff Quotient3_abs_rep[OF q1] Quotient3_abs_rep[OF q2])  | 
| 
35222
 
4f1fba00f66d
Initial version of HOL quotient package.
 
Cezary Kaliszyk <kaliszyk@in.tum.de> 
parents:  
diff
changeset
 | 
178  | 
|
| 
36695
 
b434506fb0d4
respectfullness and preservation of prod_rel
 
Cezary Kaliszyk <kaliszyk@in.tum.de> 
parents: 
35788 
diff
changeset
 | 
179  | 
lemma [quot_respect]:  | 
| 
 
b434506fb0d4
respectfullness and preservation of prod_rel
 
Cezary Kaliszyk <kaliszyk@in.tum.de> 
parents: 
35788 
diff
changeset
 | 
180  | 
shows "((R2 ===> R2 ===> op =) ===> (R1 ===> R1 ===> op =) ===>  | 
| 
 
b434506fb0d4
respectfullness and preservation of prod_rel
 
Cezary Kaliszyk <kaliszyk@in.tum.de> 
parents: 
35788 
diff
changeset
 | 
181  | 
prod_rel R2 R1 ===> prod_rel R2 R1 ===> op =) prod_rel prod_rel"  | 
| 
47624
 
16d433895d2e
add new transfer rules and setup for lifting package
 
huffman 
parents: 
47455 
diff
changeset
 | 
182  | 
by (rule prod_rel_transfer)  | 
| 
36695
 
b434506fb0d4
respectfullness and preservation of prod_rel
 
Cezary Kaliszyk <kaliszyk@in.tum.de> 
parents: 
35788 
diff
changeset
 | 
183  | 
|
| 
 
b434506fb0d4
respectfullness and preservation of prod_rel
 
Cezary Kaliszyk <kaliszyk@in.tum.de> 
parents: 
35788 
diff
changeset
 | 
184  | 
lemma [quot_preserve]:  | 
| 47308 | 185  | 
assumes q1: "Quotient3 R1 abs1 rep1"  | 
186  | 
and q2: "Quotient3 R2 abs2 rep2"  | 
|
| 
36695
 
b434506fb0d4
respectfullness and preservation of prod_rel
 
Cezary Kaliszyk <kaliszyk@in.tum.de> 
parents: 
35788 
diff
changeset
 | 
187  | 
shows "((abs1 ---> abs1 ---> id) ---> (abs2 ---> abs2 ---> id) --->  | 
| 40607 | 188  | 
map_pair rep1 rep2 ---> map_pair rep1 rep2 ---> id) prod_rel = prod_rel"  | 
| 47308 | 189  | 
by (simp add: fun_eq_iff Quotient3_abs_rep[OF q1] Quotient3_abs_rep[OF q2])  | 
| 
36695
 
b434506fb0d4
respectfullness and preservation of prod_rel
 
Cezary Kaliszyk <kaliszyk@in.tum.de> 
parents: 
35788 
diff
changeset
 | 
190  | 
|
| 
 
b434506fb0d4
respectfullness and preservation of prod_rel
 
Cezary Kaliszyk <kaliszyk@in.tum.de> 
parents: 
35788 
diff
changeset
 | 
191  | 
lemma [quot_preserve]:  | 
| 
 
b434506fb0d4
respectfullness and preservation of prod_rel
 
Cezary Kaliszyk <kaliszyk@in.tum.de> 
parents: 
35788 
diff
changeset
 | 
192  | 
shows"(prod_rel ((rep1 ---> rep1 ---> id) R1) ((rep2 ---> rep2 ---> id) R2)  | 
| 
 
b434506fb0d4
respectfullness and preservation of prod_rel
 
Cezary Kaliszyk <kaliszyk@in.tum.de> 
parents: 
35788 
diff
changeset
 | 
193  | 
(l1, l2) (r1, r2)) = (R1 (rep1 l1) (rep1 r1) \<and> R2 (rep2 l2) (rep2 r2))"  | 
| 
 
b434506fb0d4
respectfullness and preservation of prod_rel
 
Cezary Kaliszyk <kaliszyk@in.tum.de> 
parents: 
35788 
diff
changeset
 | 
194  | 
by simp  | 
| 
 
b434506fb0d4
respectfullness and preservation of prod_rel
 
Cezary Kaliszyk <kaliszyk@in.tum.de> 
parents: 
35788 
diff
changeset
 | 
195  | 
|
| 
 
b434506fb0d4
respectfullness and preservation of prod_rel
 
Cezary Kaliszyk <kaliszyk@in.tum.de> 
parents: 
35788 
diff
changeset
 | 
196  | 
declare Pair_eq[quot_preserve]  | 
| 
 
b434506fb0d4
respectfullness and preservation of prod_rel
 
Cezary Kaliszyk <kaliszyk@in.tum.de> 
parents: 
35788 
diff
changeset
 | 
197  | 
|
| 
35222
 
4f1fba00f66d
Initial version of HOL quotient package.
 
Cezary Kaliszyk <kaliszyk@in.tum.de> 
parents:  
diff
changeset
 | 
198  | 
end  |