src/HOL/HOLCF/Cprod.thy
author wenzelm
Mon, 01 Jan 2018 23:07:24 +0100
changeset 67312 0d25e02759b7
parent 62175 8ffc4d0e652d
permissions -rw-r--r--
misc tuning and modernization;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
42151
4da4fc77664b tuned headers;
wenzelm
parents: 40774
diff changeset
     1
(*  Title:      HOL/HOLCF/Cprod.thy
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
     2
    Author:     Franz Regensburger
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
     3
*)
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
     4
62175
8ffc4d0e652d isabelle update_cartouches -c -t;
wenzelm
parents: 58880
diff changeset
     5
section \<open>The cpo of cartesian products\<close>
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
     6
15577
e16da3068ad6 fix headers
huffman
parents: 15576
diff changeset
     7
theory Cprod
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
     8
  imports Cfun
15577
e16da3068ad6 fix headers
huffman
parents: 15576
diff changeset
     9
begin
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
    10
36452
d37c6eed8117 renamed command 'defaultsort' to 'default_sort';
wenzelm
parents: 35926
diff changeset
    11
default_sort cpo
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
    12
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
    13
62175
8ffc4d0e652d isabelle update_cartouches -c -t;
wenzelm
parents: 58880
diff changeset
    14
subsection \<open>Continuous case function for unit type\<close>
16008
861a255cf1e7 pcpo instance for type unit
huffman
parents: 15609
diff changeset
    15
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
    16
definition unit_when :: "'a \<rightarrow> unit \<rightarrow> 'a"
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
    17
  where "unit_when = (\<Lambda> a _. a)"
16008
861a255cf1e7 pcpo instance for type unit
huffman
parents: 15609
diff changeset
    18
18289
56ddf617d6e8 add constant unit_when
huffman
parents: 18078
diff changeset
    19
translations
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
    20
  "\<Lambda>(). t" \<rightleftharpoons> "CONST unit_when\<cdot>t"
18289
56ddf617d6e8 add constant unit_when
huffman
parents: 18078
diff changeset
    21
56ddf617d6e8 add constant unit_when
huffman
parents: 18078
diff changeset
    22
lemma unit_when [simp]: "unit_when\<cdot>a\<cdot>u = a"
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
    23
  by (simp add: unit_when_def)
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
    24
18289
56ddf617d6e8 add constant unit_when
huffman
parents: 18078
diff changeset
    25
62175
8ffc4d0e652d isabelle update_cartouches -c -t;
wenzelm
parents: 58880
diff changeset
    26
subsection \<open>Continuous version of split function\<close>
17834
28414668b43d added xsymbols syntax for pairs; cleaned up
huffman
parents: 17816
diff changeset
    27
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
    28
definition csplit :: "('a \<rightarrow> 'b \<rightarrow> 'c) \<rightarrow> ('a \<times> 'b) \<rightarrow> 'c"
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
    29
  where "csplit = (\<Lambda> f p. f\<cdot>(fst p)\<cdot>(snd p))"
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
    30
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
    31
translations
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
    32
  "\<Lambda>(CONST Pair x y). t" \<rightleftharpoons> "CONST csplit\<cdot>(\<Lambda> x y. t)"
17816
9942c5ed866a new syntax translations for continuous lambda abstraction
huffman
parents: 16916
diff changeset
    33
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
    34
abbreviation cfst :: "'a \<times> 'b \<rightarrow> 'a"
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
    35
  where "cfst \<equiv> Abs_cfun fst"
45786
3f07a7a91180 reinstate old functions cfst and csnd as abbreviations
huffman
parents: 42151
diff changeset
    36
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
    37
abbreviation csnd :: "'a \<times> 'b \<rightarrow> 'b"
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
    38
  where "csnd \<equiv> Abs_cfun snd"
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
    39
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
    40
62175
8ffc4d0e652d isabelle update_cartouches -c -t;
wenzelm
parents: 58880
diff changeset
    41
subsection \<open>Convert all lemmas to the continuous versions\<close>
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
    42
18077
f1f4f951ec8d make cpair_less, cpair_defined_iff into iff rules; add lemma csplit1
huffman
parents: 17837
diff changeset
    43
lemma csplit1 [simp]: "csplit\<cdot>f\<cdot>\<bottom> = f\<cdot>\<bottom>\<cdot>\<bottom>"
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
    44
  by (simp add: csplit_def)
18077
f1f4f951ec8d make cpair_less, cpair_defined_iff into iff rules; add lemma csplit1
huffman
parents: 17837
diff changeset
    45
33399
768b2bb9e66a add (LAM (x, y). t) syntax and lemma csplit_Pair
huffman
parents: 31113
diff changeset
    46
lemma csplit_Pair [simp]: "csplit\<cdot>f\<cdot>(x, y) = f\<cdot>x\<cdot>y"
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
    47
  by (simp add: csplit_def)
33399
768b2bb9e66a add (LAM (x, y). t) syntax and lemma csplit_Pair
huffman
parents: 31113
diff changeset
    48
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
    49
end