src/HOLCF/Cprod.thy
author huffman
Fri Feb 01 02:38:41 2008 +0100 (2008-02-01)
changeset 26029 46e84ca065f1
parent 26027 87cb69d27558
child 26035 9f8810c42604
permissions -rw-r--r--
add lemmas prod_lessI and Pair_less_iff [simp]
huffman@15600
     1
(*  Title:      HOLCF/Cprod.thy
huffman@15576
     2
    ID:         $Id$
huffman@15576
     3
    Author:     Franz Regensburger
huffman@15576
     4
wenzelm@16070
     5
Partial ordering for cartesian product of HOL products.
huffman@15576
     6
*)
huffman@15576
     7
huffman@15576
     8
header {* The cpo of cartesian products *}
huffman@15576
     9
huffman@15577
    10
theory Cprod
huffman@25910
    11
imports Bifinite
huffman@15577
    12
begin
huffman@15576
    13
huffman@15576
    14
defaultsort cpo
huffman@15576
    15
huffman@16008
    16
subsection {* Type @{typ unit} is a pcpo *}
huffman@16008
    17
huffman@26025
    18
instantiation unit :: sq_ord
huffman@25784
    19
begin
huffman@16008
    20
huffman@25784
    21
definition
huffman@16008
    22
  less_unit_def [simp]: "x \<sqsubseteq> (y::unit) \<equiv> True"
huffman@16008
    23
huffman@26025
    24
instance ..
huffman@26025
    25
end
huffman@25784
    26
huffman@26025
    27
instance unit :: discrete_cpo
huffman@26025
    28
by intro_classes simp
huffman@16008
    29
huffman@25815
    30
instance unit :: finite_po ..
huffman@16008
    31
huffman@16008
    32
instance unit :: pcpo
huffman@16008
    33
by intro_classes simp
huffman@16008
    34
wenzelm@25131
    35
definition
wenzelm@25131
    36
  unit_when :: "'a \<rightarrow> unit \<rightarrow> 'a" where
wenzelm@25131
    37
  "unit_when = (\<Lambda> a _. a)"
huffman@16008
    38
huffman@18289
    39
translations
wenzelm@25131
    40
  "\<Lambda>(). t" == "CONST unit_when\<cdot>t"
huffman@18289
    41
huffman@18289
    42
lemma unit_when [simp]: "unit_when\<cdot>a\<cdot>u = a"
huffman@18289
    43
by (simp add: unit_when_def)
huffman@18289
    44
huffman@18289
    45
huffman@18289
    46
subsection {* Product type is a partial order *}
huffman@15593
    47
huffman@25908
    48
instantiation "*" :: (po, po) po
huffman@25784
    49
begin
huffman@15576
    50
huffman@25784
    51
definition
huffman@16081
    52
  less_cprod_def: "(op \<sqsubseteq>) \<equiv> \<lambda>p1 p2. (fst p1 \<sqsubseteq> fst p2 \<and> snd p1 \<sqsubseteq> snd p2)"
huffman@15576
    53
huffman@25908
    54
instance
huffman@25784
    55
proof
huffman@25784
    56
  fix x :: "'a \<times> 'b"
huffman@25784
    57
  show "x \<sqsubseteq> x"
huffman@25784
    58
    unfolding less_cprod_def by simp
huffman@25784
    59
next
huffman@25784
    60
  fix x y :: "'a \<times> 'b"
huffman@25784
    61
  assume "x \<sqsubseteq> y" "y \<sqsubseteq> x" thus "x = y"
huffman@25784
    62
    unfolding less_cprod_def Pair_fst_snd_eq
huffman@25784
    63
    by (fast intro: antisym_less)
huffman@25784
    64
next
huffman@25784
    65
  fix x y z :: "'a \<times> 'b"
huffman@25784
    66
  assume "x \<sqsubseteq> y" "y \<sqsubseteq> z" thus "x \<sqsubseteq> z"
huffman@25784
    67
    unfolding less_cprod_def
huffman@25784
    68
    by (fast intro: trans_less)
huffman@25784
    69
qed
huffman@15576
    70
huffman@25908
    71
end
huffman@15576
    72
huffman@15593
    73
subsection {* Monotonicity of @{text "(_,_)"}, @{term fst}, @{term snd} *}
huffman@15576
    74
huffman@26029
    75
lemma prod_lessI: "\<lbrakk>fst p \<sqsubseteq> fst q; snd p \<sqsubseteq> snd q\<rbrakk> \<Longrightarrow> p \<sqsubseteq> q"
huffman@26029
    76
