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