src/HOLCF/Sprod.thy
author huffman
Tue Oct 12 06:20:05 2010 -0700 (2010-10-12)
changeset 40006 116e94f9543b
parent 40002 c5b5f7a3a3b1
child 40046 ba2e41c8b725
permissions -rw-r--r--
remove unneeded lemmas from Fun_Cpo.thy
huffman@15600
     1
(*  Title:      HOLCF/Sprod.thy
huffman@16059
     2
    Author:     Franz Regensburger and Brian Huffman
huffman@15576
     3
*)
huffman@15576
     4
huffman@15576
     5
header {* The type of strict products *}
huffman@15576
     6
huffman@15577
     7
theory Sprod
huffman@39987
     8
imports Deflation
huffman@15577
     9
begin
huffman@15576
    10
wenzelm@36452
    11
default_sort pcpo
huffman@16082
    12
huffman@15591
    13
subsection {* Definition of strict product type *}
huffman@15591
    14
huffman@35525
    15
pcpodef (Sprod)  ('a, 'b) sprod (infixr "**" 20) =
huffman@31114
    16
        "{p::'a \<times> 'b. p = \<bottom> \<or> (fst p \<noteq> \<bottom> \<and> snd p \<noteq> \<bottom>)}"
wenzelm@29063
    17
by simp_all
huffman@15576
    18
huffman@35525
    19
instance sprod :: ("{finite_po,pcpo}", "{finite_po,pcpo}") finite_po
huffman@25827
    20
by (rule typedef_finite_po [OF type_definition_Sprod])
huffman@25827
    21
huffman@35525
    22
instance sprod :: ("{chfin,pcpo}", "{chfin,pcpo}") chfin
huffman@31076
    23
by (rule typedef_chfin [OF type_definition_Sprod below_Sprod_def])
huffman@25827
    24
wenzelm@35427
    25
type_notation (xsymbols)
wenzelm@35547
    26
  sprod  ("(_ \<otimes>/ _)" [21,20] 20)
wenzelm@35427
    27
type_notation (HTML output)
wenzelm@35547
    28
  sprod  ("(_ \<otimes>/ _)" [21,20] 20)
huffman@15576
    29
huffman@16059
    30
lemma spair_lemma:
huffman@31114
    31
  "(strictify\<cdot>(\<Lambda> b. a)\<cdot>b, strictify\<cdot>(\<Lambda> a. b)\<cdot>a) \<in> Sprod"
huffman@25914
    32
by (simp add: Sprod_def strictify_conv_if)
huffman@15576
    33
huffman@16059
    34
subsection {* Definitions of constants *}
huffman@15576
    35
wenzelm@25135
    36
definition
wenzelm@25135
    37
  sfst :: "('a ** 'b) \<rightarrow> 'a" where
huffman@31114
    38
  "sfst = (\<Lambda> p. fst (Rep_Sprod p))"
wenzelm@25135
    39
wenzelm@25135
    40
definition
wenzelm@25135
    41
  ssnd :: "('a ** 'b) \<rightarrow> 'b" where
huffman@31114
    42
  "ssnd = (\<Lambda> p. snd (Rep_Sprod p))"
huffman@15576
    43
wenzelm@25135
    44
definition
wenzelm@25135
    45
  spair :: "'a \<rightarrow> 'b \<rightarrow> ('a ** 'b)" where
wenzelm@25135
    46
  "spair = (\<Lambda> a b. Abs_Sprod
huffman@31114
    47
             (strictify\<cdot>(\<Lambda> b. a)\<cdot>b, strictify\<cdot>(\<Lambda> a. b)\<cdot>a))"
huffman@15576
    48
wenzelm@25135
    49
definition
wenzelm@25135
    50
  ssplit :: "('a \<rightarrow> 'b \<rightarrow> 'c) \<rightarrow> ('a ** 'b) \<rightarrow> 'c" where
wenzelm@25135
    51
  "ssplit = (\<Lambda> f. strictify\<cdot>(\<Lambda> p. f\<cdot>(sfst\<cdot>p)\<cdot>(ssnd\<cdot>p)))"
wenzelm@25135
    52
wenzelm@25135
    53
syntax
wenzelm@35115
    54
  "_stuple" :: "['a, args] => 'a ** 'b"  ("(1'(:_,/ _:'))")
huffman@15576
    55
translations
huffman@18078
    56
  "(:x, y, z:)" == "(:x, (:y, z:):)"