unfolding less_cprod_def by simp
huffman@26029
    77
huffman@26029
    78
lemma Pair_less_iff [simp]: "(a, b) \<sqsubseteq> (c, d) = (a \<sqsubseteq> c \<and> b \<sqsubseteq> d)"
huffman@26029
    79
unfolding less_cprod_def by simp
huffman@26029
    80
huffman@15593
    81
text {* Pair @{text "(_,_)"}  is monotone in both arguments *}
huffman@15576
    82
huffman@16081
    83
lemma monofun_pair1: "monofun (\<lambda>x. (x, y))"
huffman@26029
    84
by (simp add: monofun_def)
huffman@15576
    85
huffman@16081
    86
lemma monofun_pair2: "monofun (\<lambda>y. (x, y))"
huffman@26029
    87
by (simp add: monofun_def)
huffman@15576
    88
huffman@16081
    89
lemma monofun_pair:
huffman@16081
    90
  "\<lbrakk>x1 \<sqsubseteq> x2; y1 \<sqsubseteq> y2\<rbrakk> \<Longrightarrow> (x1, y1) \<sqsubseteq> (x2, y2)"
huffman@26029
    91
by simp
huffman@15576
    92
huffman@15593
    93
text {* @{term fst} and @{term snd} are monotone *}
huffman@15576
    94
huffman@15576
    95
lemma monofun_fst: "monofun fst"
huffman@16210
    96
by (simp add: monofun_def less_cprod_def)
huffman@15576
    97
huffman@15576
    98
lemma monofun_snd: "monofun snd"
huffman@16210
    99
by (simp add: monofun_def less_cprod_def)
huffman@15576
   100
huffman@18289
   101
subsection {* Product type is a cpo *}
huffman@15576
   102
huffman@26018
   103
lemma is_lub_Pair:
huffman@26018
   104
  "\<lbrakk>range X <<| x; range Y <<| y\<rbrakk> \<Longrightarrow> range (\<lambda>i. (X i, Y i)) <<| (x, y)"
huffman@26018
   105
apply (rule is_lubI [OF ub_rangeI])
huffman@26018
   106
apply (simp add: less_cprod_def is_ub_lub)
huffman@26018
   107
apply (frule ub2ub_monofun [OF monofun_fst])
huffman@26018
   108
apply (drule ub2ub_monofun [OF monofun_snd])
huffman@26018
   109
apply (simp add: less_cprod_def is_lub_lub)
huffman@26018
   110
done
huffman@26018
   111
huffman@25784
   112
lemma lub_cprod:
huffman@25784
   113
  fixes S :: "nat \<Rightarrow> ('a::cpo \<times> 'b::cpo)"
huffman@25784
   114
  assumes S: "chain S"
huffman@25784
   115
  shows "range S <<| (\<Squnion>i. fst (S i), \<Squnion>i. snd (S i))"
huffman@26018
   116
proof -
huffman@26018
   117
  have "chain (\<lambda>i. fst (S i))"
huffman@26018
   118
    using monofun_fst S by (rule ch2ch_monofun)
huffman@26018
   119
  hence 1: "range (\<lambda>i. fst (S i)) <<| (\<Squnion>i. fst (S i))"
huffman@26027
   120
    by (rule cpo_lubI)
huffman@26018
   121
  have "chain (\<lambda>i. snd (S i))"
huffman@26018
   122
    using monofun_snd S by (rule ch2ch_monofun)
huffman@26018
   123
  hence 2: "range (\<lambda>i. snd (S i)) <<| (\<Squnion>i. snd (S i))"
huffman@26027
   124
    by (rule cpo_lubI)
huffman@26018
   125
  show "range S <<| (\<Squnion>i. fst (S i), \<Squnion>i. snd (S i))"
huffman@26018
   126
    using is_lub_Pair [OF 1 2] by simp
huffman@26018
   127
qed
huffman@15576
   128
huffman@16081
   129
lemma thelub_cprod:
huffman@25784
   130
  "chain (S::nat \<Rightarrow> 'a::cpo \<times> 'b::cpo)
huffman@25784
   131
    \<Longrightarrow> lub (range S) = (\<Squnion>i. fst (S i), \<Squnion>i. snd (S i))"
huffman@16081
   132
by (rule lub_cprod [THEN thelubI])
huffman@15576
   133
huffman@25784
   134
instance "*" :: (cpo, cpo) cpo
huffman@25784
   135
