author | kuncar |
Wed, 15 May 2013 12:10:39 +0200 | |
changeset 51994 | 82cc2aeb7d13 |
parent 51956 | a4d81cdebf8b |
child 53012 | cb82606b8215 |
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 |
|
51956
a4d81cdebf8b
better support for domains in Lifting/Transfer = replace Domainp T by the actual invariant in a transferred goal
kuncar
parents:
51377
diff
changeset
|
18 |
definition prod_pred :: "('a \<Rightarrow> bool) \<Rightarrow> ('b \<Rightarrow> bool) \<Rightarrow> 'a \<times> 'b \<Rightarrow> bool" |
a4d81cdebf8b
better support for domains in Lifting/Transfer = replace Domainp T by the actual invariant in a transferred goal
kuncar
parents:
51377
diff
changeset
|
19 |
where "prod_pred R1 R2 = (\<lambda>(a, b). R1 a \<and> R2 b)" |
a4d81cdebf8b
better support for domains in Lifting/Transfer = replace Domainp T by the actual invariant in a transferred goal
kuncar
parents:
51377
diff
changeset
|
20 |
|
40465
2989f9f3aa10
more appropriate specification packages; fun_rel_def is no simp rule by default
haftmann
parents:
39302
diff
changeset
|
21 |
lemma prod_rel_apply [simp]: |
2989f9f3aa10
more appropriate specification packages; fun_rel_def is no simp rule by default
haftmann
parents:
39302
diff
changeset
|
22 |
"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
|
23 |
by (simp add: prod_rel_def) |
35222
4f1fba00f66d
Initial version of HOL quotient package.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
24 |
|
51956
a4d81cdebf8b
better support for domains in Lifting/Transfer = replace Domainp T by the actual invariant in a transferred goal
kuncar
parents:
51377
diff
changeset
|
25 |
lemma prod_pred_apply [simp]: |
a4d81cdebf8b
better support for domains in Lifting/Transfer = replace Domainp T by the actual invariant in a transferred goal
kuncar
parents:
51377
diff
changeset
|
26 |
"prod_pred P1 P2 (a, b) \<longleftrightarrow> P1 a \<and> P2 b" |
a4d81cdebf8b
better support for domains in Lifting/Transfer = replace Domainp T by the actual invariant in a transferred goal
kuncar
parents:
51377
diff
changeset
|
27 |
by (simp add: prod_pred_def) |
a4d81cdebf8b
better support for domains in Lifting/Transfer = replace Domainp T by the actual invariant in a transferred goal
kuncar
parents:
51377
diff
changeset
|
28 |
|
40820
fd9c98ead9a9
more systematic and compact proofs on type relation operators using natural deduction rules
haftmann
parents:
40607
diff
changeset
|
29 |
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
|
30 |
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
|
31 |
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
|
32 |
|
47624
16d433895d2e
add new transfer rules and setup for lifting package
huffman
parents:
47455
diff
changeset
|
33 |
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
|
34 |
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
|
35 |
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
|
36 |
|
51377 | 37 |
lemma prod_rel_mono[relator_mono]: |
38 |
assumes "A \<le> C" |
|
39 |
assumes "B \<le> D" |
|
40 |
shows "(prod_rel A B) \<le> (prod_rel C D)" |
|
41 |
using assms by (auto simp: prod_rel_def) |
|
42 |
||
43 |
lemma prod_rel_OO[relator_distr]: |
|
44 |
"(prod_rel A B) OO (prod_rel C D) = prod_rel (A OO C) (B OO D)" |
|
45 |
by (rule ext)+ (auto simp: prod_rel_def OO_def) |
|
46 |
||
51956
a4d81cdebf8b
better support for domains in Lifting/Transfer = replace Domainp T by the actual invariant in a transferred goal
kuncar
parents:
51377
diff
changeset
|
47 |
lemma Domainp_prod[relator_domain]: |
a4d81cdebf8b
better support for domains in Lifting/Transfer = replace Domainp T by the actual invariant in a transferred goal
kuncar
parents:
51377
diff
changeset
|
48 |
assumes "Domainp T1 = P1" |
a4d81cdebf8b
better support for domains in Lifting/Transfer = replace Domainp T by the actual invariant in a transferred goal
kuncar
parents:
51377
diff
changeset
|
49 |
assumes "Domainp T2 = P2" |
a4d81cdebf8b
better support for domains in Lifting/Transfer = replace Domainp T by the actual invariant in a transferred goal
kuncar
parents:
51377
diff
changeset
|
50 |
shows "Domainp (prod_rel T1 T2) = (prod_pred P1 P2)" |
a4d81cdebf8b
better support for domains in Lifting/Transfer = replace Domainp T by the actual invariant in a transferred goal
kuncar
parents:
51377
diff
changeset
|
51 |
using assms unfolding prod_rel_def prod_pred_def by blast |
a4d81cdebf8b
better support for domains in Lifting/Transfer = replace Domainp T by the actual invariant in a transferred goal
kuncar
parents:
51377
diff
changeset
|
52 |
|
51994 | 53 |
lemma reflp_prod_rel [reflexivity_rule]: |
47936
756f30eac792
infrastructure that makes possible to prove that a relation is reflexive
kuncar
parents:
47777
diff
changeset
|
54 |
assumes "reflp R1" |
756f30eac792
infrastructure that makes possible to prove that a relation is reflexive
kuncar
parents:
47777
diff
changeset
|
55 |
assumes "reflp R2" |
756f30eac792
infrastructure that makes possible to prove that a relation is reflexive
kuncar
parents:
47777
diff
changeset
|
56 |
shows "reflp (prod_rel R1 R2)" |
756f30eac792
infrastructure that makes possible to prove that a relation is reflexive
kuncar
parents:
47777
diff
changeset
|
57 |
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
|
58 |
|
51994 | 59 |
lemma left_total_prod_rel [reflexivity_rule]: |
47982
7aa35601ff65
prove reflexivity also for the quotient composition relation; reflp_preserve renamed to reflexivity_rule
kuncar
parents:
47936
diff
changeset
|
60 |
assumes "left_total R1" |
7aa35601ff65
prove reflexivity also for the quotient composition relation; reflp_preserve renamed to reflexivity_rule
kuncar
parents:
47936
diff
changeset
|
61 |
assumes "left_total R2" |
7aa35601ff65
prove reflexivity also for the quotient composition relation; reflp_preserve renamed to reflexivity_rule
kuncar
parents:
47936
diff
changeset
|
62 |
shows "left_total (prod_rel R1 R2)" |
51994 | 63 |
using assms unfolding left_total_def prod_rel_def by auto |
64 |
||
65 |
lemma left_unique_prod_rel [reflexivity_rule]: |
|
66 |
assumes "left_unique R1" and "left_unique R2" |
|
67 |
shows "left_unique (prod_rel R1 R2)" |
|
68 |
using assms unfolding left_unique_def prod_rel_def by auto |
|
47982
7aa35601ff65
prove reflexivity also for the quotient composition relation; reflp_preserve renamed to reflexivity_rule
kuncar
parents:
47936
diff
changeset
|
69 |
|
40820
fd9c98ead9a9
more systematic and compact proofs on type relation operators using natural deduction rules
haftmann
parents:
40607
diff
changeset
|
70 |
lemma prod_equivp [quot_equiv]: |
fd9c98ead9a9
more systematic and compact proofs on type relation operators using natural deduction rules
haftmann
parents:
40607
diff
changeset
|
71 |
assumes "equivp R1" |
fd9c98ead9a9
more systematic and compact proofs on type relation operators using natural deduction rules
haftmann
parents:
40607
diff
changeset
|
72 |
assumes "equivp R2" |
35222
4f1fba00f66d
Initial version of HOL quotient package.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
73 |
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
|
74 |
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
|
75 |
|
47624
16d433895d2e
add new transfer rules and setup for lifting package
huffman
parents:
47455
diff
changeset
|
76 |
lemma right_total_prod_rel [transfer_rule]: |
16d433895d2e
add new transfer rules and setup for lifting package
huffman
parents:
47455
diff
changeset
|
77 |
assumes "right_total R1" and "right_total R2" |
16d433895d2e
add new transfer rules and setup for lifting package
huffman
parents:
47455
diff
changeset
|
78 |
shows "right_total (prod_rel R1 R2)" |
16d433895d2e
add new transfer rules and setup for lifting package
huffman
parents:
47455
diff
changeset
|
79 |
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
|
80 |
|
16d433895d2e
add new transfer rules and setup for lifting package
huffman
parents:
47455
diff
changeset
|
81 |
lemma right_unique_prod_rel [transfer_rule]: |
16d433895d2e
add new transfer rules and setup for lifting package
huffman
parents:
47455
diff
changeset
|
82 |
assumes "right_unique R1" and "right_unique R2" |
16d433895d2e
add new transfer rules and setup for lifting package
huffman
parents:
47455
diff
changeset
|
83 |
shows "right_unique (prod_rel R1 R2)" |
16d433895d2e
add new transfer rules and setup for lifting package
huffman
parents:
47455
diff
changeset
|
84 |
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
|
85 |
|
16d433895d2e
add new transfer rules and setup for lifting package
huffman
parents:
47455
diff
changeset
|
86 |
lemma bi_total_prod_rel [transfer_rule]: |
16d433895d2e
add new transfer rules and setup for lifting package
huffman
parents:
47455
diff
changeset
|
87 |
assumes "bi_total R1" and "bi_total R2" |
16d433895d2e
add new transfer rules and setup for lifting package
huffman
parents:
47455
diff
changeset
|
88 |
shows "bi_total (prod_rel R1 R2)" |
16d433895d2e
add new transfer rules and setup for lifting package
huffman
parents:
47455
diff
changeset
|
89 |
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
|
90 |
|
16d433895d2e
add new transfer rules and setup for lifting package
huffman
parents:
47455
diff
changeset
|
91 |
lemma bi_unique_prod_rel [transfer_rule]: |
16d433895d2e
add new transfer rules and setup for lifting package
huffman
parents:
47455
diff
changeset
|
92 |
assumes "bi_unique R1" and "bi_unique R2" |
16d433895d2e
add new transfer rules and setup for lifting package
huffman
parents:
47455
diff
changeset
|
93 |
shows "bi_unique (prod_rel R1 R2)" |
16d433895d2e
add new transfer rules and setup for lifting package
huffman
parents:
47455
diff
changeset
|
94 |
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
|
95 |
|
47635
ebb79474262c
rename 'correspondence' method to 'transfer_prover'
huffman
parents:
47634
diff
changeset
|
96 |
subsection {* Transfer rules for transfer package *} |
47624
16d433895d2e
add new transfer rules and setup for lifting package
huffman
parents:
47455
diff
changeset
|
97 |
|
16d433895d2e
add new transfer rules and setup for lifting package
huffman
parents:
47455
diff
changeset
|
98 |
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
|
99 |
unfolding fun_rel_def prod_rel_def by simp |
16d433895d2e
add new transfer rules and setup for lifting package
huffman
parents:
47455
diff
changeset
|
100 |
|
16d433895d2e
add new transfer rules and setup for lifting package
huffman
parents:
47455
diff
changeset
|
101 |
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
|
102 |
unfolding fun_rel_def prod_rel_def by simp |
16d433895d2e
add new transfer rules and setup for lifting package
huffman
parents:
47455
diff
changeset
|
103 |
|
16d433895d2e
add new transfer rules and setup for lifting package
huffman
parents:
47455
diff
changeset
|
104 |
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
|
105 |
unfolding fun_rel_def prod_rel_def by simp |
16d433895d2e
add new transfer rules and setup for lifting package
huffman
parents:
47455
diff
changeset
|
106 |
|
16d433895d2e
add new transfer rules and setup for lifting package
huffman
parents:
47455
diff
changeset
|
107 |
lemma prod_case_transfer [transfer_rule]: |
16d433895d2e
add new transfer rules and setup for lifting package
huffman
parents:
47455
diff
changeset
|
108 |
"((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
|
109 |
unfolding fun_rel_def prod_rel_def by simp |
16d433895d2e
add new transfer rules and setup for lifting package
huffman
parents:
47455
diff
changeset
|
110 |
|
16d433895d2e
add new transfer rules and setup for lifting package
huffman
parents:
47455
diff
changeset
|
111 |
lemma curry_transfer [transfer_rule]: |
16d433895d2e
add new transfer rules and setup for lifting package
huffman
parents:
47455
diff
changeset
|
112 |
"((prod_rel A B ===> C) ===> A ===> B ===> C) curry curry" |
47635
ebb79474262c
rename 'correspondence' method to 'transfer_prover'
huffman
parents:
47634
diff
changeset
|
113 |
unfolding curry_def by transfer_prover |
47624
16d433895d2e
add new transfer rules and setup for lifting package
huffman
parents:
47455
diff
changeset
|
114 |
|
16d433895d2e
add new transfer rules and setup for lifting package
huffman
parents:
47455
diff
changeset
|
115 |
lemma map_pair_transfer [transfer_rule]: |
16d433895d2e
add new transfer rules and setup for lifting package
huffman
parents:
47455
diff
changeset
|
116 |
"((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
|
117 |
map_pair map_pair" |
47635
ebb79474262c
rename 'correspondence' method to 'transfer_prover'
huffman
parents:
47634
diff
changeset
|
118 |
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
|
119 |
|
16d433895d2e
add new transfer rules and setup for lifting package
huffman
parents:
47455
diff
changeset
|
120 |
lemma prod_rel_transfer [transfer_rule]: |
16d433895d2e
add new transfer rules and setup for lifting package
huffman
parents:
47455
diff
changeset
|
121 |
"((A ===> B ===> op =) ===> (C ===> D ===> op =) ===> |
16d433895d2e
add new transfer rules and setup for lifting package
huffman
parents:
47455
diff
changeset
|
122 |
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
|
123 |
unfolding fun_rel_def by auto |
16d433895d2e
add new transfer rules and setup for lifting package
huffman
parents:
47455
diff
changeset
|
124 |
|
16d433895d2e
add new transfer rules and setup for lifting package
huffman
parents:
47455
diff
changeset
|
125 |
subsection {* Setup for lifting package *} |
16d433895d2e
add new transfer rules and setup for lifting package
huffman
parents:
47455
diff
changeset
|
126 |
|
47777
f29e7dcd7c40
use a quot_map theorem attribute instead of the complicated map attribute
kuncar
parents:
47635
diff
changeset
|
127 |
lemma Quotient_prod[quot_map]: |
47624
16d433895d2e
add new transfer rules and setup for lifting package
huffman
parents:
47455
diff
changeset
|
128 |
assumes "Quotient R1 Abs1 Rep1 T1" |
16d433895d2e
add new transfer rules and setup for lifting package
huffman
parents:
47455
diff
changeset
|
129 |
assumes "Quotient R2 Abs2 Rep2 T2" |
16d433895d2e
add new transfer rules and setup for lifting package
huffman
parents:
47455
diff
changeset
|
130 |
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
|
131 |
(map_pair Rep1 Rep2) (prod_rel T1 T2)" |
16d433895d2e
add new transfer rules and setup for lifting package
huffman
parents:
47455
diff
changeset
|
132 |
using assms unfolding Quotient_alt_def by auto |
16d433895d2e
add new transfer rules and setup for lifting package
huffman
parents:
47455
diff
changeset
|
133 |
|
47634
091bcd569441
hide the invariant constant for relators: invariant_commute infrastracture
kuncar
parents:
47624
diff
changeset
|
134 |
lemma prod_invariant_commute [invariant_commute]: |
091bcd569441
hide the invariant constant for relators: invariant_commute infrastracture
kuncar
parents:
47624
diff
changeset
|
135 |
"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
|
136 |
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
|
137 |
apply blast |
091bcd569441
hide the invariant constant for relators: invariant_commute infrastracture
kuncar
parents:
47624
diff
changeset
|
138 |
done |
091bcd569441
hide the invariant constant for relators: invariant_commute infrastracture
kuncar
parents:
47624
diff
changeset
|
139 |
|
47624
16d433895d2e
add new transfer rules and setup for lifting package
huffman
parents:
47455
diff
changeset
|
140 |
subsection {* Rules for quotient package *} |
16d433895d2e
add new transfer rules and setup for lifting package
huffman
parents:
47455
diff
changeset
|
141 |
|
40820
fd9c98ead9a9
more systematic and compact proofs on type relation operators using natural deduction rules
haftmann
parents:
40607
diff
changeset
|
142 |
lemma prod_quotient [quot_thm]: |
47308 | 143 |
assumes "Quotient3 R1 Abs1 Rep1" |
144 |
assumes "Quotient3 R2 Abs2 Rep2" |
|
145 |
shows "Quotient3 (prod_rel R1 R2) (map_pair Abs1 Abs2) (map_pair Rep1 Rep2)" |
|
146 |
apply (rule Quotient3I) |
|
41372 | 147 |
apply (simp add: map_pair.compositionality comp_def map_pair.identity |
47308 | 148 |
Quotient3_abs_rep [OF assms(1)] Quotient3_abs_rep [OF assms(2)]) |
149 |
apply (simp add: split_paired_all Quotient3_rel_rep [OF assms(1)] Quotient3_rel_rep [OF assms(2)]) |
|
150 |
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
|
151 |
apply (auto simp add: split_paired_all) |
35222
4f1fba00f66d
Initial version of HOL quotient package.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
152 |
done |
4f1fba00f66d
Initial version of HOL quotient package.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
153 |
|
47308 | 154 |
declare [[mapQ3 prod = (prod_rel, prod_quotient)]] |
47094 | 155 |
|
40820
fd9c98ead9a9
more systematic and compact proofs on type relation operators using natural deduction rules
haftmann
parents:
40607
diff
changeset
|
156 |
lemma Pair_rsp [quot_respect]: |
47308 | 157 |
assumes q1: "Quotient3 R1 Abs1 Rep1" |
158 |
assumes q2: "Quotient3 R2 Abs2 Rep2" |
|
35222
4f1fba00f66d
Initial version of HOL quotient package.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
159 |
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
|
160 |
by (rule Pair_transfer) |
35222
4f1fba00f66d
Initial version of HOL quotient package.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
161 |
|
40820
fd9c98ead9a9
more systematic and compact proofs on type relation operators using natural deduction rules
haftmann
parents:
40607
diff
changeset
|
162 |
lemma Pair_prs [quot_preserve]: |
47308 | 163 |
assumes q1: "Quotient3 R1 Abs1 Rep1" |
164 |
assumes q2: "Quotient3 R2 Abs2 Rep2" |
|
40607 | 165 |
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
|
166 |
apply(simp add: fun_eq_iff) |
47308 | 167 |
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
|
168 |
done |
4f1fba00f66d
Initial version of HOL quotient package.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
169 |
|
40820
fd9c98ead9a9
more systematic and compact proofs on type relation operators using natural deduction rules
haftmann
parents:
40607
diff
changeset
|
170 |
lemma fst_rsp [quot_respect]: |
47308 | 171 |
assumes "Quotient3 R1 Abs1 Rep1" |
172 |
assumes "Quotient3 R2 Abs2 Rep2" |
|
35222
4f1fba00f66d
Initial version of HOL quotient package.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
173 |
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
|
174 |
by auto |
35222
4f1fba00f66d
Initial version of HOL quotient package.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
175 |
|
40820
fd9c98ead9a9
more systematic and compact proofs on type relation operators using natural deduction rules
haftmann
parents:
40607
diff
changeset
|
176 |
lemma fst_prs [quot_preserve]: |
47308 | 177 |
assumes q1: "Quotient3 R1 Abs1 Rep1" |
178 |
assumes q2: "Quotient3 R2 Abs2 Rep2" |
|
40607 | 179 |
shows "(map_pair Rep1 Rep2 ---> Abs1) fst = fst" |
47308 | 180 |
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
|
181 |
|
40820
fd9c98ead9a9
more systematic and compact proofs on type relation operators using natural deduction rules
haftmann
parents:
40607
diff
changeset
|
182 |
lemma snd_rsp [quot_respect]: |
47308 | 183 |
assumes "Quotient3 R1 Abs1 Rep1" |
184 |
assumes "Quotient3 R2 Abs2 Rep2" |
|
35222
4f1fba00f66d
Initial version of HOL quotient package.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
185 |
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
|
186 |
by auto |
35222
4f1fba00f66d
Initial version of HOL quotient package.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
187 |
|
40820
fd9c98ead9a9
more systematic and compact proofs on type relation operators using natural deduction rules
haftmann
parents:
40607
diff
changeset
|
188 |
lemma snd_prs [quot_preserve]: |
47308 | 189 |
assumes q1: "Quotient3 R1 Abs1 Rep1" |
190 |
assumes q2: "Quotient3 R2 Abs2 Rep2" |
|
40607 | 191 |
shows "(map_pair Rep1 Rep2 ---> Abs2) snd = snd" |
47308 | 192 |
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
|
193 |
|
40820
fd9c98ead9a9
more systematic and compact proofs on type relation operators using natural deduction rules
haftmann
parents:
40607
diff
changeset
|
194 |
lemma split_rsp [quot_respect]: |
35222
4f1fba00f66d
Initial version of HOL quotient package.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
195 |
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
|
196 |
by (rule prod_case_transfer) |
35222
4f1fba00f66d
Initial version of HOL quotient package.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
197 |
|
40820
fd9c98ead9a9
more systematic and compact proofs on type relation operators using natural deduction rules
haftmann
parents:
40607
diff
changeset
|
198 |
lemma split_prs [quot_preserve]: |
47308 | 199 |
assumes q1: "Quotient3 R1 Abs1 Rep1" |
200 |
and q2: "Quotient3 R2 Abs2 Rep2" |
|
40607 | 201 |
shows "(((Abs1 ---> Abs2 ---> id) ---> map_pair Rep1 Rep2 ---> id) split) = split" |
47308 | 202 |
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
|
203 |
|
36695
b434506fb0d4
respectfullness and preservation of prod_rel
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
35788
diff
changeset
|
204 |
lemma [quot_respect]: |
b434506fb0d4
respectfullness and preservation of prod_rel
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
35788
diff
changeset
|
205 |
shows "((R2 ===> R2 ===> op =) ===> (R1 ===> R1 ===> op =) ===> |
b434506fb0d4
respectfullness and preservation of prod_rel
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
35788
diff
changeset
|
206 |
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
|
207 |
by (rule prod_rel_transfer) |
36695
b434506fb0d4
respectfullness and preservation of prod_rel
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
35788
diff
changeset
|
208 |
|
b434506fb0d4
respectfullness and preservation of prod_rel
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
35788
diff
changeset
|
209 |
lemma [quot_preserve]: |
47308 | 210 |
assumes q1: "Quotient3 R1 abs1 rep1" |
211 |
and q2: "Quotient3 R2 abs2 rep2" |
|
36695
b434506fb0d4
respectfullness and preservation of prod_rel
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
35788
diff
changeset
|
212 |
shows "((abs1 ---> abs1 ---> id) ---> (abs2 ---> abs2 ---> id) ---> |
40607 | 213 |
map_pair rep1 rep2 ---> map_pair rep1 rep2 ---> id) prod_rel = prod_rel" |
47308 | 214 |
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
|
215 |
|
b434506fb0d4
respectfullness and preservation of prod_rel
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
35788
diff
changeset
|
216 |
lemma [quot_preserve]: |
b434506fb0d4
respectfullness and preservation of prod_rel
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
35788
diff
changeset
|
217 |
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
|
218 |
(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
|
219 |
by simp |
b434506fb0d4
respectfullness and preservation of prod_rel
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
35788
diff
changeset
|
220 |
|
b434506fb0d4
respectfullness and preservation of prod_rel
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
35788
diff
changeset
|
221 |
declare Pair_eq[quot_preserve] |
b434506fb0d4
respectfullness and preservation of prod_rel
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
35788
diff
changeset
|
222 |
|
35222
4f1fba00f66d
Initial version of HOL quotient package.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
223 |
end |