wenzelm@25131
    57
  "(:x, y:)"    == "CONST spair\<cdot>x\<cdot>y"
huffman@18078
    58
huffman@18078
    59
translations
wenzelm@25131
    60
  "\<Lambda>(CONST spair\<cdot>x\<cdot>y). t" == "CONST ssplit\<cdot>(\<Lambda> x y. t)"
huffman@15576
    61
huffman@16059
    62
subsection {* Case analysis *}
huffman@15576
    63
huffman@25914
    64
lemma Rep_Sprod_spair:
huffman@31114
    65
  "Rep_Sprod (:a, b:) = (strictify\<cdot>(\<Lambda> b. a)\<cdot>b, strictify\<cdot>(\<Lambda> a. b)\<cdot>a)"
huffman@25914
    66
unfolding spair_def
huffman@25914
    67
by (simp add: cont_Abs_Sprod Abs_Sprod_inverse spair_lemma)
huffman@25914
    68
huffman@25914
    69
lemmas Rep_Sprod_simps =
huffman@31076
    70
  Rep_Sprod_inject [symmetric] below_Sprod_def
huffman@25914
    71
  Rep_Sprod_strict Rep_Sprod_spair
huffman@15576
    72
huffman@27310
    73
lemma Exh_Sprod:
huffman@16059
    74
  "z = \<bottom> \<or> (\<exists>a b. z = (:a, b:) \<and> a \<noteq> \<bottom> \<and> b \<noteq> \<bottom>)"
huffman@25914
    75
apply (insert Rep_Sprod [of z])
huffman@31114
    76
apply (simp add: Rep_Sprod_simps Pair_fst_snd_eq)
huffman@16059
    77
apply (simp add: Sprod_def)
huffman@25914
    78
apply (erule disjE, simp)
huffman@25914
    79
apply (simp add: strictify_conv_if)
huffman@25914
    80
apply fast
huffman@15576
    81
done
huffman@15576
    82
huffman@35783
    83
lemma sprodE [case_names bottom spair, cases type: sprod]:
huffman@16059
    84
  "\<lbrakk>p = \<bottom> \<Longrightarrow> Q; \<And>x y. \<lbrakk>p = (:x, y:); x \<noteq> \<bottom>; y \<noteq> \<bottom>\<rbrakk> \<Longrightarrow> Q\<rbrakk> \<Longrightarrow> Q"
huffman@35783
    85
using Exh_Sprod [of p] by auto
huffman@16059
    86
huffman@35783
    87
lemma sprod_induct [case_names bottom spair, induct type: sprod]:
huffman@25757
    88
  "\<lbrakk>P \<bottom>; \<And>x y. \<lbrakk>x \<noteq> \<bottom>; y \<noteq> \<bottom>\<rbrakk> \<Longrightarrow> P (:x, y:)\<rbrakk> \<Longrightarrow> P x"
huffman@25757
    89
by (cases x, simp_all)
huffman@25757
    90
huffman@35900
    91
subsection {* Properties of \emph{spair} *}
huffman@16059
    92
huffman@16317
    93
lemma spair_strict1 [simp]: "(:\<bottom>, y:) = \<bottom>"
huffman@25914
    94
by (simp add: Rep_Sprod_simps strictify_conv_if)
huffman@15576
    95
huffman@16317
    96
lemma spair_strict2 [simp]: "(:x, \<bottom>:) = \<bottom>"
huffman@25914
    97
by (simp add: Rep_Sprod_simps strictify_conv_if)
huffman@25914
    98
huffman@25914
    99
lemma spair_strict_iff [simp]: "((:x, y:) = \<bottom>) = (x = \<bottom> \<or> y = \<bottom>)"
huffman@25914
   100
by (simp add: Rep_Sprod_simps strictify_conv_if)
huffman@25914
   101
huffman@31076
   102
lemma spair_below_iff:
huffman@25914
   103
  "((:a, b:) \<sqsubseteq> (:c, d:)) = (a = \<bottom> \<or> b = \<bottom> \<or> (a \<sqsubseteq> c \<and> b \<sqsubseteq> d))"
huffman@25914
   104
by (simp add: Rep_Sprod_simps strictify_conv_if)
huffman@25914
   105
huffman@25914
   106
lemma spair_eq_iff:
huffman@25914
   107
  "((:a, b:) = (:c, d:)) =
