src/HOLCF/Deflation.thy
author wenzelm
Wed, 10 Dec 2008 22:05:58 +0100
changeset 29055 edaef19665e6
parent 28613 15a41d3fa959
child 29138 661a8db7e647
child 29237 e90d9d51106b
permissions -rw-r--r--
merged
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
     1
(*  Title:      HOLCF/Deflation.thy
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
     2
    ID:         $Id$
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
     3
    Author:     Brian Huffman
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
     4
*)
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
     5
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
     6
header {* Continuous Deflations and Embedding-Projection Pairs *}
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
     7
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
     8
theory Deflation
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
     9
imports Cfun
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    10
begin
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    11
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    12
defaultsort cpo
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    13
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    14
subsection {* Continuous deflations *}
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    15
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    16
locale deflation =
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    17
  fixes d :: "'a \<rightarrow> 'a"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    18
  assumes idem: "\<And>x. d\<cdot>(d\<cdot>x) = d\<cdot>x"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    19
  assumes less: "\<And>x. d\<cdot>x \<sqsubseteq> x"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    20
begin
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    21
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    22
lemma less_ID: "d \<sqsubseteq> ID"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    23
by (rule less_cfun_ext, simp add: less)
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    24
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    25
text {* The set of fixed points is the same as the range. *}
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    26
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    27
lemma fixes_eq_range: "{x. d\<cdot>x = x} = range (\<lambda>x. d\<cdot>x)"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    28
by (auto simp add: eq_sym_conv idem)
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    29
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    30
lemma range_eq_fixes: "range (\<lambda>x. d\<cdot>x) = {x. d\<cdot>x = x}"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    31
by (auto simp add: eq_sym_conv idem)
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    32
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    33
text {*
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    34
  The pointwise ordering on deflation functions coincides with
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    35
  the subset ordering of their sets of fixed-points.
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    36
*}
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    37
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    38
lemma lessI:
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    39
  assumes f: "\<And>x. d\<cdot>x = x \<Longrightarrow> f\<cdot>x = x" shows "d \<sqsubseteq> f"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    40
proof (rule less_cfun_ext)
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    41
  fix x
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    42
  from less have "f\<cdot>(d\<cdot>x) \<sqsubseteq> f\<cdot>x" by (rule monofun_cfun_arg)
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    43
  also from idem have "f\<cdot>(d\<cdot>x) = d\<cdot>x" by (rule f)
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    44
  finally show "d\<cdot>x \<sqsubseteq> f\<cdot>x" .
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    45
qed
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    46
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    47
lemma lessD: "\<lbrakk>f \<sqsubseteq> d; f\<cdot>x = x\<rbrakk> \<Longrightarrow> d\<cdot>x = x"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    48
proof (rule antisym_less)
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    49
  from less show "d\<cdot>x \<sqsubseteq> x" .
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    50
next
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    51
  assume "f \<sqsubseteq> d"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    52
  hence "f\<cdot>x \<sqsubseteq> d\<cdot>x" by (rule monofun_cfun_fun)
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    53
  also assume "f\<cdot>x = x"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    54
  finally show "x \<sqsubseteq> d\<cdot>x" .
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    55
qed
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    56
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    57
end
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    58
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    59
lemma adm_deflation: "adm (\<lambda>d. deflation d)"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    60
by (simp add: deflation_def)
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    61
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    62
lemma deflation_ID: "deflation ID"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    63
by (simp add: deflation.intro)
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    64
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    65
lemma deflation_UU: "deflation \<bottom>"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    66
by (simp add: deflation.intro)
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    67
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    68
lemma deflation_less_iff:
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    69
  "\<lbrakk>deflation p; deflation q\<rbrakk> \<Longrightarrow> p \<sqsubseteq> q \<longleftrightarrow> (\<forall>x. p\<cdot>x = x \<longrightarrow> q\<cdot>x = x)"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    70
 apply safe
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    71
  apply (simp add: deflation.lessD)
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    72
 apply (simp add: deflation.lessI)
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    73
done
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    74
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    75
text {*
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    76
  The composition of two deflations is equal to
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    77
  the lesser of the two (if they are comparable).
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    78
*}
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    79
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    80
lemma deflation_less_comp1:
28611
983c1855a7af More occurrences of 'includes' gone.
ballarin
parents: 27681
diff changeset
    81
  assumes "deflation f"
