src/HOL/HOLCF/Deflation.thy
author haftmann
Thu, 19 Jun 2025 17:15:40 +0200
changeset 82734 89347c0cc6a3
parent 81583 b6df83045178
permissions -rw-r--r--
treat map_filter similar to list_all, list_ex, list_ex1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
42151
4da4fc77664b tuned headers;
wenzelm
parents: 41430
diff changeset
     1
(*  Title:      HOL/HOLCF/Deflation.thy
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
     2
    Author:     Brian Huffman
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
     3
*)
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
     4
62175
8ffc4d0e652d isabelle update_cartouches -c -t;
wenzelm
parents: 61169
diff changeset
     5
section \<open>Continuous deflations and ep-pairs\<close>
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
     6
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
     7
theory Deflation
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
     8
  imports Cfun
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
     9
begin
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    10
62175
8ffc4d0e652d isabelle update_cartouches -c -t;
wenzelm
parents: 61169
diff changeset
    11
subsection \<open>Continuous deflations\<close>
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    12
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    13
locale deflation =
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    14
  fixes d :: "'a \<rightarrow> 'a"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    15
  assumes idem: "\<And>x. d\<cdot>(d\<cdot>x) = d\<cdot>x"
31076
99fe356cbbc2 rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents: 29252
diff changeset
    16
  assumes below: "\<And>x. d\<cdot>x \<sqsubseteq> x"
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    17
begin
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    18
31076
99fe356cbbc2 rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents: 29252
diff changeset
    19
lemma below_ID: "d \<sqsubseteq> ID"
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
    20
  by (rule cfun_belowI) (simp add: below)
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    21
62175
8ffc4d0e652d isabelle update_cartouches -c -t;
wenzelm
parents: 61169
diff changeset
    22
text \<open>The set of fixed points is the same as the range.\<close>
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    23
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    24
lemma fixes_eq_range: "{x. d\<cdot>x = x} = range (\<lambda>x. d\<cdot>x)"
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
    25
  by (auto simp add: eq_sym_conv idem)
27401
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 range_eq_fixes: "range (\<lambda>x. d\<cdot>x) = {x. d\<cdot>x = x}"
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
    28
  by (auto simp add: eq_sym_conv idem)
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    29
62175
8ffc4d0e652d isabelle update_cartouches -c -t;
wenzelm
parents: 61169
diff changeset
    30
text \<open>
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    31
  The pointwise ordering on deflation functions coincides with
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    32
  the subset ordering of their sets of fixed-points.
62175
8ffc4d0e652d isabelle update_cartouches -c -t;
wenzelm
parents: 61169
diff changeset
    33
\<close>
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    34
31076
99fe356cbbc2 rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents: 29252
diff changeset
    35
lemma belowI:
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
    36
  assumes f: "\<And>x. d\<cdot>x = x \<Longrightarrow> f\<cdot>x = x"
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
    37
  shows "d \<sqsubseteq> f"
40002
c5b5f7a3a3b1 new theorem names: fun_below_iff, fun_belowI, cfun_eq_iff, cfun_eqI, cfun_below_iff, cfun_belowI
huffman
parents: 39985
diff changeset
    38
proof (rule cfun_belowI)
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    39
  fix x
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
    40
  from below have "f\<cdot>(d\<cdot>x) \<sqsubseteq> f\<cdot>x"
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
    41
    by (rule monofun_cfun_arg)
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
    42
  also from idem have "f\<cdot>(d\<cdot>x) = d\<cdot>x"
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
    43
    by (rule f)
27401
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
31076
99fe356cbbc2 rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents: 29252
diff changeset
    47
lemma belowD: "\<lbrakk>f \<sqsubseteq> d; f\<cdot>x = x\<rbrakk> \<Longrightarrow> d\<cdot>x = x"
99fe356cbbc2 rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents: 29252
diff changeset
    48
