# HG changeset patch # User wenzelm # Date 1733910057 -3600 # Node ID a712bf5ccab09998fb603f55e2224de5778d6377 # Parent 0a01bec9bc1370196681f01cbfabebee6fee421d tuned whitespace; diff -r 0a01bec9bc13 -r a712bf5ccab0 src/HOL/HOLCF/Algebraic.thy --- a/src/HOL/HOLCF/Algebraic.thy Wed Dec 11 10:28:12 2024 +0100 +++ b/src/HOL/HOLCF/Algebraic.thy Wed Dec 11 10:40:57 2024 +0100 @@ -10,6 +10,7 @@ default_sort bifinite + subsection \Type constructor for finite deflations\ typedef 'a fin_defl = "{d::'a \ 'a. finite_deflation d}" @@ -72,6 +73,7 @@ using finite_deflation_Rep_fin_defl by (rule finite_deflation_imp_compact) + subsection \Defining algebraic deflations by ideal completion\ typedef 'a defl = "{S::'a fin_defl set. below.ideal S}" @@ -147,6 +149,7 @@ lemma inst_defl_pcpo: "\ = defl_principal (Abs_fin_defl \)" by (rule defl_minimal [THEN bottomI, symmetric]) + subsection \Applying algebraic deflations\ definition @@ -215,6 +218,7 @@ lemma cast_strict2 [simp]: "cast\A\\ = \" by (rule cast.below [THEN bottomI]) + subsection \Deflation combinators\ definition diff -r 0a01bec9bc13 -r a712bf5ccab0 src/HOL/HOLCF/Bifinite.thy --- a/src/HOL/HOLCF/Bifinite.thy Wed Dec 11 10:28:12 2024 +0100 +++ b/src/HOL/HOLCF/Bifinite.thy Wed Dec 11 10:40:57 2024 +0100 @@ -10,6 +10,7 @@ default_sort cpo + subsection \Chains of finite deflations\ locale approx_chain = @@ -43,6 +44,7 @@ end + subsection \Omega-profinite and bifinite domains\ class bifinite = pcpo + @@ -51,6 +53,7 @@ class profinite = cpo + assumes profinite: "\(a::nat \ 'a\<^sub>\ \ 'a\<^sub>\). approx_chain a" + subsection \Building approx chains\ lemma approx_chain_iso: @@ -155,6 +158,7 @@ using chain_discr_approx lub_discr_approx finite_deflation_discr_approx by (rule approx_chain.intro) + subsection \Class instance proofs\ instance bifinite \ profinite diff -r 0a01bec9bc13 -r a712bf5ccab0 src/HOL/HOLCF/Compact_Basis.thy --- a/src/HOL/HOLCF/Compact_Basis.thy Wed Dec 11 10:28:12 2024 +0100 +++ b/src/HOL/HOLCF/Compact_Basis.thy Wed Dec 11 10:40:57 2024 +0100 @@ -10,6 +10,7 @@ default_sort bifinite + subsection \A compact basis for powerdomains\ definition "pd_basis = {S::'a compact_basis set. finite S \ S \ {}}" @@ -40,6 +41,7 @@ (* FIXME: why doesn't ".." or "by (rule exI)" work? *) qed + subsection \Unit and plus constructors\ definition @@ -91,6 +93,7 @@ apply (rule PDUnit, erule PDPlus [OF PDUnit]) done + subsection \Fold operator\ definition diff -r 0a01bec9bc13 -r a712bf5ccab0 src/HOL/HOLCF/Completion.thy --- a/src/HOL/HOLCF/Completion.thy Wed Dec 11 10:28:12 2024 +0100 +++ b/src/HOL/HOLCF/Completion.thy Wed Dec 11 10:40:57 2024 +0100 @@ -128,6 +128,7 @@ apply (erule (1) below_trans) done + subsection \Lemmas about least upper bounds\ lemma is_ub_thelub_ex: "\\u. S <<| u; x \ S\ \ x \ lub S" @@ -184,6 +185,7 @@ "\i. Y i \ Y (Suc i) \ chain (\i. principal (Y i))" by (simp add: chainI principal_mono) + subsubsection \Principal ideals approximate all elements\ lemma compact_principal [simp]: "compact (principal a)" @@ -296,6 +298,7 @@ apply (drule (2) admD2, fast, simp) done + subsection \Defining functions in terms of basis elements\ definition diff -r 0a01bec9bc13 -r a712bf5ccab0 src/HOL/HOLCF/ConvexPD.thy --- a/src/HOL/HOLCF/ConvexPD.thy Wed Dec 11 10:28:12 2024 +0100 +++ b/src/HOL/HOLCF/ConvexPD.thy Wed Dec 11 10:40:57 2024 +0100 @@ -466,6 +466,7 @@ by (rule finite_range_imp_finite_fixes) qed + subsection \Convex powerdomain is bifinite\ lemma approx_chain_convex_map: @@ -481,6 +482,7 @@ by (fast intro!: approx_chain_convex_map) qed + subsection \Join\ definition diff -r 0a01bec9bc13 -r a712bf5ccab0 src/HOL/HOLCF/Cpo.thy --- a/src/HOL/HOLCF/Cpo.thy Wed Dec 11 10:28:12 2024 +0100 +++ b/src/HOL/HOLCF/Cpo.thy Wed Dec 11 10:40:57 2024 +0100 @@ -558,6 +558,7 @@ end + subsection \Discrete cpos\ class discrete_cpo = below + @@ -799,10 +800,12 @@ apply simp done + section \Admissibility and compactness\ default_sort cpo + subsection \Definitions\ definition adm :: "('a::cpo \ bool) \ bool" @@ -969,6 +972,7 @@ adm_below adm_eq adm_not_below adm_compact_not_below adm_compact_neq adm_neq_compact + section \Class instances for the full function space\ subsection \Full function space is a partial order\ @@ -1109,6 +1113,7 @@ for S :: "nat \ 'a::type \ 'b::cpo" by (simp add: lub_fun ch2ch_lambda) + section \The cpo of cartesian products\ subsection \Unit type is a pcpo\ @@ -1401,6 +1406,7 @@ apply (case_tac "\i. Y i", simp) done + section \Discrete cpo types\ datatype 'a discr = Discr "'a :: type" diff -r 0a01bec9bc13 -r a712bf5ccab0 src/HOL/HOLCF/Deflation.thy --- a/src/HOL/HOLCF/Deflation.thy Wed Dec 11 10:28:12 2024 +0100 +++ b/src/HOL/HOLCF/Deflation.thy Wed Dec 11 10:40:57 2024 +0100 @@ -313,6 +313,7 @@ end + subsection \Uniqueness of ep-pairs\ lemma ep_pair_unique_e_lemma: diff -r 0a01bec9bc13 -r a712bf5ccab0 src/HOL/HOLCF/Domain.thy --- a/src/HOL/HOLCF/Domain.thy Wed Dec 11 10:28:12 2024 +0100 +++ b/src/HOL/HOLCF/Domain.thy Wed Dec 11 10:40:57 2024 +0100 @@ -112,6 +112,7 @@ end + subsection \Proofs about take functions\ text \ @@ -173,6 +174,7 @@ with \chain t\ \(\n. t n) = ID\ show "P x" by (simp add: lub_distribs) qed + subsection \Finiteness\ text \ @@ -264,6 +266,7 @@ shows "(\n. P (d n\x)) \ P x" using lub_ID_finite [OF assms] by metis + subsection \Proofs about constructor functions\ text \Lemmas for proving nchotomy rule:\ @@ -354,6 +357,7 @@ ssum_map_sinl' ssum_map_sinr' sprod_map_spair' u_map_up deflation_strict deflation_ID ID1 cfcomp2 + subsection \ML setup\ named_theorems domain_deflation "theorems like deflation a ==> deflation (foo_map$a)" @@ -416,6 +420,7 @@ unfolding abs_def rep_def by (simp add: emb_prj_emb DEFL) + subsection \Deflations as sets\ definition defl_set :: "'a::bifinite defl \ 'a set" @@ -435,6 +440,7 @@ apply (auto simp add: cast.belowI cast.belowD) done + subsection \Proving a subtype is representable\ text \Temporarily relax type constraints.\ @@ -509,6 +515,7 @@ ML_file \Tools/domaindef.ML\ + subsection \Isomorphic deflations\ definition isodefl :: "('a \ 'a) \ udom defl \ bool" @@ -671,6 +678,7 @@ using isodefl_sfun [OF assms] unfolding isodefl_def by (simp add: emb_cfun_def prj_cfun_def cfcomp1 encode_cfun_map) + subsection \Setting up the domain package\ named_theorems domain_defl_simps "theorems like DEFL('a t) = t_defl$DEFL('a)" diff -r 0a01bec9bc13 -r a712bf5ccab0 src/HOL/HOLCF/Fixrec.thy --- a/src/HOL/HOLCF/Fixrec.thy Wed Dec 11 10:28:12 2024 +0100 +++ b/src/HOL/HOLCF/Fixrec.thy Wed Dec 11 10:40:57 2024 +0100 @@ -285,6 +285,7 @@ "succeed\x \ fail" "fail \ succeed\x" by (simp_all add: succeed_def fail_def cont_Abs_match Abs_match_inject) + subsubsection \Run operator\ definition @@ -305,6 +306,7 @@ unfolding run_def succeed_def by (simp add: cont_Rep_match cont_Abs_match Abs_match_inverse) + subsubsection \Monad plus operator\ definition @@ -335,6 +337,7 @@ lemma mplus_assoc: "(x +++ y) +++ z = x +++ (y +++ z)" by (cases x, simp_all) + subsection \Match functions for built-in types\ default_sort pcpo @@ -431,6 +434,7 @@ "match_FF\\\k = \" by (simp_all add: match_FF_def) + subsection \Mutual recursion\ text \ diff -r 0a01bec9bc13 -r a712bf5ccab0 src/HOL/HOLCF/Lift.thy --- a/src/HOL/HOLCF/Lift.thy Wed Dec 11 10:28:12 2024 +0100 +++ b/src/HOL/HOLCF/Lift.thy Wed Dec 11 10:40:57 2024 +0100 @@ -19,6 +19,7 @@ Def :: "'a \ 'a lift" where "Def x = Abs_lift (up\(Discr x))" + subsection \Lift as a datatype\ lemma lift_induct: "\P \; \x. P (Def x)\ \ P y" @@ -70,6 +71,7 @@ by (induct x) auto qed + subsection \Continuity of \<^const>\case_lift\\ lemma case_lift_eq: "case_lift \ f x = fup\(\ y. f (undiscr y))\(Rep_lift x)" @@ -82,6 +84,7 @@ "\\y. cont (\x. f x y); cont g\ \ cont (\x. case_lift \ (f x) (g x))" unfolding case_lift_eq by (simp add: cont_Rep_lift) + subsection \Further operations\ definition diff -r 0a01bec9bc13 -r a712bf5ccab0 src/HOL/HOLCF/LowerPD.thy --- a/src/HOL/HOLCF/LowerPD.thy Wed Dec 11 10:28:12 2024 +0100 +++ b/src/HOL/HOLCF/LowerPD.thy Wed Dec 11 10:40:57 2024 +0100 @@ -459,6 +459,7 @@ by (rule finite_range_imp_finite_fixes) qed + subsection \Lower powerdomain is bifinite\ lemma approx_chain_lower_map: @@ -474,6 +475,7 @@ by (fast intro!: approx_chain_lower_map) qed + subsection \Join\ definition diff -r 0a01bec9bc13 -r a712bf5ccab0 src/HOL/HOLCF/Powerdomains.thy --- a/src/HOL/HOLCF/Powerdomains.thy Wed Dec 11 10:28:12 2024 +0100 +++ b/src/HOL/HOLCF/Powerdomains.thy Wed Dec 11 10:40:57 2024 +0100 @@ -31,6 +31,7 @@ unfolding convex_emb_def convex_prj_def by (simp add: ep_pair_udom approx_chain_convex_map) + subsection \Deflation combinators\ definition upper_defl :: "udom defl \ udom defl" @@ -57,6 +58,7 @@ using ep_pair_convex finite_deflation_convex_map unfolding convex_defl_def by (rule cast_defl_fun1) + subsection \Domain class instances\ instantiation upper_pd :: ("domain") "domain" @@ -167,6 +169,7 @@ lemma DEFL_convex: "DEFL('a::domain convex_pd) = convex_defl\DEFL('a)" by (rule defl_convex_pd_def) + subsection \Isomorphic deflations\ lemma isodefl_upper: @@ -193,6 +196,7 @@ apply (simp add: convex_map_map) done + subsection \Domain package setup for powerdomains\ lemmas [domain_defl_simps] = DEFL_upper DEFL_lower DEFL_convex diff -r 0a01bec9bc13 -r a712bf5ccab0 src/HOL/HOLCF/Representable.thy --- a/src/HOL/HOLCF/Representable.thy Wed Dec 11 10:28:12 2024 +0100 +++ b/src/HOL/HOLCF/Representable.thy Wed Dec 11 10:40:57 2024 +0100 @@ -10,6 +10,7 @@ default_sort cpo + subsection \Class of representable domains\ text \ @@ -88,6 +89,7 @@ lemmas emb_strict = domain.e_strict lemmas prj_strict = domain.p_strict + subsection \Domains are bifinite\ lemma approx_chain_ep_cast: @@ -126,6 +128,7 @@ instance predomain \ profinite by standard (rule approx_chain_ep_cast [OF predomain_ep cast_liftdefl]) + subsection \Universal domain ep-pairs\ definition "u_emb = udom_emb (\i. u_map\(udom_approx i))" @@ -163,6 +166,7 @@ unfolding sfun_emb_def sfun_prj_def by (simp add: ep_pair_udom approx_chain_sfun_map) + subsection \Type combinators\ definition u_defl :: "udom defl \ udom defl" @@ -223,6 +227,7 @@ by (rule cast_eq_imp_eq) (simp add: cast_u_liftdefl cast_liftdefl_of cast_u_defl) + subsection \Class instance proofs\ subsubsection \Universal domain\ @@ -267,6 +272,7 @@ end + subsubsection \Lifted cpo\ instantiation u :: (predomain) "domain" @@ -304,6 +310,7 @@ lemma DEFL_u: "DEFL('a::predomain u) = u_liftdefl\LIFTDEFL('a)" by (rule defl_u_def) + subsubsection \Strict function space\ instantiation sfun :: ("domain", "domain") "domain" @@ -342,6 +349,7 @@ "DEFL('a::domain \! 'b::domain) = sfun_defl\DEFL('a)\DEFL('b)" by (rule defl_sfun_def) + subsubsection \Continuous function space\ instantiation cfun :: (predomain, "domain") "domain" @@ -382,6 +390,7 @@ "DEFL('a::predomain \ 'b::domain) = DEFL('a u \! 'b)" by (rule defl_cfun_def) + subsubsection \Strict product\ instantiation sprod :: ("domain", "domain") "domain" @@ -420,6 +429,7 @@ "DEFL('a::domain \ 'b::domain) = sprod_defl\DEFL('a)\DEFL('b)" by (rule defl_sprod_def) + subsubsection \Cartesian product\ definition prod_liftdefl :: "udom u defl \ udom u defl \ udom u defl" @@ -508,6 +518,7 @@ prod_liftdefl\LIFTDEFL('a)\LIFTDEFL('b)" by (rule liftdefl_prod_def) + subsubsection \Unit type\ instantiation unit :: "domain" @@ -541,6 +552,7 @@ end + subsubsection \Discrete cpo\ instantiation discr :: (countable) predomain @@ -586,6 +598,7 @@ end + subsubsection \Strict sum\ instantiation ssum :: ("domain", "domain") "domain" @@ -624,6 +637,7 @@ "DEFL('a::domain \ 'b::domain) = ssum_defl\DEFL('a)\DEFL('b)" by (rule defl_ssum_def) + subsubsection \Lifted HOL type\ instantiation lift :: (countable) "domain" diff -r 0a01bec9bc13 -r a712bf5ccab0 src/HOL/HOLCF/Universal.thy --- a/src/HOL/HOLCF/Universal.thy Wed Dec 11 10:28:12 2024 +0100 +++ b/src/HOL/HOLCF/Universal.thy Wed Dec 11 10:40:57 2024 +0100 @@ -10,6 +10,7 @@ no_notation binomial (infix \choose\ 64) + subsection \Basis for universal domain\ subsubsection \Basis datatype\ @@ -79,6 +80,7 @@ apply (simp add: 2 node_gt1 node_gt2) done + subsubsection \Basis ordering\ inductive @@ -105,6 +107,7 @@ apply (erule (1) ubasis_le_trans) done + subsubsection \Generic take function\ function @@ -275,6 +278,7 @@ approx_chain approx for approx :: "nat \ 'a::bifinite \ 'a" begin + subsubsection \Choosing a maximal element from a finite set\ lemma finite_has_maximal: @@ -389,6 +393,7 @@ apply (simp add: choose_pos.simps) done + subsubsection \Compact basis take function\ primrec @@ -443,6 +448,7 @@ apply (rule inj_onI, simp add: Rep_compact_basis_inject) done + subsubsection \Rank of basis elements\ definition @@ -522,6 +528,7 @@ lemma rank_lt_Un_rank_eq: "rank_lt x \ rank_eq x = rank_le x" unfolding rank_lt_def rank_eq_def rank_le_def by auto + subsubsection \Sequencing basis elements\ definition @@ -571,6 +578,7 @@ lemma inj_place: "inj place" by (rule inj_onI, erule place_eqD) + subsubsection \Embedding and projection on basis elements\ definition @@ -831,6 +839,7 @@ by (rule bifinite_approx_chain.ideal_completion) qed + subsubsection \EP-pair from any bifinite domain into \emph{udom}\ context bifinite_approx_chain begin @@ -879,6 +888,7 @@ lemmas ep_pair_udom = bifinite_approx_chain.ep_pair_udom [unfolded bifinite_approx_chain_def] + subsection \Chain of approx functions for type \emph{udom}\ definition diff -r 0a01bec9bc13 -r a712bf5ccab0 src/HOL/HOLCF/UpperPD.thy --- a/src/HOL/HOLCF/UpperPD.thy Wed Dec 11 10:28:12 2024 +0100 +++ b/src/HOL/HOLCF/UpperPD.thy Wed Dec 11 10:40:57 2024 +0100 @@ -452,6 +452,7 @@ by (rule finite_range_imp_finite_fixes) qed + subsection \Upper powerdomain is bifinite\ lemma approx_chain_upper_map: @@ -467,6 +468,7 @@ by (fast intro!: approx_chain_upper_map) qed + subsection \Join\ definition