huffman@25914
   108
    (a = c \<and> b = d \<or> (a = \<bottom> \<or> b = \<bottom>) \<and> (c = \<bottom> \<or> d = \<bottom>))"
huffman@25914
   109
by (simp add: Rep_Sprod_simps strictify_conv_if)
huffman@15576
   110
huffman@16317
   111
lemma spair_strict: "x = \<bottom> \<or> y = \<bottom> \<Longrightarrow> (:x, y:) = \<bottom>"
huffman@25914
   112
by simp
huffman@16059
   113
huffman@16212
   114
lemma spair_strict_rev: "(:x, y:) \<noteq> \<bottom> \<Longrightarrow> x \<noteq> \<bottom> \<and> y \<noteq> \<bottom>"
huffman@25914
   115
by simp
huffman@16059
   116
huffman@25914
   117
lemma spair_defined: "\<lbrakk>x \<noteq> \<bottom>; y \<noteq> \<bottom>\<rbrakk> \<Longrightarrow> (:x, y:) \<noteq> \<bottom>"
huffman@25914
   118
by simp
huffman@15576
   119
huffman@16317
   120
lemma spair_defined_rev: "(:x, y:) = \<bottom> \<Longrightarrow> x = \<bottom> \<or> y = \<bottom>"
huffman@25914
   121
by simp
huffman@15576
   122
huffman@16317
   123
lemma spair_eq:
huffman@16317
   124
  "\<lbrakk>x \<noteq> \<bottom>; y \<noteq> \<bottom>\<rbrakk> \<Longrightarrow> ((:x, y:) = (:a, b:)) = (x = a \<and> y = b)"
huffman@25914
   125
by (simp add: spair_eq_iff)
huffman@16317
   126
huffman@16212
   127
lemma spair_inject:
huffman@16317
   128
  "\<lbrakk>x \<noteq> \<bottom>; y \<noteq> \<bottom>; (:x, y:) = (:a, b:)\<rbrakk> \<Longrightarrow> x = a \<and> y = b"
huffman@16317
   129
by (rule spair_eq [THEN iffD1])
huffman@15576
   130
huffman@15576
   131
lemma inst_sprod_pcpo2: "UU = (:UU,UU:)"
huffman@16059
   132
by simp
huffman@15576
   133
huffman@33504
   134
lemma sprodE2: "(\<And>x y. p = (:x, y:) \<Longrightarrow> Q) \<Longrightarrow> Q"
huffman@33504
   135
by (cases p, simp only: inst_sprod_pcpo2, simp)
huffman@33504
   136
huffman@35900
   137
subsection {* Properties of \emph{sfst} and \emph{ssnd} *}
huffman@15576
   138
huffman@16212
   139
lemma sfst_strict [simp]: "sfst\<cdot>\<bottom> = \<bottom>"
huffman@16212
   140
by (simp add: sfst_def cont_Rep_Sprod Rep_Sprod_strict)
huffman@15576
   141
huffman@16212
   142
lemma ssnd_strict [simp]: "ssnd\<cdot>\<bottom> = \<bottom>"
huffman@16212
   143
by (simp add: ssnd_def cont_Rep_Sprod Rep_Sprod_strict)
huffman@15576
   144
huffman@16212
   145
lemma sfst_spair [simp]: "y \<noteq> \<bottom> \<Longrightarrow> sfst\<cdot>(:x, y:) = x"
huffman@16059
   146
by (simp add: sfst_def cont_Rep_Sprod Rep_Sprod_spair)
huffman@15576
   147
huffman@16212
   148
lemma ssnd_spair [simp]: "x \<noteq> \<bottom> \<Longrightarrow> ssnd\<cdot>(:x, y:) = y"
huffman@16059
   149
by (simp add: ssnd_def cont_Rep_Sprod Rep_Sprod_spair)
huffman@15576
   150
huffman@16777
   151
lemma sfst_defined_iff [simp]: "(sfst\<cdot>p = \<bottom>) = (p = \<bottom>)"
huffman@25757
   152
by (cases p, simp_all)
huffman@16777
   153
huffman@16777
   154
lemma ssnd_defined_iff [simp]: "(ssnd\<cdot>p = \<bottom>) = (p = \<bottom>)"
huffman@25757
   155
by (cases p, simp_all)
huffman@16317
   156
huffman@16777
   157
lemma sfst_defined: "p \<noteq> \<bottom> \<Longrightarrow> sfst\<cdot>p \<noteq> \<bottom>"
huffman@16777
   158
