(* Title: HOL/HOLCF/UpperPD.thy Author: Brian Huffman *)
section‹Upper powerdomain›
theory UpperPD imports Compact_Basis begin
subsection‹Basis preorder›
definition
upper_le :: "'a::bifinite pd_basis ==> 'a pd_basis ==> bool" (infix‹≤♯› 50) where "upper_le = (λu v. ∀y∈Rep_pd_basis v. ∃x∈Rep_pd_basis u. x ⊑ y)"
lemma upper_le_refl [simp]: "t ≤♯ t" unfolding upper_le_def by fast
lemma PDUnit_upper_mono: "x ⊑ y ==> PDUnit x ≤♯ PDUnit y" unfolding upper_le_def Rep_PDUnit by simp
lemma PDPlus_upper_mono: "[s ≤♯ t; u ≤♯ v]==> PDPlus s u ≤♯ PDPlus t v" unfolding upper_le_def Rep_PDPlus by fast
lemma PDPlus_upper_le: "PDPlus t u ≤♯ t" unfolding upper_le_def Rep_PDPlus by fast
lemma upper_le_PDUnit_PDUnit_iff [simp]: "(PDUnit a ≤♯ PDUnit b) = (a ⊑ b)" unfolding upper_le_def Rep_PDUnit by fast
lemma upper_le_PDPlus_PDUnit_iff: "(PDPlus t u ≤♯ PDUnit a) = (t ≤♯ PDUnit a ∨ u ≤♯ PDUnit a)" unfolding upper_le_def Rep_PDPlus Rep_PDUnit by fast
lemma upper_le_PDPlus_iff: "(t ≤♯ PDPlus u v) = (t ≤♯ u ∧ t ≤♯ v)" unfolding upper_le_def Rep_PDPlus by fast
lemma upper_le_induct [induct set: upper_le]: assumes le: "t ≤♯ u" assumes 1: "∧a b. a ⊑ b ==> P (PDUnit a) (PDUnit b)" assumes 2: "∧t u a. P t (PDUnit a) ==> P (PDPlus t u) (PDUnit a)" assumes 3: "∧t u v. [P t u; P t v]==> P t (PDPlus u v)" shows"P t u" using le proof (induct u arbitrary: t rule: pd_basis_induct) case (PDUnit a) thenshow ?case proof (induct t rule: pd_basis_induct) case PDUnit thenshow ?caseby (simp add: 1) next case (PDPlus t u) from PDPlus(3) consider (t) "t ≤♯ PDUnit a" | (u) "u ≤♯ PDUnit a" by (auto simp: upper_le_PDPlus_PDUnit_iff) thenshow ?case proof cases case t thenhave"P t (PDUnit a)"by (rule PDPlus(1)) thenshow ?thesis by (rule 2) next case u thenhave"P u (PDUnit a)"by (rule PDPlus(2)) thenhave"P (PDPlus u t) (PDUnit a)"by (rule 2) thenshow ?thesis by (simp only: PDPlus_commute) qed qed next case (PDPlus t t' u) thenshow ?caseby (simp add: upper_le_PDPlus_iff 3) qed
definition "x ⊑ y ⟷ Rep_upper_pd x ⊆ Rep_upper_pd y"
instance .. end
instance upper_pd :: (bifinite) po using type_definition_upper_pd below_upper_pd_def by (rule upper_le.typedef_ideal_po)
instance upper_pd :: (bifinite) cpo using type_definition_upper_pd below_upper_pd_def by (rule upper_le.typedef_ideal_cpo)
definition
upper_principal :: "'a::bifinite pd_basis ==> 'a upper_pd"where "upper_principal t = Abs_upper_pd {u. u ≤♯ t}"
interpretation upper_pd:
ideal_completion upper_le upper_principal Rep_upper_pd using type_definition_upper_pd below_upper_pd_def using upper_principal_def pd_basis_countable by (rule upper_le.typedef_ideal_completion)
lemma upper_pd_induct1: assumes P: "adm P" assumes unit: "∧x. P {x}♯" assumes insert: "∧x ys. [P {x}♯; P ys]==> P ({x}♯∪♯ ys)" shows"P (xs::'a::bifinite upper_pd)" proof (induct xs rule: upper_pd.principal_induct) have *: "P {Rep_compact_basis a}♯"for a by (rule unit) show"P (upper_principal a)"for a proof (induct a rule: pd_basis_induct1) case (PDUnit a) with * show ?case by (simp only: upper_unit_Rep_compact_basis [symmetric]) next case (PDPlus a t) with * have"P ({Rep_compact_basis a}♯∪♯ upper_principal t)" by (rule insert) thenshow ?case by (simp only: upper_unit_Rep_compact_basis [symmetric]
upper_plus_principal [symmetric]) qed qed (rule P)
lemma upper_pd_induct [case_names adm upper_unit upper_plus, induct type: upper_pd]: assumes P: "adm P" assumes unit: "∧x. P {x}♯" assumes plus: "∧xs ys. [P xs; P ys]==> P (xs ∪♯ ys)" shows"P (xs::'a::bifinite upper_pd)" proof (induct xs rule: upper_pd.principal_induct) show"P (upper_principal a)"for a proof (induct a rule: pd_basis_induct) case PDUnit thenshow ?case by (simp only: upper_unit_Rep_compact_basis [symmetric] unit) next case PDPlus thenshow ?case by (simp only: upper_plus_principal [symmetric] plus) qed qed (rule P)
subsection‹Monadic bind›
definition
upper_bind_basis :: "'a::bifinite pd_basis ==> ('a → 'b upper_pd) → 'b::bifinite upper_pd"where "upper_bind_basis = fold_pd (λa. Λ f. f⋅(Rep_compact_basis a)) (λx y. Λ f. x⋅f ∪♯ y⋅f)"
lemma approx_chain_upper_map: assumes"approx_chain a" shows"approx_chain (λi. upper_map⋅(a i))" using assms unfolding approx_chain_def by (simp add: lub_APP upper_map_ID finite_deflation_upper_map)
instance upper_pd :: (bifinite) bifinite proof show"∃(a::nat ==> 'a upper_pd → 'a upper_pd). approx_chain a" using bifinite [where 'a='a] by (fast intro!: approx_chain_upper_map) qed
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.