proof (rule below_antisym)
99fe356cbbc2 rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents: 29252
diff changeset
    49
  from below show "d\<cdot>x \<sqsubseteq> x" .
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    50
  assume "f \<sqsubseteq> d"
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
    51
  then have "f\<cdot>x \<sqsubseteq> d\<cdot>x" by (rule monofun_cfun_fun)
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    52
  also assume "f\<cdot>x = x"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    53
  finally show "x \<sqsubseteq> d\<cdot>x" .
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    54
qed
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    55
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    56
end
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    57
33503
3496616b2171 lemma deflation_strict
huffman
parents: 31076
diff changeset
    58
lemma deflation_strict: "deflation d \<Longrightarrow> d\<cdot>\<bottom> = \<bottom>"
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
    59
  by (rule deflation.below [THEN bottomI])
33503
3496616b2171 lemma deflation_strict
huffman
parents: 31076
diff changeset
    60
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    61
lemma adm_deflation: "adm (\<lambda>d. deflation d)"
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
    62
  by (simp add: deflation_def)
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    63
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    64
lemma deflation_ID: "deflation ID"
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
    65
  by (simp add: deflation.intro)
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    66
41430
1aa23e9f2c87 change some lemma names containing 'UU' to 'bottom'
huffman
parents: 41182
diff changeset
    67
lemma deflation_bottom: "deflation \<bottom>"
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
    68
  by (simp add: deflation.intro)
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    69
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
    70
lemma deflation_below_iff: "deflation p \<Longrightarrow> deflation q \<Longrightarrow> p \<sqsubseteq> q \<longleftrightarrow> (\<forall>x. p\<cdot>x = x \<longrightarrow> q\<cdot>x = x)"
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
    71
  apply safe
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
    72
   apply (simp add: deflation.belowD)
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
    73
  apply (simp add: deflation.belowI)
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
    74
  done
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    75
62175
8ffc4d0e652d isabelle update_cartouches -c -t;
wenzelm
parents: 61169
diff changeset
    76
text \<open>
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    77
  The composition of two deflations is equal to
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    78
  the lesser of the two (if they are comparable).
62175
8ffc4d0e652d isabelle update_cartouches -c -t;
wenzelm
parents: 61169
diff changeset
    79
\<close>
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    80
31076
99fe356cbbc2 rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents: 29252
diff changeset
    81
lemma deflation_below_comp1:
28611
983c1855a7af More occurrences of 'includes' gone.
ballarin
parents: 27681
diff changeset
    82
  assumes "deflation f"
983c1855a7af More occurrences of 'includes' gone.
ballarin
parents: 27681
diff changeset
    83
  assumes "deflation g"
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    84
  shows "f \<sqsubseteq> g \<Longrightarrow> f\<cdot>(g\<cdot>x) = f\<cdot>x"
31076
99fe356cbbc2 rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents: 29252
diff changeset
    85
proof (rule below_antisym)
29237
e90d9d51106b More porting to new locales.
ballarin
parents: 28613
diff changeset
    86
  interpret g: deflation g by fact
31076
99fe356cbbc2 rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents: 29252
diff changeset
    87
  from g.below show "f\<cdot>(g\<cdot>x) \<sqsubseteq> f\<cdot>x" by (rule monofun_cfun_arg)
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    88
next
29237
e90d9d51106b More porting to new locales.
ballarin
parents: 28613
diff changeset
    89
  interpret f: deflation f by fact
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
    90
  assume "f \<sqsubseteq> g"
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
    91
  then have "f\<cdot>x \<sqsubseteq> g\<cdot>x" by (rule monofun_cfun_fun)
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
    92
  then have "f\<cdot>(f\<cdot>x) \<sqsubseteq> f\<cdot>(g\<cdot>x)" by (rule monofun_cfun_arg)
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    93
  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
    94
  finally show "f\<cdot>x \<sqsubseteq> f\<cdot>(g\<cdot>x)" .
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    95
qed
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
    96
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
    97
lemma deflation_below_comp2: "deflation f \<Longrightarrow> deflation g \<Longrightarrow> f \<sqsubseteq> g \<Longrightarrow> g\<cdot>(f\<cdot>x) = f\<cdot>x"
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
    98
  by (simp only: deflation.belowD deflation.idem)