by simp
huffman@16777
   159
huffman@16777
   160
lemma ssnd_defined: "p \<noteq> \<bottom> \<Longrightarrow> ssnd\<cdot>p \<noteq> \<bottom>"
huffman@16777
   161
by simp
huffman@16777
   162
huffman@16059
   163
lemma surjective_pairing_Sprod2: "(:sfst\<cdot>p, ssnd\<cdot>p:) = p"
huffman@25757
   164
by (cases p, simp_all)
huffman@15576
   165
huffman@31076
   166
lemma below_sprod: "x \<sqsubseteq> y = (sfst\<cdot>x \<sqsubseteq> sfst\<cdot>y \<and> ssnd\<cdot>x \<sqsubseteq> ssnd\<cdot>y)"
huffman@31076
   167
apply (simp add: below_Sprod_def sfst_def ssnd_def cont_Rep_Sprod)
huffman@31114
   168
apply (simp only: below_prod_def)
huffman@16317
   169
done
huffman@16317
   170
huffman@16751
   171
lemma eq_sprod: "(x = y) = (sfst\<cdot>x = sfst\<cdot>y \<and> ssnd\<cdot>x = ssnd\<cdot>y)"
huffman@31076
   172
by (auto simp add: po_eq_conv below_sprod)
huffman@16751
   173
huffman@31076
   174
lemma spair_below:
huffman@16317
   175
  "\<lbrakk>x \<noteq> \<bottom>; y \<noteq> \<bottom>\<rbrakk> \<Longrightarrow> (:x, y:) \<sqsubseteq> (:a, b:) = (x \<sqsubseteq> a \<and> y \<sqsubseteq> b)"
huffman@25757
   176
apply (cases "a = \<bottom>", simp)
huffman@25757
   177
apply (cases "b = \<bottom>", simp)
huffman@31076
   178
apply (simp add: below_sprod)
huffman@16317
   179
done
huffman@16317
   180
huffman@31076
   181
lemma sfst_below_iff: "sfst\<cdot>x \<sqsubseteq> y = x \<sqsubseteq> (:y, ssnd\<cdot>x:)"
huffman@25881
   182
apply (cases "x = \<bottom>", simp, cases "y = \<bottom>", simp)
huffman@31076
   183
apply (simp add: below_sprod)
huffman@25881
   184
done
huffman@25881
   185
huffman@31076
   186
lemma ssnd_below_iff: "ssnd\<cdot>x \<sqsubseteq> y = x \<sqsubseteq> (:sfst\<cdot>x, y:)"
huffman@25881
   187
apply (cases "x = \<bottom>", simp, cases "y = \<bottom>", simp)
huffman@31076
   188
apply (simp add: below_sprod)
huffman@25881
   189
done
huffman@25881
   190
huffman@25881
   191
subsection {* Compactness *}
huffman@25881
   192
huffman@25881
   193
lemma compact_sfst: "compact x \<Longrightarrow> compact (sfst\<cdot>x)"
huffman@31076
   194
by (rule compactI, simp add: sfst_below_iff)
huffman@25881
   195
huffman@25881
   196
lemma compact_ssnd: "compact x \<Longrightarrow> compact (ssnd\<cdot>x)"
huffman@31076
   197
by (rule compactI, simp add: ssnd_below_iff)
huffman@25881
   198
huffman@25881
   199
lemma compact_spair: "\<lbrakk>compact x; compact y\<rbrakk> \<Longrightarrow> compact (:x, y:)"
huffman@25881
   200
by (rule compact_Sprod, simp add: Rep_Sprod_spair strictify_conv_if)
huffman@25881
   201
huffman@25881
   202
lemma compact_spair_iff:
huffman@25881
   203
  "compact (:x, y:) = (x = \<bottom> \<or> y = \<bottom> \<or> (compact x \<and> compact y))"
huffman@25881
   204
apply (safe elim!: compact_spair)
huffman@25881
   205
apply (drule compact_sfst, simp)
huffman@25881
   206
apply (drule compact_ssnd, simp)
huffman@25881
   207
apply simp
huffman@25881
   208
apply simp
huffman@25881
   209
done
huffman@25881
   210
huffman@35900
   211
subsection {* Properties of \emph{ssplit} *}
huffman@15576
   212
huffman@16059
   213
lemma ssplit1 [simp]: "ssplit\<cdot>f\<cdot>\<bottom> = \<bottom>"
huffman@15591
   214
