src/HOL/Library/Quotient_Set.thy
author kuncar
Wed May 15 12:10:39 2013 +0200 (2013-05-15)
changeset 51994 82cc2aeb7d13
parent 51956 a4d81cdebf8b
child 52359 0eafa146b399
permissions -rw-r--r--
stronger reflexivity prover
wenzelm@47455
     1
(*  Title:      HOL/Library/Quotient_Set.thy
kaliszyk@44413
     2
    Author:     Cezary Kaliszyk and Christian Urban
kaliszyk@44413
     3
*)
kaliszyk@44413
     4
kaliszyk@44413
     5
header {* Quotient infrastructure for the set type *}
kaliszyk@44413
     6
kaliszyk@44413
     7
theory Quotient_Set
kaliszyk@44413
     8
imports Main Quotient_Syntax
kaliszyk@44413
     9
begin
kaliszyk@44413
    10
huffman@47648
    11
subsection {* Relator for set type *}
huffman@47648
    12
huffman@47648
    13
definition set_rel :: "('a \<Rightarrow> 'b \<Rightarrow> bool) \<Rightarrow> 'a set \<Rightarrow> 'b set \<Rightarrow> bool"
huffman@47648
    14
  where "set_rel R = (\<lambda>A B. (\<forall>x\<in>A. \<exists>y\<in>B. R x y) \<and> (\<forall>y\<in>B. \<exists>x\<in>A. R x y))"
huffman@47648
    15
huffman@47648
    16
lemma set_relI:
huffman@47648
    17
  assumes "\<And>x. x \<in> A \<Longrightarrow> \<exists>y\<in>B. R x y"
huffman@47648
    18
  assumes "\<And>y. y \<in> B \<Longrightarrow> \<exists>x\<in>A. R x y"
huffman@47648
    19
  shows "set_rel R A B"
huffman@47648
    20
  using assms unfolding set_rel_def by simp
huffman@47648
    21
huffman@47648
    22
lemma set_rel_conversep: "set_rel (conversep R) = conversep (set_rel R)"
huffman@47648
    23
  unfolding set_rel_def by auto
huffman@47648
    24
kuncar@51377
    25
lemma set_rel_eq [relator_eq]: "set_rel (op =) = (op =)"
kuncar@51377
    26
  unfolding set_rel_def fun_eq_iff by auto
kuncar@51377
    27
kuncar@51377
    28
lemma set_rel_mono[relator_mono]:
kuncar@51377
    29
  assumes "A \<le> B"
kuncar@51377
    30
  shows "set_rel A \<le> set_rel B"
kuncar@51377
    31
using assms unfolding set_rel_def by blast
kuncar@51377
    32
kuncar@51377
    33
lemma set_rel_OO[relator_distr]: "set_rel R OO set_rel S = set_rel (R OO S)"
kuncar@51377
    34
  apply (rule sym)
huffman@47648
    35
  apply (intro ext, rename_tac X Z)
huffman@47648
    36
  apply (rule iffI)
huffman@47648
    37
  apply (rule_tac b="{y. (\<exists>x\<in>X. R x y) \<and> (\<exists>z\<in>Z. S y z)}" in relcomppI)
huffman@47648
    38
  apply (simp add: set_rel_def, fast)
huffman@47648
    39
  apply (simp add: set_rel_def, fast)
huffman@47648
    40
  apply (simp add: set_rel_def, fast)
huffman@47648
    41
  done
huffman@47648
    42
kuncar@51956
    43
lemma Domainp_set[relator_domain]:
kuncar@51956
    44
  assumes "Domainp T = R"
kuncar@51956
    45
  shows "Domainp (set_rel T) = (\<lambda>A. Ball A R)"
kuncar@51956
    46
using assms unfolding set_rel_def Domainp_iff[abs_def]
kuncar@51956
    47
apply (intro ext)
kuncar@51956
    48
apply (rule iffI) 
kuncar@51956
    49
