# HG changeset patch # User paulson # Date 1736880418 0 # Node ID 5a2e05eb700147a424f3751b49d655ba342dfa08 # Parent 40f979c845b7d68f06b201ef7cb7428792a5e7ea polished messy proofs diff -r 40f979c845b7 -r 5a2e05eb7001 src/HOL/Library/Extended_Nonnegative_Real.thy --- a/src/HOL/Library/Extended_Nonnegative_Real.thy Mon Jan 13 21:17:40 2025 +0100 +++ b/src/HOL/Library/Extended_Nonnegative_Real.thy Tue Jan 14 18:46:58 2025 +0000 @@ -16,20 +16,17 @@ lemma Limsup_const_add: fixes c :: "'a::{complete_linorder, linorder_topology, topological_monoid_add, ordered_ab_semigroup_add}" shows "F \ bot \ Limsup F (\x. c + f x) = c + Limsup F f" - by (rule Limsup_compose_continuous_mono) - (auto intro!: monoI add_mono continuous_on_add continuous_on_id continuous_on_const) + by (intro Limsup_compose_continuous_mono monoI add_mono continuous_intros) auto lemma Liminf_const_add: fixes c :: "'a::{complete_linorder, linorder_topology, topological_monoid_add, ordered_ab_semigroup_add}" shows "F \ bot \ Liminf F (\x. c + f x) = c + Liminf F f" - by (rule Liminf_compose_continuous_mono) - (auto intro!: monoI add_mono continuous_on_add continuous_on_id continuous_on_const) + by (intro Liminf_compose_continuous_mono monoI add_mono continuous_intros) auto lemma Liminf_add_const: fixes c :: "'a::{complete_linorder, linorder_topology, topological_monoid_add, ordered_ab_semigroup_add}" shows "F \ bot \ Liminf F (\x. f x + c) = Liminf F f + c" - by (rule Liminf_compose_continuous_mono) - (auto intro!: monoI add_mono continuous_on_add continuous_on_id continuous_on_const) + by (intro Liminf_compose_continuous_mono monoI add_mono continuous_intros) auto lemma sums_offset: fixes f g :: "nat \ 'a :: {t2_space, topological_comm_monoid_add}" @@ -96,9 +93,7 @@ by (induction i) (auto simp: bot eq f_le_lfp intro!: le_lfp mg) then show "\ (lfp f) \ lfp g" unfolding sup_continuous_lfp[OF f] - by (subst \[THEN sup_continuousD]) - (auto intro!: mono_funpow sup_continuous_mono[OF f] SUP_least) - + by (simp add: SUP_least \[THEN sup_continuousD] mf mono_funpow) show "lfp g \ \ (lfp f)" by (rule lfp_lowerbound) (simp add: eq[symmetric] lfp_fixpoint[OF mf]) qed @@ -337,16 +332,17 @@ lemma rel_fun_limsup[transfer_rule]: "rel_fun (rel_fun (=) pcr_ennreal) pcr_ennreal limsup limsup" proof - + have [simp]: "max 0 (SUP x\{n..}. enn2ereal (y x)) = (SUP x\{n..}. enn2ereal (y x))" for n::nat and y + by (meson SUP_upper atLeast_iff enn2ereal_nonneg max.absorb2 nle_le order_trans) have "rel_fun (rel_fun (=) pcr_ennreal) pcr_ennreal (\x. INF n. sup 0 (SUP i\{n..}. x i)) limsup" unfolding limsup_INF_SUP[abs_def] by (transfer_prover_start, transfer_step+; simp) - then show ?thesis - unfolding limsup_INF_SUP[abs_def] - apply (subst (asm) (2) rel_fun_def) - apply (subst (2) rel_fun_def) - apply (auto simp: comp_def max.absorb2 Sup_upper2 rel_fun_eq_pcr_ennreal) - apply (subst (asm) max.absorb2) - apply (auto intro: SUP_upper2) - done + moreover + have "\x y. \rel_fun (=) pcr_ennreal x y; + pcr_ennreal (INF n::nat. max 0 (Sup (x ` {n..}))) (INF n. Sup (y ` {n..}))\ + \ pcr_ennreal (INF n. Sup (x ` {n..})) (INF n. Sup (y ` {n..}))" + by (auto simp: comp_def rel_fun_eq_pcr_ennreal) + ultimately show ?thesis + by (simp add: limsup_INF_SUP rel_fun_def) qed lemma sum_enn2ereal[simp]: "(\i. i \ I \ 0 \ f i) \ (\i\I. enn2ereal (f i)) = enn2ereal (sum f I)" @@ -363,7 +359,7 @@ by (metis enn2ereal_of_nat numeral_eq_ereal of_nat_numeral) lemma transfer_numeral[transfer_rule]: "pcr_ennreal (numeral a) (numeral a)" - unfolding cr_ennreal_def pcr_ennreal_def by auto + by (metis enn2ereal_numeral pcr_ennreal_enn2ereal) subsection \Cancellation simprocs\ @@ -654,7 +650,7 @@ fixes a b c :: ennreal shows "a - b \ a - c \ a < top \ b \ a \ c \ a \ c \ b" by transfer - (auto simp add: max.absorb2 ereal_diff_positive top_ereal_def dest: ereal_mono_minus_cancel) + (auto simp add: ereal_diff_positive top_ereal_def dest: ereal_mono_minus_cancel) lemma ennreal_mono_minus: fixes a b c :: ennreal @@ -718,16 +714,13 @@ done lemma ennreal_inverse_mult: "a < top \ b < top \ inverse (a * b::ennreal) = inverse a * inverse b" - apply transfer - subgoal for a b - by (cases a b rule: ereal2_cases) (auto simp: top_ereal_def) - done + by (simp add: ennreal_inverse_mult') lemma ennreal_inverse_1[simp]: "inverse (1::ennreal) = 1" by transfer simp lemma ennreal_inverse_eq_0_iff[simp]: "inverse (a::ennreal) = 0 \ a = top" - by transfer (simp add: ereal_inverse_eq_0 top_ereal_def) + by (metis ennreal_inverse_positive not_gr_zero) lemma ennreal_inverse_eq_top_iff[simp]: "inverse (a::ennreal) = top \ a = 0" by transfer (simp add: top_ereal_def) @@ -752,7 +745,7 @@ by (cases "a = 0") simp_all lemma ennreal_zero_less_mult_iff: "0 < a * b \ 0 < a \ 0 < (b::ennreal)" - by transfer (auto simp add: ereal_zero_less_0_iff le_less) + using not_gr_zero by fastforce lemma less_diff_eq_ennreal: fixes a b c :: ennreal @@ -768,7 +761,7 @@ by transfer (metis (no_types) add.commute ereal_diff_positive ereal_ineq_diff_add max_def not_MInfty_nonneg) lemma ennreal_diff_self[simp]: "a \ top \ a - a = (0::ennreal)" - by transfer (simp add: top_ereal_def) + by (meson ennreal_minus_pos_iff less_imp_neq not_gr_zero top.not_eq_extremum) lemma ennreal_minus_mono: fixes a b c :: ennreal @@ -852,7 +845,7 @@ by (metis e2ennreal_def enn2ereal_inverse ennreal.rep_eq sup_ereal_def) lemma ennreal_0[simp]: "ennreal 0 = 0" - by (simp add: ennreal_def max.absorb1 zero_ennreal.abs_eq) + by (simp add: ennreal_def zero_ennreal.abs_eq) lemma ennreal_1[simp]: "ennreal 1 = 1" by transfer (simp add: max_absorb2) @@ -926,11 +919,10 @@ by (auto split: split_min) lemma ennreal_half[simp]: "ennreal (1/2) = inverse 2" - by transfer (simp add: max.absorb2) + by transfer auto lemma ennreal_minus: "0 \ q \ ennreal r - ennreal q = ennreal (r - q)" - by transfer - (simp add: max.absorb2 zero_ereal_def flip: ereal_max) + by transfer (simp add: zero_ereal_def flip: ereal_max) lemma ennreal_minus_top[simp]: "ennreal a - top = 0" by (simp add: minus_top_ennreal) @@ -958,8 +950,7 @@ by (induction n) (auto simp: ennreal_mult) lemma power_eq_top_ennreal: "x ^ n = top \ (n \ 0 \ (x::ennreal) = top)" - by (cases x rule: ennreal_cases) - (auto simp: ennreal_power top_power_ennreal) + using not_gr_zero power_eq_top_ennreal_iff by force lemma inverse_ennreal: "0 < r \ inverse (ennreal r) = ennreal (inverse r)" by transfer (simp add: max.absorb2) @@ -982,7 +973,7 @@ lemma power_divide_distrib_ennreal [algebra_simps]: "(x / y) ^ n = x ^ n / (y ^ n :: ennreal)" - by (simp add: divide_ennreal_def algebra_simps ennreal_inverse_power) + by (simp add: divide_ennreal_def ennreal_inverse_power power_mult_distrib) lemma ennreal_divide_numeral: "0 \ x \ ennreal x / numeral b = ennreal (x / numeral b)" by (subst divide_ennreal[symmetric]) auto @@ -997,11 +988,7 @@ using assms by (induction A rule: infinite_finite_induct) (auto intro!: mult_mono) lemma mult_right_ennreal_cancel: "a * ennreal c = b * ennreal c \ (a = b \ c \ 0)" -proof (cases "0 \ c") - case True - then show ?thesis - by (metis ennreal_eq_0_iff ennreal_mult_right_cong ennreal_neq_top mult_divide_eq_ennreal) -qed (use ennreal_neg in auto) + by (metis ennreal_eq_0_iff mult_divide_eq_ennreal mult_eq_0_iff top_neq_ennreal) lemma ennreal_le_epsilon: "(\e::real. y < top \ 0 < e \ x \ y + ennreal e) \ x \ y" @@ -1166,13 +1153,13 @@ lemma enn2ereal_Iio: "enn2ereal -` {.. a then {..< e2ennreal a} else {})" using enn2ereal_nonneg by (cases a rule: ereal_ennreal_cases) - (auto simp add: vimage_def set_eq_iff ennreal.enn2ereal_inverse less_ennreal.rep_eq e2ennreal_def max_absorb2 + (auto simp add: vimage_def set_eq_iff ennreal.enn2ereal_inverse less_ennreal.rep_eq e2ennreal_def simp del: enn2ereal_nonneg intro: le_less_trans less_imp_le) lemma enn2ereal_Ioi: "enn2ereal -` {a <..} = (if 0 \ a then {e2ennreal a <..} else UNIV)" by (cases a rule: ereal_ennreal_cases) - (auto simp add: vimage_def set_eq_iff ennreal.enn2ereal_inverse less_ennreal.rep_eq e2ennreal_def max_absorb2 + (auto simp add: vimage_def set_eq_iff ennreal.enn2ereal_inverse less_ennreal.rep_eq e2ennreal_def intro: less_le_trans) instantiation ennreal :: linear_continuum_topology @@ -1203,25 +1190,23 @@ show "continuous_on ({0..} \ {..0}) e2ennreal" proof (rule continuous_on_closed_Un) show "continuous_on {0 ..} e2ennreal" - by (rule continuous_onI_mono) - (auto simp add: less_eq_ennreal.abs_eq eq_onp_def enn2ereal_range) + by (simp add: continuous_onI_mono e2ennreal_mono enn2ereal_range) show "continuous_on {.. 0} e2ennreal" - by (subst continuous_on_cong[OF refl, of _ _ "\_. 0"]) - (auto simp add: e2ennreal_neg continuous_on_const) + by (metis atMost_iff continuous_on_cong continuous_on_const e2ennreal_neg) qed auto - show "A \ {0..} \ {..0::ereal}" - by auto -qed +qed auto lemma continuous_at_e2ennreal: "continuous (at x within A) e2ennreal" - by (rule continuous_on_imp_continuous_within[OF continuous_on_e2ennreal, of _ UNIV]) auto + using continuous_on_e2ennreal continuous_on_imp_continuous_within top.extremum + by blast lemma continuous_on_enn2ereal: "continuous_on UNIV enn2ereal" by (rule continuous_on_generate_topology[OF open_generated_order]) (auto simp add: enn2ereal_Iio enn2ereal_Ioi) lemma continuous_at_enn2ereal: "continuous (at x within A) enn2ereal" - by (rule continuous_on_imp_continuous_within[OF continuous_on_enn2ereal]) auto + by (meson UNIV_I continuous_at_imp_continuous_at_within + continuous_on_enn2ereal continuous_on_eq_continuous_within) lemma sup_continuous_e2ennreal[order_continuous_intros]: assumes f: "sup_continuous f" shows "sup_continuous (\x. e2ennreal (f x))" @@ -1370,7 +1355,7 @@ unfolding sums_def by (simp add: always_eventually sum_nonneg) lemma suminf_enn2ereal[simp]: "(\i. enn2ereal (f i)) = enn2ereal (suminf f)" - by (rule sums_unique[symmetric]) (simp add: summable_sums) + by (metis summableI summable_sums sums_enn2ereal sums_unique) lemma transfer_e2ennreal_suminf [transfer_rule]: "rel_fun (rel_fun (=) pcr_ennreal) pcr_ennreal suminf suminf" by (auto simp: rel_funI rel_fun_eq_pcr_ennreal comp_def) @@ -1565,7 +1550,7 @@ fixes f g :: "nat \ ennreal" shows "(\i. g i \ f i) \ suminf f \ top \ suminf g \ top \ (\i. f i - g i) = suminf f - suminf g" by transfer - (auto simp add: max.absorb2 ereal_diff_positive suminf_le_pos top_ereal_def intro!: suminf_ereal_minus) + (auto simp add: ereal_diff_positive suminf_le_pos top_ereal_def intro!: suminf_ereal_minus) lemma ennreal_Sup_countable_SUP: "A \ {} \ \f::nat \ ennreal. incseq f \ range f \ A \ Sup A = (SUP i. f i)" @@ -1605,7 +1590,7 @@ have "f (SUP i \ I. g i) = (SUP i \ range M. f i)" unfolding eq sup_continuousD[OF f \mono M\] by (simp add: image_comp) also have "\ \ (SUP i \ I. f (g i))" - by (insert M, drule SUP_subset_mono) (auto simp add: image_comp) + by (smt (verit) M SUP_le_iff dual_order.refl image_iff subsetD) finally show "f (SUP i \ I. g i) \ (SUP i \ I. f (g i))" . qed @@ -1633,8 +1618,9 @@ (* Contributed by Dominique Unruh *) lemma isCont_ennreal[simp]: \isCont ennreal x\ - apply (auto intro!: sequentially_imp_eventually_within simp: continuous_within tendsto_def) - by (metis tendsto_def tendsto_ennrealI) + unfolding continuous_within tendsto_def + using tendsto_ennrealI topological_tendstoD + by (blast intro: sequentially_imp_eventually_within) (* Contributed by Dominique Unruh *) lemma isCont_ennreal_of_enat[simp]: \isCont ennreal_of_enat x\ @@ -1672,12 +1658,8 @@ define s where \s = {x}\ have \open s\ using False open_enat_iff s_def by blast - moreover have \x \ s\ - using s_def by auto - moreover have \ennreal_of_enat z \ t\ if \z \ s\ for z - using asm s_def that by blast - ultimately show \\s. open s \ x \ s \ (\z\s. ennreal_of_enat z \ t)\ - by auto + then show \\s. open s \ x \ s \ (\z\s. ennreal_of_enat z \ t)\ + using asm s_def by blast qed qed @@ -1686,15 +1668,10 @@ lemma INF_approx_ennreal: fixes x::ennreal and e::real assumes "e > 0" - assumes INF: "x = (INF i \ A. f i)" + assumes "x = (INF i \ A. f i)" assumes "x \ \" shows "\i \ A. f i < x + e" -proof - - have "(INF i \ A. f i) < x + e" - unfolding INF[symmetric] using \0 \x \ \\ by (cases x) auto - then show ?thesis - unfolding INF_less_iff . -qed + using INF_less_iff assms by fastforce lemma SUP_approx_ennreal: fixes x::ennreal and e::real @@ -1751,9 +1728,9 @@ lemma ennreal_approx_unit: "(\a::ennreal. 0 < a \ a < 1 \ a * z \ y) \ z \ y" - apply (subst SUP_mult_right_ennreal[of "\x. x" "{0 <..< 1}" z, simplified]) - apply (auto intro: SUP_least) - done + using SUP_mult_right_ennreal[of "\x. x" "{0 <..< 1}" z] + by (smt (verit) SUP_least Sup_greaterThanLessThan greaterThanLessThan_iff + image_ident mult_1 zero_less_one) lemma suminf_ennreal2: "(\i. 0 \ f i) \ summable f \ (\i. ennreal (f i)) = ennreal (\i. f i)" @@ -1784,11 +1761,8 @@ lemma ennreal_tendsto_top_eq_at_top: "((\z. ennreal (f z)) \ top) F \ (LIM z F. f z :> at_top)" unfolding filterlim_at_top_dense tendsto_top_iff_ennreal - using ennreal_less_iff eventually_mono - apply (auto simp: ennreal_less_iff) - subgoal for y - by (auto elim!: eventually_mono allE[of _ "max 0 y"]) - done + using ennreal_less_iff eventually_mono allE[of _ "max 0 _"] + by (smt (verit) linorder_not_less order_refl order_trans) lemma tendsto_0_if_Limsup_eq_0_ennreal: fixes f :: "_ \ ennreal" @@ -1874,10 +1848,7 @@ lemma add_diff_eq_iff_ennreal[simp]: fixes x y :: ennreal shows "x + (y - x) = y \ x \ y" -proof - assume *: "x + (y - x) = y" show "x \ y" - by (subst *[symmetric]) simp -qed (simp add: add_diff_inverse_ennreal) + by (metis ennreal_ineq_diff_add le_iff_add) lemma add_diff_le_ennreal: "a + b - c \ a + (b - c::ennreal)" apply (cases a b c rule: ennreal3_cases) @@ -1901,7 +1872,8 @@ simp flip: ennreal_plus) lemma power_less_top_ennreal: fixes x :: ennreal shows "x ^ n < top \ x < top \ n = 0" - using power_eq_top_ennreal[of x n] by (auto simp: less_top) + using power_eq_top_ennreal top.not_eq_extremum + by blast lemma ennreal_divide_times: "(a / b) * c = a * (c / b :: ennreal)" by (simp add: mult.commute ennreal_times_divide) @@ -1914,7 +1886,7 @@ (auto simp: divide_ennreal ennreal_mult[symmetric] ennreal_less_iff field_simps ennreal_top_mult ennreal_top_divide) lemma one_less_numeral[simp]: "1 < (numeral n::ennreal) \ (num.One < n)" - by (simp flip: ennreal_1 ennreal_numeral add: ennreal_less_iff) + by simp lemma divide_eq_1_ennreal: "a / b = (1::ennreal) \ (b \ top \ b \ 0 \ b = a)" by (cases a ; cases b; cases "b = 0") (auto simp: ennreal_top_divide divide_ennreal split: if_split_asm) diff -r 40f979c845b7 -r 5a2e05eb7001 src/HOL/Library/ListVector.thy --- a/src/HOL/Library/ListVector.thy Mon Jan 13 21:17:40 2025 +0100 +++ b/src/HOL/Library/ListVector.thy Tue Jan 14 18:46:58 2025 +0000 @@ -3,7 +3,7 @@ section \Lists as vectors\ theory ListVector -imports Main + imports Main begin text\\noindent @@ -13,19 +13,19 @@ text\Multiplication with a scalar:\ abbreviation scale :: "('a::times) \ 'a list \ 'a list" (infix \*\<^sub>s\ 70) -where "x *\<^sub>s xs \ map ((*) x) xs" + where "x *\<^sub>s xs \ map ((*) x) xs" lemma scale1[simp]: "(1::'a::monoid_mult) *\<^sub>s xs = xs" -by (induct xs) simp_all + by (induct xs) simp_all subsection \\+\ and \-\\ fun zipwith0 :: "('a::zero \ 'b::zero \ 'c) \ 'a list \ 'b list \ 'c list" -where -"zipwith0 f [] [] = []" | -"zipwith0 f (x#xs) (y#ys) = f x y # zipwith0 f xs ys" | -"zipwith0 f (x#xs) [] = f x 0 # zipwith0 f xs []" | -"zipwith0 f [] (y#ys) = f 0 y # zipwith0 f [] ys" + where + "zipwith0 f [] [] = []" | + "zipwith0 f (x#xs) (y#ys) = f x y # zipwith0 f xs ys" | + "zipwith0 f (x#xs) [] = f x 0 # zipwith0 f xs []" | + "zipwith0 f [] (y#ys) = f 0 y # zipwith0 f [] ys" instantiation list :: ("{zero, plus}") plus begin @@ -58,44 +58,44 @@ end lemma zipwith0_Nil[simp]: "zipwith0 f [] ys = map (f 0) ys" -by(induct ys) simp_all + by(induct ys) simp_all lemma list_add_Nil[simp]: "[] + xs = (xs::'a::monoid_add list)" -by (induct xs) (auto simp:list_add_def) + by (induct xs) (auto simp:list_add_def) lemma list_add_Nil2[simp]: "xs + [] = (xs::'a::monoid_add list)" -by (induct xs) (auto simp:list_add_def) + by (induct xs) (auto simp:list_add_def) lemma list_add_Cons[simp]: "(x#xs) + (y#ys) = (x+y)#(xs+ys)" -by(auto simp:list_add_def) + by(auto simp:list_add_def) lemma list_diff_Nil[simp]: "[] - xs = -(xs::'a::group_add list)" -by (induct xs) (auto simp:list_diff_def list_uminus_def) + by (induct xs) (auto simp:list_diff_def list_uminus_def) lemma list_diff_Nil2[simp]: "xs - [] = (xs::'a::group_add list)" -by (induct xs) (auto simp:list_diff_def) + by (induct xs) (auto simp:list_diff_def) lemma list_diff_Cons_Cons[simp]: "(x#xs) - (y#ys) = (x-y)#(xs-ys)" -by (induct xs) (auto simp:list_diff_def) + by (induct xs) (auto simp:list_diff_def) lemma list_uminus_Cons[simp]: "-(x#xs) = (-x)#(-xs)" -by (induct xs) (auto simp:list_uminus_def) + by (induct xs) (auto simp:list_uminus_def) lemma self_list_diff: "xs - xs = replicate (length(xs::'a::group_add list)) 0" -by(induct xs) simp_all + by(induct xs) simp_all -lemma list_add_assoc: fixes xs :: "'a::monoid_add list" -shows "(xs+ys)+zs = xs+(ys+zs)" -apply(induct xs arbitrary: ys zs) - apply simp -apply(case_tac ys) - apply(simp) -apply(simp) -apply(case_tac zs) - apply(simp) -apply(simp add: add.assoc) -done +lemma list_add_assoc: + fixes xs :: "'a::monoid_add list" + shows "(xs+ys)+zs = xs+(ys+zs)" +proof (induct xs arbitrary: ys zs) + case Nil + then show ?case by simp +next + case (Cons a xs ys zs) + show ?case + by (cases ys; cases zs; simp add: add.assoc Cons) +qed subsection "Inner product" @@ -103,50 +103,55 @@ where "\xs,ys\ = (\(x,y) \ zip xs ys. x*y)" lemma iprod_Nil[simp]: "\[],ys\ = 0" -by(simp add: iprod_def) + by(simp add: iprod_def) lemma iprod_Nil2[simp]: "\xs,[]\ = 0" -by(simp add: iprod_def) + by(simp add: iprod_def) lemma iprod_Cons[simp]: "\x#xs,y#ys\ = x*y + \xs,ys\" -by(simp add: iprod_def) + by(simp add: iprod_def) lemma iprod0_if_coeffs0: "\c\set cs. c = 0 \ \cs,xs\ = 0" -apply(induct cs arbitrary:xs) - apply simp -apply(case_tac xs) apply simp -apply auto -done +proof (induct cs arbitrary: xs) + case Nil + then show ?case by simp +next + case (Cons a cs xs) + then show ?case + by (cases xs; fastforce) +qed lemma iprod_uminus[simp]: "\-xs,ys\ = -\xs,ys\" -by(simp add: iprod_def uminus_sum_list_map o_def split_def map_zip_map list_uminus_def) + by(simp add: iprod_def uminus_sum_list_map o_def split_def map_zip_map list_uminus_def) lemma iprod_left_add_distrib: "\xs + ys,zs\ = \xs,zs\ + \ys,zs\" -apply(induct xs arbitrary: ys zs) -apply (simp add: o_def split_def) -apply(case_tac ys) -apply simp -apply(case_tac zs) -apply (simp) -apply(simp add: distrib_right) -done +proof (induct xs arbitrary: ys zs) + case Nil + then show ?case by simp +next + case (Cons a xs ys zs) + show ?case + by (cases ys; cases zs; simp add: distrib_right Cons) +qed lemma iprod_left_diff_distrib: "\xs - ys, zs\ = \xs,zs\ - \ys,zs\" -apply(induct xs arbitrary: ys zs) -apply (simp add: o_def split_def) -apply(case_tac ys) -apply simp -apply(case_tac zs) -apply (simp) -apply(simp add: left_diff_distrib) -done +proof (induct xs arbitrary: ys zs) + case Nil + then show ?case by simp +next + case (Cons a xs ys zs) + show ?case + by (cases ys; cases zs; simp add: left_diff_distrib Cons) +qed lemma iprod_assoc: "\x *\<^sub>s xs, ys\ = x * \xs,ys\" -apply(induct xs arbitrary: ys) -apply simp -apply(case_tac ys) -apply (simp) -apply (simp add: distrib_left mult.assoc) -done +proof (induct xs arbitrary: ys) + case Nil + then show ?case by simp +next + case (Cons a xs ys) + show ?case + by (cases ys; simp add: distrib_left mult.assoc Cons) +qed end