src/HOL/HOLCF/Adm.thy
changeset 62175 8ffc4d0e652d
parent 58880 0baae4311a9f
child 63040 eb4ddd18d635
equal deleted inserted replaced
62174:fae6233c5f37 62175:8ffc4d0e652d
     1 (*  Title:      HOL/HOLCF/Adm.thy
     1 (*  Title:      HOL/HOLCF/Adm.thy
     2     Author:     Franz Regensburger and Brian Huffman
     2     Author:     Franz Regensburger and Brian Huffman
     3 *)
     3 *)
     4 
     4 
     5 section {* Admissibility and compactness *}
     5 section \<open>Admissibility and compactness\<close>
     6 
     6 
     7 theory Adm
     7 theory Adm
     8 imports Cont
     8 imports Cont
     9 begin
     9 begin
    10 
    10 
    11 default_sort cpo
    11 default_sort cpo
    12 
    12 
    13 subsection {* Definitions *}
    13 subsection \<open>Definitions\<close>
    14 
    14 
    15 definition
    15 definition
    16   adm :: "('a::cpo \<Rightarrow> bool) \<Rightarrow> bool" where
    16   adm :: "('a::cpo \<Rightarrow> bool) \<Rightarrow> bool" where
    17   "adm P = (\<forall>Y. chain Y \<longrightarrow> (\<forall>i. P (Y i)) \<longrightarrow> P (\<Squnion>i. Y i))"
    17   "adm P = (\<forall>Y. chain Y \<longrightarrow> (\<forall>i. P (Y i)) \<longrightarrow> P (\<Squnion>i. Y i))"
    18 
    18 
    27 unfolding adm_def by fast
    27 unfolding adm_def by fast
    28 
    28 
    29 lemma triv_admI: "\<forall>x. P x \<Longrightarrow> adm P"
    29 lemma triv_admI: "\<forall>x. P x \<Longrightarrow> adm P"
    30 by (rule admI, erule spec)
    30 by (rule admI, erule spec)
    31 
    31 
    32 subsection {* Admissibility on chain-finite types *}
    32 subsection \<open>Admissibility on chain-finite types\<close>
    33 
    33 
    34 text {* For chain-finite (easy) types every formula is admissible. *}
    34 text \<open>For chain-finite (easy) types every formula is admissible.\<close>
    35 
    35 
    36 lemma adm_chfin [simp]: "adm (P::'a::chfin \<Rightarrow> bool)"
    36 lemma adm_chfin [simp]: "adm (P::'a::chfin \<Rightarrow> bool)"
    37 by (rule admI, frule chfin, auto simp add: maxinch_is_thelub)
    37 by (rule admI, frule chfin, auto simp add: maxinch_is_thelub)
    38 
    38 
    39 subsection {* Admissibility of special formulae and propagation *}
    39 subsection \<open>Admissibility of special formulae and propagation\<close>
    40 
    40 
    41 lemma adm_const [simp]: "adm (\<lambda>x. t)"
    41 lemma adm_const [simp]: "adm (\<lambda>x. t)"
    42 by (rule admI, simp)
    42 by (rule admI, simp)
    43 
    43 
    44 lemma adm_conj [simp]:
    44 lemma adm_conj [simp]:
    51 
    51 
    52 lemma adm_ball [simp]:
    52 lemma adm_ball [simp]:
    53   "(\<And>y. y \<in> A \<Longrightarrow> adm (\<lambda>x. P x y)) \<Longrightarrow> adm (\<lambda>x. \<forall>y\<in>A. P x y)"
    53   "(\<And>y. y \<in> A \<Longrightarrow> adm (\<lambda>x. P x y)) \<Longrightarrow> adm (\<lambda>x. \<forall>y\<in>A. P x y)"
    54 by (fast intro: admI elim: admD)
    54 by (fast intro: admI elim: admD)
    55 
    55 
    56 text {* Admissibility for disjunction is hard to prove. It requires 2 lemmas. *}
    56 text \<open>Admissibility for disjunction is hard to prove. It requires 2 lemmas.\<close>
    57 
    57 
    58 lemma adm_disj_lemma1:
    58 lemma adm_disj_lemma1:
    59   assumes adm: "adm P"
    59   assumes adm: "adm P"
    60   assumes chain: "chain Y"
    60   assumes chain: "chain Y"
    61   assumes P: "\<forall>i. \<exists>j\<ge>i. P (Y j)"
    61   assumes P: "\<forall>i. \<exists>j\<ge>i. P (Y j)"
   106 lemma adm_iff [simp]:
   106 lemma adm_iff [simp]:
   107   "\<lbrakk>adm (\<lambda>x. P x \<longrightarrow> Q x); adm (\<lambda>x. Q x \<longrightarrow> P x)\<rbrakk>  
   107   "\<lbrakk>adm (\<lambda>x. P x \<longrightarrow> Q x); adm (\<lambda>x. Q x \<longrightarrow> P x)\<rbrakk>  
   108     \<Longrightarrow> adm (\<lambda>x. P x = Q x)"
   108     \<Longrightarrow> adm (\<lambda>x. P x = Q x)"
   109 by (subst iff_conv_conj_imp, rule adm_conj)
   109 by (subst iff_conv_conj_imp, rule adm_conj)
   110 
   110 
   111 text {* admissibility and continuity *}
   111 text \<open>admissibility and continuity\<close>
   112 
   112 
   113 lemma adm_below [simp]:
   113 lemma adm_below [simp]:
   114   "\<lbrakk>cont (\<lambda>x. u x); cont (\<lambda>x. v x)\<rbrakk> \<Longrightarrow> adm (\<lambda>x. u x \<sqsubseteq> v x)"
   114   "\<lbrakk>cont (\<lambda>x. u x); cont (\<lambda>x. v x)\<rbrakk> \<Longrightarrow> adm (\<lambda>x. u x \<sqsubseteq> v x)"
   115 by (simp add: adm_def cont2contlubE lub_mono ch2ch_cont)
   115 by (simp add: adm_def cont2contlubE lub_mono ch2ch_cont)
   116 
   116 
   122 by (simp add: adm_def cont2contlubE ch2ch_cont)
   122 by (simp add: adm_def cont2contlubE ch2ch_cont)
   123 
   123 
   124 lemma adm_not_below [simp]: "cont (\<lambda>x. t x) \<Longrightarrow> adm (\<lambda>x. t x \<notsqsubseteq> u)"
   124 lemma adm_not_below [simp]: "cont (\<lambda>x. t x) \<Longrightarrow> adm (\<lambda>x. t x \<notsqsubseteq> u)"
   125 by (rule admI, simp add: cont2contlubE ch2ch_cont lub_below_iff)
   125 by (rule admI, simp add: cont2contlubE ch2ch_cont lub_below_iff)
   126 
   126 
   127 subsection {* Compactness *}
   127 subsection \<open>Compactness\<close>
   128 
   128 
   129 definition
   129 definition
   130   compact :: "'a::cpo \<Rightarrow> bool" where
   130   compact :: "'a::cpo \<Rightarrow> bool" where
   131   "compact k = adm (\<lambda>x. k \<notsqsubseteq> x)"
   131   "compact k = adm (\<lambda>x. k \<notsqsubseteq> x)"
   132 
   132 
   159 apply (rule below_antisym)
   159 apply (rule below_antisym)
   160 apply (erule (1) chain_mono)
   160 apply (erule (1) chain_mono)
   161 apply (erule (1) below_trans [OF is_ub_thelub])
   161 apply (erule (1) below_trans [OF is_ub_thelub])
   162 done
   162 done
   163 
   163 
   164 text {* admissibility and compactness *}
   164 text \<open>admissibility and compactness\<close>
   165 
   165 
   166 lemma adm_compact_not_below [simp]:
   166 lemma adm_compact_not_below [simp]:
   167   "\<lbrakk>compact k; cont (\<lambda>x. t x)\<rbrakk> \<Longrightarrow> adm (\<lambda>x. k \<notsqsubseteq> t x)"
   167   "\<lbrakk>compact k; cont (\<lambda>x. t x)\<rbrakk> \<Longrightarrow> adm (\<lambda>x. k \<notsqsubseteq> t x)"
   168 unfolding compact_def by (rule adm_subst)
   168 unfolding compact_def by (rule adm_subst)
   169 
   169 
   176 by (simp add: po_eq_conv)
   176 by (simp add: po_eq_conv)
   177 
   177 
   178 lemma compact_bottom [simp, intro]: "compact \<bottom>"
   178 lemma compact_bottom [simp, intro]: "compact \<bottom>"
   179 by (rule compactI, simp)
   179 by (rule compactI, simp)
   180 
   180 
   181 text {* Any upward-closed predicate is admissible. *}
   181 text \<open>Any upward-closed predicate is admissible.\<close>
   182 
   182 
   183 lemma adm_upward:
   183 lemma adm_upward:
   184   assumes P: "\<And>x y. \<lbrakk>P x; x \<sqsubseteq> y\<rbrakk> \<Longrightarrow> P y"
   184   assumes P: "\<And>x y. \<lbrakk>P x; x \<sqsubseteq> y\<rbrakk> \<Longrightarrow> P y"
   185   shows "adm P"
   185   shows "adm P"
   186 by (rule admI, drule spec, erule P, erule is_ub_thelub)
   186 by (rule admI, drule spec, erule P, erule is_ub_thelub)