apply blast
kuncar@51956
    50
apply (rename_tac A, rule_tac x="{y. \<exists>x\<in>A. T x y}" in exI, fast)
kuncar@51956
    51
done
kuncar@51956
    52
kuncar@47982
    53
lemma reflp_set_rel[reflexivity_rule]: "reflp R \<Longrightarrow> reflp (set_rel R)"
huffman@47648
    54
  unfolding reflp_def set_rel_def by fast
huffman@47648
    55
kuncar@51994
    56
lemma left_total_set_rel[reflexivity_rule]: 
kuncar@51994
    57
  "left_total A \<Longrightarrow> left_total (set_rel A)"
kuncar@51994
    58
  unfolding left_total_def set_rel_def
kuncar@51994
    59
  apply safe
kuncar@51994
    60
  apply (rename_tac X, rule_tac x="{y. \<exists>x\<in>X. A x y}" in exI, fast)
kuncar@51994
    61
done
kuncar@51994
    62
kuncar@51994
    63
lemma left_unique_set_rel[reflexivity_rule]: 
kuncar@51994
    64
  "left_unique A \<Longrightarrow> left_unique (set_rel A)"
kuncar@51994
    65
  unfolding left_unique_def set_rel_def
kuncar@51994
    66
  by fast
kuncar@47982
    67
huffman@47648
    68
lemma symp_set_rel: "symp R \<Longrightarrow> symp (set_rel R)"
huffman@47648
    69
  unfolding symp_def set_rel_def by fast
huffman@47648
    70
huffman@47648
    71
lemma transp_set_rel: "transp R \<Longrightarrow> transp (set_rel R)"
huffman@47648
    72
  unfolding transp_def set_rel_def by fast
huffman@47648
    73
huffman@47648
    74
lemma equivp_set_rel: "equivp R \<Longrightarrow> equivp (set_rel R)"
huffman@47648
    75
  by (blast intro: equivpI reflp_set_rel symp_set_rel transp_set_rel
huffman@47648
    76
    elim: equivpE)
huffman@47648
    77
huffman@47648
    78
lemma right_total_set_rel [transfer_rule]:
huffman@47648
    79
  "right_total A \<Longrightarrow> right_total (set_rel A)"
huffman@47648
    80
  unfolding right_total_def set_rel_def
huffman@47648
    81
  by (rule allI, rename_tac Y, rule_tac x="{x. \<exists>y\<in>Y. A x y}" in exI, fast)
huffman@47648
    82
huffman@47648
    83
lemma right_unique_set_rel [transfer_rule]:
huffman@47648
    84
  "right_unique A \<Longrightarrow> right_unique (set_rel A)"
huffman@47648
    85
  unfolding right_unique_def set_rel_def by fast
huffman@47648
    86
huffman@47648
    87
lemma bi_total_set_rel [transfer_rule]:
huffman@47648
    88
  "bi_total A \<Longrightarrow> bi_total (set_rel A)"
huffman@47648
    89
  unfolding bi_total_def set_rel_def
huffman@47648
    90
  apply safe
huffman@47648
    91
  apply (rename_tac X, rule_tac x="{y. \<exists>x\<in>X. A x y}" in exI, fast)
huffman@47648
    92
  apply (rename_tac Y, rule_tac x="{x. \<exists>y\<in>Y. A x y}" in exI, fast)
huffman@47648
    93
  done
huffman@47648
    94
huffman@47648
    95
lemma bi_unique_set_rel [transfer_rule]:
huffman@47648
    96
  "bi_unique A \<Longrightarrow> bi_unique (set_rel A)"
huffman@47648
    97
  unfolding bi_unique_def set_rel_def by fast
huffman@47648
    98
huffman@47648
    99
subsection {* Transfer rules for transfer package *}
huffman@47648
   100
huffman@47648
   101
subsubsection {* Unconditional transfer rules *}
huffman@47648
   102