27401
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
62175
8ffc4d0e652d isabelle update_cartouches -c -t;
wenzelm
parents: 61169
diff changeset
   101
subsection \<open>Deflations with finite range\<close>
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   102
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   103
lemma finite_range_imp_finite_fixes:
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   104
  assumes "finite (range f)"
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   105
  shows "finite {x. f x = x}"
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   106
proof -
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   107
  have "{x. f x = x} \<subseteq> range f"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   108
    by (clarify, erule subst, rule rangeI)
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   109
  from this assms show "finite {x. f x = x}"
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   110
    by (rule finite_subset)
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   111
qed
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   112
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   113
locale finite_deflation = deflation +
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   114
  assumes finite_fixes: "finite {x. d\<cdot>x = x}"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   115
begin
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   116
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   117
lemma finite_range: "finite (range (\<lambda>x. d\<cdot>x))"
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   118
  by (simp add: range_eq_fixes finite_fixes)
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   119
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   120
lemma finite_image: "finite ((\<lambda>x. d\<cdot>x) ` A)"
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   121
  by (rule finite_subset [OF image_mono [OF subset_UNIV] finite_range])
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   122
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   123
lemma compact: "compact (d\<cdot>x)"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   124
proof (rule compactI2)
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   125
  fix Y :: "nat \<Rightarrow> 'a"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   126
  assume Y: "chain Y"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   127
  have "finite_chain (\<lambda>i. d\<cdot>(Y i))"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   128
  proof (rule finite_range_imp_finch)
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   129
    from Y show "chain (\<lambda>i. d\<cdot>(Y i))" by simp
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   130
    have "range (\<lambda>i. d\<cdot>(Y i)) \<subseteq> range (\<lambda>x. d\<cdot>x)" by auto
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   131
    then show "finite (range (\<lambda>i. d\<cdot>(Y i)))"
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   132
      using finite_range by (rule finite_subset)
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   133
  qed
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   134
  then have "\<exists>j. (\<Squnion>i. d\<cdot>(Y i)) = d\<cdot>(Y j)"
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   135
    by (simp add: finite_chain_def maxinch_is_thelub Y)
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   136
  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
   137
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   138
  assume "d\<cdot>x \<sqsubseteq> (\<Squnion>i. Y i)"
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   139
  then have "d\<cdot>(d\<cdot>x) \<sqsubseteq> d\<cdot>(\<Squnion>i. Y i)"
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   140
    by (rule monofun_cfun_arg)
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   141
  then have "d\<cdot>x \<sqsubseteq> (\<Squnion>i. d\<cdot>(Y i))"
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   142
    by (simp add: contlub_cfun_arg Y idem)
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   143
  with j have "d\<cdot>x \<sqsubseteq> d\<cdot>(Y j)" by simp
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   144
  then have "d\<cdot>x \<sqsubseteq> Y j"
31076
99fe356cbbc2 rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents: 29252
diff changeset
   145
    using below by (rule below_trans)
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   146
  then show "\<exists>j. d\<cdot>x \<sqsubseteq> Y j" ..
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   147
qed
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   148
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   149
end
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   150
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   151
lemma finite_deflation_intro: "deflation d \<Longrightarrow> finite {x. d\<cdot>x = x} \<Longrightarrow> finite_deflation d"
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   152
  by (intro finite_deflation.intro finite_deflation_axioms.intro)
39973
c62b4ff97bfc add lemma finite_deflation_intro
Brian Huffman <brianh@cs.pdx.edu>
parents: 39971
diff changeset
   153
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   154
lemma finite_deflation_imp_deflation: "finite_deflation d \<Longrightarrow> deflation d"
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   155
  by (simp add: finite_deflation_def)
39971
2949af5e6b9c move lemmas to Deflation.thy
Brian Huffman <brianh@cs.pdx.edu>
parents: 36452
diff changeset
   156
41430
1aa23e9f2c87 change some lemma names containing 'UU' to 'bottom'
huffman
parents: 41182
diff changeset
   157
