src/HOLCF/Adm.thy
changeset 25880 2c6cabe7a47c
parent 25806 2b976fcee6e5
child 25895 0eaadfa8889e
equal deleted inserted replaced
25879:98b93782c3b1 25880:2c6cabe7a47c
    15 
    15 
    16 definition
    16 definition
    17   adm :: "('a::cpo \<Rightarrow> bool) \<Rightarrow> bool" where
    17   adm :: "('a::cpo \<Rightarrow> bool) \<Rightarrow> bool" where
    18   "adm P = (\<forall>Y. chain Y \<longrightarrow> (\<forall>i. P (Y i)) \<longrightarrow> P (\<Squnion>i. Y i))"
    18   "adm P = (\<forall>Y. chain Y \<longrightarrow> (\<forall>i. P (Y i)) \<longrightarrow> P (\<Squnion>i. Y i))"
    19 
    19 
    20 definition
       
    21   compact :: "'a::cpo \<Rightarrow> bool" where
       
    22   "compact k = adm (\<lambda>x. \<not> k \<sqsubseteq> x)"
       
    23 
       
    24 lemma admI:
    20 lemma admI:
    25    "(\<And>Y. \<lbrakk>chain Y; \<forall>i. P (Y i)\<rbrakk> \<Longrightarrow> P (\<Squnion>i. Y i)) \<Longrightarrow> adm P"
    21    "(\<And>Y. \<lbrakk>chain Y; \<forall>i. P (Y i)\<rbrakk> \<Longrightarrow> P (\<Squnion>i. Y i)) \<Longrightarrow> adm P"
    26 by (unfold adm_def, fast)
    22 by (unfold adm_def, fast)
    27 
    23 
    28 lemma triv_admI: "\<forall>x. P x \<Longrightarrow> adm P"
    24 lemma triv_admI: "\<forall>x. P x \<Longrightarrow> adm P"
    29 by (rule admI, erule spec)
    25 by (rule admI, erule spec)
    30 
    26 
    31 lemma admD: "\<lbrakk>adm P; chain Y; \<forall>i. P (Y i)\<rbrakk> \<Longrightarrow> P (\<Squnion>i. Y i)"
    27 lemma admD: "\<lbrakk>adm P; chain Y; \<forall>i. P (Y i)\<rbrakk> \<Longrightarrow> P (\<Squnion>i. Y i)"
    32 by (unfold adm_def, fast)
    28 by (unfold adm_def, fast)
    33 
       
    34 lemma compactI: "adm (\<lambda>x. \<not> k \<sqsubseteq> x) \<Longrightarrow> compact k"
       
    35 by (unfold compact_def)
       
    36 
       
    37 lemma compactD: "compact k \<Longrightarrow> adm (\<lambda>x. \<not> k \<sqsubseteq> x)"
       
    38 by (unfold compact_def)
       
    39 
    29 
    40 text {* improved admissibility introduction *}
    30 text {* improved admissibility introduction *}
    41 
    31 
    42 lemma admI2:
    32 lemma admI2:
    43   "(\<And>Y. \<lbrakk>chain Y; \<forall>i. P (Y i); \<forall>i. \<exists>j>i. Y i \<noteq> Y j \<and> Y i \<sqsubseteq> Y j\<rbrakk> 
    33   "(\<And>Y. \<lbrakk>chain Y; \<forall>i. P (Y i); \<forall>i. \<exists>j>i. Y i \<noteq> Y j \<and> Y i \<sqsubseteq> Y j\<rbrakk> 
    55   "\<forall>Y. chain (Y::nat \<Rightarrow> 'a) \<longrightarrow> (\<exists>n. max_in_chain n Y)
    45   "\<forall>Y. chain (Y::nat \<Rightarrow> 'a) \<longrightarrow> (\<exists>n. max_in_chain n Y)
    56     \<Longrightarrow> adm (P::'a \<Rightarrow> bool)"
    46     \<Longrightarrow> adm (P::'a \<Rightarrow> bool)"
    57 by (auto simp add: adm_def maxinch_is_thelub)
    47 by (auto simp add: adm_def maxinch_is_thelub)
    58 
    48 
    59 lemmas adm_chfin = chfin [THEN adm_max_in_chain, standard]
    49 lemmas adm_chfin = chfin [THEN adm_max_in_chain, standard]
    60 
       
    61 lemma compact_chfin: "compact (x::'a::chfin)"
       
    62 by (rule compactI, rule adm_chfin)
       
    63 
    50 
    64 subsection {* Admissibility of special formulae and propagation *}
    51 subsection {* Admissibility of special formulae and propagation *}
    65 
    52 
    66 lemma adm_not_free: "adm (\<lambda>x. t)"
    53 lemma adm_not_free: "adm (\<lambda>x. t)"
    67 by (rule admI, simp)
    54 by (rule admI, simp)
   169 apply (erule rev_trans_less)
   156 apply (erule rev_trans_less)
   170 apply (erule cont2mono [THEN monofunE])
   157 apply (erule cont2mono [THEN monofunE])
   171 apply (erule is_ub_thelub)
   158 apply (erule is_ub_thelub)
   172 done
   159 done
   173 
   160 
       
   161 subsection {* Compactness *}
       
   162 
       
   163 definition
       
   164   compact :: "'a::cpo \<Rightarrow> bool" where
       
   165   "compact k = adm (\<lambda>x. \<not> k \<sqsubseteq> x)"
       
   166 
       
   167 lemma compactI: "adm (\<lambda>x. \<not> k \<sqsubseteq> x) \<Longrightarrow> compact k"
       
   168 unfolding compact_def .
       
   169 
       
   170 lemma compactD: "compact k \<Longrightarrow> adm (\<lambda>x. \<not> k \<sqsubseteq> x)"
       
   171 unfolding compact_def .
       
   172 
       
   173 lemma compactI2:
       
   174   "(\<And>Y. \<lbrakk>chain Y; x \<sqsubseteq> lub (range Y)\<rbrakk> \<Longrightarrow> \<exists>i. x \<sqsubseteq> Y i) \<Longrightarrow> compact x"
       
   175 unfolding compact_def adm_def by fast
       
   176 
       
   177 lemma compactD2:
       
   178   "\<lbrakk>compact x; chain Y; x \<sqsubseteq> lub (range Y)\<rbrakk> \<Longrightarrow> \<exists>i. x \<sqsubseteq> Y i"
       
   179 unfolding compact_def adm_def by fast
       
   180 
       
   181 lemma compact_chfin [simp]: "compact (x::'a::chfin)"
       
   182 by (rule compactI [OF adm_chfin])
       
   183 
       
   184 lemma compact_imp_max_in_chain:
       
   185   "\<lbrakk>chain Y; compact (\<Squnion>i. Y i)\<rbrakk> \<Longrightarrow> \<exists>i. max_in_chain i Y"
       
   186 apply (drule (1) compactD2, simp)
       
   187 apply (erule exE, rule_tac x=i in exI)
       
   188 apply (rule max_in_chainI)
       
   189 apply (rule antisym_less)
       
   190 apply (erule (1) chain_mono3)
       
   191 apply (erule (1) trans_less [OF is_ub_thelub])
       
   192 done
       
   193 
   174 text {* admissibility and compactness *}
   194 text {* admissibility and compactness *}
   175 
   195 
   176 lemma adm_compact_not_less: "\<lbrakk>compact k; cont t\<rbrakk> \<Longrightarrow> adm (\<lambda>x. \<not> k \<sqsubseteq> t x)"
   196 lemma adm_compact_not_less: "\<lbrakk>compact k; cont t\<rbrakk> \<Longrightarrow> adm (\<lambda>x. \<not> k \<sqsubseteq> t x)"
   177 by (unfold compact_def, erule adm_subst)
   197 unfolding compact_def by (rule adm_subst)
   178 
   198 
   179 lemma adm_neq_compact: "\<lbrakk>compact k; cont t\<rbrakk> \<Longrightarrow> adm (\<lambda>x. t x \<noteq> k)"
   199 lemma adm_neq_compact: "\<lbrakk>compact k; cont t\<rbrakk> \<Longrightarrow> adm (\<lambda>x. t x \<noteq> k)"
   180 by (simp add: po_eq_conv adm_imp adm_not_less adm_compact_not_less)
   200 by (simp add: po_eq_conv adm_imp adm_not_less adm_compact_not_less)
   181 
   201 
   182 lemma adm_compact_neq: "\<lbrakk>compact k; cont t\<rbrakk> \<Longrightarrow> adm (\<lambda>x. k \<noteq> t x)"
   202 lemma adm_compact_neq: "\<lbrakk>compact k; cont t\<rbrakk> \<Longrightarrow> adm (\<lambda>x. k \<noteq> t x)"