huffman@47648
   103
lemma empty_transfer [transfer_rule]: "(set_rel A) {} {}"
huffman@47648
   104
  unfolding set_rel_def by simp
huffman@47648
   105
huffman@47648
   106
lemma insert_transfer [transfer_rule]:
huffman@47648
   107
  "(A ===> set_rel A ===> set_rel A) insert insert"
huffman@47648
   108
  unfolding fun_rel_def set_rel_def by auto
huffman@47648
   109
huffman@47648
   110
lemma union_transfer [transfer_rule]:
huffman@47648
   111
  "(set_rel A ===> set_rel A ===> set_rel A) union union"
huffman@47648
   112
  unfolding fun_rel_def set_rel_def by auto
huffman@47648
   113
huffman@47648
   114
lemma Union_transfer [transfer_rule]:
huffman@47648
   115
  "(set_rel (set_rel A) ===> set_rel A) Union Union"
huffman@47648
   116
  unfolding fun_rel_def set_rel_def by simp fast
huffman@47648
   117
huffman@47648
   118
lemma image_transfer [transfer_rule]:
huffman@47648
   119
  "((A ===> B) ===> set_rel A ===> set_rel B) image image"
huffman@47648
   120
  unfolding fun_rel_def set_rel_def by simp fast
huffman@47648
   121
huffman@47660
   122
lemma UNION_transfer [transfer_rule]:
huffman@47660
   123
  "(set_rel A ===> (A ===> set_rel B) ===> set_rel B) UNION UNION"
huffman@47660
   124
  unfolding SUP_def [abs_def] by transfer_prover
huffman@47660
   125
huffman@47648
   126
lemma Ball_transfer [transfer_rule]:
huffman@47648
   127
  "(set_rel A ===> (A ===> op =) ===> op =) Ball Ball"
huffman@47648
   128
  unfolding set_rel_def fun_rel_def by fast
huffman@47648
   129
huffman@47648
   130
lemma Bex_transfer [transfer_rule]:
huffman@47648
   131
  "(set_rel A ===> (A ===> op =) ===> op =) Bex Bex"
huffman@47648
   132
  unfolding set_rel_def fun_rel_def by fast
huffman@47648
   133
huffman@47648
   134
lemma Pow_transfer [transfer_rule]:
huffman@47648
   135
  "(set_rel A ===> set_rel (set_rel A)) Pow Pow"
huffman@47648
   136
  apply (rule fun_relI, rename_tac X Y, rule set_relI)
huffman@47648
   137
  apply (rename_tac X', rule_tac x="{y\<in>Y. \<exists>x\<in>X'. A x y}" in rev_bexI, clarsimp)
huffman@47648
   138
  apply (simp add: set_rel_def, fast)
huffman@47648
   139
  apply (rename_tac Y', rule_tac x="{x\<in>X. \<exists>y\<in>Y'. A x y}" in rev_bexI, clarsimp)
huffman@47648
   140
  apply (simp add: set_rel_def, fast)
huffman@47648
   141
  done
huffman@47648
   142
huffman@47922
   143
lemma set_rel_transfer [transfer_rule]:
huffman@47922
   144
  "((A ===> B ===> op =) ===> set_rel A ===> set_rel B ===> op =)
huffman@47922
   145
    set_rel set_rel"
huffman@47922
   146
  unfolding fun_rel_def set_rel_def by fast
huffman@47922
   147
kuncar@51956
   148
kuncar@51956
   149
subsubsection {* Rules requiring bi-unique, bi-total or right-total relations *}
huffman@47648
   150
huffman@47648
   151
lemma member_transfer [transfer_rule]:
huffman@47648
   152
  assumes "bi_unique A"
huffman@47648
   153
  shows "(A ===> set_rel A ===> op =) (op \<in>) (op \<in>)"
huffman@47648
   154
  using assms unfolding fun_rel_def set_rel_def bi_unique_def by fast