lemma finite_deflation_bottom: "finite_deflation \<bottom>"
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   158
  by standard simp_all
39971
2949af5e6b9c move lemmas to Deflation.thy
Brian Huffman <brianh@cs.pdx.edu>
parents: 36452
diff changeset
   159
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   160
62175
8ffc4d0e652d isabelle update_cartouches -c -t;
wenzelm
parents: 61169
diff changeset
   161
subsection \<open>Continuous embedding-projection pairs\<close>
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   162
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   163
locale ep_pair =
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   164
  fixes e :: "'a \<rightarrow> 'b" and p :: "'b \<rightarrow> 'a"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   165
  assumes e_inverse [simp]: "\<And>x. p\<cdot>(e\<cdot>x) = x"
31076
99fe356cbbc2 rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents: 29252
diff changeset
   166
  and e_p_below: "\<And>y. e\<cdot>(p\<cdot>y) \<sqsubseteq> y"
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   167
begin
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   168
31076
99fe356cbbc2 rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents: 29252
diff changeset
   169
lemma e_below_iff [simp]: "e\<cdot>x \<sqsubseteq> e\<cdot>y \<longleftrightarrow> x \<sqsubseteq> y"
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   170
proof
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   171
  assume "e\<cdot>x \<sqsubseteq> e\<cdot>y"
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   172
  then have "p\<cdot>(e\<cdot>x) \<sqsubseteq> p\<cdot>(e\<cdot>y)" by (rule monofun_cfun_arg)
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   173
  then show "x \<sqsubseteq> y" by simp
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   174
next
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   175
  assume "x \<sqsubseteq> y"
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   176
  then show "e\<cdot>x \<sqsubseteq> e\<cdot>y" by (rule monofun_cfun_arg)
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   177
qed
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 e_eq_iff [simp]: "e\<cdot>x = e\<cdot>y \<longleftrightarrow> x = y"
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   180
  unfolding po_eq_conv e_below_iff ..
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   181
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   182
lemma p_eq_iff: "e\<cdot>(p\<cdot>x) = x \<Longrightarrow> e\<cdot>(p\<cdot>y) = y \<Longrightarrow> p\<cdot>x = p\<cdot>y \<longleftrightarrow> x = y"
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   183
  by (safe, erule subst, erule subst, simp)
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   184
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   185
lemma p_inverse: "(\<exists>x. y = e\<cdot>x) \<longleftrightarrow> e\<cdot>(p\<cdot>y) = y"
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   186
  by (auto, rule exI, erule sym)
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   187
31076
99fe356cbbc2 rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents: 29252
diff changeset
   188
lemma e_below_iff_below_p: "e\<cdot>x \<sqsubseteq> y \<longleftrightarrow> x \<sqsubseteq> p\<cdot>y"
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   189
proof
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   190
  assume "e\<cdot>x \<sqsubseteq> y"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   191
  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
   192
  then show "x \<sqsubseteq> p\<cdot>y" by simp
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   193
next
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   194
  assume "x \<sqsubseteq> p\<cdot>y"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   195
  then have "e\<cdot>x \<sqsubseteq> e\<cdot>(p\<cdot>y)" by (rule monofun_cfun_arg)