proof
huffman@25784
   136
  fix S :: "nat \<Rightarrow> ('a \<times> 'b)"
huffman@25784
   137
  assume "chain S"
huffman@25784
   138
  hence "range S <<| (\<Squnion>i. fst (S i), \<Squnion>i. snd (S i))"
huffman@25784
   139
    by (rule lub_cprod)
huffman@25784
   140
  thus "\<exists>x. range S <<| x" ..
huffman@25784
   141
qed
huffman@15593
   142
huffman@25827
   143
instance "*" :: (finite_po, finite_po) finite_po ..
huffman@25827
   144
huffman@26025
   145
instance "*" :: (discrete_cpo, discrete_cpo) discrete_cpo
huffman@26025
   146
proof
huffman@26025
   147
  fix x y :: "'a \<times> 'b"
huffman@26025
   148
  show "x \<sqsubseteq> y \<longleftrightarrow> x = y"
huffman@26025
   149
    unfolding less_cprod_def Pair_fst_snd_eq
huffman@26025
   150
    by simp
huffman@26025
   151
qed
huffman@26025
   152
huffman@18289
   153
subsection {* Product type is pointed *}
huffman@15593
   154
huffman@16081
   155
lemma minimal_cprod: "(\<bottom>, \<bottom>) \<sqsubseteq> p"
huffman@16081
   156
by (simp add: less_cprod_def)
huffman@15593
   157
huffman@25908
   158
instance "*" :: (pcpo, pcpo) pcpo
huffman@25908
   159
by intro_classes (fast intro: minimal_cprod)
huffman@15593
   160
huffman@25908
   161
lemma inst_cprod_pcpo: "\<bottom> = (\<bottom>, \<bottom>)"
huffman@16081
   162
by (rule minimal_cprod [THEN UU_I, symmetric])
huffman@16081
   163
huffman@15593
   164
huffman@15593
   165
subsection {* Continuity of @{text "(_,_)"}, @{term fst}, @{term snd} *}
huffman@15593
   166
huffman@16081
   167
lemma cont_pair1: "cont (\<lambda>x. (x, y))"
huffman@26018
   168
apply (rule contI)
huffman@26018
   169
apply (rule is_lub_Pair)
huffman@26027
   170
apply (erule cpo_lubI)
huffman@26018
   171
apply (rule lub_const)
huffman@15593
   172
done
huffman@15593
   173
huffman@16081
   174
lemma cont_pair2: "cont (\<lambda>y. (x, y))"
huffman@26018
   175
apply (rule contI)
huffman@26018
   176
apply (rule is_lub_Pair)
huffman@26018
   177
apply (rule lub_const)
huffman@26027
   178
apply (erule cpo_lubI)
huffman@15593
   179
done
huffman@15576
   180
huffman@16081
   181
lemma contlub_fst: "contlub fst"
huffman@16210
   182
apply (rule contlubI)
huffman@16210
   183
apply (simp add: thelub_cprod)
huffman@15593
   184
done
huffman@15593
   185
huffman@16081
   186
lemma contlub_snd: "contlub snd"
huffman@16210
   187
apply (rule contlubI)
huffman@16210
   188
apply (simp add: thelub_cprod)
huffman@15593
   189
done
huffman@15576
   190
huffman@16081
   191
lemma cont_fst: "cont fst"
huffman@15593
   192
apply (rule monocontlub2cont)
huffman@15593
   193
apply (rule monofun_fst)
huffman@15593
   194
apply (rule contlub_fst)
huffman@15593
   195
done
huffman@15593
   196
huffman@16081
   197
lemma cont_snd: "cont snd"
huffman@15593
   198
apply (rule monocontlub2cont)
huffman@15593
   199
apply (rule monofun_snd)
huffman@15593
   200
apply (rule contlub_snd)
huffman@15593
   201
done
huffman@15593
   202
huffman@15593
   203
subsection {* Continuous versions of constants *}
huffman@15576
   204
wenzelm@25131
   205
definition
wenzelm@25131
   206
  cpair :: "'a \<rightarrow> 'b \<rightarrow> ('a * 'b)"  -- {* continuous pairing *}  where
wenzelm@25131
   207
  "cpair = (\<Lambda> x y. (x, y))"
wenzelm@25131
   208
wenzelm@25131
   209
definition
wenzelm@25131
   210
  cfst :: "('a * 'b) \<rightarrow> 'a" where
wenzelm@25131
   211
  "cfst = (\<Lambda> p. fst p)"