huffman@47648
   155
kuncar@51956
   156
lemma right_total_Collect_transfer[transfer_rule]:
kuncar@51956
   157
  assumes "right_total A"
kuncar@51956
   158
  shows "((A ===> op =) ===> set_rel A) (\<lambda>P. Collect (\<lambda>x. P x \<and> Domainp A x)) Collect"
kuncar@51956
   159
  using assms unfolding right_total_def set_rel_def fun_rel_def Domainp_iff by fast
kuncar@51956
   160
huffman@47648
   161
lemma Collect_transfer [transfer_rule]:
huffman@47648
   162
  assumes "bi_total A"
huffman@47648
   163
  shows "((A ===> op =) ===> set_rel A) Collect Collect"
huffman@47648
   164
  using assms unfolding fun_rel_def set_rel_def bi_total_def by fast
huffman@47648
   165
huffman@47648
   166
lemma inter_transfer [transfer_rule]:
huffman@47648
   167
  assumes "bi_unique A"
huffman@47648
   168
  shows "(set_rel A ===> set_rel A ===> set_rel A) inter inter"
huffman@47648
   169
  using assms unfolding fun_rel_def set_rel_def bi_unique_def by fast
huffman@47648
   170
huffman@47680
   171
lemma Diff_transfer [transfer_rule]:
huffman@47680
   172
  assumes "bi_unique A"
huffman@47680
   173
  shows "(set_rel A ===> set_rel A ===> set_rel A) (op -) (op -)"
huffman@47680
   174
  using assms unfolding fun_rel_def set_rel_def bi_unique_def
huffman@47680
   175
  unfolding Ball_def Bex_def Diff_eq
huffman@47680
   176
  by (safe, simp, metis, simp, metis)
huffman@47680
   177
huffman@47648
   178
lemma subset_transfer [transfer_rule]:
huffman@47648
   179
  assumes [transfer_rule]: "bi_unique A"
huffman@47648
   180
  shows "(set_rel A ===> set_rel A ===> op =) (op \<subseteq>) (op \<subseteq>)"
huffman@47648
   181
  unfolding subset_eq [abs_def] by transfer_prover
huffman@47648
   182
kuncar@51956
   183
lemma right_total_UNIV_transfer[transfer_rule]: 
kuncar@51956
   184
  assumes "right_total A"
kuncar@51956
   185
  shows "(set_rel A) (Collect (Domainp A)) UNIV"
kuncar@51956
   186
  using assms unfolding right_total_def set_rel_def Domainp_iff by blast
kuncar@51956
   187
huffman@47648
   188
lemma UNIV_transfer [transfer_rule]:
huffman@47648
   189
  assumes "bi_total A"
huffman@47648
   190
  shows "(set_rel A) UNIV UNIV"
huffman@47648
   191
  using assms unfolding set_rel_def bi_total_def by simp
huffman@47648
   192
kuncar@51956
   193
lemma right_total_Compl_transfer [transfer_rule]:
kuncar@51956
   194
  assumes [transfer_rule]: "bi_unique A" and [transfer_rule]: "right_total A"
kuncar@51956
   195
  shows "(set_rel A ===> set_rel A) (\<lambda>S. uminus S \<inter> Collect (Domainp A)) uminus"
kuncar@51956
   196
  unfolding Compl_eq [abs_def]
kuncar@51956
   197
  by (subst Collect_conj_eq[symmetric]) transfer_prover
kuncar@51956
   198
huffman@47648
   199
lemma Compl_transfer [transfer_rule]:
huffman@47648
   200
  assumes [transfer_rule]: "bi_unique A" and [transfer_rule]: "bi_total A"
huffman@47648
   201
  shows "(set_rel A ===> set_rel A) uminus uminus"
huffman@47648
   202
  unfolding Compl_eq [abs_def] by transfer_prover
huffman@47648
   203
kuncar@51956
   204