983c1855a7af More occurrences of 'includes' gone.
ballarin
parents: 27681
diff changeset
    82
  assumes "deflation g"
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    83
  shows "f \<sqsubseteq> g \<Longrightarrow> f\<cdot>(g\<cdot>x) = f\<cdot>x"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    84
proof (rule antisym_less)
28611
983c1855a7af More occurrences of 'includes' gone.
ballarin
parents: 27681
diff changeset
    85
  interpret g: deflation [g] by fact
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    86
  from g.less show "f\<cdot>(g\<cdot>x) \<sqsubseteq> f\<cdot>x" by (rule monofun_cfun_arg)
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    87
next
28611
983c1855a7af More occurrences of 'includes' gone.
ballarin
parents: 27681
diff changeset
    88
  interpret f: deflation [f] by fact
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    89
  assume "f \<sqsubseteq> g" hence "f\<cdot>x \<sqsubseteq> g\<cdot>x" by (rule monofun_cfun_fun)
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    90
  hence "f\<cdot>(f\<cdot>x) \<sqsubseteq> f\<cdot>(g\<cdot>x)" by (rule monofun_cfun_arg)
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    91
  also have "f\<cdot>(f\<cdot>x) = f\<cdot>x" by (rule f.idem)
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    92
  finally show "f\<cdot>x \<sqsubseteq> f\<cdot>(g\<cdot>x)" .
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    93
qed
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    94
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    95
lemma deflation_less_comp2:
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    96
  "\<lbrakk>deflation f; deflation g; f \<sqsubseteq> g\<rbrakk> \<Longrightarrow> g\<cdot>(f\<cdot>x) = f\<cdot>x"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    97
by (simp only: deflation.lessD deflation.idem)
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    98
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    99
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   100
subsection {* Deflations with finite range *}
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   101
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   102
lemma finite_range_imp_finite_fixes:
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   103
  "finite (range f) \<Longrightarrow> finite {x. f x = x}"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   104
proof -
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   105
  have "{x. f x = x} \<subseteq> range f"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   106
    by (clarify, erule subst, rule rangeI)
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   107
  moreover assume "finite (range f)"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   108
  ultimately show "finite {x. f x = x}"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   109
    by (rule finite_subset)
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   110
qed
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   111
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   112
locale finite_deflation = deflation +
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   113
  assumes finite_fixes: "finite {x. d\<cdot>x = x}"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   114
begin
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   115
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   116
lemma finite_range: "finite (range (\<lambda>x. d\<cdot>x))"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   117
by (simp add: range_eq_fixes finite_fixes)
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   118
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   119
lemma finite_image: "finite ((\<lambda>x. d\<cdot>x) ` A)"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   120
by (rule finite_subset [OF image_mono [OF subset_UNIV] finite_range])
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   121
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   122
lemma compact: "compact (d\<cdot>x)"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   123
proof (rule compactI2)
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   124
  fix Y :: "nat \<Rightarrow> 'a"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   125
  assume Y: "chain Y"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   126
  have "finite_chain (\<lambda>i. d\<cdot>(Y i))"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   127
  proof (rule finite_range_imp_finch)
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   128
    show "chain (\<lambda>i. d\<cdot>(Y i))"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   129
      using Y by simp
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   130
    have "range (\<lambda>i. d\<cdot>(Y i)) \<subseteq> range (\<lambda>x. d\<cdot>x)"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   131
      by clarsimp
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   132
    thus "finite (range (\<lambda>i. d\<cdot>(Y i)))"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   133
      using finite_range by (rule finite_subset)
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   134
  qed
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   135
  hence "\<exists>j. (\<Squnion>i. d\<cdot>(Y i)) = d\<cdot>(Y j)"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   136
    by (simp add: finite_chain_def maxinch_is_thelub Y)
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   137
  then obtain j where j: "(\<Squnion>i. d\<cdot>(Y i)) = d\<cdot>(Y j)" ..
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   138
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   139
  assume "d\<cdot>x \<sqsubseteq> (\<Squnion>i. Y i)"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   140
  hence "d\<cdot>(d\<cdot>x) \<sqsubseteq> d\<cdot>(\<Squnion>i. Y i)"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   141
    by (rule monofun_cfun_arg)
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   142
  hence "d\<cdot>x \<sqsubseteq> (\<Squnion>i. d\<cdot>(Y i))"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   143
    by (simp add: contlub_cfun_arg Y idem)
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   144
  hence "d\<cdot>x \<sqsubseteq> d\<cdot>(Y j)"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   145
    using j by simp
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   146
  hence "d\<cdot>x \<sqsubseteq> Y j"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   147
    using less by (rule trans_less)
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   148
  thus "\<exists>j. d\<cdot>x \<sqsubseteq> Y j" ..
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   149
qed
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   150
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   151
end
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   152
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   153
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   154
subsection {* Continuous embedding-projection pairs *}
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   155
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   156
locale ep_pair =
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   157
  fixes e :: "'a \<rightarrow> 'b" and p :: "'b \<rightarrow> 'a"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   158
  assumes e_inverse [simp]: "\<And>x. p\<cdot>(e\<cdot>x) = x"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   159
  and e_p_less: "\<And>y. e\<cdot>(p\<cdot>y) \<sqsubseteq> y"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   160
