src/HOL/Quotient.thy
changeset 61799 4cf66f21b764
parent 60758 d8d85a8172b5
child 63343 fb5d8a50c641
equal deleted inserted replaced
61798:27f3c10b0b50 61799:4cf66f21b764
    62   using a
    62   using a
    63   unfolding Quotient3_def
    63   unfolding Quotient3_def
    64   by blast
    64   by blast
    65 
    65 
    66 lemma Quotient3_rel:
    66 lemma Quotient3_rel:
    67   "R r r \<and> R s s \<and> Abs r = Abs s \<longleftrightarrow> R r s" -- \<open>orientation does not loop on rewriting\<close>
    67   "R r r \<and> R s s \<and> Abs r = Abs s \<longleftrightarrow> R r s" \<comment> \<open>orientation does not loop on rewriting\<close>
    68   using a
    68   using a
    69   unfolding Quotient3_def
    69   unfolding Quotient3_def
    70   by blast
    70   by blast
    71 
    71 
    72 lemma Quotient3_refl1: 
    72 lemma Quotient3_refl1: 
   194 
   194 
   195 text\<open>
   195 text\<open>
   196   In the following theorem R1 can be instantiated with anything,
   196   In the following theorem R1 can be instantiated with anything,
   197   but we know some of the types of the Rep and Abs functions;
   197   but we know some of the types of the Rep and Abs functions;
   198   so by solving Quotient assumptions we can get a unique R1 that
   198   so by solving Quotient assumptions we can get a unique R1 that
   199   will be provable; which is why we need to use @{text apply_rsp} and
   199   will be provable; which is why we need to use \<open>apply_rsp\<close> and
   200   not the primed version\<close>
   200   not the primed version\<close>
   201 
   201 
   202 lemma apply_rspQ3:
   202 lemma apply_rspQ3:
   203   fixes f g::"'a \<Rightarrow> 'c"
   203   fixes f g::"'a \<Rightarrow> 'c"
   204   assumes q: "Quotient3 R1 Abs1 Rep1"
   204   assumes q: "Quotient3 R1 Abs1 Rep1"
   390   assumes a: "Quotient3 R absf repf"
   390   assumes a: "Quotient3 R absf repf"
   391   shows "Bex (Respects R) ((absf ---> id) f) = Ex f"
   391   shows "Bex (Respects R) ((absf ---> id) f) = Ex f"
   392   using a unfolding Quotient3_def Bex_def in_respects id_apply comp_def map_fun_def
   392   using a unfolding Quotient3_def Bex_def in_respects id_apply comp_def map_fun_def
   393   by metis
   393   by metis
   394 
   394 
   395 subsection \<open>@{text Bex1_rel} quantifier\<close>
   395 subsection \<open>\<open>Bex1_rel\<close> quantifier\<close>
   396 
   396 
   397 definition
   397 definition
   398   Bex1_rel :: "('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> ('a \<Rightarrow> bool) \<Rightarrow> bool"
   398   Bex1_rel :: "('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> ('a \<Rightarrow> bool) \<Rightarrow> bool"
   399 where
   399 where
   400   "Bex1_rel R P \<longleftrightarrow> (\<exists>x \<in> Respects R. P x) \<and> (\<forall>x \<in> Respects R. \<forall>y \<in> Respects R. ((P x \<and> P y) \<longrightarrow> (R x y)))"
   400   "Bex1_rel R P \<longleftrightarrow> (\<exists>x \<in> Respects R. P x) \<and> (\<forall>x \<in> Respects R. \<forall>y \<in> Respects R. ((P x \<and> P y) \<longrightarrow> (R x y)))"