by (simp add: ssplit_def)
huffman@15591
   215
huffman@16920
   216
lemma ssplit2 [simp]: "\<lbrakk>x \<noteq> \<bottom>; y \<noteq> \<bottom>\<rbrakk> \<Longrightarrow> ssplit\<cdot>f\<cdot>(:x, y:) = f\<cdot>x\<cdot>y"
huffman@15591
   217
by (simp add: ssplit_def)
huffman@15591
   218
huffman@16553
   219
lemma ssplit3 [simp]: "ssplit\<cdot>spair\<cdot>z = z"
huffman@25757
   220
by (cases z, simp_all)
huffman@15576
   221
huffman@25827
   222
subsection {* Strict product preserves flatness *}
huffman@25827
   223
huffman@35525
   224
instance sprod :: (flat, flat) flat
huffman@27310
   225
proof
huffman@27310
   226
  fix x y :: "'a \<otimes> 'b"
huffman@27310
   227
  assume "x \<sqsubseteq> y" thus "x = \<bottom> \<or> x = y"
huffman@27310
   228
    apply (induct x, simp)
huffman@27310
   229
    apply (induct y, simp)
huffman@31076
   230
    apply (simp add: spair_below_iff flat_below_iff)
huffman@27310
   231
    done
huffman@27310
   232
qed
huffman@25827
   233
huffman@33504
   234
subsection {* Map function for strict products *}
huffman@33504
   235
huffman@33504
   236
definition
huffman@33504
   237
  sprod_map :: "('a \<rightarrow> 'b) \<rightarrow> ('c \<rightarrow> 'd) \<rightarrow> 'a \<otimes> 'c \<rightarrow> 'b \<otimes> 'd"
huffman@33504
   238
where
huffman@33504
   239
  "sprod_map = (\<Lambda> f g. ssplit\<cdot>(\<Lambda> x y. (:f\<cdot>x, g\<cdot>y:)))"
huffman@33504
   240
huffman@33504
   241
lemma sprod_map_strict [simp]: "sprod_map\<cdot>a\<cdot>b\<cdot>\<bottom> = \<bottom>"
huffman@33504
   242
unfolding sprod_map_def by simp
huffman@33504
   243
huffman@33504
   244
lemma sprod_map_spair [simp]:
huffman@33504
   245
  "x \<noteq> \<bottom> \<Longrightarrow> y \<noteq> \<bottom> \<Longrightarrow> sprod_map\<cdot>f\<cdot>g\<cdot>(:x, y:) = (:f\<cdot>x, g\<cdot>y:)"
huffman@33504
   246
by (simp add: sprod_map_def)
huffman@33504
   247
huffman@35491
   248
lemma sprod_map_spair':
huffman@35491
   249
  "f\<cdot>\<bottom> = \<bottom> \<Longrightarrow> g\<cdot>\<bottom> = \<bottom> \<Longrightarrow> sprod_map\<cdot>f\<cdot>g\<cdot>(:x, y:) = (:f\<cdot>x, g\<cdot>y:)"
huffman@35491
   250
by (cases "x = \<bottom> \<or> y = \<bottom>") auto
huffman@35491
   251
huffman@33808
   252
lemma sprod_map_ID: "sprod_map\<cdot>ID\<cdot>ID = ID"
huffman@40002
   253
unfolding sprod_map_def by (simp add: cfun_eq_iff eta_cfun)
huffman@33808
   254
huffman@33587
   255
lemma sprod_map_map:
huffman@33587
   256
  "\<lbrakk>f1\<cdot>\<bottom> = \<bottom>; g1\<cdot>\<bottom> = \<bottom>\<rbrakk> \<Longrightarrow>
huffman@33587
   257
    sprod_map\<cdot>f1\<cdot>g1\<cdot>(sprod_map\<cdot>f2\<cdot>g2\<cdot>p) =
huffman@33587
   258
     sprod_map\<cdot>(\<Lambda> x. f1\<cdot>(f2\<cdot>x))\<cdot>(\<Lambda> x. g1\<cdot>(g2\<cdot>x))\<cdot>p"
huffman@33587
   259
apply (induct p, simp)
huffman@33587
   260
apply (case_tac "f2\<cdot>x = \<bottom>", simp)
huffman@33587
   261
apply (case_tac "g2\<cdot>y = \<bottom>", simp)
huffman@33587
   262
apply simp
huffman@33587
   263
done
huffman@33587
   264