31076
99fe356cbbc2 rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents: 29252
diff changeset
   196
  then show "e\<cdot>x \<sqsubseteq> y" using e_p_below by (rule below_trans)
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   197
qed
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   198
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   199
lemma compact_e_rev: "compact (e\<cdot>x) \<Longrightarrow> compact x"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   200
proof -
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   201
  assume "compact (e\<cdot>x)"
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   202
  then have "adm (\<lambda>y. e\<cdot>x \<notsqsubseteq> y)" by (rule compactD)
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   203
  then have "adm (\<lambda>y. e\<cdot>x \<notsqsubseteq> e\<cdot>y)" by (rule adm_subst [OF cont_Rep_cfun2])
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   204
  then have "adm (\<lambda>y. x \<notsqsubseteq> y)" by simp
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   205
  then show "compact x" by (rule compactI)
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   206
qed
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   207
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   208
lemma compact_e:
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   209
  assumes "compact x"
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   210
  shows "compact (e\<cdot>x)"
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   211
proof -
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   212
  from assms have "adm (\<lambda>y. x \<notsqsubseteq> y)" by (rule compactD)
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   213
  then have "adm (\<lambda>y. x \<notsqsubseteq> p\<cdot>y)" by (rule adm_subst [OF cont_Rep_cfun2])
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   214
  then have "adm (\<lambda>y. e\<cdot>x \<notsqsubseteq> y)" by (simp add: e_below_iff_below_p)
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   215
  then show "compact (e\<cdot>x)" by (rule compactI)
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   216
qed
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   217
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   218
lemma compact_e_iff: "compact (e\<cdot>x) \<longleftrightarrow> compact x"
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   219
  by (rule iffI [OF compact_e_rev compact_e])
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   220
62175
8ffc4d0e652d isabelle update_cartouches -c -t;
wenzelm
parents: 61169
diff changeset
   221
text \<open>Deflations from ep-pairs\<close>
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   222
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   223
lemma deflation_e_p: "deflation (e oo p)"
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   224
  by (simp add: deflation.intro e_p_below)
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   225
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   226
lemma deflation_e_d_p:
28611
983c1855a7af More occurrences of 'includes' gone.
ballarin
parents: 27681
diff changeset
   227
  assumes "deflation d"
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   228
  shows "deflation (e oo d oo p)"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   229
proof
29237
e90d9d51106b More porting to new locales.
ballarin
parents: 28613
diff changeset
   230
  interpret deflation d by fact
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   231
  fix x :: 'b
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   232
  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
   233
    by (simp add: idem)
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   234
  show "(e oo d oo p)\<cdot>x \<sqsubseteq> x"
31076
99fe356cbbc2 rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents: 29252
diff changeset
   235
    by (simp add: e_below_iff_below_p below)
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   236
qed
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   237
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   238
lemma finite_deflation_e_d_p:
28611
983c1855a7af More occurrences of 'includes' gone.
ballarin
parents: 27681
diff changeset
   239
  assumes "finite_deflation d"
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   240
  shows "finite_deflation (e oo d oo p)"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   241
proof
29237
e90d9d51106b More porting to new locales.
ballarin
parents: 28613
diff changeset
   242
  interpret finite_deflation d by fact
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   243
  fix x :: 'b
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   244
  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
   245
    by (simp add: idem)
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   246
  show "(e oo d oo p)\<cdot>x \<sqsubseteq> x"
31076
99fe356cbbc2 rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents: 29252
diff changeset
   247
    by (simp add: e_below_iff_below_p below)
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   248
  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
   249
    by (simp add: finite_image)
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   250
  then have "finite (range (\<lambda>x. (e oo d oo p)\<cdot>x))"
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   251
    by (simp add: image_image)
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   252
  then show "finite {x. (e oo d oo p)\<cdot>x = x}"
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   253
    by (rule finite_range_imp_finite_fixes)
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   254
qed
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   255
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   256
lemma deflation_p_d_e:
28611
983c1855a7af More occurrences of 'includes' gone.
ballarin
parents: 27681
diff changeset
   257
  assumes "deflation d"
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   258
  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
   259
  shows "deflation (p oo d oo e)"
28611
983c1855a7af More occurrences of 'includes' gone.
ballarin
parents: 27681
diff changeset
   260
proof -
29237
e90d9d51106b More porting to new locales.
ballarin
parents: 28613
diff changeset
   261
  interpret d: deflation d by fact
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   262
  have p_d_e_below: "(p oo d oo e)\<cdot>x \<sqsubseteq> x" for x
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   263
  proof -
28613
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   264
    have "d\<cdot>(e\<cdot>x) \<sqsubseteq> e\<cdot>x"
31076
99fe356cbbc2 rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents: 29252
diff changeset
   265
      by (rule d.below)
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   266
    then have "p\<cdot>(d\<cdot>(e\<cdot>x)) \<sqsubseteq> p\<cdot>(e\<cdot>x)"