huffman@17834
   212
wenzelm@25131
   213
definition
wenzelm@25131
   214
  csnd :: "('a * 'b) \<rightarrow> 'b" where
wenzelm@25131
   215
  "csnd = (\<Lambda> p. snd p)"      
huffman@17834
   216
wenzelm@25131
   217
definition
wenzelm@25131
   218
  csplit :: "('a \<rightarrow> 'b \<rightarrow> 'c) \<rightarrow> ('a * 'b) \<rightarrow> 'c" where
wenzelm@25131
   219
  "csplit = (\<Lambda> f p. f\<cdot>(cfst\<cdot>p)\<cdot>(csnd\<cdot>p))"
huffman@15576
   220
huffman@15576
   221
syntax
huffman@17834
   222
  "_ctuple" :: "['a, args] \<Rightarrow> 'a * 'b"  ("(1<_,/ _>)")
huffman@17834
   223
huffman@17834
   224
syntax (xsymbols)
huffman@17834
   225
  "_ctuple" :: "['a, args] \<Rightarrow> 'a * 'b"  ("(1\<langle>_,/ _\<rangle>)")
huffman@15576
   226
huffman@15576
   227
translations
huffman@18078
   228
  "\<langle>x, y, z\<rangle>" == "\<langle>x, \<langle>y, z\<rangle>\<rangle>"
wenzelm@25131
   229
  "\<langle>x, y\<rangle>"    == "CONST cpair\<cdot>x\<cdot>y"
huffman@17834
   230
huffman@17816
   231
translations
wenzelm@25131
   232
  "\<Lambda>(CONST cpair\<cdot>x\<cdot>y). t" == "CONST csplit\<cdot>(\<Lambda> x y. t)"
huffman@17816
   233
huffman@15576
   234
huffman@15593
   235
subsection {* Convert all lemmas to the continuous versions *}
huffman@15576
   236
huffman@16081
   237
lemma cpair_eq_pair: "<x, y> = (x, y)"
huffman@16081
   238
by (simp add: cpair_def cont_pair1 cont_pair2)
huffman@16081
   239
huffman@25910
   240
lemma pair_eq_cpair: "(x, y) = <x, y>"
huffman@25910
   241
by (simp add: cpair_def cont_pair1 cont_pair2)
huffman@25910
   242
huffman@16081
   243
lemma inject_cpair: "<a,b> = <aa,ba> \<Longrightarrow> a = aa \<and> b = ba"
huffman@16081
   244
by (simp add: cpair_eq_pair)
huffman@15576
   245
huffman@16081
   246
lemma cpair_eq [iff]: "(<a, b> = <a', b'>) = (a = a' \<and> b = b')"
huffman@16081
   247
by (simp add: cpair_eq_pair)
huffman@15576
   248
huffman@18077
   249
lemma cpair_less [iff]: "(<a, b> \<sqsubseteq> <a', b'>) = (a \<sqsubseteq> a' \<and> b \<sqsubseteq> b')"
huffman@16081
   250
by (simp add: cpair_eq_pair less_cprod_def)
huffman@16057
   251
huffman@18077
   252
lemma cpair_defined_iff [iff]: "(<x, y> = \<bottom>) = (x = \<bottom> \<and> y = \<bottom>)"
huffman@16916
   253
by (simp add: inst_cprod_pcpo cpair_eq_pair)
huffman@16916
   254
huffman@25913
   255
lemma cpair_strict [simp]: "\<langle>\<bottom>, \<bottom>\<rangle> = \<bottom>"
huffman@18077
   256
by simp
huffman@16210
   257
huffman@16081
   258
lemma inst_cprod_pcpo2: "\<bottom> = <\<bottom>, \<bottom>>"
huffman@16916
   259
by (rule cpair_strict [symmetric])
huffman@15576
   260
huffman@15576
   261
lemma defined_cpair_rev: 
huffman@16081
   262
 "<a,b> = \<bottom> \<Longrightarrow> a = \<bottom> \<and> b = \<bottom>"
huffman@18077
   263
by simp
huffman@16081
   264
huffman@16081
   265
lemma Exh_Cprod2: "\<exists>a b. z = <a, b>"
huffman@16081
   266
by (simp add: cpair_eq_pair)
huffman@16081
   267
huffman@16081
   268
lemma cprodE: "\<lbrakk>\<And>x y. p = <x, y> \<Longrightarrow> Q\<rbrakk> \<Longrightarrow> Q"
huffman@16081
   269
