Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/Isabelle/HOL/HOLCF/   (Beweissystem Isabelle Version 2025-1©)  Datei vom 16.11.2025 mit Größe 19 kB image not shown  

Quelle  Universal.thy   Sprache: Isabelle

 
(*  Title:      HOL/HOLCF/Universal.thy
    Author:     Brian Huffman
*)


java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

theory
importsbasis_until_mono  assumes "\i a S b. \finite S; P (node i a S); b \ S; ubasis_le a b\ \ P b"
begin

unbundle no  shows "ubasis_le a b \ ubasis_le (ubasis_until P a) (ubasis_until P b)"


subsection \<open>Basis for universal domain\<close>

subsubsection  case (ubasis_le_trans a b c) thus ?case bynext

type_synonym ubasis = natnext

definition
  node    by (metis assms ubasis_le.simps
where
  "node i a apply (rule finite_subset [where B="java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 40

java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
unfolding node_def byjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

lemma java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
unfolding node_def by simpby (rule

lemma node_inject  "udom_principal t = Abs_udom {u. java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  " ideal_completion ubasis_le udom_principal Rep_udom
    \<Longrightarrow> node i a S = node j b T \<longleftrightarrow> i = j \<and> a = b \<and> S = T"usingby (rule
unfoldingapply (inductapply (simp,java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4

lemma node_gt0by (rule
unfolding node_def less_Suc_eq_le
by typedef 'a compact_basis = "{x::'by auto

lemma node_gt1: "java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
unfolding node_def less_Suc_eq_leby (rule java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 0
  compact_le_def    "(\) \ (\x y. Rep_compact_basis x \ Rep_compact_basis y)"

lemma nat_less_power2:nstanceend
  by (factusing type_definition_compact_basisby (rule

lemma node_gt2  "approximants = (\x. {a. Rep_compact_basis a \ x})"
unfolding node_defdefinition
apply (rule  "compact_bot = Abs_compact_basis \"
applylemma Rep_compact_bot [simpunfolding compact_bot_def java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
apply (java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
apply (simp add: nat_less_power2 [THEN order_less_imp_le])
apply (erule sum_mono2, simp, simp)
done

lemma eq_prod_encode_pairI:
  "java.lang.StringIndexOutOfBoundsException: Range [0, 85) out of bounds for length 30
  by  case     show ?case java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4

lemma node_cases:
  assumes 1: "x = 0 \ P"
  java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
  shows "P"
 apply (cases x)
  apply    thus "(if x \ a then a else x) = y"
 apply (rule      apply (frule      apply (frule (1) x_eq      apply (rule below_antisym, assumption      apply simp      apply (erule (1)       done
where
 apply (simp add: node_def)
 apply (rule eq_prod_encode_pairI
lemma choose_lemma  "\finite A; A \ {}\ \ choose A \ {x\A. \y\A. x \ y \ x = y}"
done

lemma node_induct:
  assumesapply (ruleapply (frule (1) finite_has_maximaldone
  assumes 2: "\i a S. \P a; finite S; \b\S. P b\ \ P (node i a S)"
  shows "P xapply (frule (1) choose_lemma, simp)
 apply (lemma choose_in: "\finite A; A \ {}\ \ choose A \ A"
 apply (case_tacby (frule (1) choose_lemma
  apply (simp add: 1)
 apply (simp add: 2 node_gt1 node_gt2where  "choose_pos A x (if finite A \ x \ A \ x \ choose A
done


subsubsection

inductive
  ubasis_leapply (relation "measure (cardapply clarsimp
where assumptionapply (erule choose_inapply java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
  ubasis_le_refl  "\card A = n; finite A\ \ inj_on (choose_pos A) A"
apply (induct n   apply simp
    " apply (frule (1) choose_in)
| ubasis_le_lower apply (apply (drule_tac x="A - apply (simp add: choose_pos.simps)
    "finite S \ ubasis_le a (node i a S)"
| ubasis_le_upper
    "\finite S; b \ S; ubasis_le a b\ \ ubasis_le (node i a S) b"

lemma ubasis_le_minimal: "ubasis_le 0 x"
apply (inductapply (induct n arbitraryapply simp apply (case_tac apply (fruleapply (subst choose_pos.simps)
apply (rule ubasis_le_refl)
apply simp
apply (done
done

interpretation udomlemma choose_pos_lessD  "\choose_pos A x < choose_pos A y; finite A; x \ A; y \ A\ \ x \ y"
apply standard
apply (rule ubasis_le_refl)
apply (erule apply (induct A x arbitrary: y rule apply simp apply (case_tac "x = choose A"  apply simp
done apply (case_tac "y = choose apply (simp add: choose_pos_choose)


subsubsection apply (erule  apply (simp add: done

function
  ubasis_until :: "java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
where
  "ubasis_until P| "cb_take (Suc n) = (| "cb_take (Suc n) = (\<lambda>a. Abs_compact_basis (approx n\<cdot>(Rep_compact_basis a)))"
|  "Rep_compact_basis (cb_take (Suc n) a)by (simp add: cb_take
apply (ruleapply (rule
   applylemma cb_take_less: "cb_take n x unfolding compact_le_def
   lemma cb_take_idem: "cb_take n (cb_take n x) = cb_take n x"
    apply simp_allby (cases n, simp
done

termination ubasis_untilunfolding compact_le_defby (cases n, java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
apply (relation "measure snd")
applyapply (subgoal_tac "range (cb_take 0) = {apply (rule finite_imageD [where f="Rep_compact_basis"])
apply (simp add: node_gt1)
doneapply (clarsimp simp addapply (ruleapply (rule inj_onIdone

lemma ubasis_until: java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5

lemma ubasis_until
by (inductlemma compact_approx_rank: "cb_take (rank xunfolding rank_def

lemma ubasis_until_same
by (induct x rule: node_induct) simp_allapply (rule below_antisym [apply (subst compact_approx_rank [apply (erule cb_take_chain_ledone

java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 0
  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
by (rule ubasis_until_same

lemma ubasis_until_0:
  "\x. x \ 0 \ \ P x \ ubasis_until P x = 0"
by (induct java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

lemma ubasis_until_less: "ubasis_le (ubasis_until java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
apply (java.lang.StringIndexOutOfBoundsException: Range [0, 13) out of bounds for length 10
apply (simp 
  by (metisdefinition

lemma ubasis_until_chain:
  assumes  "rank_eq x = {y. rank y =
  shows "ubasis_le (ubasis_until P x) (ubasis_until Q x)"
apply (inductlemma rank_lt_cong: "rankunfolding rank_lt_def by simp
apply (simpunfolding rank_eq_def
  by (metisunfolding rank_lt_def

lemma ubasis_until_mono:
  assumesapply (ruleapply (erule rank_leD [symmetric])
  shows
prooflemma finite_rank_eq: "finite (rank_eq x)"
  casejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
next
  lemma rank_lt_Int_rank_eq: "rank_lt x \ rank_eq x = {}"
next
  case (ubasis_le_lowerjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    by (metis ubasis_le.simps ubasis_until.simps(2) ubasis_until_less)lemma rank_lt_Un_rank_eq: "rank_lt x \ rank_eq x = rank_le x"
next
  casesubsubsection \<open>Sequencing basis elements\<close>
java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
qed

lemma finite_range_ubasis_until:
  "finite {x. P x} \ finite (range (ubasis_until P))"
apply (rule finite_subset [where B="insert 0 {x. P x}"])
apply (clarsimp simp add: ubasis_until')
apply simp
done


subsection \<open>Defining the universal domain by ideal completion\<close>

typedef udom  "place x = card (rank_lt x) + choose_pos (rank_eq x) x"
by (rulelemma place_bounded: "place x < card (rank_le x)"

instantiation  apply (rule add_strict_left_mono)
   apply (rule finite_rank_eq)

definition
  "x \ y \ Rep_udom x \ Rep_udom y"

instance ..
end

instance udom :: po  apply (rule  apply (simp add: java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
usinglemma place_rank_mono:
by (rule udom.typedef_ideal_po  shows "rank x < rank y \ place x < place y"

instance udomapply (rule order_transapply (rule card_monoapply (rule finite_rank_ltapply (simp add: rank_le_def rank_lt_def subset_eq)
using type_definition_udom below_udom_def apply (rule linorder_cases [where x="rank x" and   apply (drule place_rank_mono, simp  apply (simp add: place_def  apply (rule inj_on_choose_pos [where      apply (rule finite_rank_eq)
by (rule udomby (rule inj_onI

subsubsection \<open>Embedding and projection on basis elements\<close>
  java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
  "udom_principal tlemma rank_sub_less: "\<noteq> compact_bot \<Longrightarrow> rank (sub x) < rank x"

lemmaapply (simpapply (rule rank_leIapply (ruledone
by (rule exIapply (ruleapply (eruledone

unfolding sub_def by (cases
  ideal_completion ubasis_le udom_principal Rep_udomunfoldingapply (cases "rank y",apply (simp apply (subgoal_tac "cb_take nat
using type_definition_udom below_udom_def  where "basis_emb x = (if x = compact_bot then 0 else
using udom_principal_def ubasis_countable
by (ruletermination   by (relation "measure place

text

lemma  "basis_emb compact_bot = 0"
apply (induct x rule
apply (simp  "basis_emb x = node (place x) (basis_emb (sub x)) (basis_emb ` {y. place y < place x if "\<noteq> compact_bot"
done

instance udom :: pcpo
by intro_classes

lemma inst_udom_pcpo: "\ = udom_principal 0"
by (rule udom_minimal [THEN bottomI  by (cases "x = compact_bot") (simp_all add: basis_emb_rec


subsection \<open>Compact bases of domains\<close>apply (rule finite_Intapply (rule disjI1apply (subgoal_tac "finite (apply (rule finite_vimageI [OF _ inj_place])

typedef 'aby (rule finite_imageI [OF fin1])
by auto  "\place x < place y; x \ y\ \ rank x < rank y"

lemma applyapplyapply (ruleapply (simpapply (simp apply simp
by (rule

lemma Abs_compact_basis_inverse' "x \ y \ ubasis_le (basis_emb x) (basis_emb y)"
   "compact x \ Rep_compact_basis (Abs_compact_basis x) = x"
by (rule    assume "place x < < rank y"

instantiation    with \<open>place x < place y\<close> show ?case
begin

definition      apply (rule ubasis_le_trans      apply (rule        apply (simp add: less_max_iff_disj)
      done
      next

instance ..
    hence "x = y" by (rule    thus ?case by (simp  next

instance compact_basis :: (pcpo      apply (case_tac "x = compact_bot", simp add      apply (simp add: basis_emb.simps [of      apply (rule ubasis_le_upper      apply       apply (simp add       apply (erule place_sub_less      apply (erule rev_below_trans      apply (rule      done
using type_definition_compact_basisqed
by (java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10

definition    (ubasis_until (\<lambda>x. x \<in> range (basis_emb :: 'a compact_basis \<Rightarrow> ubasis)) x)"
  approximants
  "approximants = (\x. {a. Rep_compact_basis a \ x})"

definition
   apply (subst ubasis_until_same)
  "compact_bot = Abs_compact_basis \"

lemma Rep_compact_botdone
unfolding compact_bot_def lemma basis_prj_node:

lemma compact_bot_minimal    \<Longrightarrow> basis_prj (node i a S) = (basis_prj a :: 'a compact_basis)"
unfolding compact_le_defapply (subst basis_emb_compact_bot [symmetric])


subsection \<open>Universality of \emph{udom}\<close>

textapply (cases "x = compact_bot", simpapply (simp add: basis_embapply (simp add: fin2done
of approx functionsproof (induct a b refl a) show ?case by (rulenext

locale bifinite_approx_chain  case (ubasis_le_lower S a i) thus    apply (cases "node i a S \ range (basis_emb :: 'a compact_basis \ nat)")
     apply (simp add: basis_prj_basis_emb)
begin


subsubsection     apply (rule sub_below)

lemma finite_has_maximal:
  fixes A :: "'a case (ubasis_le_upper S b a i) thus ?case
  shows     apply (erule rangeE     apply (simp add     apply (clarsimp simp add: node_eq_basis_emb_iff     apply (simp add: basis_prj_basis_emb    apply (simp add: basis_prj_node)
proof (induct rule: finite_ne_induct)
  case (singleton x)
    show ?case by simp
next
  case (insert a A)
  from \<open>\<exists>x\<in>A. \<forall>y\<in>A. x \<sqsubseteq> y \<longrightarrow> x = y\<close>
  obtain x where x:   apply (rule ubasis_until)
  apply simp
  show ?case
  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    fix y
      show "below.ideal (approximants w)"
    thus "(if x \ a then a else x) = y"
      apply auto    thus "\x. x \ approximants w" ..
      apply (frule (1) below_trans)
      apply (frule (1) x_eq)
      apply (rule    obtain i where i: "approx i\(Rep_compact_basis x) = Rep_compact_basis x"
          obtain j where j: "approx j\(Rep_compact_basis y) = Rep_compact_basis y"
      apply (erule (    let ?z = "Abs_compact_basis (approx (max i j)\w)"
      done
  next
    show "(if by (simp add: approximants_def compact_le_def)
      by (simp add    ultimately show "\z \ approximants w. x \ z \ y \ z" ..
  qed
qed

definition
  choose :: "'a approximants_def compact_le_def
where
  "choose A = (SOME x. x \ {x\A. \y\A. x \ y \ x = y})"

lemma java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 5
  "\finite A; A \ {}\ \ choose A \ {x\A. \y\A. x \ y \ x = y}"
unfolding choose_def
apply (rule someI_ex)next
apply (frule (1) nts (Rep_compact_basis a) = {b. b \<sqsubseteq> a}"
done  fix x y :: "'a"

lemma maximal_choose:
  "\finite A; y \ A; choose A \ y\ \ choose A = y"
apply (cases "A = approximants_def subset_eq)
apply (frule       (metis Abs_compact_basis_inverse')
done

lemma choose_in: "\finite A; A \ {}\ \ choose A \ A"
by  by (simp addnext

function
  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
where
  "choose_pos A x =
    (if    using bifinite  hence "bifinite_approx_chain a unfolding bifinite_approx_chain_def .
      then Sucqed
by auto

termination choose_pos
apply (relation context bifinite_approx_chain begin
apply clarsimp
apply (rule card_Diff1_less)
apply assumption
apply (erule choose_in)
apply clarsimp
done

declare  udom_prj :: "udom \ 'a"

lemma choose_pos_choose: "finite A \ choose_pos A (choose A) = 0"
by (simp add: choose_pos.simpslemma udom_emb_principal:

lemma inj_on_choose_pos [OF refl]:
  "\card A = n; finite A\ \ inj_on (choose_pos A) A"
 apply (inductapply (rule compact_basis.extension_principalapply (rule udom.principal_monoapply (erule basis_emb_mono)
  apply simplemma udom_prj_principal:
 apply (case_tac "A = {}", simp)
 apply (fruleapply (rule udom.extension_principal)apply (rule compact_basis.principal_mono)
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
 apply (drule_tac apply standard
 apply (simp  apply (rule compact_basis.principal_induct, simp)
 apply (simp split  apply (simp add: basis_prj_basis_emb)
  apply (simp add: udom_emb_principal udom_prj_principal)
done

lemma choose_pos_bounded [OF reflend
  "\card A = n; finite A; x \ A\ \ choose_pos A x < n"
apply (induct n arbitrary: A)
apply simp
 apply (case_tac "A java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 apply (frulejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
apply (substsubsection \<open>Chain of approx functions for type \emph{udom}\<close>
apply simp
done

lemma   "udom_approx i =
  "\choose_pos A x < choose_pos A y; finite A; x \ A; y \ A\ \ x \ y"
 apply (inductlemma udom_approx_mono:
 apply simp
 apply (case_tac "x = choose A")
  apply simp
  apply (rule notI)
  apply (frule (2) maximal_chooseapply (ruleapply (frule (2) order_less_le_trans [OF node_gt2apply (erule order_less_imp_le)
  apply simp
 apply (case_tac "y = choose Ak>cont f; finite S\ \ adm (\x. f x \ S)"
  apply (simp add: choose_pos_chooseby (erule adm_subst, induct set: finite, java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 apply (drule_tacunfolding udom_approx_def
apply (erule udom_approx_mono)
 apply (erule meta_mp)
 apply (simp lemma finite_deflation_udom_approx: "finite_deflation (udom_approx i)"
done


subsubsection \<open>Compact basis take function\<close>    by (induct x rule: udom.principal_induct       (simp add: udom_approx_principal ubasis_until_idem)

primrec
  cb_take :: "nat \ 'a compact_basis \ 'a compact_basis" where
  "cb_take 0 = (java.lang.StringIndexOutOfBoundsException: Range [0, 19) out of bounds for length 4
"cb_take (Suc n) = (\a. Abs_compact_basis (approx n\(Rep_compact_basis a)))"

declare    done

lemma cb_take_zero [simp]: "cb_take 0 a apply (rule finite_range_imp_finite_fixes)
by (simp    apply (rule rev_finite_subset [OF *])

lemma Rep_cb_take:
  " apply (simp add: adm_mem_finitejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
by (simp add.simps())

lemmas     done

lemma cb_take_covers: "\n. cb_take n x = x"
apply (subgoal_tac udom_approx: finite_deflation "
apply (simp add: Rep_compact_basis_inject [symmetric])
apply (simp add: Rep_cb_take)
apply (rule compact_eq_approx)
apply (rule Rep_compact_basis')
done

lemma cb_take_less: "cb_take n x \ x"
unfolding compact_le_def
by

cb_take_idem  cb_takecb_take
unfolding Rep_compact_basis_inject [symmetric]
by (cases n, simp( chainI

ke_mono:"x\ y \ cb_take n x \ cb_take n y"
unfolding compact_le_def
by ( n, simp add Rep_cb_take)

lemma : "m\java.lang.StringIndexOutOfBoundsException: Index 91 out of bounds for length 91
unfoldingjava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
apply ( m, simp n, )
apply (simp add: Rep_cb_take,java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
done

lemma finite_range_cb_take: "finite (range (cb_take n))"
apply(ases
apply (subgoal_tac "range (apply (rule cfun_eqI, simp : contlub_cfun_fun)
apply (rule [where""])
apply (rule finite_subset [where B="apply(rule lub_below)
apply (clarsimp simp()
apply (rule finite_range_approx)
apply ( inj_onI, simp add Rep_compact_basis_inject
done


subsubsection \<open>Rank of basis elements\<close>

definition
  rank :: "'a compact_basis \ nat"
where
  "ank = (LEAST n. cb_taken x"

lemma compact_approx_rank: "cb_take (rank x) x = x"
unfolding rank_def
apply (rule java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 10
apply ( cb_take_covers
done

lemma : " x \ n \ cb_take n x = x"
apply (rule below_antisymdone
apply (subst compact_approx_rank [symmetric])
 ( cb_take_chain_le
done

lemma   show (\<lambda>i. udom_approx i)"
 rank_def rule)

lemma rank_le_iff:   "(\i. udom_approx i) = ID"
by ( iffIOF  rank_leI

lemmajava.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
using rank_leI [of 0 compact_bot udom: bifinite

lemmarank_eq_0_iff]: "rank =0\ x = compact_bot"
using rank_le_iff [of x 0] by auto

definition
  rank_le :: "'hide_const (open) node
where
  "rank_le x = {y.unbundle binomial_syntax

definition
  rank_lt: 'acompact_basis\ 'a compact_basis set"
where
  "rank_lt x = {y. rank y < rank x}"

definition
  rank_eq :: "'a compact_basis \ 'a compact_basis set"
where
  "rank_eq x = {y. rank y = rank x}"

lemma rank_eq_cong: "rank x = rank y \ rank_eq x = rank_eq y"
unfolding rank_eq_def by simp

lemma rank_lt_cong: "rank x = rank y \ rank_lt x = rank_lt y"
unfolding rank_lt_def by simp

lemma rank_eq_subset: "rank_eq x \ rank_le x"
unfolding rank_eq_def rank_le_def by auto

lemma rank_lt_subset: "rank_lt x \ rank_le x"
unfolding rank_lt_def rank_le_def by auto

lemma finite_rank_le: "finite (rank_le x)"
unfolding rank_le_def
apply (rule finite_subset [where B="range (cb_take (rank x))"])
apply clarify
apply (rule range_eqI)
apply (erule rank_leD [symmetric])
apply (rule finite_range_cb_take)
done

lemma finite_rank_eq: "finite (rank_eq x)"
by (rule finite_subset [OF rank_eq_subset finite_rank_le])

lemma finite_rank_lt: "finite (rank_lt x)"
by (rule finite_subset [OF rank_lt_subset finite_rank_le])

lemma rank_lt_Int_rank_eq: "rank_lt x \ rank_eq x = {}"
unfolding rank_lt_def rank_eq_def rank_le_def by auto

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 \<open>Sequencing basis elements\<close>

definition
  place :: "'a compact_basis \ nat"
where
  "place x = card (rank_lt x) + choose_pos (rank_eq x) x"

lemma place_bounded: "place x < card (rank_le x)"
unfolding place_def
 apply (rule ord_less_eq_trans)
  apply (rule add_strict_left_mono)
  apply (rule choose_pos_bounded)
   apply (rule finite_rank_eq)
  apply (simp add: rank_eq_def)
 apply (subst card_Un_disjoint [symmetric])
    apply (rule finite_rank_lt)
   apply (rule finite_rank_eq)
  apply (rule rank_lt_Int_rank_eq)
 apply (simp add: rank_lt_Un_rank_eq)
done

lemma place_ge: "card (rank_lt x) \ place x"
unfolding place_def by simp

lemma place_rank_mono:
  fixes x y :: "'a compact_basis"
  shows "rank x < rank y \ place x < place y"
apply (rule less_le_trans [OF place_bounded])
apply (rule order_trans [OF _ place_ge])
apply (rule card_mono)
apply (rule finite_rank_lt)
apply (simp add: rank_le_def rank_lt_def subset_eq)
done

lemma place_eqD: "place x = place y \ x = y"
 apply (rule linorder_cases [where x="rank x" and y="rank y"])
   apply (drule place_rank_mono, simp)
  apply (simp add: place_def)
  apply (rule inj_on_choose_pos [where A="rank_eq x"THEN inj_onD])
     apply (rule finite_rank_eq)
    apply (simp cong: rank_lt_cong rank_eq_cong)
   apply (simp add: rank_eq_def)
  apply (simp add: rank_eq_def)
 apply (drule place_rank_mono, simp)
done

lemma inj_place: "inj place"
by (rule inj_onI, erule place_eqD)


subsubsection \<open>Embedding and projection on basis elements\<close>

definition
  sub :: "'a compact_basis \ 'a compact_basis"
where
  "
sub x = (case rank x of 0 \<Rightarrow> compact_bot | Suc k \<Rightarrow> cb_take k x)"

lemma rank_sub_less: "x \ compact_bot \ rank (sub x) < rank x"
unfolding sub_def
apply (cases "rank x", simp)
apply (simp add: less_Suc_eq_le)
apply (rule rank_leI)
apply (rule cb_take_idem)
done

lemma place_sub_less: "x \ compact_bot \ place (sub x) < place x"
apply (rule place_rank_mono)
apply (erule rank_sub_less)
done

lemma sub_below: "sub x \ x"
unfolding sub_def by (cases "rank x", simp_all add: cb_take_less)

lemma rank_less_imp_below_sub: "\x \ y; rank x < rank y\ \ x \ sub y"
unfolding sub_def
apply (cases "rank y", simp)
apply (simp add: less_Suc_eq_le)
apply (subgoal_tac "cb_take nat x \ cb_take nat y")
apply (simp add: rank_leD)
apply (erule cb_take_mono)
done

function basis_emb :: "'a compact_basis \ ubasis"
  where "basis_emb x = (if x = compact_bot then 0 else
    node (place x) (basis_emb (sub x))
      (basis_emb ` {y. place(*  Title:      HOL/HOLCF/Universal.thy
  by simp_all

termination basis_emb
  by (relation "measure place") (simp_all add: place_sub_less)

declare basis_emb.simps [simp del]

lemma basis_emb_compact_bot [simp]:
  "basis_emb compact_bot = 0"
  using basis_emb.simps [of compact_bot] by simp

lemma basis_emb_rec:
  "basis_emb x = node (place x) (basis_emb (sub x)) (basis_emb ` {y. place y < place x \<and> x \<sqsubseteq> y})"
  if "x \<noteq> compact_bot"
  using that basis_emb.simps [of x] by simp

lemma basis_emb_eq_0_iff [simp]:
  "basis_emb x = 0 \<longleftrightarrow> x = compact_bot"
  by (cases "x = compact_bot") (simp_all add: basis_emb_rec)

lemma fin1: "finite {y. place y < place x \<and> x \<sqsubseteq> y}"
apply (subst Collect_conj_eq)
apply (rule finite_Int)
apply (rule disjI1)
apply (subgoal_tac "finite (place -` {n. n < place x})", simp)
apply (rule finite_vimageI [OF _ inj_place])
apply (simp add: lessThan_def [symmetric])
done

lemma fin2: "finite (basis_emb ` {y. place y < place x \<and> x \<sqsubseteq> y})"
by (rule finite_imageI [OF fin1])

lemma rank_place_mono:
  "\<lbrakk>place x < place y; x \<sqsubseteq> y\<rbrakk> \<Longrightarrow> rank x < rank y"
apply (rule linorder_cases, assumption)
apply (simp add: place_def cong: rank_lt_cong rank_eq_cong)
apply (drule choose_pos_lessD)
apply (rule finite_rank_eq)
apply (simp add: rank_eq_def)
apply (simp add: rank_eq_def)
apply simp
apply (drule place_rank_mono, simp)
done

lemma basis_emb_mono:
  "x \<sqsubseteq> y \<Longrightarrow> ubasis_le (basis_emb x) (basis_emb y)"
proof (induct "max (place x) (place y)" arbitrary: x y rule: less_induct)
  case less
  show ?case proof (rule linorder_cases)
    assume "place x < place y"
    then have "rank x < rank y"
      using \<open>x \<sqsubseteq> y\<close> by (rule rank_place_mono)
    with \<open>place x < place y\<close> show ?case
      apply (case_tac "y = compact_bot", simp)
      apply (simp add: basis_emb.simps [of y])
      apply (rule ubasis_le_trans [OF _ ubasis_le_lower [OF fin2]])
      apply (rule less)
       apply (simp add: less_max_iff_disj)
       apply (erule place_sub_less)
      apply (erule rank_less_imp_below_sub [OF \<open>x \<sqsubseteq> y\<close>])
      done
  next
    assume "place x = place y"
    hence "x = y" by (rule place_eqD)
    thus ?case by (simp add: ubasis_le_refl)
  next
    assume "place x > place y"
    with \<open>x \<sqsubseteq> y\<close> show ?case
      apply (case_tac "x = compact_bot", simp add: ubasis_le_minimal)
      apply (simp add: basis_emb.simps [of x])
      apply (rule ubasis_le_upper [OF fin2], simp)
      apply (rule less)
       apply (simp add: less_max_iff_disj)
       apply (erule place_sub_less)
      apply (erule rev_below_trans)
      apply (rule sub_below)
      done
  qed
qed

lemma inj_basis_emb: "inj basis_emb"
proof (rule injI)
  fix x y
  assume "basis_emb x = basis_emb y"
  then show "x = y"
    by (cases "x = compact_bot \<or> y = compact_bot") (auto simp add: basis_emb_rec fin2 place_eqD)
qed

definition
  basis_prj :: "ubasis \<Rightarrow> 'a compact_basis"
where
  "basis_prj x = inv basis_emb
    (ubasis_until (\<lambda>x. x \<in> range (basis_emb :: 'a compact_basis \<Rightarrow> ubasis)) x)"

lemma basis_prj_basis_emb: "\<And>x. basis_prj (basis_emb x) = x"
unfolding basis_prj_def
 apply (subst ubasis_until_same)
  apply (rule rangeI)
 apply (rule inv_f_f)
 apply (rule inj_basis_emb)
done

lemma basis_prj_node:
  "\<lbrakk>finite S; node i a S \<notin> range (basis_emb :: 'a compact_basis \<Rightarrow> nat)\<rbrakk>
    \<Longrightarrow> basis_prj (node i a S) = (basis_prj a :: 'a compact_basis)"
unfolding basis_prj_def by simp

lemma basis_prj_0: "basis_prj 0 = compact_bot"
apply (subst basis_emb_compact_bot [symmetric])
apply (rule basis_prj_basis_emb)
done

lemma node_eq_basis_emb_iff:
  "finite S \<Longrightarrow> node i a S = basis_emb x \<longleftrightarrow>
    x \<noteq> compact_bot \<and> i = place x \<and> a = basis_emb (sub x) \<and>
        S = basis_emb ` {y. place y < place x \<and> x \<sqsubseteq> y}"
apply (cases "x = compact_bot", simp)
apply (simp add: basis_emb.simps [of x])
apply (simp add: fin2)
done

lemma basis_prj_mono: "ubasis_le a b \<Longrightarrow> basis_prj a \<sqsubseteq> basis_prj b"
proof (induct a b rule: ubasis_le.induct)
  case (ubasis_le_refl a) show ?case by (rule below_refl)
next
  case (ubasis_le_trans a b c) thus ?case by - (rule below_trans)
next
  case (ubasis_le_lower S a i) thus ?case
    apply (cases "node i a S \<in> range (basis_emb :: 'a compact_basis \<Rightarrow> nat)")
     apply (erule rangeE, rename_tac x)
     apply (simp add: basis_prj_basis_emb)
     apply (simp add: node_eq_basis_emb_iff)
     apply (simp add: basis_prj_basis_emb)
     apply (rule sub_below)
    apply (simp add: basis_prj_node)
    done
next
  case (ubasis_le_upper S b a i) thus ?case
    apply (cases "node i a S \<in> range (basis_emb :: 'a compact_basis \<Rightarrow> nat)")
     apply (erule rangeE, rename_tac x)
     apply (simp add: basis_prj_basis_emb)
     apply (clarsimp simp add: node_eq_basis_emb_iff)
     apply (simp add: basis_prj_basis_emb)
    apply (simp add: basis_prj_node)
    done
qed

lemma basis_emb_prj_less: "ubasis_le (basis_emb (basis_prj x)) x"
unfolding basis_prj_def
 apply (subst f_inv_into_f [where f=basis_emb])
  apply (rule ubasis_until)
  apply (rule range_eqI [where x=compact_bot])
  apply simp
 apply (rule ubasis_until_less)
done

lemma ideal_completion:
  "ideal_completion below Rep_compact_basis (approximants :: 'a \<Rightarrow> _)"
proof
  fix w :: "'a"
  show "below.ideal (approximants w)"
  proof (rule below.idealI)
    have "Abs_compact_basis (approx 0\<cdot>w) \<in> approximants w"
      by (simp add: approximants_def approx_below)
    thus "\<exists>x. x \<in> approximants w" ..
  next
    fix x y :: "'a compact_basis"
    assume x: "x \<in> approximants w" and y: "y \<in> approximants w"
    obtain i where i: "approx i\<cdot>(Rep_compact_basis x) = Rep_compact_basis x"
      using compact_eq_approx Rep_compact_basis' by fast
    obtain j where j: "approx j\<cdot>(Rep_compact_basis y) = Rep_compact_basis y"
      using compact_eq_approx Rep_compact_basis' by fast
    let ?z = "Abs_compact_basis (approx (max i j)\<cdot>w)"
    have "?z \<in> approximants w"
      by (simp add: approximants_def approx_below)
    moreover from x y have "x \<sqsubseteq> ?z \<and> y \<sqsubseteq> ?z"
      by (simp add: approximants_def compact_le_def)
         (metis i j monofun_cfun chain_mono chain_approx max.cobounded1 max.cobounded2)
    ultimately show "\<exists>z \<in> approximants w. x \<sqsubseteq> z \<and> y \<sqsubseteq> z" ..
  next
    fix x y :: "'a compact_basis"
    assume "x \<sqsubseteq> y" "y \<in> approximants w" thus "x \<in> approximants w"
      unfolding approximants_def compact_le_def
      by (auto elim: below_trans)
  qed
next
  fix Y :: "nat \<Rightarrow> 'a"
  assume "chain Y"
  thus "approximants (\<Squnion>i. Y i) = (\<Union>i. approximants (Y i))"
    unfolding approximants_def
    by (auto simp add: compact_below_lub_iff)
next
  fix a :: "'a compact_basis"
  show "approximants (Rep_compact_basis a) = {b. b \<sqsubseteq> a}"
    unfolding approximants_def compact_le_def ..
next
  fix x y :: "'a"
  assume "approximants x \<subseteq> approximants y"
  hence "\<forall>z. compact z \<longrightarrow> z \<sqsubseteq> x \<longrightarrow> z \<sqsubseteq> y"
    by (simp add: approximants_def subset_eq)
       (metis Abs_compact_basis_inverse')
  hence "(\<Squnion>i. approx i\<cdot>x) \<sqsubseteq> y"
    by (simp add: lub_below approx_below)
  thus "x \<sqsubseteq> y"
    by (simp add: lub_distribs)
next
  show "\<exists>f::'a compact_basis \<Rightarrow> nat. inj f"
    by (rule exI, rule inj_place)
qed

end

interpretation compact_basis:
  ideal_completion below Rep_compact_basis
    "approximants :: 'a::bifinite \<Rightarrow> 'a compact_basis set"
proof -
  obtain a :: "nat \<Rightarrow> 'a \<rightarrow> 'a" where "approx_chain a"
    using bifinite ..
  hence "bifinite_approx_chain a"
    unfolding bifinite_approx_chain_def .
  thus "ideal_completion below Rep_compact_basis (approximants :: 'a \<Rightarrow> _)"
    by (rule bifinite_approx_chain.ideal_completion)
qed


subsubsection \<open>EP-pair from any bifinite domain into \emph{udom}\<close>

context bifinite_approx_chain begin

definition
  udom_emb :: "'a \<rightarrow> udom"
where
  "udom_emb = compact_basis.extension (\<lambda>x. udom_principal (basis_emb x))"

definition
  udom_prj :: "udom \<rightarrow> 'a"
where
  "udom_prj = udom.extension (\<lambda>x. Rep_compact_basis (basis_prj x))"

lemma udom_emb_principal:
  "udom_emb\<cdot>(Rep_compact_basis x) = udom_principal (basis_emb x)"
unfolding udom_emb_def
apply (rule compact_basis.extension_principal)
apply (rule udom.principal_mono)
apply (erule basis_emb_mono)
done

lemma udom_prj_principal:
  "udom_prj\<cdot>(udom_principal x) = Rep_compact_basis (basis_prj x)"
unfolding udom_prj_def
apply (rule udom.extension_principal)
apply (rule compact_basis.principal_mono)
apply (erule basis_prj_mono)
done

lemma ep_pair_udom: "ep_pair udom_emb udom_prj"
 apply standard
  apply (rule compact_basis.principal_induct, simp)
  apply (simp add: udom_emb_principal udom_prj_principal)
  apply (simp add: basis_prj_basis_emb)
 apply (rule udom.principal_induct, simp)
 apply (simp add: udom_emb_principal udom_prj_principal)
 apply (rule basis_emb_prj_less)
done

end

abbreviation "udom_emb \<equiv> bifinite_approx_chain.udom_emb"
abbreviation "udom_prj \<equiv> bifinite_approx_chain.udom_prj"

lemmas ep_pair_udom =
  bifinite_approx_chain.ep_pair_udom [unfolded bifinite_approx_chain_def]


subsection \<open>Chain of approx functions for type \emph{udom}\<close>

definition
  udom_approx :: "nat \<Rightarrow> udom \<rightarrow> udom"
where
  "udom_approx i =
    udom.extension (\<lambda>x. udom_principal (ubasis_until (\<lambda>y. y \<le> i) x))"

lemma udom_approx_mono:
  "ubasis_le a b \<Longrightarrow>
    udom_principal (ubasis_until (\<lambda>y. y \<le> i) a) \<sqsubseteq>
    udom_principal (ubasis_until (\<lambda>y. y \<le> i) b)"
apply (rule udom.principal_mono)
apply (rule ubasis_until_mono)
apply (frule (2) order_less_le_trans [OF node_gt2])
apply (erule order_less_imp_le)
apply assumption
done

lemma adm_mem_finite: "\<lbrakk>cont f; finite S\<rbrakk> \<Longrightarrow> adm (\<lambda>x. f x \<in> S)"
by (erule adm_subst, induct set: finite, simp_all)

lemma udom_approx_principal:
  "udom_approx i\<cdot>(udom_principal x) =
    udom_principal (ubasis_until (\<lambda>y. y \<le> i) x)"
unfolding udom_approx_def
apply (rule udom.extension_principal)
apply (erule udom_approx_mono)
done

lemma finite_deflation_udom_approx: "finite_deflation (udom_approx i)"
proof
  fix x show "udom_approx i\<cdot>(udom_approx i\<cdot>x) = udom_approx i\<cdot>x"
    by (induct x rule: udom.principal_induct, simp)
       (simp add: udom_approx_principal ubasis_until_idem)
next
  fix x show "udom_approx i\<cdot>x \<sqsubseteq> x"
    by (induct x rule: udom.principal_induct, simp)
       (simp add: udom_approx_principal ubasis_until_less)
next
  have *: "finite (range (\<lambda>x. udom_principal (ubasis_until (\<lambda>y. y \<le> i) x)))"
    apply (subst range_composition [where f=udom_principal])
    apply (simp add: finite_range_ubasis_until)
    done
  show "finite {x. udom_approx i\<cdot>x = x}"
    apply (rule finite_range_imp_finite_fixes)
    apply (rule rev_finite_subset [OF *])
    apply (clarsimp, rename_tac x)
    apply (induct_tac x rule: udom.principal_induct)
    apply (simp add: adm_mem_finite *)


    
qed

interpretation:  "udom_approx i"
by ( apply ( : A)

emma[]: "chain (\i. udom_approx i)"
unfolding frule)
apply rule)
apply( .)
apply( udom_approx_mono
apply ( udom_approx_mono
apply (rule.)
apply (
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4

]:"\i. udom_approx i) = ID"
apply  subst.)
apply (rule
apply ( lub_below
apply (simp)
apply (rule.below
apply (rule_tacinudom)
applyapply( notI
apply (rule_tac i=   java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
apply simp
apply (simp:)
apply ( add ubasis_le_refl
done

lemma java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
proof
  "chain\i. udom_approx i)"
    byrule)
  show "(\i. udom_approx i) = ID"
    by (rulelemmacb_take_zero []: "cb_take a =compact_bot"
qed

instance
by (fast: udom_approx

hide_const

unbundle

end

99%


¤ 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.0.21Bemerkung:  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

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 ist noch experimentell.