28613
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   267
      by (rule monofun_cfun_arg)
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   268
    then show ?thesis by simp
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   269
  qed
28611
983c1855a7af More occurrences of 'includes' gone.
ballarin
parents: 27681
diff changeset
   270
  show ?thesis
28613
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   271
  proof
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   272
    show "(p oo d oo e)\<cdot>x \<sqsubseteq> x" for x
31076
99fe356cbbc2 rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents: 29252
diff changeset
   273
      by (rule p_d_e_below)
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   274
    show "(p oo d oo e)\<cdot>((p oo d oo e)\<cdot>x) = (p oo d oo e)\<cdot>x" for x
31076
99fe356cbbc2 rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents: 29252
diff changeset
   275
    proof (rule below_antisym)
28613
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   276
      show "(p oo d oo e)\<cdot>((p oo d oo e)\<cdot>x) \<sqsubseteq> (p oo d oo e)\<cdot>x"
31076
99fe356cbbc2 rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents: 29252
diff changeset
   277
        by (rule p_d_e_below)
28613
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   278
      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
   279
        by (intro monofun_cfun_arg d)
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   280
      then have "p\<cdot>(d\<cdot>(e\<cdot>x)) \<sqsubseteq> p\<cdot>(d\<cdot>(e\<cdot>(p\<cdot>(d\<cdot>(e\<cdot>x)))))"
28613
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   281
        by (simp only: d.idem)
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   282
      then show "(p oo d oo e)\<cdot>x \<sqsubseteq> (p oo d oo e)\<cdot>((p oo d oo e)\<cdot>x)"
28613
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   283
        by simp
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   284
    qed
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   285
  qed
28611
983c1855a7af More occurrences of 'includes' gone.
ballarin
parents: 27681
diff changeset
   286
qed
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   287
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   288
lemma finite_deflation_p_d_e:
28611
983c1855a7af More occurrences of 'includes' gone.
ballarin
parents: 27681
diff changeset
   289
  assumes "finite_deflation d"
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   290
  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
   291
  shows "finite_deflation (p oo d oo e)"
28611
983c1855a7af More occurrences of 'includes' gone.
ballarin
parents: 27681
diff changeset
   292
proof -
29237
e90d9d51106b More porting to new locales.
ballarin
parents: 28613
diff changeset
   293
  interpret d: finite_deflation d by fact
28611
983c1855a7af More occurrences of 'includes' gone.
ballarin
parents: 27681
diff changeset
   294
  show ?thesis
39973
c62b4ff97bfc add lemma finite_deflation_intro
Brian Huffman <brianh@cs.pdx.edu>
parents: 39971
diff changeset
   295
  proof (rule finite_deflation_intro)
28613
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   296
    have "deflation d" ..
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   297
    then show "deflation (p oo d oo e)"
28613
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   298
      using d by (rule deflation_p_d_e)
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   299
  next
39973
c62b4ff97bfc add lemma finite_deflation_intro
Brian Huffman <brianh@cs.pdx.edu>
parents: 39971
diff changeset
   300
    have "finite ((\<lambda>x. d\<cdot>x) ` range (\<lambda>x. e\<cdot>x))"
c62b4ff97bfc add lemma finite_deflation_intro
Brian Huffman <brianh@cs.pdx.edu>
parents: 39971
diff changeset
   301
      by (rule d.finite_image)
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   302
    then have "finite ((\<lambda>x. p\<cdot>x) ` (\<lambda>x. d\<cdot>x) ` range (\<lambda>x. e\<cdot>x))"
39973
c62b4ff97bfc add lemma finite_deflation_intro
Brian Huffman <brianh@cs.pdx.edu>
parents: 39971
diff changeset
   303
      by (rule finite_imageI)
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   304
    then have "finite (range (\<lambda>x. (p oo d oo e)\<cdot>x))"