begin
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   161
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   162
lemma e_less_iff [simp]: "e\<cdot>x \<sqsubseteq> e\<cdot>y \<longleftrightarrow> x \<sqsubseteq> y"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   163
proof
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   164
  assume "e\<cdot>x \<sqsubseteq> e\<cdot>y"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   165
  hence "p\<cdot>(e\<cdot>x) \<sqsubseteq> p\<cdot>(e\<cdot>y)" by (rule monofun_cfun_arg)
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   166
  thus "x \<sqsubseteq> y" by simp
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   167
next
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   168
  assume "x \<sqsubseteq> y"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   169
  thus "e\<cdot>x \<sqsubseteq> e\<cdot>y" by (rule monofun_cfun_arg)
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   170
qed
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   171
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   172
lemma e_eq_iff [simp]: "e\<cdot>x = e\<cdot>y \<longleftrightarrow> x = y"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   173
unfolding po_eq_conv e_less_iff ..
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   174
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   175
lemma p_eq_iff:
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   176
  "\<lbrakk>e\<cdot>(p\<cdot>x) = x; e\<cdot>(p\<cdot>y) = y\<rbrakk> \<Longrightarrow> p\<cdot>x = p\<cdot>y \<longleftrightarrow> x = y"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   177
by (safe, erule subst, erule subst, simp)
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   178
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   179
lemma p_inverse: "(\<exists>x. y = e\<cdot>x) = (e\<cdot>(p\<cdot>y) = y)"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   180
by (auto, rule exI, erule sym)
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   181
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   182
lemma e_less_iff_less_p: "e\<cdot>x \<sqsubseteq> y \<longleftrightarrow> x \<sqsubseteq> p\<cdot>y"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   183
proof
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   184
  assume "e\<cdot>x \<sqsubseteq> y"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   185
  then have "p\<cdot>(e\<cdot>x) \<sqsubseteq> p\<cdot>y" by (rule monofun_cfun_arg)
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   186
  then show "x \<sqsubseteq> p\<cdot>y" by simp
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   187
next
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   188
  assume "x \<sqsubseteq> p\<cdot>y"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   189
  then have "e\<cdot>x \<sqsubseteq> e\<cdot>(p\<cdot>y)" by (rule monofun_cfun_arg)
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   190
  then show "e\<cdot>x \<sqsubseteq> y" using e_p_less by (rule trans_less)
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   191
qed
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   192
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   193
lemma compact_e_rev: "compact (e\<cdot>x) \<Longrightarrow> compact x"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   194
proof -
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   195
  assume "compact (e\<cdot>x)"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   196
  hence "adm (\<lambda>y. \<not> e\<cdot>x \<sqsubseteq> y)" by (rule compactD)
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   197
  hence "adm (\<lambda>y. \<not> e\<cdot>x \<sqsubseteq> e\<cdot>y)" by (rule adm_subst [OF cont_Rep_CFun2])
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   198
  hence "adm (\<lambda>y. \<not> x \<sqsubseteq> y)" by simp
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   199
  thus "compact x" by (rule compactI)
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   200
qed
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   201
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   202
lemma compact_e: "compact x \<Longrightarrow> compact (e\<cdot>x)"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   203
proof -
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   204
  assume "compact x"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   205
  hence "adm (\<lambda>y. \<not> x \<sqsubseteq> y)" by (rule compactD)
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   206
  hence "adm (\<lambda>y. \<not> x \<sqsubseteq> p\<cdot>y)" by (rule adm_subst [OF cont_Rep_CFun2])
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   207
  hence "adm (\<lambda>y. \<not> e\<cdot>x \<sqsubseteq> y)" by (simp add: e_less_iff_less_p)
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   208
  thus "compact (e\<cdot>x)" by (rule compactI)
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   209
qed
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   210
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   211
lemma compact_e_iff: "compact (e\<cdot>x) \<longleftrightarrow> compact x"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   212
by (rule iffI [OF compact_e_rev compact_e])
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   213
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   214
text {* Deflations from ep-pairs *}
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   215
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   216
lemma deflation_e_p: "deflation (e oo p)"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   217
by (simp add: deflation.intro e_p_less)
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   218
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   219
lemma deflation_e_d_p:
28611
983c1855a7af More occurrences of 'includes' gone.
ballarin
parents: 27681
diff changeset
   220
  assumes "deflation d"
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   221
  shows "deflation (e oo d oo p)"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   222