by (cut_tac Exh_Cprod2, auto)
huffman@16081
   270
huffman@16210
   271
lemma cfst_cpair [simp]: "cfst\<cdot><x, y> = x"
huffman@16081
   272
by (simp add: cpair_eq_pair cfst_def cont_fst)
huffman@15576
   273
huffman@16210
   274
lemma csnd_cpair [simp]: "csnd\<cdot><x, y> = y"
huffman@16081
   275
by (simp add: cpair_eq_pair csnd_def cont_snd)
huffman@16081
   276
huffman@16081
   277
lemma cfst_strict [simp]: "cfst\<cdot>\<bottom> = \<bottom>"
huffman@25913
   278
unfolding inst_cprod_pcpo2 by (rule cfst_cpair)
huffman@16081
   279
huffman@16081
   280
lemma csnd_strict [simp]: "csnd\<cdot>\<bottom> = \<bottom>"
huffman@25913
   281
unfolding inst_cprod_pcpo2 by (rule csnd_cpair)
huffman@16081
   282
huffman@25910
   283
lemma cpair_cfst_csnd: "\<langle>cfst\<cdot>p, csnd\<cdot>p\<rangle> = p"
huffman@25910
   284
by (cases p rule: cprodE, simp)
huffman@25910
   285
huffman@25910
   286
lemmas surjective_pairing_Cprod2 = cpair_cfst_csnd
huffman@15576
   287
huffman@16750
   288
lemma less_cprod: "x \<sqsubseteq> y = (cfst\<cdot>x \<sqsubseteq> cfst\<cdot>y \<and> csnd\<cdot>x \<sqsubseteq> csnd\<cdot>y)"
huffman@16315
   289
by (simp add: less_cprod_def cfst_def csnd_def cont_fst cont_snd)
huffman@16315
   290
huffman@16750
   291
lemma eq_cprod: "(x = y) = (cfst\<cdot>x = cfst\<cdot>y \<and> csnd\<cdot>x = csnd\<cdot>y)"
huffman@16750
   292
by (auto simp add: po_eq_conv less_cprod)
huffman@16750
   293
huffman@25879
   294
lemma cfst_less_iff: "cfst\<cdot>x \<sqsubseteq> y = x \<sqsubseteq> <y, csnd\<cdot>x>"
huffman@25879
   295
by (simp add: less_cprod)
huffman@25879
   296
huffman@25879
   297
lemma csnd_less_iff: "csnd\<cdot>x \<sqsubseteq> y = x \<sqsubseteq> <cfst\<cdot>x, y>"
huffman@25879
   298
by (simp add: less_cprod)
huffman@25879
   299
huffman@25879
   300
lemma compact_cfst: "compact x \<Longrightarrow> compact (cfst\<cdot>x)"
huffman@25879
   301
by (rule compactI, simp add: cfst_less_iff)
huffman@25879
   302
huffman@25879
   303
lemma compact_csnd: "compact x \<Longrightarrow> compact (csnd\<cdot>x)"
huffman@25879
   304
by (rule compactI, simp add: csnd_less_iff)
huffman@25879
   305
huffman@25879
   306
lemma compact_cpair: "\<lbrakk>compact x; compact y\<rbrakk> \<Longrightarrow> compact <x, y>"
huffman@17837
   307
by (rule compactI, simp add: less_cprod)
huffman@17837
   308
huffman@25879
   309
lemma compact_cpair_iff [simp]: "compact <x, y> = (compact x \<and> compact y)"
huffman@25879
   310
apply (safe intro!: compact_cpair)
huffman@25879
   311
apply (drule compact_cfst, simp)
huffman@25879
   312
apply (drule compact_csnd, simp)
huffman@25879
   313
done
huffman@25879
   314
huffman@25905
   315
instance "*" :: (chfin, chfin) chfin
huffman@25921
   316
apply intro_classes
huffman@25905
   317
apply (erule compact_imp_max_in_chain)
huffman@25905
   318
apply (rule_tac p="\<Squnion>i. Y i" in cprodE, simp)
huffman@25905
   319
done
huffman@25905
   320
huffman@15576
   321
lemma lub_cprod2: 
huffman@16081
   322
  "chain S \<Longrightarrow> range S <<| <\<Squnion>i. cfst\<cdot>(S i), \<Squnion>i. csnd\<cdot>(S i)>"
huffman@16081
   323