39973
c62b4ff97bfc add lemma finite_deflation_intro
Brian Huffman <brianh@cs.pdx.edu>
parents: 39971
diff changeset
   305
      by (simp add: image_image)
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   306
    then show "finite {x. (p oo d oo e)\<cdot>x = x}"
39973
c62b4ff97bfc add lemma finite_deflation_intro
Brian Huffman <brianh@cs.pdx.edu>
parents: 39971
diff changeset
   307
      by (rule finite_range_imp_finite_fixes)
28613
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   308
  qed
28611
983c1855a7af More occurrences of 'includes' gone.
ballarin
parents: 27681
diff changeset
   309
qed
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   310
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   311
end
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   312
81577
a712bf5ccab0 tuned whitespace;
wenzelm
parents: 67312
diff changeset
   313
62175
8ffc4d0e652d isabelle update_cartouches -c -t;
wenzelm
parents: 61169
diff changeset
   314
subsection \<open>Uniqueness of ep-pairs\<close>
27401
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:
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   317
  assumes 1: "ep_pair e1 p"
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   318
    and 2: "ep_pair e2 p"
28613
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   319
  shows "e1 \<sqsubseteq> e2"
40002
c5b5f7a3a3b1 new theorem names: fun_below_iff, fun_belowI, cfun_eq_iff, cfun_eqI, cfun_below_iff, cfun_belowI
huffman
parents: 39985
diff changeset
   320
proof (rule cfun_belowI)
28613
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   321
  fix x
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   322
  have "e1\<cdot>(p\<cdot>(e2\<cdot>x)) \<sqsubseteq> e2\<cdot>x"
35168
07b3112e464b fix warnings about duplicate simp rules
huffman
parents: 33503
diff changeset
   323
    by (rule ep_pair.e_p_below [OF 1])
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   324
  then show "e1\<cdot>x \<sqsubseteq> e2\<cdot>x"
35168
07b3112e464b fix warnings about duplicate simp rules
huffman
parents: 33503
diff changeset
   325
    by (simp only: ep_pair.e_inverse [OF 2])
28613
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   326
qed
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   327
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   328
lemma ep_pair_unique_e: "ep_pair e1 p \<Longrightarrow> ep_pair e2 p \<Longrightarrow> e1 = e2"
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   329
  by (fast intro: below_antisym elim: ep_pair_unique_e_lemma)
28613
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   330
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   331
lemma ep_pair_unique_p_lemma:
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   332
  assumes 1: "ep_pair e p1"
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   333
    and 2: "ep_pair e p2"
28613
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   334
  shows "p1 \<sqsubseteq> p2"
40002
c5b5f7a3a3b1 new theorem names: fun_below_iff, fun_belowI, cfun_eq_iff, cfun_eqI, cfun_below_iff, cfun_belowI
huffman
parents: 39985
diff changeset
   335
proof (rule cfun_belowI)
28613
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   336
  fix x
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   337
  have "e\<cdot>(p1\<cdot>x) \<sqsubseteq> x"
35168
07b3112e464b fix warnings about duplicate simp rules
huffman
parents: 33503
diff changeset
   338
    by (rule ep_pair.e_p_below [OF 1])
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   339
  then have "p2\<cdot>(e\<cdot>(p1\<cdot>x)) \<sqsubseteq> p2\<cdot>x"
28613
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   340
    by (rule monofun_cfun_arg)
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   341
  then show "p1\<cdot>x \<sqsubseteq> p2\<cdot>x"
35168
07b3112e464b fix warnings about duplicate simp rules
huffman
parents: 33503
diff changeset
   342
    by (simp only: ep_pair.e_inverse [OF 2])
28613
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   343
qed
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   344
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   345
lemma ep_pair_unique_p: "ep_pair e p1 \<Longrightarrow> ep_pair e p2 \<Longrightarrow> p1 = p2"
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   346
  by (fast intro: below_antisym elim: ep_pair_unique_p_lemma)
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   347
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   348
62175
8ffc4d0e652d isabelle update_cartouches -c -t;
wenzelm
parents: 61169
diff changeset
   349
