src/HOL/Lifting_Product.thy
changeset 56525 b5b6ad5dc2ae
parent 56520 3373f5d1e074
child 56526 58ac520db7ae
equal deleted inserted replaced
56524:f4ba736040fa 56525:b5b6ad5dc2ae
     5 header {* Setup for Lifting/Transfer for the product type *}
     5 header {* Setup for Lifting/Transfer for the product type *}
     6 
     6 
     7 theory Lifting_Product
     7 theory Lifting_Product
     8 imports Lifting Basic_BNFs
     8 imports Lifting Basic_BNFs
     9 begin
     9 begin
    10 
       
    11 subsection {* Relator and predicator properties *}
       
    12 
       
    13 definition pred_prod :: "('a \<Rightarrow> bool) \<Rightarrow> ('b \<Rightarrow> bool) \<Rightarrow> 'a \<times> 'b \<Rightarrow> bool"
       
    14 where "pred_prod R1 R2 = (\<lambda>(a, b). R1 a \<and> R2 b)"
       
    15 
       
    16 lemma pred_prod_apply [simp]:
       
    17   "pred_prod P1 P2 (a, b) \<longleftrightarrow> P1 a \<and> P2 b"
       
    18   by (simp add: pred_prod_def)
       
    19 
       
    20 lemmas rel_prod_eq[relator_eq] = prod.rel_eq
       
    21 lemmas rel_prod_mono[relator_mono] = prod.rel_mono
       
    22 
       
    23 lemma rel_prod_OO[relator_distr]:
       
    24   "(rel_prod A B) OO (rel_prod C D) = rel_prod (A OO C) (B OO D)"
       
    25 by (rule ext)+ (auto simp: rel_prod_def OO_def)
       
    26 
       
    27 lemma Domainp_prod[relator_domain]: 
       
    28   "Domainp (rel_prod T1 T2) = (pred_prod (Domainp T1) (Domainp T2))"
       
    29 unfolding rel_prod_def pred_prod_def by blast
       
    30 
       
    31 lemma left_total_rel_prod [transfer_rule]:
       
    32   assumes "left_total R1"
       
    33   assumes "left_total R2"
       
    34   shows "left_total (rel_prod R1 R2)"
       
    35   using assms unfolding left_total_def rel_prod_def by auto
       
    36 
       
    37 lemma left_unique_rel_prod [transfer_rule]:
       
    38   assumes "left_unique R1" and "left_unique R2"
       
    39   shows "left_unique (rel_prod R1 R2)"
       
    40   using assms unfolding left_unique_def rel_prod_def by auto
       
    41 
       
    42 lemma right_total_rel_prod [transfer_rule]:
       
    43   assumes "right_total R1" and "right_total R2"
       
    44   shows "right_total (rel_prod R1 R2)"
       
    45   using assms unfolding right_total_def rel_prod_def by auto
       
    46 
       
    47 lemma right_unique_rel_prod [transfer_rule]:
       
    48   assumes "right_unique R1" and "right_unique R2"
       
    49   shows "right_unique (rel_prod R1 R2)"
       
    50   using assms unfolding right_unique_def rel_prod_def by auto
       
    51 
       
    52 lemma bi_total_rel_prod [transfer_rule]:
       
    53   assumes "bi_total R1" and "bi_total R2"
       
    54   shows "bi_total (rel_prod R1 R2)"
       
    55   using assms unfolding bi_total_def rel_prod_def by auto
       
    56 
       
    57 lemma bi_unique_rel_prod [transfer_rule]:
       
    58   assumes "bi_unique R1" and "bi_unique R2"
       
    59   shows "bi_unique (rel_prod R1 R2)"
       
    60   using assms unfolding bi_unique_def rel_prod_def by auto
       
    61 
       
    62 lemma prod_relator_eq_onp [relator_eq_onp]: 
       
    63   "rel_prod (eq_onp P1) (eq_onp P2) = eq_onp (pred_prod P1 P2)"
       
    64   by (simp add: fun_eq_iff rel_prod_def pred_prod_def eq_onp_def) blast
       
    65 
       
    66 subsection {* Quotient theorem for the Lifting package *}
       
    67 
       
    68 lemma Quotient_prod[quot_map]:
       
    69   assumes "Quotient R1 Abs1 Rep1 T1"
       
    70   assumes "Quotient R2 Abs2 Rep2 T2"
       
    71   shows "Quotient (rel_prod R1 R2) (map_prod Abs1 Abs2) (map_prod Rep1 Rep2) (rel_prod T1 T2)"
       
    72   using assms unfolding Quotient_alt_def by auto
       
    73 
    10 
    74 subsection {* Transfer rules for the Transfer package *}
    11 subsection {* Transfer rules for the Transfer package *}
    75 
    12 
    76 context
    13 context
    77 begin
    14 begin