lemma right_total_Inter_transfer [transfer_rule]:
kuncar@51956
   205
  assumes [transfer_rule]: "bi_unique A" and [transfer_rule]: "right_total A"
kuncar@51956
   206
  shows "(set_rel (set_rel A) ===> set_rel A) (\<lambda>S. Inter S \<inter> Collect (Domainp A)) Inter"
kuncar@51956
   207
  unfolding Inter_eq[abs_def]
kuncar@51956
   208
  by (subst Collect_conj_eq[symmetric]) transfer_prover
kuncar@51956
   209
huffman@47648
   210
lemma Inter_transfer [transfer_rule]:
huffman@47648
   211
  assumes [transfer_rule]: "bi_unique A" and [transfer_rule]: "bi_total A"
huffman@47648
   212
  shows "(set_rel (set_rel A) ===> set_rel A) Inter Inter"
huffman@47648
   213
  unfolding Inter_eq [abs_def] by transfer_prover
huffman@47648
   214
kuncar@51956
   215
lemma filter_transfer [transfer_rule]:
kuncar@51956
   216
  assumes [transfer_rule]: "bi_unique A"
kuncar@51956
   217
  shows "((A ===> op=) ===> set_rel A ===> set_rel A) Set.filter Set.filter"
kuncar@51956
   218
  unfolding Set.filter_def[abs_def] fun_rel_def set_rel_def by blast
kuncar@51956
   219
huffman@47648
   220
lemma finite_transfer [transfer_rule]:
huffman@47648
   221
  assumes "bi_unique A"
huffman@47648
   222
  shows "(set_rel A ===> op =) finite finite"
huffman@47648
   223
  apply (rule fun_relI, rename_tac X Y)
huffman@47648
   224
  apply (rule iffI)
huffman@47648
   225
  apply (subgoal_tac "Y \<subseteq> (\<lambda>x. THE y. A x y) ` X")
huffman@47648
   226
  apply (erule finite_subset, erule finite_imageI)
huffman@47648
   227
  apply (rule subsetI, rename_tac y)
huffman@47648
   228
  apply (clarsimp simp add: set_rel_def)
huffman@47648
   229
  apply (drule (1) bspec, clarify)
huffman@47648
   230
  apply (rule image_eqI)
huffman@47648
   231
  apply (rule the_equality [symmetric])
huffman@47648
   232
  apply assumption
huffman@47648
   233
  apply (simp add: assms [unfolded bi_unique_def])
huffman@47648
   234
  apply assumption
huffman@47648
   235
  apply (subgoal_tac "X \<subseteq> (\<lambda>y. THE x. A x y) ` Y")
huffman@47648
   236
  apply (erule finite_subset, erule finite_imageI)
huffman@47648
   237
  apply (rule subsetI, rename_tac x)
huffman@47648
   238
  apply (clarsimp simp add: set_rel_def)
huffman@47648
   239
  apply (drule (1) bspec, clarify)
huffman@47648
   240
  apply (rule image_eqI)
huffman@47648
   241
  apply (rule the_equality [symmetric])
huffman@47648
   242
  apply assumption
huffman@47648
   243
  apply (simp add: assms [unfolded bi_unique_def])
huffman@47648
   244
  apply assumption
huffman@47648
   245
  done
huffman@47648
   246
huffman@47648
   247
subsection {* Setup for lifting package *}
huffman@47648
   248
kuncar@47777
   249
lemma Quotient_set[quot_map]:
huffman@47648
   250
  assumes "Quotient R Abs Rep T"
huffman@47648
   251
  shows "Quotient (set_rel R) (image Abs) (image Rep) (set_rel T)"
huffman@47648
   252
  using assms unfolding Quotient_alt_def4
kuncar@51377
   253
  apply (simp add: set_rel_OO[symmetric] set_rel_conversep)
huffman@47648
   254
  apply (simp add: set_rel_def, fast)
huffman@47648
   255
  done
