instruct
stringclasses
1 value
input
stringlengths
25
4.64k
output
stringlengths
17
413
Given a lemma, please prove it.
lemma small_step_terminated: "s \<rightarrow>\<^bsub>x\<^esub> s' \<Longrightarrow> atCs (fst s) = {} \<Longrightarrow> atCs (fst s') = {}"
by (induct pred: small_step) auto
Given a lemma, please prove it.
theorem HEndPhase2_HInv3: "\<lbrakk> HEndPhase2 s s' p; HInv3 s \<rbrakk> \<Longrightarrow> HInv3 s'"
by(auto simp add: HInv3_def dest: EndPhase2_HInv3)
Given a lemma, please prove it.
lemma retract_of_closed: fixes S :: "'a :: t2_space set" shows "\<lbrakk>closed T; S retract_of T\<rbrakk> \<Longrightarrow> closed S"
by (metis closedin_retract closedin_closed_eq)
Given a lemma, please prove it.
lemma fmap_below_add_restrI: assumes "x f|` (-S) \<sqsubseteq> y f|` (-S)" and "x f|` S \<sqsubseteq> z f|` S" shows "x \<sqsubseteq> y ++\<^bsub>S\<^esub> z"
using assms by (auto intro!: fun_belowI dest:env_restr_belowD simp add: lookup_override_on_eq)
Given a lemma, please prove it.
lemma ground_subst_no_var[intro]: "ground (subst_range s) \<Longrightarrow> x \<notin> range_vars s"
using ground_range_vars[of s] by blast
Given a lemma, please prove it.
lemma HPhase0Read_maxBalInp: assumes act: "HPhase0Read s s' q d" and asm3: "maxBalInp s b v" shows "maxBalInp s' b v"
proof(auto simp add: maxBalInp_def) fix bk assume bk: "bk \<in> allBlocks s'" and b_bal: "b\<le> bal bk" from subsetD[OF HPhase0Read_allBlocks[OF act] bk] asm3 b_bal show "inp bk = v" by(auto simp add: maxBalInp_def) qed
Given a lemma, please prove it.
lemma outside_frontier_eq_complement_closure: fixes S :: "'a :: {real_normed_vector, perfect_space} set" assumes "bounded S" "convex S" shows "outside(frontier S) = - closure S"
by (metis Diff_subset assms convex_closure frontier_def outside_frontier_misses_closure outside_subset_convex subset_antisym)
Given a lemma, please prove it.
lemma AssertionsImplyMethInvariants: "\<lbrakk> G \<rhd> \<lbrace> A \<rbrace> C,m,l \<lbrace> B \<rbrace> I; A s0 s\<rbrakk> \<Longrightarrow> I s0 s (heap s)"
by (drule AssertionsImplyInvariantsAux, fast)
Given a lemma, please prove it.
lemma Star_string: assumes "s \<in> star A" shows "\<exists>ss. concat ss = s \<and> (\<forall>s \<in> set ss. s \<in> A)"
using assms by (metis in_star_iff_concat subsetD)
Given a lemma, please prove it.
lemma is_subseq_closed: assumes "s \<in> closed_seqs Zp" assumes "is_subseq_of s s'" shows "s' \<in> closed_seqs Zp"
apply(rule closed_seqs_memI) using is_subseq_ind assms closed_seqs_memE by metis
Given a lemma, please prove it.
lemma condition_split: "P (condition C a b s) = ((((C s) \<longrightarrow> P (a s)) \<and> (\<not> (C s) \<longrightarrow> P (b s))))"
apply (clarsimp simp: condition_def) done
Given a lemma, please prove it.
lemma siterate_eq_scons[iff]: "siterate f s = a ## w \<longleftrightarrow> s = a \<and> siterate f (f s) = w"
using siterate.ctr stream.inject by metis
Given a lemma, please prove it.
theorem while_rule_lemma: assumes invariant: "!!s. P s ==> b s ==> P (c s)" and terminate: "!!s. P s ==> \<not> b s ==> Q s" and wf: "wf {(t, s). P s \<and> b s \<and> t = c s}" shows "P s \<Longrightarrow> Q (while b c s)"
using wf apply (induct s) apply simp apply (subst while_unfold) apply (simp add: invariant terminate) done
Given a lemma, please prove it.
lemma matchI[intro?]: assumes "validTrans (Trans s1 a1 ou1 s1')" and "consume (Trans s1 a1 ou1 s1') vl1 vl1'" and "\<gamma> (Trans s a ou s') = \<gamma> (Trans s1 a1 ou1 s1')" and "\<gamma> (Trans s a ou s') \<Longrightarrow> g (Trans s a ou s') = g (Trans s1 a1 ou1 s1')" and "\<Delta> s' vl' s1' vl1'" shows "match \<D...
unfolding match_def using assms by auto
Given a lemma, please prove it.
lemma (in poly_set_iteratei) dres_ne_bot_iterate[refine_transfer]: assumes A: "\<And>x s. f x s \<noteq> dSUCCEED" shows "iteratei r c (\<lambda>x s. dbind s (f x)) (dRETURN s) \<noteq> dSUCCEED"
unfolding iteratei_def it_to_list_def it_to_it_def apply (rule dres_foldli_ne_bot) by (simp_all add: A)
Given a lemma, please prove it.
lemma list_all_add_6E[elim]: "list_all (\<lambda>(acn, s). s \<le> Suc q) xs \<Longrightarrow> list_all (\<lambda>(acn, s). s \<le> q + (2 * n + 6)) xs"
by(auto simp: list_all_length)
Given a lemma, please prove it.
lemma Abs_type': assumes H: "\<Gamma> \<turnstile> (\<lambda>x:S. s) : U \<rightarrow> U'" and H': "x \<sharp> \<Gamma>" obtains S' where "\<Gamma> \<turnstile> U <: S" and "(VarB x S) # \<Gamma> \<turnstile> s : S'" and "\<Gamma> \<turnstile> S' <: U'"
using H subtype_reflexivity_from_typing [OF H] H' by (rule Abs_type)
Given a lemma, please prove it.
theorem invertible_is_bijective: assumes dom: "\<alpha> \<in> S \<rightarrow>\<^sub>E S" shows "invertible \<alpha> \<longleftrightarrow> bij_betw \<alpha> S S"
proof - from dom interpret map \<alpha> S S by unfold_locales show ?thesis by (auto simp add: bij_betw_iff_has_inverse invertible_def) qed
Given a lemma, please prove it.
lemma convex_rel_interior_iff2: fixes S :: "'n::euclidean_space set" assumes "convex S" and "S \<noteq> {}" shows "z \<in> rel_interior S \<longleftrightarrow> (\<forall>x\<in>affine hull S. \<exists>e. e > 1 \<and> (1 - e) *\<^sub>R x + e *\<^sub>R z \<in> S)"
using assms hull_subset[of S] convex_rel_interior_if2[of S z] convex_rel_interior_only_if[of S z] by auto
Given a lemma, please prove it.
lemma simplicial_chain_diff: "\<lbrakk>simplicial_chain p S c1; simplicial_chain p S c2\<rbrakk> \<Longrightarrow> simplicial_chain p S (c1 - c2)"
unfolding simplicial_chain_def by (meson UnE keys_diff subset_iff)
Given a lemma, please prove it.
lemma additiveI[intro]: "\<lbrakk> \<And>P Q s. \<lbrakk> sound P; sound Q \<rbrakk> \<Longrightarrow> t (\<lambda>s. P s + Q s) s = t P s + t Q s \<rbrakk> \<Longrightarrow> additive t"
unfolding additive_def by(blast)
Given a lemma, please prove it.
lemma pre_zeta_aux_eq_pre_zeta: assumes "Re s > -2 * real n" and "a > 0" shows "pre_zeta_aux n a s = pre_zeta a s"
unfolding pre_zeta_def proof (intro pre_zeta_aux_eq') from assms show "- 2 * real (nat (1 - \<lceil>Re s / 2\<rceil>)) < Re s" by linarith qed (insert assms, simp_all)
Given a lemma, please prove it.
lemma homeomorphic_to_disc_imp_simply_connected: assumes "S = {} \<or> S homeomorphic ball (0::complex) 1" shows "simply_connected S"
using assms homeomorphic_simply_connected_eq convex_imp_simply_connected by auto
Given a lemma, please prove it.
lemma continuous_on_components_open: fixes S :: "'a::real_normed_vector set" assumes "open S " "\<And>c. c \<in> components S \<Longrightarrow> continuous_on c f" shows "continuous_on S f"
using continuous_on_components open_imp_locally_connected assms by blast
Given a lemma, please prove it.
lemma exhaustive_fusion_code: "exhaustive_fusion g s = (list.has_next g s \<and> (let (x, s') = list.next g s in \<not> proper_interval None (Some x) \<and> exhaustive_above_fusion g x s'))"
unfolding exhaustive_fusion_def exhaustive_above_fusion_def by(subst (1) list.unfoldr.simps)(simp add: split_beta)
Given a lemma, please prove it.
lemma countable_image_inj_Int_vimage: "\<lbrakk>inj_on f S; countable A\<rbrakk> \<Longrightarrow> countable (S \<inter> f -` A)"
by (meson countable_image_inj_on countable_subset image_subset_iff_subset_vimage inf_le2 inj_on_Int)
Given a lemma, please prove it.
lemma fbox_test[simp]: "(\<lambda>s. ( |\<questiondown>P?] Q) s) = (\<lambda>s. P s \<longrightarrow> Q s)"
unfolding fbox_def test_def by simp \<comment> \<open> Assignments \<close>
Given a lemma, please prove it.
lemma colours_flip_fM[simp]: "fl \<noteq> sys_fM s \<Longrightarrow> black b (s(sys := (s sys)\<lparr>fM := fl, mem_store_buffers := (mem_store_buffers (s sys))(p := ws)\<rparr>)) \<longleftrightarrow> white b s \<and> \<not>grey b s"
unfolding black_def white_def by (simp add: fun_upd_apply)
Given a lemma, please prove it.
lemma length_tl_list_minus_butlast_gt_zero: assumes "length s < length t" and "strict_prefix (butlast s) t" and "length s > 0" shows "length (tl (t - (butlast s))) > 0"
using assms by (metis Nitpick.size_list_simp(2) butlast_snoc hd_Cons_tl length_butlast length_greater_0_conv length_tl less_trans nat_neq_iff strict_prefix_minus_not_empty prefix_order.dual_order.strict_implies_order prefix_concat_minus)
Given a lemma, please prove it.
lemma assumes "s \<in> S" and "fair rs" shows trim_in_R: "shd (trim rs s) \<in> R" and trim_enabled: "enabled (shd (trim rs s)) s" and trim_fair: "fair (trim rs s)"
unfolding trim_alt[OF assms] minWait_def using LeastI_ex[OF minWait_ex[OF assms]] sdrop_fair[OF assms(2)] conjunct1[OF assms(2)[unfolded fair_def]] by simp_all (metis subsetD snth_sset)
Given a lemma, please prove it.
lemma SpecIf: "\<lbrakk>P \<subseteq> {s. (b s \<longrightarrow> f s \<in> Q) \<and> (\<not> b s \<longrightarrow> g s \<in> Q \<and> h s \<in> Q)}\<rbrakk> \<Longrightarrow> \<Gamma>,\<Theta>\<turnstile>\<^bsub>/F\<^esub> P Spec (if_rel b f g h) Q,A"
apply (rule Spec) apply (auto simp add: if_rel_def) done
Given a lemma, please prove it.
lemma rfn_tool12_2:"\<lbrakk>0 < (s::nat); (i::nat) mod s = s - Suc 0\<rbrakk> \<Longrightarrow> (Suc i) mod s = 0"
apply (insert div_mult_mod_eq [THEN sym, of "i" "s"]) apply (insert add_Suc_right [THEN sym, of "i div s * s" "i mod s"]) apply simp done
Given a lemma, please prove it.
lemma wlp_strengthen_modset: "wlp \<pi> c Q s \<Longrightarrow> wlp \<pi> c (\<lambda>s'. Q s' \<and> modifies (lhsv \<pi> c) s' s) s"
unfolding wlp_def by (blast intro: modifies_lhsv)
Given a lemma, please prove it.
lemma streams_sset: assumes "s \<in> streams A" shows "sset s \<subseteq> A"
proof fix x assume "x \<in> sset s" from this \<open>s \<in> streams A\<close> show "x \<in> A" by (induct s) (auto intro: streams_shd streams_stl) qed
Given a lemma, please prove it.
lemma Astack_restr_stack_below: "Astack (restr_stack V S) \<sqsubseteq> Astack S"
by (induction V S rule: restr_stack.induct) auto
Given a lemma, please prove it.
lemma closure_inside_subset: fixes S :: "'a::real_normed_vector set" assumes "closed S" shows "closure(inside S) \<subseteq> S \<union> inside S"
by (metis assms closure_minimal open_closed open_outside sup.cobounded2 union_with_inside)
Given a lemma, please prove it.
lemma hmac_trans_lkr: "hmac X K \<in> parts (extr (bad s') (ik s') (chan s')) \<Longrightarrow> K \<notin> synth (analz (extr (bad s) (ik s) (chan s))) \<Longrightarrow> s \<in> l2_inv3 \<Longrightarrow> (s, s') \<in> l2_lkr_others A \<union> l2_lkr_after A \<Longrightarrow> hmac X K \<in> parts (extr (b...
apply (auto simp add: l2_defs dest!: parts_monotone [OF _ extr_insert_bad]) apply (auto intro: parts_monotone intro!:hmac_trans_lkr_aux) done
Given a lemma, please prove it.
lemma dependent_biggerset_general: "(finite S \<Longrightarrow> card S > dim S) \<Longrightarrow> dependent S"
using independent_bound_general[of S] by (metis linorder_not_le)
Given a lemma, please prove it.
lemma peek_st_split [simp]: "(\<lambda>s.. \<lambda>Y s'. P s Y s') = (\<lambda>Y s. P (store s) Y s)"
apply (rule ext) apply (rule ext) apply (simp (no_asm)) done
Given a lemma, please prove it.
lemma deg_fun_superset: fixes A::"'a set" assumes "supp_fun s \<subseteq> A" and "finite A" shows "deg_fun s = (\<Sum>x\<in>A. s x)"
unfolding deg_fun_def proof (rule sum.mono_neutral_cong_left, fact, fact, rule) fix x assume "x \<in> A - supp_fun s" hence "x \<notin> supp_fun s" by simp thus "s x = 0" by (simp add: supp_fun_def) qed rule
Given a lemma, please prove it.
lemma dfoldli_simps[simp]: "dfoldli [] c f s = dRETURN s" "dfoldli (x#ls) c f s = (if c s then do { s\<leftarrow>f x s; dfoldli ls c f s} else dRETURN s)"
apply (subst dfoldli.simps, simp)+ done
Given a lemma, please prove it.
lemma card_insert_Suc: "card (insert x S) \<le> Suc (card S)"
by (metis Suc_n_not_le_n card.infinite card_insert_if finite_insert linear)
Given a lemma, please prove it.
lemma wlp_while_rl[vcg_comb_rules]: assumes "\<paragraph>''invar-initial'' \<Longrightarrow> I s\<^sub>0" assumes "\<And>s. \<lbrakk> \<paragraph>''invar-pres''; modifies modset s s\<^sub>0; I s; bval b s \<rbrakk> \<Longrightarrow> wlp \<pi> c I s" assumes "\<And>s. \<lbrakk> \<paragraph>''invar-post''; mo...
using wlp_whileI_modset[of I, OF _ assms(2)] assms(1,3,4) unfolding WHILE_annotI_def GOAL_INDICATION_def by auto
Given a lemma, please prove it.
lemma Phase1or2ReadThen_HInv3_hasRead: "\<lbrakk> \<not>hasRead s pp dd qq; Phase1or2ReadThen s s' p d q; pp\<noteq>p \<or> qq\<noteq>q \<or> dd\<noteq>d\<rbrakk> \<Longrightarrow> \<not>hasRead s' pp dd qq"
by(auto simp add: hasRead_def Phase1or2ReadThen_def)
Given a lemma, please prove it.
lemma permutes_imp_bij: "p permutes S \<Longrightarrow> bij_betw p S S"
by (metis UNIV_I bij_betw_subset permutes_bij permutes_image subsetI)
Given a lemma, please prove it.
lemma homeomorphism_on_homeomorphic: assumes "homeomorphism_on S f" shows "S homeomorphic (f`S)"
using assms unfolding homeomorphism_on_def homeomorphic_def by auto
Given a lemma, please prove it.
lemma tagged_division_of_finite: "s tagged_division_of i \<Longrightarrow> finite s"
unfolding tagged_division_of_def tagged_partial_division_of_def by auto
Given a lemma, please prove it.
lemma stack_set_def: "set (stack s) = dom (discovered s) - dom (finished s)"
using basic_invar by (simp add: basic_invar_def)
Given a lemma, please prove it.
lemma Spair_induced_automorph: "s\<in>S \<Longrightarrow> s = case_prod Abs_induced_automorph (Spair s)"
using Spair_def someI_ex[of "\<lambda>fg. fg \<in> fundfoldpairs \<and> s = case_prod Abs_induced_automorph fg" ] by auto
Given a lemma, please prove it.
lemma hd_stack_in_tj_stack: "stack s \<noteq> [] \<Longrightarrow> hd (stack s) \<in> set (tj_stack s)"
using stack_ss_tj_stack hd_in_set by auto
Given a lemma, please prove it.
lemma ms_of_greek_cons: "ms_of_greek (x # s) = {# adj_msog [] s (x,[]) #} + image_mset (adj_msog [x] []) (ms_of_greek s)"
using msog_append[of "[x]" s] by (auto simp add: adj_msog_def ms_of_greek_def accent.splits)
Given a lemma, please prove it.
lemma F_hiding: "F(P \\ A) = {(s,X). \<exists> t. s = trace_hide t (ev`A) \<and> (t,X \<union> (ev`A)) \<in> F P} \<union> {(s,X). s \<in> div_hide P A}"
by (subst F_def, simp only: hiding_def Rep_Abs_Hiding FAILURES_def fst_conv)
Given a lemma, please prove it.
lemma piecewise_C1_differentiable_on_imp_continuous_on: assumes "f piecewise_C1_differentiable_on s" shows "continuous_on s f"
using assms by (auto simp add: piecewise_C1_differentiable_on_def)
Given a lemma, please prove it.
lemma borel_measurableI: fixes f :: "'a \<Rightarrow> 'x::topological_space" assumes "\<And>S. open S \<Longrightarrow> f -` S \<inter> space M \<in> sets M" shows "f \<in> borel_measurable M"
unfolding borel_def proof (rule measurable_measure_of, simp_all) fix S :: "'x set" assume "open S" thus "f -` S \<inter> space M \<in> sets M" using assms[of S] by simp qed
Given a lemma, please prove it.
lemma connected_openin: "connected S \<longleftrightarrow> \<not>(\<exists>E1 E2. openin (top_of_set S) E1 \<and> openin (top_of_set S) E2 \<and> S \<subseteq> E1 \<union> E2 \<and> E1 \<inter> E2 = {} \<and> E1 \<noteq> {} \<and> E2 \<noteq> {})"
unfolding connected_def openin_open disjoint_iff_not_equal by blast
Given a lemma, please prove it.
lemma assumes forward: "\<And>s g p v. A g p v s \<Longrightarrow> AA g p s " shows "\<And>xv yv P s y x s. (A g x yv ** A g y yv ** P) s \<Longrightarrow> (AA g y ** sep_True) s"
by (sep_cancel add: forward)
Given a lemma, please prove it.
lemma step_Stuck_prop: assumes step: "\<Gamma> \<turnstile> (c, s) \<rightarrow> (c', s')" shows "s=Stuck \<Longrightarrow> s'=Stuck"
using step by (induct) auto
Given a lemma, please prove it.
lemma back_edges_tree_pathes_disjoint: "back_edges s \<inter> (tree_edges s)\<^sup>+ = {}"
using back_edge_disc tree_path_disc by force
Given a lemma, please prove it.
lemma HT_mods_cong[named_ss vcg_bb cong]: assumes "vs = vs'" assumes "P=P'" assumes "c=c'" assumes "\<And>s\<^sub>0 s. modifies vs s s\<^sub>0 \<Longrightarrow> Q s\<^sub>0 s = Q' s\<^sub>0 s" shows "HT_mods \<pi> vs P c Q = HT_mods \<pi> vs' P' c' Q'"
unfolding HT_mods_def HT_def using assms by (auto intro: wp_conseq)
Given a lemma, please prove it.
lemma HPhase0Read_HInv4b_p: "HPhase0Read s s' p d \<Longrightarrow> HInv4b s' p"
by(auto simp add: Phase0Read_def HInv4b_def)
Given a lemma, please prove it.
lemma connected_complement_homeomorphic_interval: fixes S :: "'a::euclidean_space set" assumes "S homeomorphic cbox a b" "2 \<le> DIM('a)" shows "connected(-S)"
using assms path_connected_complement_homeomorphic_interval path_connected_imp_connected by blast
Given a lemma, please prove it.
lemma ENR_from_Un_Int: fixes S :: "'a::euclidean_space set" assumes "closed S" "closed T" "ENR(S \<union> T)" "ENR(S \<inter> T)" shows "ENR S"
by (meson ENR_from_Un_Int_gen assms closed_subset sup_ge1 sup_ge2)
Given a lemma, please prove it.
lemma compact_simplex: "n simplex S \<Longrightarrow> compact S"
unfolding simplex using finite_imp_compact_convex_hull by blast
Given a lemma, please prove it.
lemma absolutely_integrable_negligible: fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space" assumes "negligible S" shows "f absolutely_integrable_on S"
using assms by (simp add: absolutely_integrable_on_def integrable_negligible)
Given a lemma, please prove it.
lemma V_lemma2: "Mutex \<in> {s. n s = 2} LeadsTo {s. ~ p s}"
apply (rule LeadsTo_Diff [OF LeadsTo_weaken_L Int_lower2 [THEN subset_imp_LeadsTo]]) apply (rule LeadsTo_Trans [OF V_F2 V_F3], auto) done
Given a lemma, please prove it.
lemma resolution_blocks_subset: "S \<in># \<P> \<Longrightarrow> S \<subseteq># \<B>"
using partition_on_mset_subsets resolutionD1 by auto
Given a lemma, please prove it.
lemma restrictA_noop: "domA \<Gamma> \<subseteq> S \<Longrightarrow> restrictA S \<Gamma> = \<Gamma>"
unfolding restrict_eq by (induction \<Gamma>) auto
Given a lemma, please prove it.
lemma inorder_node44: "height n > 0 \<Longrightarrow> inorder (tree\<^sub>d (node44 l a m b n c r)) = inorder l @ a # inorder m @ b # inorder n @ c # inorder (tree\<^sub>d r)"
by(induct l a m b n c r rule: node44.induct) auto
Given a lemma, please prove it.
lemma inorder_del: "t \<in> T h \<Longrightarrow> sorted1(inorder t) \<Longrightarrow> inorder(del x t) = del_list x (inorder t)"
by(induction h arbitrary: t) (auto simp: del_list_simps inorder_n2 inorder_split_min[OF UnI1] inorder_split_min[OF UnI2] split: option.splits)
Given a lemma, please prove it.
lemma inorder_del: "sorted(inorder t) \<Longrightarrow> inorder(del x t) = del_list x (inorder t)"
by(induction x t rule: del.induct) (auto simp: del_list_simps inorder_baldL inorder_baldR split_minD split: prod.splits)
Given a lemma, please prove it.
lemma inorder_update: "t \<in> T h \<Longrightarrow> sorted1(inorder t) \<Longrightarrow> inorder(update x y t) = upd_list x y (inorder t)"
by(simp add: update_def inorder_upd inorder_tree)