theory"TTree-HOLCF" imports TTree "Launchbury.HOLCF-Utils""Set-Cpo""Launchbury.HOLCF-Join-Classes" begin
instantiation ttree :: (type) below begin
lift_definition below_ttree :: "'a ttree ==> 'a ttree ==> bool"is"(⊆)". instance.. end
lemma paths_mono: "t ⊑ t' ==> paths t ⊑ paths t'" by transfer (auto simp add: below_set_def)
lemma paths_mono_iff: "paths t ⊑ paths t' ⟷ t ⊑ t'" by transfer (auto simp add: below_set_def)
lemma ttree_belowI: "(∧ xs. xs ∈ paths t ==> xs ∈ paths t') ==> t ⊑ t'" by transfer auto
lemma paths_belowI: "(∧ x xs. x#xs ∈ paths t ==> x#xs ∈ paths t') ==> t ⊑ t'" apply (rule ttree_belowI) apply (case_tac xs) apply auto done
instance ttree :: (type) po by standard (transfer, simp)+
lemma is_lub_ttree: "S <<| Either S" unfolding is_lub_def is_ub_def by transfer auto
lemma lub_is_either: "lub S = Either S" using is_lub_ttree by (rule lub_eqI)
instance ttree :: (type) cpo by standard (rule exI, rule is_lub_ttree)
lemma minimal_ttree[simp, intro!]: "empty ⊑ S" by transfer simp
instance ttree :: (type) pcpo by standard (rule+)
lemma empty_is_bottom: "empty = ⊥" by (metis below_bottom_iff minimal_ttree)
lemma carrier_bottom[simp]: "carrier ⊥ = {}" unfolding empty_is_bottom[symmetric] by simp
lemma below_anything[simp]: "t ⊑ anything" by transfer auto
lemma carrier_mono: "t ⊑ t' ==> carrier t ⊆ carrier t'" by transfer auto
lemma nxt_mono: "t ⊑ t' ==> nxt t x ⊑ nxt t' x" by transfer auto
lemma either_above_arg1: "t ⊑ t ⊕⊕ t'" by transfer fastforce
lemma either_above_arg2: "t' ⊑ t ⊕⊕ t'" by transfer fastforce
lemma either_belowI: "t ⊑ t'' ==> t' ⊑ t'' ==> t ⊕⊕ t' ⊑ t''" by transfer auto
lemma both_above_arg1: "t ⊑ t ⊗⊗ t'" by transfer fastforce
lemma both_above_arg2: "t' ⊑ t ⊗⊗ t'" by transfer fastforce
lemma both_mono1': "t ⊑ t' ==> t ⊗⊗ t'' ⊑ t' ⊗⊗ t''" using both_mono1[folded below_set_def, unfolded paths_mono_iff].
lemma both_mono2': "t ⊑ t' ==> t'' ⊗⊗ t ⊑ t'' ⊗⊗ t'" using both_mono2[folded below_set_def, unfolded paths_mono_iff].
lemma nxt_both_left: "possible t x ==> nxt t x ⊗⊗ t' ⊑ nxt (t ⊗⊗ t') x" by (auto simp add: nxt_both either_above_arg2)
lemma nxt_both_right: "possible t' x ==> t ⊗⊗ nxt t' x ⊑ nxt (t ⊗⊗ t') x" by (auto simp add: nxt_both either_above_arg1)
lemma substitute_mono1': "f ⊑ f'==> substitute f T t ⊑ substitute f' T t" using substitute_mono1[folded below_set_def, unfolded paths_mono_iff] fun_belowD by metis
lemma substitute_mono2': "t ⊑ t'==> substitute f T t ⊑ substitute f T t'" using substitute_mono2[folded below_set_def, unfolded paths_mono_iff].
lemma substitute_above_arg: "t ⊑ substitute f T t" using substitute_contains_arg[folded below_set_def, unfolded paths_mono_iff].
lemma ttree_contI: assumes"∧ S. f (Either S) = Either (f ` S)" shows"cont f" proof(rule contI) fix Y :: "nat ==> 'a ttree" have"range (λi. f (Y i)) = f ` range Y"by auto alsohave"Either … = f (Either (range Y))"unfolding assms(1).. alsohave"Either (range Y) = lub (range Y)"unfolding lub_is_either by simp finally show"range (λi. f (Y i)) <<| f (⊔ i. Y i)"by (metis is_lub_ttree) qed
lemma ttree_contI2: assumes"∧ x. paths (f x) = ∪(t ` paths x)" assumes"[] ∈ t []" shows"cont f" proof(rule contI) fix Y :: "nat ==> 'a ttree" have"paths (Either (range (λi. f (Y i)))) = insert [] (∪x. paths (f (Y x)))" by (simp add: paths_Either) alsohave"… = insert [] (∪x. ∪(t ` paths (Y x)))" by (simp add: assms(1)) alsohave"… = ∪(t ` insert [] (∪x. paths (Y x)))" using assms(2) by (auto cong add: SUP_cong_simp) alsohave"… = ∪(t ` paths (Either (range Y)))" by (auto simp add: paths_Either) alsohave"… = paths (f (Either (range Y)))" by (simp add: assms(1)) alsohave"… = paths (f (lub (range Y)))"unfolding lub_is_either by simp finally show"range (λi. f (Y i)) <<| f (⊔ i. Y i)"by (metis is_lub_ttree paths_inj) qed
lemma cont_paths[THEN cont_compose, cont2cont, simp]: "cont paths" apply (rule set_contI) apply (thin_tac _) unfolding lub_is_either apply transfer apply auto done
lemma range_filter[simp]: "range (filter P) = {xs. set xs ⊆ Collect P}" apply auto apply (rule_tac x = x in rev_image_eqI) apply simp apply (rule sym) apply (auto simp add: filter_id_conv) done
lemma ttree_restr_anything_cont[THEN cont_compose, simp, cont2cont]: "cont (λ S. ttree_restr S anything)" apply (rule ttree_contI3) apply (rule set_contI) apply (auto simp add: filter_paths_conv_free_restr[symmetric] lub_set) apply (rule finite_subset_chain) apply auto done
instance ttree :: (type) Finite_Join_cpo proof fix x y :: "'a ttree" show"compatible x y" unfolding compatible_def apply (rule exI) apply (rule is_lub_ttree) done qed
lemma ttree_join_is_either: "t ⊔ t' = t ⊕⊕ t'" proof- have"t ⊕⊕ t' = Either {t, t'}"by transfer auto thus"t ⊔ t' = t ⊕⊕ t'"by (metis lub_is_join is_lub_ttree) qed
lemma ttree_join_transfer[transfer_rule]: "rel_fun (pcr_ttree (=)) (rel_fun (pcr_ttree (=)) (pcr_ttree (=))) (∪) (⊔)" proof- have"(⊔) = ((⊕⊕) :: 'a ttree ==> 'a ttree ==> 'a ttree)"using ttree_join_is_either by blast thus ?thesis using either.transfer by metis qed
lemma ttree_restr_join[simp]: "ttree_restr S (t ⊔ t') = ttree_restr S t ⊔ ttree_restr S t'" by transfer auto
lemma nxt_singles_below_singles: "nxt (singles S) x ⊑ singles S" apply auto apply transfer apply auto apply (erule_tac x = xc in ballE) apply (erule order_trans[rotated]) apply (rule length_filter_mono) apply simp apply simp done
lemma in_carrier_fup[simp]: "x' ∈ carrier (fup⋅f⋅u) ⟷ (∃ u'. u = up⋅u' ∧ x' ∈ carrier (f⋅u'))" by (cases u) auto
end
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.10 Sekunden
(vorverarbeitet am 2026-06-10)
¤
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.