huffman@47648
   256
huffman@47648
   257
lemma set_invariant_commute [invariant_commute]:
huffman@47648
   258
  "set_rel (Lifting.invariant P) = Lifting.invariant (\<lambda>A. Ball A P)"
huffman@47648
   259
  unfolding fun_eq_iff set_rel_def Lifting.invariant_def Ball_def by fast
huffman@47648
   260
huffman@47648
   261
subsection {* Contravariant set map (vimage) and set relator *}
huffman@47626
   262
huffman@47647
   263
definition "vset_rel R xs ys \<equiv> \<forall>x y. R x y \<longrightarrow> x \<in> xs \<longleftrightarrow> y \<in> ys"
huffman@47626
   264
huffman@47647
   265
lemma vset_rel_eq [id_simps]:
huffman@47647
   266
  "vset_rel op = = op ="
huffman@47647
   267
  by (subst fun_eq_iff, subst fun_eq_iff) (simp add: set_eq_iff vset_rel_def)
huffman@47626
   268
huffman@47647
   269
lemma vset_rel_equivp:
huffman@47626
   270
  assumes e: "equivp R"
huffman@47647
   271
  shows "vset_rel R xs ys \<longleftrightarrow> xs = ys \<and> (\<forall>x y. x \<in> xs \<longrightarrow> R x y \<longrightarrow> y \<in> xs)"
huffman@47647
   272
  unfolding vset_rel_def
huffman@47626
   273
  using equivp_reflp[OF e]
huffman@47626
   274
  by auto (metis, metis equivp_symp[OF e])
huffman@47626
   275
kaliszyk@44413
   276
lemma set_quotient [quot_thm]:
kuncar@47308
   277
  assumes "Quotient3 R Abs Rep"
huffman@47647
   278
  shows "Quotient3 (vset_rel R) (vimage Rep) (vimage Abs)"
kuncar@47308
   279
proof (rule Quotient3I)
kuncar@47308
   280
  from assms have "\<And>x. Abs (Rep x) = x" by (rule Quotient3_abs_rep)
kaliszyk@44413
   281
  then show "\<And>xs. Rep -` (Abs -` xs) = xs"
kaliszyk@44413
   282
    unfolding vimage_def by auto
kaliszyk@44413
   283
next
huffman@47647
   284
  show "\<And>xs. vset_rel R (Abs -` xs) (Abs -` xs)"
huffman@47647
   285
    unfolding vset_rel_def vimage_def
kuncar@47308
   286
    by auto (metis Quotient3_rel_abs[OF assms])+
kaliszyk@44413
   287
next
kaliszyk@44413
   288
  fix r s
huffman@47647
   289
  show "vset_rel R r s = (vset_rel R r r \<and> vset_rel R s s \<and> Rep -` r = Rep -` s)"
huffman@47647
   290
    unfolding vset_rel_def vimage_def set_eq_iff
kuncar@47308
   291
    by auto (metis rep_abs_rsp[OF assms] assms[simplified Quotient3_def])+
kaliszyk@44413
   292
qed
kaliszyk@44413
   293
huffman@47647
   294
declare [[mapQ3 set = (vset_rel, set_quotient)]]
kuncar@47094
   295
kaliszyk@44413
   296
lemma empty_set_rsp[quot_respect]:
huffman@47647
   297
  "vset_rel R {} {}"
huffman@47647
   298
  unfolding vset_rel_def by simp
kaliszyk@44413
   299
kaliszyk@44413
   300
lemma collect_rsp[quot_respect]:
kuncar@47308
   301
  assumes "Quotient3 R Abs Rep"
huffman@47647
   302
  shows "((R ===> op =) ===> vset_rel R) Collect Collect"
huffman@47647
   303
  by (intro fun_relI) (simp add: fun_rel_def vset_rel_def)
kaliszyk@44413
   304
kaliszyk@44413
   305
