src/HOL/Lifting_Product.thy
author haftmann
Fri Oct 10 19:55:32 2014 +0200 (2014-10-10)
changeset 58646 cd63a4b12a33
parent 58448 a1d4e7473c98
child 58889 5b7a9633cfa8
permissions -rw-r--r--
specialized specification: avoid trivial instances
kuncar@53012
     1
(*  Title:      HOL/Lifting_Product.thy
kuncar@53012
     2
    Author:     Brian Huffman and Ondrej Kuncar
kuncar@53012
     3
*)
kuncar@53012
     4
kuncar@53012
     5
header {* Setup for Lifting/Transfer for the product type *}
kuncar@53012
     6
kuncar@53012
     7
theory Lifting_Product
blanchet@55083
     8
imports Lifting Basic_BNFs
kuncar@53012
     9
begin
kuncar@53012
    10
kuncar@56526
    11
(* The following lemma can be deleted when product is added to FP sugar *)
kuncar@56526
    12
lemma prod_pred_inject [simp]:
kuncar@56526
    13
  "pred_prod P1 P2 (a, b) = (P1 a \<and> P2 b)"
kuncar@56526
    14
  unfolding pred_prod_def fun_eq_iff prod_set_simps by blast
kuncar@56526
    15
kuncar@53012
    16
subsection {* Transfer rules for the Transfer package *}
kuncar@53012
    17
kuncar@53012
    18
context
kuncar@53012
    19
begin
kuncar@53012
    20
interpretation lifting_syntax .
kuncar@53012
    21
desharna@58448
    22
declare Pair_transfer [transfer_rule]
desharna@58444
    23
declare fst_transfer [transfer_rule]
desharna@58444
    24
declare snd_transfer [transfer_rule]
desharna@58446
    25
declare case_prod_transfer [transfer_rule]
kuncar@53012
    26
kuncar@53012
    27
lemma curry_transfer [transfer_rule]:
blanchet@55944
    28
  "((rel_prod A B ===> C) ===> A ===> B ===> C) curry curry"
kuncar@53012
    29
  unfolding curry_def by transfer_prover
kuncar@53012
    30
blanchet@55932
    31
lemma map_prod_transfer [transfer_rule]:
blanchet@55944
    32
  "((A ===> C) ===> (B ===> D) ===> rel_prod A B ===> rel_prod C D)
blanchet@55932
    33
    map_prod map_prod"
blanchet@55932
    34
  unfolding map_prod_def [abs_def] by transfer_prover
kuncar@53012
    35
blanchet@55944
    36
lemma rel_prod_transfer [transfer_rule]:
kuncar@53012
    37
  "((A ===> B ===> op =) ===> (C ===> D ===> op =) ===>
blanchet@55944
    38
    rel_prod A C ===> rel_prod B D ===> op =) rel_prod rel_prod"
blanchet@55945
    39
  unfolding rel_fun_def by auto
kuncar@53012
    40
kuncar@53012
    41
end
kuncar@53012
    42
kuncar@53012
    43
end