proof
28611
983c1855a7af More occurrences of 'includes' gone.
ballarin
parents: 27681
diff changeset
   223
  interpret deflation [d] by fact
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   224
  fix x :: 'b
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   225
  show "(e oo d oo p)\<cdot>((e oo d oo p)\<cdot>x) = (e oo d oo p)\<cdot>x"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   226
    by (simp add: idem)
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   227
  show "(e oo d oo p)\<cdot>x \<sqsubseteq> x"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   228
    by (simp add: e_less_iff_less_p less)
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   229
qed
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   230
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   231
lemma finite_deflation_e_d_p:
28611
983c1855a7af More occurrences of 'includes' gone.
ballarin
parents: 27681
diff changeset
   232
  assumes "finite_deflation d"
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   233
  shows "finite_deflation (e oo d oo p)"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   234
proof
28611
983c1855a7af More occurrences of 'includes' gone.
ballarin
parents: 27681
diff changeset
   235
  interpret finite_deflation [d] by fact
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   236
  fix x :: 'b
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   237
  show "(e oo d oo p)\<cdot>((e oo d oo p)\<cdot>x) = (e oo d oo p)\<cdot>x"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   238
    by (simp add: idem)
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   239
  show "(e oo d oo p)\<cdot>x \<sqsubseteq> x"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   240
    by (simp add: e_less_iff_less_p less)
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   241
  have "finite ((\<lambda>x. e\<cdot>x) ` (\<lambda>x. d\<cdot>x) ` range (\<lambda>x. p\<cdot>x))"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   242
    by (simp add: finite_image)
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   243
  hence "finite (range (\<lambda>x. (e oo d oo p)\<cdot>x))"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   244
    by (simp add: image_image)
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   245
  thus "finite {x. (e oo d oo p)\<cdot>x = x}"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   246
    by (rule finite_range_imp_finite_fixes)
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   247
qed
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   248
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   249
lemma deflation_p_d_e:
28611
983c1855a7af More occurrences of 'includes' gone.
ballarin
parents: 27681
diff changeset
   250
  assumes "deflation d"
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   251
  assumes d: "\<And>x. d\<cdot>x \<sqsubseteq> e\<cdot>(p\<cdot>x)"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   252
  shows "deflation (p oo d oo e)"
28611
983c1855a7af More occurrences of 'includes' gone.
ballarin
parents: 27681
diff changeset
   253
proof -
983c1855a7af More occurrences of 'includes' gone.
ballarin
parents: 27681
diff changeset
   254
  interpret d: deflation [d] by fact
28613
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   255
  {
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   256
    fix x
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   257
    have "d\<cdot>(e\<cdot>x) \<sqsubseteq> e\<cdot>x"
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   258
      by (rule d.less)
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   259
    hence "p\<cdot>(d\<cdot>(e\<cdot>x)) \<sqsubseteq> p\<cdot>(e\<cdot>x)"
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   260
      by (rule monofun_cfun_arg)
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   261
    hence "(p oo d oo e)\<cdot>x \<sqsubseteq> x"
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   262
      by simp
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   263
  }
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   264
  note p_d_e_less = this
28611
983c1855a7af More occurrences of 'includes' gone.
ballarin
parents: 27681
diff changeset
   265
  show ?thesis