subsection \<open>Composing ep-pairs\<close>
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   350
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   351
lemma ep_pair_ID_ID: "ep_pair ID ID"
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   352
  by standard simp_all
27401
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_comp:
28613
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   355
  assumes "ep_pair e1 p1" and "ep_pair e2 p2"
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   356
  shows "ep_pair (e2 oo e1) (p1 oo p2)"
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   357
proof
29237
e90d9d51106b More porting to new locales.
ballarin
parents: 28613
diff changeset
   358
  interpret ep1: ep_pair e1 p1 by fact
e90d9d51106b More porting to new locales.
ballarin
parents: 28613
diff changeset
   359
  interpret ep2: ep_pair e2 p2 by fact
28613
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   360
  fix x y
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   361
  show "(p1 oo p2)\<cdot>((e2 oo e1)\<cdot>x) = x"
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   362
    by simp
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   363
  have "e1\<cdot>(p1\<cdot>(p2\<cdot>y)) \<sqsubseteq> p2\<cdot>y"
31076
99fe356cbbc2 rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents: 29252
diff changeset
   364
    by (rule ep1.e_p_below)
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   365
  then have "e2\<cdot>(e1\<cdot>(p1\<cdot>(p2\<cdot>y))) \<sqsubseteq> e2\<cdot>(p2\<cdot>y)"
28613
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   366
    by (rule monofun_cfun_arg)
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   367
  also have "e2\<cdot>(p2\<cdot>y) \<sqsubseteq> y"
31076
99fe356cbbc2 rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents: 29252
diff changeset
   368
    by (rule ep2.e_p_below)
28613
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   369
  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
   370
    by simp
15a41d3fa959 rewrite more proofs in Isar style
huffman
parents: 28611
diff changeset
   371
qed
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   372
46868
6c250adbe101 eliminated old-fashioned 'constrains' element;
wenzelm
parents: 42151
diff changeset
   373
locale pcpo_ep_pair = ep_pair e p
6c250adbe101 eliminated old-fashioned 'constrains' element;
wenzelm
parents: 42151
diff changeset
   374
  for e :: "'a::pcpo \<rightarrow> 'b::pcpo"
6c250adbe101 eliminated old-fashioned 'constrains' element;
wenzelm
parents: 42151
diff changeset
   375
  and p :: "'b::pcpo \<rightarrow> 'a::pcpo"
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   376
begin
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   377
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   378
lemma e_strict [simp]: "e\<cdot>\<bottom> = \<bottom>"
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   379
proof -
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   380
  have "\<bottom> \<sqsubseteq> p\<cdot>\<bottom>" by (rule minimal)
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   381
  then have "e\<cdot>\<bottom> \<sqsubseteq> e\<cdot>(p\<cdot>\<bottom>)" by (rule monofun_cfun_arg)
31076
99fe356cbbc2 rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents: 29252
diff changeset
   382
  also have "e\<cdot>(p\<cdot>\<bottom>) \<sqsubseteq> \<bottom>" by (rule e_p_below)
27401
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   383
  finally show "e\<cdot>\<bottom> = \<bottom>" by simp
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   384
qed
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   385
40321
d065b195ec89 rename lemmas *_defined_iff and *_strict_iff to *_bottom_iff
huffman
parents: 40002
diff changeset
   386
lemma e_bottom_iff [simp]: "e\<cdot>x = \<bottom> \<longleftrightarrow> x = \<bottom>"
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   387
  by (rule e_eq_iff [where y="\<bottom>", unfolded e_strict])
27401
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: "x \<noteq> \<bottom> \<Longrightarrow> e\<cdot>x \<noteq> \<bottom>"
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   390
  by simp
27401
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 p_strict [simp]: "p\<cdot>\<bottom> = \<bottom>"
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 65380
diff changeset
   393
  by (rule e_inverse [where x="\<bottom>", unfolded e_strict])
27401
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
lemmas stricts = e_strict p_strict
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   396
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   397
end
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   398
4edc81f93e35 New theory of deflations and embedding-projection pairs
huffman
parents:
diff changeset
   399
end