lemma collect_prs[quot_preserve]:
kuncar@47308
   306
  assumes "Quotient3 R Abs Rep"
kaliszyk@44413
   307
  shows "((Abs ---> id) ---> op -` Rep) Collect = Collect"
kaliszyk@44413
   308
  unfolding fun_eq_iff
kuncar@47308
   309
  by (simp add: Quotient3_abs_rep[OF assms])
kaliszyk@44413
   310
kaliszyk@44413
   311
lemma union_rsp[quot_respect]:
kuncar@47308
   312
  assumes "Quotient3 R Abs Rep"
huffman@47647
   313
  shows "(vset_rel R ===> vset_rel R ===> vset_rel R) op \<union> op \<union>"
huffman@47647
   314
  by (intro fun_relI) (simp add: vset_rel_def)
kaliszyk@44413
   315
kaliszyk@44413
   316
lemma union_prs[quot_preserve]:
kuncar@47308
   317
  assumes "Quotient3 R Abs Rep"
kaliszyk@44413
   318
  shows "(op -` Abs ---> op -` Abs ---> op -` Rep) op \<union> = op \<union>"
kaliszyk@44413
   319
  unfolding fun_eq_iff
kuncar@47308
   320
  by (simp add: Quotient3_abs_rep[OF set_quotient[OF assms]])
kaliszyk@44413
   321
kaliszyk@44413
   322
lemma diff_rsp[quot_respect]:
kuncar@47308
   323
  assumes "Quotient3 R Abs Rep"
huffman@47647
   324
  shows "(vset_rel R ===> vset_rel R ===> vset_rel R) op - op -"
huffman@47647
   325
  by (intro fun_relI) (simp add: vset_rel_def)
kaliszyk@44413
   326
kaliszyk@44413
   327
lemma diff_prs[quot_preserve]:
kuncar@47308
   328
  assumes "Quotient3 R Abs Rep"
kaliszyk@44413
   329
  shows "(op -` Abs ---> op -` Abs ---> op -` Rep) op - = op -"
kaliszyk@44413
   330
  unfolding fun_eq_iff
kuncar@47308
   331
  by (simp add: Quotient3_abs_rep[OF set_quotient[OF assms]] vimage_Diff)
kaliszyk@44413
   332
kaliszyk@44413
   333
lemma inter_rsp[quot_respect]:
kuncar@47308
   334
  assumes "Quotient3 R Abs Rep"
huffman@47647
   335
  shows "(vset_rel R ===> vset_rel R ===> vset_rel R) op \<inter> op \<inter>"
huffman@47647
   336
  by (intro fun_relI) (auto simp add: vset_rel_def)
kaliszyk@44413
   337
kaliszyk@44413
   338
lemma inter_prs[quot_preserve]:
kuncar@47308
   339
  assumes "Quotient3 R Abs Rep"
kaliszyk@44413
   340
  shows "(op -` Abs ---> op -` Abs ---> op -` Rep) op \<inter> = op \<inter>"
kaliszyk@44413
   341
  unfolding fun_eq_iff
kuncar@47308
   342
  by (simp add: Quotient3_abs_rep[OF set_quotient[OF assms]])
kaliszyk@44413
   343
kaliszyk@44459
   344
lemma mem_prs[quot_preserve]:
kuncar@47308
   345
  assumes "Quotient3 R Abs Rep"
kaliszyk@44459
   346
  shows "(Rep ---> op -` Abs ---> id) op \<in> = op \<in>"
kuncar@47308
   347
  by (simp add: fun_eq_iff Quotient3_abs_rep[OF assms])
kaliszyk@44459
   348
haftmann@45970
   349
lemma mem_rsp[quot_respect]:
huffman@47647
   350
  shows "(R ===> vset_rel R ===> op =) op \<in> op \<in>"
huffman@47647
   351
  by (intro fun_relI) (simp add: vset_rel_def)
kaliszyk@44459
   352
kaliszyk@44413
   353
end