28613
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   266
  proof
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   267
    fix x
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   268
    show "(p oo d oo e)\<cdot>x \<sqsubseteq> x"
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   269
      by (rule p_d_e_less)
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   270
  next
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   271
    fix x
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   272
    show "(p oo d oo e)\<cdot>((p oo d oo e)\<cdot>x) = (p oo d oo e)\<cdot>x"
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   273
    proof (rule antisym_less)
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   274
      show "(p oo d oo e)\<cdot>((p oo d oo e)\<cdot>x) \<sqsubseteq> (p oo d oo e)\<cdot>x"
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   275
        by (rule p_d_e_less)
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   276
      have "p\<cdot>(d\<cdot>(d\<cdot>(d\<cdot>(e\<cdot>x)))) \<sqsubseteq> p\<cdot>(d\<cdot>(e\<cdot>(p\<cdot>(d\<cdot>(e\<cdot>x)))))"
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   277
        by (intro monofun_cfun_arg d)
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   278
      hence "p\<cdot>(d\<cdot>(e\<cdot>x)) \<sqsubseteq> p\<cdot>(d\<cdot>(e\<cdot>(p\<cdot>(d\<cdot>(e\<cdot>x)))))"
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   279
        by (simp only: d.idem)
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   280
      thus "(p oo d oo e)\<cdot>x \<sqsubseteq> (p oo d oo e)\<cdot>((p oo d oo e)\<cdot>x)"
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   281
        by simp
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   282
    qed
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   283
  qed
28611
983c1855a7af More occurrences of 'includes' gone.
ballarin
parents: 27681
diff changeset
   284
qed
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   285
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   286
lemma finite_deflation_p_d_e:
28611
983c1855a7af More occurrences of 'includes' gone.
ballarin
parents: 27681
diff changeset
   287
  assumes "finite_deflation d"
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   288
  assumes d: "\<And>x. d\<cdot>x \<sqsubseteq> e\<cdot>(p\<cdot>x)"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   289
  shows "finite_deflation (p oo d oo e)"
28611
983c1855a7af More occurrences of 'includes' gone.
ballarin
parents: 27681
diff changeset
   290
proof -
983c1855a7af More occurrences of 'includes' gone.
ballarin
parents: 27681
diff changeset
   291
  interpret d: finite_deflation [d] by fact
983c1855a7af More occurrences of 'includes' gone.
ballarin
parents: 27681
diff changeset
   292
  show ?thesis
28613
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   293
  proof (intro_locales)
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   294
    have "deflation d" ..
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   295
    thus "deflation (p oo d oo e)"
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   296
      using d by (rule deflation_p_d_e)
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   297
  next
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   298
    show "finite_deflation_axioms (p oo d oo e)"
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   299
    proof
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   300
      have "finite ((\<lambda>x. d\<cdot>x) ` range (\<lambda>x. e\<cdot>x))"
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   301
        by (rule d.finite_image)
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   302
      hence "finite ((\<lambda>x. p\<cdot>x) ` (\<lambda>x. d\<cdot>x) ` range (\<lambda>x. e\<cdot>x))"
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   303
        by (rule finite_imageI)
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   304
      hence "finite (range (\<lambda>x. (p oo d oo e)\<cdot>x))"
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   305
        by (simp add: image_image)
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   306
      thus "finite {x. (p oo d oo e)\<cdot>x = x}"
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   307
        by (rule finite_range_imp_finite_fixes)
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   308
    qed
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   309
  qed
28611
983c1855a7af More occurrences of 'includes' gone.
ballarin
parents: 27681
diff changeset
   310
qed
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   311
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   312
end
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   313
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   314
subsection {* Uniqueness of ep-pairs *}
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   315
28613
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   316
lemma ep_pair_unique_e_lemma:
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   317
  assumes "ep_pair e1 p" and "ep_pair e2 p"
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   318
  shows "e1 \<sqsubseteq> e2"
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   319
proof (rule less_cfun_ext)
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   320
  interpret e1: ep_pair [e1 p] by fact
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   321
  interpret e2: ep_pair [e2 p] by fact
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   322
  fix x
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   323
  have "e1\<cdot>(p\<cdot>(e2\<cdot>x)) \<sqsubseteq> e2\<cdot>x"
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   324
    by (rule e1.e_p_less)
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   325
  thus "e1\<cdot>x \<sqsubseteq> e2\<cdot>x"
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   326
    by (simp only: e2.e_inverse)
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   327
qed
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   328
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   329
lemma ep_pair_unique_e:
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   330
  "\<lbrakk>ep_pair e1 p; ep_pair e2 p\<rbrakk> \<Longrightarrow> e1 = e2"