huffman@33504
   265
lemma ep_pair_sprod_map:
huffman@33504
   266
  assumes "ep_pair e1 p1" and "ep_pair e2 p2"
huffman@33504
   267
  shows "ep_pair (sprod_map\<cdot>e1\<cdot>e2) (sprod_map\<cdot>p1\<cdot>p2)"
huffman@33504
   268
proof
huffman@33504
   269
  interpret e1p1: pcpo_ep_pair e1 p1 unfolding pcpo_ep_pair_def by fact
huffman@33504
   270
  interpret e2p2: pcpo_ep_pair e2 p2 unfolding pcpo_ep_pair_def by fact
huffman@33504
   271
  fix x show "sprod_map\<cdot>p1\<cdot>p2\<cdot>(sprod_map\<cdot>e1\<cdot>e2\<cdot>x) = x"
huffman@33504
   272
    by (induct x) simp_all
huffman@33504
   273
  fix y show "sprod_map\<cdot>e1\<cdot>e2\<cdot>(sprod_map\<cdot>p1\<cdot>p2\<cdot>y) \<sqsubseteq> y"
huffman@33504
   274
    apply (induct y, simp)
huffman@33504
   275
    apply (case_tac "p1\<cdot>x = \<bottom>", simp, case_tac "p2\<cdot>y = \<bottom>", simp)
huffman@33504
   276
    apply (simp add: monofun_cfun e1p1.e_p_below e2p2.e_p_below)
huffman@33504
   277
    done
huffman@33504
   278
qed
huffman@33504
   279
huffman@33504
   280
lemma deflation_sprod_map:
huffman@33504
   281
  assumes "deflation d1" and "deflation d2"
huffman@33504
   282
  shows "deflation (sprod_map\<cdot>d1\<cdot>d2)"
huffman@33504
   283
proof
huffman@33504
   284
  interpret d1: deflation d1 by fact
huffman@33504
   285
  interpret d2: deflation d2 by fact
huffman@33504
   286
  fix x
huffman@33504
   287
  show "sprod_map\<cdot>d1\<cdot>d2\<cdot>(sprod_map\<cdot>d1\<cdot>d2\<cdot>x) = sprod_map\<cdot>d1\<cdot>d2\<cdot>x"
huffman@33504
   288
    apply (induct x, simp)
huffman@33504
   289
    apply (case_tac "d1\<cdot>x = \<bottom>", simp, case_tac "d2\<cdot>y = \<bottom>", simp)
huffman@33504
   290
    apply (simp add: d1.idem d2.idem)
huffman@33504
   291
    done
huffman@33504
   292
  show "sprod_map\<cdot>d1\<cdot>d2\<cdot>x \<sqsubseteq> x"
huffman@33504
   293
    apply (induct x, simp)
huffman@33504
   294
    apply (simp add: monofun_cfun d1.below d2.below)
huffman@33504
   295
    done
huffman@33504
   296
qed
huffman@33504
   297
huffman@33504
   298
lemma finite_deflation_sprod_map:
huffman@33504
   299
  assumes "finite_deflation d1" and "finite_deflation d2"
huffman@33504
   300
  shows "finite_deflation (sprod_map\<cdot>d1\<cdot>d2)"
brianh@39973
   301
proof (rule finite_deflation_intro)
huffman@33504
   302
  interpret d1: finite_deflation d1 by fact
huffman@33504
   303
  interpret d2: finite_deflation d2 by fact
huffman@33504
   304
  have "deflation d1" and "deflation d2" by fact+
huffman@33504
   305
  thus "deflation (sprod_map\<cdot>d1\<cdot>d2)" by (rule deflation_sprod_map)
huffman@33504
   306
  have "{x. sprod_map\<cdot>d1\<cdot>d2\<cdot>x = x} \<subseteq> insert \<bottom>
huffman@33504
   307
        ((\<lambda>(x, y). (:x, y:)) ` ({x. d1\<cdot>x = x} \<times> {y. d2\<cdot>y = y}))"
huffman@33504
   308
    by (rule subsetI, case_tac x, auto simp add: spair_eq_iff)
huffman@33504
   309
  thus "finite {x. sprod_map\<cdot>d1\<cdot>d2\<cdot>x = x}"
huffman@33504
   310
    by (rule finite_subset, simp add: d1.finite_fixes d2.finite_fixes)
huffman@33504
   311
qed
huffman@33504
   312
huffman@26962
   313
end