src/HOLCF/ConvexPD.thy
changeset 26420 57a626f64875
parent 26407 562a1d615336
child 26806 40b411ec05aa
equal deleted inserted replaced
26419:945d8d7a66ec 26420:57a626f64875
    25 by (rule preorder.intro, rule convex_le_refl, rule convex_le_trans)
    25 by (rule preorder.intro, rule convex_le_refl, rule convex_le_trans)
    26 
    26 
    27 lemma upper_le_minimal [simp]: "PDUnit compact_bot \<le>\<natural> t"
    27 lemma upper_le_minimal [simp]: "PDUnit compact_bot \<le>\<natural> t"
    28 unfolding convex_le_def Rep_PDUnit by simp
    28 unfolding convex_le_def Rep_PDUnit by simp
    29 
    29 
    30 lemma PDUnit_convex_mono: "compact_le x y \<Longrightarrow> PDUnit x \<le>\<natural> PDUnit y"
    30 lemma PDUnit_convex_mono: "x \<sqsubseteq> y \<Longrightarrow> PDUnit x \<le>\<natural> PDUnit y"
    31 unfolding convex_le_def by (fast intro: PDUnit_upper_mono PDUnit_lower_mono)
    31 unfolding convex_le_def by (fast intro: PDUnit_upper_mono PDUnit_lower_mono)
    32 
    32 
    33 lemma PDPlus_convex_mono: "\<lbrakk>s \<le>\<natural> t; u \<le>\<natural> v\<rbrakk> \<Longrightarrow> PDPlus s u \<le>\<natural> PDPlus t v"
    33 lemma PDPlus_convex_mono: "\<lbrakk>s \<le>\<natural> t; u \<le>\<natural> v\<rbrakk> \<Longrightarrow> PDPlus s u \<le>\<natural> PDPlus t v"
    34 unfolding convex_le_def by (fast intro: PDPlus_upper_mono PDPlus_lower_mono)
    34 unfolding convex_le_def by (fast intro: PDPlus_upper_mono PDPlus_lower_mono)
    35 
    35 
    36 lemma convex_le_PDUnit_PDUnit_iff [simp]:
    36 lemma convex_le_PDUnit_PDUnit_iff [simp]:
    37   "(PDUnit a \<le>\<natural> PDUnit b) = compact_le a b"
    37   "(PDUnit a \<le>\<natural> PDUnit b) = a \<sqsubseteq> b"
    38 unfolding convex_le_def upper_le_def lower_le_def Rep_PDUnit by fast
    38 unfolding convex_le_def upper_le_def lower_le_def Rep_PDUnit by fast
    39 
    39 
    40 lemma convex_le_PDUnit_lemma1:
    40 lemma convex_le_PDUnit_lemma1:
    41   "(PDUnit a \<le>\<natural> t) = (\<forall>b\<in>Rep_pd_basis t. compact_le a b)"
    41   "(PDUnit a \<le>\<natural> t) = (\<forall>b\<in>Rep_pd_basis t. a \<sqsubseteq> b)"
    42 unfolding convex_le_def upper_le_def lower_le_def Rep_PDUnit
    42 unfolding convex_le_def upper_le_def lower_le_def Rep_PDUnit
    43 using Rep_pd_basis_nonempty [of t, folded ex_in_conv] by fast
    43 using Rep_pd_basis_nonempty [of t, folded ex_in_conv] by fast
    44 
    44 
    45 lemma convex_le_PDUnit_PDPlus_iff [simp]:
    45 lemma convex_le_PDUnit_PDPlus_iff [simp]:
    46   "(PDUnit a \<le>\<natural> PDPlus t u) = (PDUnit a \<le>\<natural> t \<and> PDUnit a \<le>\<natural> u)"
    46   "(PDUnit a \<le>\<natural> PDPlus t u) = (PDUnit a \<le>\<natural> t \<and> PDUnit a \<le>\<natural> u)"
    47 unfolding convex_le_PDUnit_lemma1 Rep_PDPlus by fast
    47 unfolding convex_le_PDUnit_lemma1 Rep_PDPlus by fast
    48 
    48 
    49 lemma convex_le_PDUnit_lemma2:
    49 lemma convex_le_PDUnit_lemma2:
    50   "(t \<le>\<natural> PDUnit b) = (\<forall>a\<in>Rep_pd_basis t. compact_le a b)"
    50   "(t \<le>\<natural> PDUnit b) = (\<forall>a\<in>Rep_pd_basis t. a \<sqsubseteq> b)"
    51 unfolding convex_le_def upper_le_def lower_le_def Rep_PDUnit
    51 unfolding convex_le_def upper_le_def lower_le_def Rep_PDUnit
    52 using Rep_pd_basis_nonempty [of t, folded ex_in_conv] by fast
    52 using Rep_pd_basis_nonempty [of t, folded ex_in_conv] by fast
    53 
    53 
    54 lemma convex_le_PDPlus_PDUnit_iff [simp]:
    54 lemma convex_le_PDPlus_PDUnit_iff [simp]:
    55   "(PDPlus t u \<le>\<natural> PDUnit a) = (t \<le>\<natural> PDUnit a \<and> u \<le>\<natural> PDUnit a)"
    55   "(PDPlus t u \<le>\<natural> PDUnit a) = (t \<le>\<natural> PDUnit a \<and> u \<le>\<natural> PDUnit a)"
    57 
    57 
    58 lemma convex_le_PDPlus_lemma:
    58 lemma convex_le_PDPlus_lemma:
    59   assumes z: "PDPlus t u \<le>\<natural> z"
    59   assumes z: "PDPlus t u \<le>\<natural> z"
    60   shows "\<exists>v w. z = PDPlus v w \<and> t \<le>\<natural> v \<and> u \<le>\<natural> w"
    60   shows "\<exists>v w. z = PDPlus v w \<and> t \<le>\<natural> v \<and> u \<le>\<natural> w"
    61 proof (intro exI conjI)
    61 proof (intro exI conjI)
    62   let ?A = "{b\<in>Rep_pd_basis z. \<exists>a\<in>Rep_pd_basis t. compact_le a b}"
    62   let ?A = "{b\<in>Rep_pd_basis z. \<exists>a\<in>Rep_pd_basis t. a \<sqsubseteq> b}"
    63   let ?B = "{b\<in>Rep_pd_basis z. \<exists>a\<in>Rep_pd_basis u. compact_le a b}"
    63   let ?B = "{b\<in>Rep_pd_basis z. \<exists>a\<in>Rep_pd_basis u. a \<sqsubseteq> b}"
    64   let ?v = "Abs_pd_basis ?A"
    64   let ?v = "Abs_pd_basis ?A"
    65   let ?w = "Abs_pd_basis ?B"
    65   let ?w = "Abs_pd_basis ?B"
    66   have Rep_v: "Rep_pd_basis ?v = ?A"
    66   have Rep_v: "Rep_pd_basis ?v = ?A"
    67     apply (rule Abs_pd_basis_inverse)
    67     apply (rule Abs_pd_basis_inverse)
    68     apply (rule Rep_pd_basis_nonempty [of t, folded ex_in_conv, THEN exE])
    68     apply (rule Rep_pd_basis_nonempty [of t, folded ex_in_conv, THEN exE])
   100 qed
   100 qed
   101 
   101 
   102 lemma convex_le_induct [induct set: convex_le]:
   102 lemma convex_le_induct [induct set: convex_le]:
   103   assumes le: "t \<le>\<natural> u"
   103   assumes le: "t \<le>\<natural> u"
   104   assumes 2: "\<And>t u v. \<lbrakk>P t u; P u v\<rbrakk> \<Longrightarrow> P t v"
   104   assumes 2: "\<And>t u v. \<lbrakk>P t u; P u v\<rbrakk> \<Longrightarrow> P t v"
   105   assumes 3: "\<And>a b. compact_le a b \<Longrightarrow> P (PDUnit a) (PDUnit b)"
   105   assumes 3: "\<And>a b. a \<sqsubseteq> b \<Longrightarrow> P (PDUnit a) (PDUnit b)"
   106   assumes 4: "\<And>t u v w. \<lbrakk>P t v; P u w\<rbrakk> \<Longrightarrow> P (PDPlus t u) (PDPlus v w)"
   106   assumes 4: "\<And>t u v w. \<lbrakk>P t v; P u w\<rbrakk> \<Longrightarrow> P (PDPlus t u) (PDPlus v w)"
   107   shows "P t u"
   107   shows "P t u"
   108 using le apply (induct t arbitrary: u rule: pd_basis_induct)
   108 using le apply (induct t arbitrary: u rule: pd_basis_induct)
   109 apply (erule rev_mp)
   109 apply (erule rev_mp)
   110 apply (induct_tac u rule: pd_basis_induct1)
   110 apply (induct_tac u rule: pd_basis_induct1)
   166 apply (rule Abs_convex_pd_inverse [simplified])
   166 apply (rule Abs_convex_pd_inverse [simplified])
   167 apply (rule convex_le.ideal_principal)
   167 apply (rule convex_le.ideal_principal)
   168 done
   168 done
   169 
   169 
   170 interpretation convex_pd:
   170 interpretation convex_pd:
   171   bifinite_basis [convex_le convex_principal Rep_convex_pd approx_pd]
   171   bifinite_basis [convex_le approx_pd convex_principal Rep_convex_pd]
   172 apply unfold_locales
   172 apply unfold_locales
   173 apply (rule ideal_Rep_convex_pd)
       
   174 apply (rule cont_Rep_convex_pd)
       
   175 apply (rule Rep_convex_principal)
       
   176 apply (simp only: less_convex_pd_def less_set_def)
       
   177 apply (rule approx_pd_convex_le)
   173 apply (rule approx_pd_convex_le)
   178 apply (rule approx_pd_idem)
   174 apply (rule approx_pd_idem)
   179 apply (erule approx_pd_convex_mono)
   175 apply (erule approx_pd_convex_mono)
   180 apply (rule approx_pd_convex_mono1, simp)
   176 apply (rule approx_pd_convex_mono1, simp)
   181 apply (rule finite_range_approx_pd)
   177 apply (rule finite_range_approx_pd)
   182 apply (rule ex_approx_pd_eq)
   178 apply (rule ex_approx_pd_eq)
       
   179 apply (rule ideal_Rep_convex_pd)
       
   180 apply (rule cont_Rep_convex_pd)
       
   181 apply (rule Rep_convex_principal)
       
   182 apply (simp only: less_convex_pd_def less_set_def)
   183 done
   183 done
   184 
   184 
   185 lemma convex_principal_less_iff [simp]:
   185 lemma convex_principal_less_iff [simp]:
   186   "(convex_principal t \<sqsubseteq> convex_principal u) = (t \<le>\<natural> u)"
   186   "(convex_principal t \<sqsubseteq> convex_principal u) = (t \<le>\<natural> u)"
   187 unfolding less_convex_pd_def Rep_convex_principal less_set_def
   187 unfolding less_convex_pd_def Rep_convex_principal less_set_def