28613
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   331
by (fast intro: antisym_less elim: ep_pair_unique_e_lemma)
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   332
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   333
lemma ep_pair_unique_p_lemma:
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   334
  assumes "ep_pair e p1" and "ep_pair e p2"
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   335
  shows "p1 \<sqsubseteq> p2"
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   336
proof (rule less_cfun_ext)
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   337
  interpret p1: ep_pair [e p1] by fact
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   338
  interpret p2: ep_pair [e p2] by fact
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   339
  fix x
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   340
  have "e\<cdot>(p1\<cdot>x) \<sqsubseteq> x"
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   341
    by (rule p1.e_p_less)
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   342
  hence "p2\<cdot>(e\<cdot>(p1\<cdot>x)) \<sqsubseteq> p2\<cdot>x"
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   343
    by (rule monofun_cfun_arg)
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   344
  thus "p1\<cdot>x \<sqsubseteq> p2\<cdot>x"
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   345
    by (simp only: p2.e_inverse)
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   346
qed
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   347
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   348
lemma ep_pair_unique_p:
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   349
  "\<lbrakk>ep_pair e p1; ep_pair e p2\<rbrakk> \<Longrightarrow> p1 = p2"
28613
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   350
by (fast intro: antisym_less elim: ep_pair_unique_p_lemma)
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   351
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   352
subsection {* Composing ep-pairs *}
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   353
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   354
lemma ep_pair_ID_ID: "ep_pair ID ID"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   355
by default simp_all
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   356
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   357
lemma ep_pair_comp:
28613
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   358
  assumes "ep_pair e1 p1" and "ep_pair e2 p2"
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   359
  shows "ep_pair (e2 oo e1) (p1 oo p2)"
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   360
proof
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   361
  interpret ep1: ep_pair [e1 p1] by fact
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   362
  interpret ep2: ep_pair [e2 p2] by fact
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   363
  fix x y
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   364
  show "(p1 oo p2)\<cdot>((e2 oo e1)\<cdot>x) = x"
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   365
    by simp
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   366
  have "e1\<cdot>(p1\<cdot>(p2\<cdot>y)) \<sqsubseteq> p2\<cdot>y"
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   367
    by (rule ep1.e_p_less)
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   368
  hence "e2\<cdot>(e1\<cdot>(p1\<cdot>(p2\<cdot>y))) \<sqsubseteq> e2\<cdot>(p2\<cdot>y)"
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   369
    by (rule monofun_cfun_arg)
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   370
  also have "e2\<cdot>(p2\<cdot>y) \<sqsubseteq> y"
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   371
    by (rule ep2.e_p_less)
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   372
  finally show "(e2 oo e1)\<cdot>((p1 oo p2)\<cdot>y) \<sqsubseteq> y"
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   373
    by simp
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   374
qed
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   375
27681
8cedebf55539 dropped locale (open)
haftmann
parents: 27401
diff changeset
   376
locale pcpo_ep_pair = ep_pair +
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   377
  constrains e :: "'a::pcpo \<rightarrow> 'b::pcpo"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   378
  constrains p :: "'b::pcpo \<rightarrow> 'a::pcpo"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   379
begin
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   380
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   381
lemma e_strict [simp]: "e\<cdot>\<bottom> = \<bottom>"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   382
proof -
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   383
  have "\<bottom> \<sqsubseteq> p\<cdot>\<bottom>" by (rule minimal)
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   384
  hence "e\<cdot>\<bottom> \<sqsubseteq> e\<cdot>(p\<cdot>\<bottom>)" by (rule monofun_cfun_arg)
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   385
  also have "e\<cdot>(p\<cdot>\<bottom>) \<sqsubseteq> \<bottom>" by (rule e_p_less)
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   386
  finally show "e\<cdot>\<bottom> = \<bottom>" by simp
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   387
qed
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   388
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   389
lemma e_defined_iff [simp]: "e\<cdot>x = \<bottom> \<longleftrightarrow> x = \<bottom>"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   390
by (rule e_eq_iff [where y="\<bottom>", unfolded e_strict])
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   391
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   392
lemma e_defined: "x \<noteq> \<bottom> \<Longrightarrow> e\<cdot>x \<noteq> \<bottom>"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   393
by simp
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   394
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   395
lemma p_strict [simp]: "p\<cdot>\<bottom> = \<bottom>"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   396
by (rule e_inverse [where x="\<bottom>", unfolded e_strict])
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   397
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   398
lemmas stricts = e_strict p_strict
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   399
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   400
end
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   402
end