apply (simp add: cpair_eq_pair cfst_def csnd_def cont_fst cont_snd)
huffman@15593
   324
apply (erule lub_cprod)
huffman@15576
   325
done
huffman@15576
   326
huffman@16081
   327
lemma thelub_cprod2:
huffman@16081
   328
  "chain S \<Longrightarrow> lub (range S) = <\<Squnion>i. cfst\<cdot>(S i), \<Squnion>i. csnd\<cdot>(S i)>"
huffman@16081
   329
by (rule lub_cprod2 [THEN thelubI])
huffman@15576
   330
huffman@18077
   331
lemma csplit1 [simp]: "csplit\<cdot>f\<cdot>\<bottom> = f\<cdot>\<bottom>\<cdot>\<bottom>"
huffman@18077
   332
by (simp add: csplit_def)
huffman@18077
   333
huffman@16081
   334
lemma csplit2 [simp]: "csplit\<cdot>f\<cdot><x,y> = f\<cdot>x\<cdot>y"
huffman@15593
   335
by (simp add: csplit_def)
huffman@15576
   336
huffman@16553
   337
lemma csplit3 [simp]: "csplit\<cdot>cpair\<cdot>z = z"
huffman@25910
   338
by (simp add: csplit_def cpair_cfst_csnd)
huffman@15576
   339
huffman@16210
   340
lemmas Cprod_rews = cfst_cpair csnd_cpair csplit2
huffman@15576
   341
huffman@25910
   342
subsection {* Product type is a bifinite domain *}
huffman@25910
   343
huffman@25910
   344
instance "*" :: (bifinite_cpo, bifinite_cpo) approx ..
huffman@25910
   345
huffman@25910
   346
defs (overloaded)
huffman@25910
   347
  approx_cprod_def:
huffman@25910
   348
    "approx \<equiv> \<lambda>n. \<Lambda>\<langle>x, y\<rangle>. \<langle>approx n\<cdot>x, approx n\<cdot>y\<rangle>"
huffman@25910
   349
huffman@25910
   350
instance "*" :: (bifinite_cpo, bifinite_cpo) bifinite_cpo
huffman@25910
   351
proof
huffman@25910
   352
  fix i :: nat and x :: "'a \<times> 'b"
huffman@25910
   353
  show "chain (\<lambda>i. approx i\<cdot>x)"
huffman@25910
   354
    unfolding approx_cprod_def by simp
huffman@25910
   355
  show "(\<Squnion>i. approx i\<cdot>x) = x"
huffman@25910
   356
    unfolding approx_cprod_def
huffman@25910
   357
    by (simp add: lub_distribs eta_cfun)
huffman@25910
   358
  show "approx i\<cdot>(approx i\<cdot>x) = approx i\<cdot>x"
huffman@25910
   359
    unfolding approx_cprod_def csplit_def by simp
huffman@25910
   360
  have "{x::'a \<times> 'b. approx i\<cdot>x = x} \<subseteq>
huffman@25910
   361
        {x::'a. approx i\<cdot>x = x} \<times> {x::'b. approx i\<cdot>x = x}"
huffman@25910
   362
    unfolding approx_cprod_def
huffman@25910
   363
    by (clarsimp simp add: pair_eq_cpair)
huffman@25910
   364
  thus "finite {x::'a \<times> 'b. approx i\<cdot>x = x}"
huffman@25910
   365
    by (rule finite_subset,
huffman@25910
   366
        intro finite_cartesian_product finite_fixes_approx)
huffman@25910
   367
qed
huffman@25910
   368
huffman@25910
   369
instance "*" :: (bifinite, bifinite) bifinite ..
huffman@25910
   370
huffman@25910
   371
lemma approx_cpair [simp]:
huffman@25910
   372
  "approx i\<cdot>\<langle>x, y\<rangle> = \<langle>approx i\<cdot>x, approx i\<cdot>y\<rangle>"
huffman@25910
   373
unfolding approx_cprod_def by simp
huffman@25910
   374
huffman@25910
   375
lemma cfst_approx: "cfst\<cdot>(approx i\<cdot>p) = approx i\<cdot>(cfst\<cdot>p)"
huffman@25910
   376
by (cases p rule: cprodE, simp)
huffman@25910
   377
huffman@25910
   378
lemma csnd_approx: "csnd\<cdot>(approx i\<cdot>p) = approx i\<cdot>(csnd\<cdot>p)"
huffman@25910
   379
by (cases p rule: cprodE, simp)
huffman@25910
   380
huffman@15576
   381
end