[STATEMENT]
lemma omega_sum_less_iff_cases:
  assumes "m > 0" "n > 0"
  shows "omega_sum (m#ms) < omega_sum (n#ns)
          \<longleftrightarrow> length ms < length ns
            \<or> length ms = length ns \<and> m<n
            \<or> length ms = length ns \<and> m=n \<and> omega_sum ms < omega_sum ns"
    (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (omega_sum (m # ms) < omega_sum (n # ns)) = (length ms < length ns \<or> length ms = length ns \<and> m < n \<or> length ms = length ns \<and> m = n \<and> omega_sum ms < omega_sum ns)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. omega_sum (m # ms) < omega_sum (n # ns) \<Longrightarrow> length ms < length ns \<or> length ms = length ns \<and> m < n \<or> length ms = length ns \<and> m = n \<and> omega_sum ms < omega_sum ns
 2. length ms < length ns \<or> length ms = length ns \<and> m < n \<or> length ms = length ns \<and> m = n \<and> omega_sum ms < omega_sum ns \<Longrightarrow> omega_sum (m # ms) < omega_sum (n # ns)
[PROOF STEP]
assume ?lhs
[PROOF STATE]
proof (state)
this:
omega_sum (m # ms) < omega_sum (n # ns)

goal (2 subgoals):
 1. omega_sum (m # ms) < omega_sum (n # ns) \<Longrightarrow> length ms < length ns \<or> length ms = length ns \<and> m < n \<or> length ms = length ns \<and> m = n \<and> omega_sum ms < omega_sum ns
 2. length ms < length ns \<or> length ms = length ns \<and> m < n \<or> length ms = length ns \<and> m = n \<and> omega_sum ms < omega_sum ns \<Longrightarrow> omega_sum (m # ms) < omega_sum (n # ns)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
omega_sum (m # ms) < omega_sum (n # ns)
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
using this:
omega_sum (m # ms) < omega_sum (n # ns)

goal (1 subgoal):
 1. length ms < length ns \<or> length ms = length ns \<and> m < n \<or> length ms = length ns \<and> m = n \<and> omega_sum ms < omega_sum ns
[PROOF STEP]
by (metis Suc_less_eq \<open>m>0\<close> length_Cons less_asym nat_neq_iff normal_Cons omega_sum_length_less omega_sum_less_eqlen_iff_cases)
[PROOF STATE]
proof (state)
this:
length ms < length ns \<or> length ms = length ns \<and> m < n \<or> length ms = length ns \<and> m = n \<and> omega_sum ms < omega_sum ns

goal (1 subgoal):
 1. length ms < length ns \<or> length ms = length ns \<and> m < n \<or> length ms = length ns \<and> m = n \<and> omega_sum ms < omega_sum ns \<Longrightarrow> omega_sum (m # ms) < omega_sum (n # ns)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. length ms < length ns \<or> length ms = length ns \<and> m < n \<or> length ms = length ns \<and> m = n \<and> omega_sum ms < omega_sum ns \<Longrightarrow> omega_sum (m # ms) < omega_sum (n # ns)
[PROOF STEP]
assume ?rhs
[PROOF STATE]
proof (state)
this:
length ms < length ns \<or> length ms = length ns \<and> m < n \<or> length ms = length ns \<and> m = n \<and> omega_sum ms < omega_sum ns

goal (1 subgoal):
 1. length ms < length ns \<or> length ms = length ns \<and> m < n \<or> length ms = length ns \<and> m = n \<and> omega_sum ms < omega_sum ns \<Longrightarrow> omega_sum (m # ms) < omega_sum (n # ns)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
length ms < length ns \<or> length ms = length ns \<and> m < n \<or> length ms = length ns \<and> m = n \<and> omega_sum ms < omega_sum ns
[PROOF STEP]
show ?lhs
[PROOF STATE]
proof (prove)
using this:
length ms < length ns \<or> length ms = length ns \<and> m < n \<or> length ms = length ns \<and> m = n \<and> omega_sum ms < omega_sum ns

goal (1 subgoal):
 1. omega_sum (m # ms) < omega_sum (n # ns)
[PROOF STEP]
by (metis (full_types) Suc_less_eq \<open>n>0\<close> length_Cons normal_Cons omega_sum_length_less omega_sum_less_eqlen_iff_cases)
[PROOF STATE]
proof (state)
this:
omega_sum (m # ms) < omega_sum (n # ns)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in group) subgroupI:
  assumes subset: "H \<subseteq> carrier G" and non_empty: "H \<noteq> {}"
    and inv: "!!a. a \<in> H \<Longrightarrow> inv a \<in> H"
    and mult: "!!a b. \<lbrakk>a \<in> H; b \<in> H\<rbrakk> \<Longrightarrow> a \<otimes> b \<in> H"
  shows "subgroup H G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subgroup H G
[PROOF STEP]
proof (simp add: subgroup_def assms)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<one> \<in> H
[PROOF STEP]
show "\<one> \<in> H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<one> \<in> H
[PROOF STEP]
by (rule one_in_subset) (auto simp only: assms)
[PROOF STATE]
proof (state)
this:
\<one> \<in> H

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma tendsto_compose_at:
  assumes f: "(f \<longlongrightarrow> y) F" and g: "(g \<longlongrightarrow> z) (at y)" and fg: "eventually (\<lambda>w. f w = y \<longrightarrow> g y = z) F"
  shows "((g \<circ> f) \<longlongrightarrow> z) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((g \<circ> f) \<longlongrightarrow> z) F
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((g \<circ> f) \<longlongrightarrow> z) F
[PROOF STEP]
have "(\<forall>\<^sub>F a in F. f a \<noteq> y) \<or> g y = z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>\<^sub>F a in F. f a \<noteq> y) \<or> g y = z
[PROOF STEP]
using fg
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F w in F. f w = y \<longrightarrow> g y = z

goal (1 subgoal):
 1. (\<forall>\<^sub>F a in F. f a \<noteq> y) \<or> g y = z
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
(\<forall>\<^sub>F a in F. f a \<noteq> y) \<or> g y = z

goal (1 subgoal):
 1. ((g \<circ> f) \<longlongrightarrow> z) F
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<forall>\<^sub>F a in F. f a \<noteq> y) \<or> g y = z

goal (1 subgoal):
 1. ((g \<circ> f) \<longlongrightarrow> z) F
[PROOF STEP]
have "(g \<longlongrightarrow> z) (filtermap f F) \<or> \<not> (\<forall>\<^sub>F a in F. f a \<noteq> y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (g \<longlongrightarrow> z) (filtermap f F) \<or> \<not> (\<forall>\<^sub>F a in F. f a \<noteq> y)
[PROOF STEP]
by (metis (no_types) filterlim_atI filterlim_def tendsto_mono f g)
[PROOF STATE]
proof (state)
this:
(g \<longlongrightarrow> z) (filtermap f F) \<or> \<not> (\<forall>\<^sub>F a in F. f a \<noteq> y)

goal (1 subgoal):
 1. ((g \<circ> f) \<longlongrightarrow> z) F
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<forall>\<^sub>F a in F. f a \<noteq> y) \<or> g y = z
(g \<longlongrightarrow> z) (filtermap f F) \<or> \<not> (\<forall>\<^sub>F a in F. f a \<noteq> y)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<forall>\<^sub>F a in F. f a \<noteq> y) \<or> g y = z
(g \<longlongrightarrow> z) (filtermap f F) \<or> \<not> (\<forall>\<^sub>F a in F. f a \<noteq> y)

goal (1 subgoal):
 1. ((g \<circ> f) \<longlongrightarrow> z) F
[PROOF STEP]
by (metis (no_types) f filterlim_compose filterlim_filtermap g tendsto_at_iff_tendsto_nhds tendsto_compose_filtermap)
[PROOF STATE]
proof (state)
this:
((g \<circ> f) \<longlongrightarrow> z) F

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma no_trailing_map:
  "no_trailing P (map f xs) \<longleftrightarrow> no_trailing (P \<circ> f) xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. no_trailing P (map f xs) = no_trailing (P \<circ> f) xs
[PROOF STEP]
by (simp add: last_map no_trailing_unfold)


[STATEMENT]
lemma PosOrd_LeftI:
  assumes "v1 :\<sqsubset>val v2" "flat v1 = flat v2"
  shows  "Left v1 :\<sqsubset>val Left v2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. val.Left v1 :\<sqsubset>val val.Left v2
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
v1 :\<sqsubset>val v2
flat v1 = flat v2

goal (1 subgoal):
 1. val.Left v1 :\<sqsubset>val val.Left v2
[PROOF STEP]
unfolding PosOrd_ex_def PosOrd_def2
[PROOF STATE]
proof (prove)
using this:
\<exists>p. pflat_len v2 p < pflat_len v1 p \<and> (\<forall>q\<in>Pos v1. q \<sqsubset>lex p \<longrightarrow> pflat_len v1 q = pflat_len v2 q) \<and> (\<forall>q\<in>Pos v2. q \<sqsubset>lex p \<longrightarrow> pflat_len v1 q = pflat_len v2 q)
flat v1 = flat v2

goal (1 subgoal):
 1. \<exists>p. pflat_len (val.Left v2) p < pflat_len (val.Left v1) p \<and> (\<forall>q\<in>Pos (val.Left v1). q \<sqsubset>lex p \<longrightarrow> pflat_len (val.Left v1) q = pflat_len (val.Left v2) q) \<and> (\<forall>q\<in>Pos (val.Left v2). q \<sqsubset>lex p \<longrightarrow> pflat_len (val.Left v1) q = pflat_len (val.Left v2) q)
[PROOF STEP]
apply(auto simp add: pflat_len_simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>p. \<lbrakk>flat v1 = flat v2; pflat_len v2 p < pflat_len v1 p; \<forall>q\<in>Pos v1. q \<sqsubset>lex p \<longrightarrow> pflat_len v1 q = pflat_len v2 q; \<forall>q\<in>Pos v2. q \<sqsubset>lex p \<longrightarrow> pflat_len v1 q = pflat_len v2 q\<rbrakk> \<Longrightarrow> \<exists>p. pflat_len (val.Left v2) p < pflat_len (val.Left v1) p \<and> (\<forall>q. (\<exists>ps. q = 0 # ps \<and> ps \<in> Pos v1) \<longrightarrow> q \<sqsubset>lex p \<longrightarrow> pflat_len (val.Left v1) q = pflat_len (val.Left v2) q) \<and> (\<forall>q. (\<exists>ps. q = 0 # ps \<and> ps \<in> Pos v2) \<longrightarrow> q \<sqsubset>lex p \<longrightarrow> pflat_len (val.Left v1) q = pflat_len (val.Left v2) q)
[PROOF STEP]
by (metis less_numeral_extra(3) lex_simps(3) pflat_len_simps(3))


[STATEMENT]
lemma ordermap_bij:
  assumes "wf r" "total_on A r" "small A"
  shows "bij_betw (ordermap A r) A (elts (ordertype A r))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw (ordermap A r) A (elts (ordertype A r))
[PROOF STEP]
unfolding bij_betw_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (ordermap A r) A \<and> ordermap A r ` A = elts (ordertype A r)
[PROOF STEP]
proof (intro conjI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. inj_on (ordermap A r) A
 2. ordermap A r ` A = elts (ordertype A r)
[PROOF STEP]
show "inj_on (ordermap A r) A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (ordermap A r) A
[PROOF STEP]
unfolding inj_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>A. \<forall>y\<in>A. ordermap A r x = ordermap A r y \<longrightarrow> x = y
[PROOF STEP]
by (metis assms mem_not_refl ordermap_mono total_on_def)
[PROOF STATE]
proof (state)
this:
inj_on (ordermap A r) A

goal (1 subgoal):
 1. ordermap A r ` A = elts (ordertype A r)
[PROOF STEP]
show "ordermap A r ` A = elts (ordertype A r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ordermap A r ` A = elts (ordertype A r)
[PROOF STEP]
by (metis ordertype_def \<open>small A\<close> elts_of_set replacement)
[PROOF STATE]
proof (state)
this:
ordermap A r ` A = elts (ordertype A r)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma minus_image_real_of_ereal_image_greaterThanLessThan:
  "(-) c ` real_of_ereal ` {l <..< u} = real_of_ereal ` {c - u <..< c - l}"
  (is "?l = ?r")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (-) c ` real_of_ereal ` {l<..<u} = real_of_ereal ` {ereal c - u<..<ereal c - l}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (-) c ` real_of_ereal ` {l<..<u} = real_of_ereal ` {ereal c - u<..<ereal c - l}
[PROOF STEP]
have "?l = (+) c ` uminus ` real_of_ereal ` {l <..< u}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (-) c ` real_of_ereal ` {l<..<u} = (+) c ` uminus ` real_of_ereal ` {l<..<u}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(-) c ` real_of_ereal ` {l<..<u} = (+) c ` uminus ` real_of_ereal ` {l<..<u}

goal (1 subgoal):
 1. (-) c ` real_of_ereal ` {l<..<u} = real_of_ereal ` {ereal c - u<..<ereal c - l}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(-) c ` real_of_ereal ` {l<..<u} = (+) c ` uminus ` real_of_ereal ` {l<..<u}

goal (1 subgoal):
 1. (-) c ` real_of_ereal ` {l<..<u} = real_of_ereal ` {ereal c - u<..<ereal c - l}
[PROOF STEP]
note uminus_image_real_of_ereal_image_greaterThanLessThan
[PROOF STATE]
proof (state)
this:
uminus ` real_of_ereal ` {?l<..<?u} = real_of_ereal ` {- ?u<..<- ?l}

goal (1 subgoal):
 1. (-) c ` real_of_ereal ` {l<..<u} = real_of_ereal ` {ereal c - u<..<ereal c - l}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
uminus ` real_of_ereal ` {?l<..<?u} = real_of_ereal ` {- ?u<..<- ?l}

goal (1 subgoal):
 1. (-) c ` real_of_ereal ` {l<..<u} = real_of_ereal ` {ereal c - u<..<ereal c - l}
[PROOF STEP]
note add_image_real_of_ereal_image_greaterThanLessThan
[PROOF STATE]
proof (state)
this:
(+) ?c ` real_of_ereal ` {?l<..<?u} = real_of_ereal ` {ereal ?c + ?l<..<ereal ?c + ?u}

goal (1 subgoal):
 1. (-) c ` real_of_ereal ` {l<..<u} = real_of_ereal ` {ereal c - u<..<ereal c - l}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(-) c ` real_of_ereal ` {l<..<u} = real_of_ereal ` {ereal c + - u<..<ereal c + - l}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(-) c ` real_of_ereal ` {l<..<u} = real_of_ereal ` {ereal c + - u<..<ereal c + - l}

goal (1 subgoal):
 1. (-) c ` real_of_ereal ` {l<..<u} = real_of_ereal ` {ereal c - u<..<ereal c - l}
[PROOF STEP]
by (simp add: minus_ereal_def)
[PROOF STATE]
proof (state)
this:
(-) c ` real_of_ereal ` {l<..<u} = real_of_ereal ` {ereal c - u<..<ereal c - l}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fls_X_inv_power_times_conv_shift:
  "fls_X_inv ^ n * f = fls_shift (int n) f" "f * fls_X_inv ^ n = fls_shift (int n) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_X_inv ^ n * f = fls_shift (int n) f &&& f * fls_X_inv ^ n = fls_shift (int n) f
[PROOF STEP]
using fls_times_both_shifted_simp[of "int n" 1 0 f]
        fls_times_both_shifted_simp[of 0 f "int n" 1]
[PROOF STATE]
proof (prove)
using this:
fls_shift (int n) 1 * fls_shift 0 f = fls_shift (int n + 0) (1 * f)
fls_shift 0 f * fls_shift (int n) 1 = fls_shift (0 + int n) (f * 1)

goal (1 subgoal):
 1. fls_X_inv ^ n * f = fls_shift (int n) f &&& f * fls_X_inv ^ n = fls_shift (int n) f
[PROOF STEP]
by    (simp_all add: fls_X_inv_power_conv_shift_1)


[STATEMENT]
lemma extract_Some_iff:
  "List.extract P xs = Some (ys, y, zs) \<longleftrightarrow>
   xs = ys @ y # zs \<and> P y \<and> \<not> (\<exists> y \<in> set ys. P y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (List.extract P xs = Some (ys, y, zs)) = (xs = ys @ y # zs \<and> P y \<and> \<not> (\<exists>y\<in>set ys. P y))
[PROOF STEP]
by(auto simp: extract_def dropWhile_eq_Cons_conv dest: set_takeWhileD split: list.splits)


[STATEMENT]
lemma bl_word_or: "to_bl (v OR w) = map2 (\<or>) (to_bl v) (to_bl w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_bl (v OR w) = map2 (\<or>) (to_bl v) (to_bl w)
[PROOF STEP]
by transfer (simp flip: bl_or_bin)


[STATEMENT]
lemma snd_image_mset_times_mset [simp]:
  "image_mset snd (A \<times># B) = (if A = {#} then {#} else repeat_mset (size A) B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. image_mset snd (A \<times># B) = (if A = {#} then {#} else repeat_mset (size A) B)
[PROOF STEP]
by (induct B) (auto simp add: Times_mset_single_right Times_insert_left image_mset_const_eq)


[STATEMENT]
lemma shift_eq_scons: "u @- v = a ## w \<longleftrightarrow> (u = [] \<and> v = a ## w) \<or> (\<exists> u'. u = a # u' \<and> u' @- v = w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (u @- v = a ## w) = (u = [] \<and> v = a ## w \<or> (\<exists>u'. u = a # u' \<and> u' @- v = w))
[PROOF STEP]
by (cases u) (auto)


[STATEMENT]
lemma set_foldl_append:
  "set (foldl (@) i xs) = set i \<union> \<Union>{set x | x. x \<in> set xs}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (foldl (@) i xs) = set i \<union> \<Union> {set x |x. x \<in> set xs}
[PROOF STEP]
by (induction xs arbitrary: i) auto


[STATEMENT]
lemma spmf_of_pmf_pmf_of_set [simp]:
  "\<lbrakk> finite A; A \<noteq> {} \<rbrakk> \<Longrightarrow> spmf_of_pmf (pmf_of_set A) = spmf_of_set A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; A \<noteq> {}\<rbrakk> \<Longrightarrow> spmf_of_pmf (pmf_of_set A) = spmf_of_set A
[PROOF STEP]
by(simp add: spmf_of_set_def)


[STATEMENT]
lemma ordIso_or_ordLess:
assumes WELL: "Well_order r" and WELL': "Well_order r'"
shows "r =o r' \<or> r <o r' \<or> r' <o r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r =o r' \<or> r <o r' \<or> r' <o r
[PROOF STEP]
using assms ordLess_or_ordLeq ordLeq_iff_ordLess_or_ordIso
[PROOF STATE]
proof (prove)
using this:
Well_order r
Well_order r'
\<lbrakk>Well_order ?r; Well_order ?r'\<rbrakk> \<Longrightarrow> ?r <o ?r' \<or> ?r' \<le>o ?r
(?r \<le>o ?r') = (?r <o ?r' \<or> ?r =o ?r')

goal (1 subgoal):
 1. r =o r' \<or> r <o r' \<or> r' <o r
[PROOF STEP]
by blast


[STATEMENT]
lemma tendsto_minus_cancel_left:
  "(f \<longlongrightarrow> - (y::_::topological_group_add)) F \<longleftrightarrow> ((\<lambda>x. - f x) \<longlongrightarrow> y) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<longlongrightarrow> - y) F = ((\<lambda>x. - f x) \<longlongrightarrow> y) F
[PROOF STEP]
using tendsto_minus_cancel[of f "- y" F]  tendsto_minus[of f "- y" F]
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. - f x) \<longlongrightarrow> - (- y)) F \<Longrightarrow> (f \<longlongrightarrow> - y) F
(f \<longlongrightarrow> - y) F \<Longrightarrow> ((\<lambda>x. - f x) \<longlongrightarrow> - (- y)) F

goal (1 subgoal):
 1. (f \<longlongrightarrow> - y) F = ((\<lambda>x. - f x) \<longlongrightarrow> y) F
[PROOF STEP]
by auto


[STATEMENT]
lemma isometry_homeomorphism:
  fixes f::"('a::metric_space) \<Rightarrow> ('b::metric_space)"
  assumes "isometry f"
  shows "homeomorphism UNIV UNIV f (inv f)"
        "(UNIV::'a set) homeomorphic (UNIV::'b set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. homeomorphism UNIV UNIV f (inv f) &&& UNIV homeomorphic UNIV
[PROOF STEP]
using isometry_on_homeomorphism[OF isometryD(1)[OF assms]] isometryD(3)[OF assms]
[PROOF STATE]
proof (prove)
using this:
homeomorphism UNIV (range f) f (inv f)
homeomorphism_on UNIV f
UNIV homeomorphic range f
surj f

goal (1 subgoal):
 1. homeomorphism UNIV UNIV f (inv f) &&& UNIV homeomorphic UNIV
[PROOF STEP]
by auto


[STATEMENT]
lemma Qp_funs_car_memE:
  assumes "f \<in> carrier (Fun\<^bsub>n\<^esub> Q\<^sub>p)"
  shows "f \<in> (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) \<rightarrow> (carrier Q\<^sub>p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>) \<rightarrow> carrier Q\<^sub>p
[PROOF STEP]
by (simp add: assms ring_pow_function_ring_car_memE(2))


[STATEMENT]
lemma norm_round_complex_le: "norm (z - gauss2complex (round_complex z)) ^ 2 \<le> 1 / 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (cmod (z - gauss2complex (round_complex z)))\<^sup>2 \<le> 1 / 2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (cmod (z - gauss2complex (round_complex z)))\<^sup>2 \<le> 1 / 2
[PROOF STEP]
have "(Re z - ReZ (round_complex z)) ^ 2 \<le> (1 / 2) ^ 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Re z - real_of_int (ReZ (round_complex z)))\<^sup>2 \<le> (1 / 2)\<^sup>2
[PROOF STEP]
using of_int_round_abs_le[of "Re z"]
[PROOF STATE]
proof (prove)
using this:
\<bar>real_of_int (round (Re z)) - Re z\<bar> \<le> 1 / 2

goal (1 subgoal):
 1. (Re z - real_of_int (ReZ (round_complex z)))\<^sup>2 \<le> (1 / 2)\<^sup>2
[PROOF STEP]
by (subst abs_le_square_iff [symmetric]) (auto simp: abs_minus_commute)
[PROOF STATE]
proof (state)
this:
(Re z - real_of_int (ReZ (round_complex z)))\<^sup>2 \<le> (1 / 2)\<^sup>2

goal (1 subgoal):
 1. (cmod (z - gauss2complex (round_complex z)))\<^sup>2 \<le> 1 / 2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(Re z - real_of_int (ReZ (round_complex z)))\<^sup>2 \<le> (1 / 2)\<^sup>2

goal (1 subgoal):
 1. (cmod (z - gauss2complex (round_complex z)))\<^sup>2 \<le> 1 / 2
[PROOF STEP]
have "(Im z - ImZ (round_complex z)) ^ 2 \<le> (1 / 2) ^ 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Im z - real_of_int (ImZ (round_complex z)))\<^sup>2 \<le> (1 / 2)\<^sup>2
[PROOF STEP]
using of_int_round_abs_le[of "Im z"]
[PROOF STATE]
proof (prove)
using this:
\<bar>real_of_int (round (Im z)) - Im z\<bar> \<le> 1 / 2

goal (1 subgoal):
 1. (Im z - real_of_int (ImZ (round_complex z)))\<^sup>2 \<le> (1 / 2)\<^sup>2
[PROOF STEP]
by (subst abs_le_square_iff [symmetric]) (auto simp: abs_minus_commute)
[PROOF STATE]
proof (state)
this:
(Im z - real_of_int (ImZ (round_complex z)))\<^sup>2 \<le> (1 / 2)\<^sup>2

goal (1 subgoal):
 1. (cmod (z - gauss2complex (round_complex z)))\<^sup>2 \<le> 1 / 2
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(Re z - real_of_int (ReZ (round_complex z)))\<^sup>2 \<le> (1 / 2)\<^sup>2
(Im z - real_of_int (ImZ (round_complex z)))\<^sup>2 \<le> (1 / 2)\<^sup>2
[PROOF STEP]
have "(Re z - ReZ (round_complex z)) ^ 2 + (Im z - ImZ (round_complex z)) ^ 2 \<le>
                     (1 / 2) ^ 2 + (1 / 2) ^ 2"
[PROOF STATE]
proof (prove)
using this:
(Re z - real_of_int (ReZ (round_complex z)))\<^sup>2 \<le> (1 / 2)\<^sup>2
(Im z - real_of_int (ImZ (round_complex z)))\<^sup>2 \<le> (1 / 2)\<^sup>2

goal (1 subgoal):
 1. (Re z - real_of_int (ReZ (round_complex z)))\<^sup>2 + (Im z - real_of_int (ImZ (round_complex z)))\<^sup>2 \<le> (1 / 2)\<^sup>2 + (1 / 2)\<^sup>2
[PROOF STEP]
by (rule add_mono)
[PROOF STATE]
proof (state)
this:
(Re z - real_of_int (ReZ (round_complex z)))\<^sup>2 + (Im z - real_of_int (ImZ (round_complex z)))\<^sup>2 \<le> (1 / 2)\<^sup>2 + (1 / 2)\<^sup>2

goal (1 subgoal):
 1. (cmod (z - gauss2complex (round_complex z)))\<^sup>2 \<le> 1 / 2
[PROOF STEP]
thus "norm (z - gauss2complex (round_complex z)) ^ 2 \<le> 1 / 2"
[PROOF STATE]
proof (prove)
using this:
(Re z - real_of_int (ReZ (round_complex z)))\<^sup>2 + (Im z - real_of_int (ImZ (round_complex z)))\<^sup>2 \<le> (1 / 2)\<^sup>2 + (1 / 2)\<^sup>2

goal (1 subgoal):
 1. (cmod (z - gauss2complex (round_complex z)))\<^sup>2 \<le> 1 / 2
[PROOF STEP]
by (simp add: cmod_def power2_eq_square)
[PROOF STATE]
proof (state)
this:
(cmod (z - gauss2complex (round_complex z)))\<^sup>2 \<le> 1 / 2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bottom_eq:
  "\<lbrakk> b \<in> carrier L; \<And> x. x \<in> carrier L \<Longrightarrow> b \<sqsubseteq> x \<rbrakk> \<Longrightarrow> b = \<bottom>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>b \<in> carrier L; \<And>x. x \<in> carrier L \<Longrightarrow> b \<sqsubseteq> x\<rbrakk> \<Longrightarrow> b = \<bottom>
[PROOF STEP]
by (metis bottom_closed bottom_lower le_antisym)


[STATEMENT]
lemma Ring_CongruenceI: "\<lbrakk> a - b \<in> I; a \<in> R; b \<in> R \<rbrakk> \<Longrightarrow> (a, b) \<in> Ring_Congruence"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a - b \<in> I; a \<in> R; b \<in> R\<rbrakk> \<Longrightarrow> (a, b) \<in> Ring_Congruence
[PROOF STEP]
using Ring_Congruence_def
[PROOF STATE]
proof (prove)
using this:
Ring_Congruence = {(a, b). a \<in> R \<and> b \<in> R \<and> a - b \<in> I}

goal (1 subgoal):
 1. \<lbrakk>a - b \<in> I; a \<in> R; b \<in> R\<rbrakk> \<Longrightarrow> (a, b) \<in> Ring_Congruence
[PROOF STEP]
by blast


[STATEMENT]
lemma (in Corps) field_one_plus_frac1:"\<lbrakk>a \<in> carrier K; b \<in> carrier K; b \<noteq> \<zero>\<rbrakk>
 \<Longrightarrow> 1\<^sub>r \<plusminus> (a \<cdot>\<^sub>r (b\<^bsup>\<hyphen>K\<^esup>)) = (b \<plusminus> a) \<cdot>\<^sub>r (b\<^bsup>\<hyphen>K\<^esup>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier K; b \<in> carrier K; b \<noteq> \<zero>\<rbrakk> \<Longrightarrow> 1\<^sub>r \<plusminus> a \<cdot>\<^sub>r b\<^bsup>\<hyphen> K\<^esup> = (b \<plusminus> a) \<cdot>\<^sub>r b\<^bsup>\<hyphen> K\<^esup>
[PROOF STEP]
apply (cut_tac field_is_ring,
       cut_tac invf_closed1[of b], simp+, erule conjE,
       cut_tac field_is_idom)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>a \<in> carrier K; b \<in> carrier K; b \<noteq> \<zero>; Ring K; b\<^bsup>\<hyphen> K\<^esup> \<in> carrier K; b\<^bsup>\<hyphen> K\<^esup> \<noteq> \<zero>; Idomain K\<rbrakk> \<Longrightarrow> 1\<^sub>r \<plusminus> a \<cdot>\<^sub>r b\<^bsup>\<hyphen> K\<^esup> = (b \<plusminus> a) \<cdot>\<^sub>r b\<^bsup>\<hyphen> K\<^esup>
 2. \<lbrakk>a \<in> carrier K; b \<in> carrier K; b \<noteq> \<zero>; Ring K\<rbrakk> \<Longrightarrow> b \<in> carrier K - {\<zero>}
[PROOF STEP]
apply (rule Idomain.idom_mult_cancel_r[of K "1\<^sub>r \<plusminus> (a \<cdot>\<^sub>r (b\<^bsup>\<hyphen>K\<^esup>))"
        "(b \<plusminus> a) \<cdot>\<^sub>r (b\<^bsup>\<hyphen>K\<^esup>)" "b"],  assumption+,
       frule Idomain.idom_is_ring[of "K"], frule Ring.ring_is_ag[of "K"],
       rule aGroup.ag_pOp_closed [of "K"], assumption+,
       simp add:Ring.ring_one,rule Ring.ring_tOp_closed, assumption+,
       rule Ring.ring_tOp_closed, assumption+,
       frule Ring.ring_is_ag[of "K"],
       rule aGroup.ag_pOp_closed, assumption+,
       subst Ring.ring_distrib2[of "K" "b"], assumption+,
       simp add:Ring.ring_one, simp add:Ring.ring_tOp_closed,
       simp add:Ring.ring_l_one)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>a \<in> carrier K; b \<in> carrier K; b \<noteq> \<zero>; Ring K; b\<^bsup>\<hyphen> K\<^esup> \<in> carrier K; b\<^bsup>\<hyphen> K\<^esup> \<noteq> \<zero>; Idomain K\<rbrakk> \<Longrightarrow> b \<plusminus> a \<cdot>\<^sub>r b\<^bsup>\<hyphen> K\<^esup> \<cdot>\<^sub>r b = (b \<plusminus> a) \<cdot>\<^sub>r b\<^bsup>\<hyphen> K\<^esup> \<cdot>\<^sub>r b
 2. \<lbrakk>a \<in> carrier K; b \<in> carrier K; b \<noteq> \<zero>; Ring K\<rbrakk> \<Longrightarrow> b \<in> carrier K - {\<zero>}
[PROOF STEP]
thm Ring.ring_distrib2[of K "b\<^bsup>\<hyphen>K\<^esup>"]
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>a \<in> carrier K; b \<in> carrier K; b \<noteq> \<zero>; Ring K; b\<^bsup>\<hyphen> K\<^esup> \<in> carrier K; b\<^bsup>\<hyphen> K\<^esup> \<noteq> \<zero>; Idomain K\<rbrakk> \<Longrightarrow> b \<plusminus> a \<cdot>\<^sub>r b\<^bsup>\<hyphen> K\<^esup> \<cdot>\<^sub>r b = (b \<plusminus> a) \<cdot>\<^sub>r b\<^bsup>\<hyphen> K\<^esup> \<cdot>\<^sub>r b
 2. \<lbrakk>a \<in> carrier K; b \<in> carrier K; b \<noteq> \<zero>; Ring K\<rbrakk> \<Longrightarrow> b \<in> carrier K - {\<zero>}
[PROOF STEP]
apply (subst Ring.ring_distrib2[of K "b\<^bsup>\<hyphen>K\<^esup>"], assumption+,
       simp add:Ring.ring_tOp_commute[of "K" "b" "b\<^bsup>\<hyphen>K\<^esup>"],
       subst linvf[of "b"], simp,
       subst  Ring.ring_distrib2[of "K" "b"], assumption+,
       simp add:Ring.ring_one, simp add:Ring.ring_tOp_closed,
       simp add:Ring.ring_l_one, simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma maximal_repetition_sets_from_separators_code_alt:
  "maximal_repetition_sets_from_separators M = set (maximal_repetition_sets_from_separators_list_naive M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. maximal_repetition_sets_from_separators M = set (maximal_repetition_sets_from_separators_list_naive M)
[PROOF STEP]
unfolding maximal_repetition_sets_from_separators_def
            maximal_repetition_sets_from_separators_list_naive_def
            maximal_pairwise_r_distinguishable_state_sets_from_separators_code
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(S, S \<inter> fst ` d_reachable_states_with_preambles M) |S. S \<in> set (maximal_pairwise_r_distinguishable_state_sets_from_separators_list M)} = set (let DR = fst ` d_reachable_states_with_preambles M in map (\<lambda>S. (S, S \<inter> DR)) (maximal_pairwise_r_distinguishable_state_sets_from_separators_list M))
[PROOF STEP]
by force


[STATEMENT]
lemma "(x - y < z) = (x < z + (y::real))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x - y < z) = (x < z + y)
[PROOF STEP]
by arith


[STATEMENT]
lemma zhmset_of_times: "zhmset_of (A * B) = zhmset_of A * zhmset_of B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. zhmset_of (A * B) = zhmset_of A * zhmset_of B
[PROOF STEP]
by transfer simp


[STATEMENT]
lemma singular_simplex_simplex_map:
   "\<lbrakk>singular_simplex p X f; continuous_map X X' g\<rbrakk>
        \<Longrightarrow> singular_simplex p X' (simplex_map p g f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>singular_simplex p X f; continuous_map X X' g\<rbrakk> \<Longrightarrow> singular_simplex p X' (simplex_map p g f)
[PROOF STEP]
unfolding singular_simplex_def simplex_map_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>continuous_map (subtopology (powertop_real UNIV) (standard_simplex p)) X f \<and> f \<in> extensional (standard_simplex p); continuous_map X X' g\<rbrakk> \<Longrightarrow> continuous_map (subtopology (powertop_real UNIV) (standard_simplex p)) X' (restrict (g \<circ> f) (standard_simplex p)) \<and> restrict (g \<circ> f) (standard_simplex p) \<in> extensional (standard_simplex p)
[PROOF STEP]
by (auto simp: continuous_map_compose)


[STATEMENT]
lemma "\<forall>(x::int). 2 dvd x \<longleftrightarrow> (\<exists>(y::int). x = 2*y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. even x = (\<exists>y. x = 2 * y)
[PROOF STEP]
by cooper


[STATEMENT]
theorem TBtheorem3a:
assumes "\<not> (ine P E)"
       and "\<not> (ine Q E)"
       and "subcomponents PQ = {P,Q}"
       and "correctCompositionIn PQ"
shows    "\<not> (ine PQ E)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> ine PQ E
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<not> ine P E
\<not> ine Q E
subcomponents PQ = {P, Q}
correctCompositionIn PQ

goal (1 subgoal):
 1. \<not> ine PQ E
[PROOF STEP]
by (simp add: ine_def correctCompositionIn_def, auto )


[STATEMENT]
lemma continuous_on_blinfun_matrix:
  fixes f::"'a::t2_space \<Rightarrow> 'b::real_normed_vector \<Rightarrow>\<^sub>L 'c::real_inner"
  assumes "continuous_on S f"
  shows "continuous_on S (\<lambda>x. (f x) j \<bullet> i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on S (\<lambda>x. blinfun_apply (f x) j \<bullet> i)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
continuous_on S f

goal (1 subgoal):
 1. continuous_on S (\<lambda>x. blinfun_apply (f x) j \<bullet> i)
[PROOF STEP]
by (auto simp: continuous_on_eq_continuous_within continuous_blinfun_matrix)


[STATEMENT]
lemma lm020:
  assumes "finite X" "mx \<in> X" "f x < f mx"
  shows"x \<notin> argmax f X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<notin> argmax f X
[PROOF STEP]
using assms not_less
[PROOF STATE]
proof (prove)
using this:
finite X
mx \<in> X
f x < f mx
(\<not> ?x < ?y) = (?y \<le> ?x)

goal (1 subgoal):
 1. x \<notin> argmax f X
[PROOF STEP]
by fastforce


[STATEMENT]
lemma cut_greater_Max_not_empty: "\<lbrakk> I \<noteq> {}; finite I; t < Max I \<rbrakk> \<Longrightarrow> I \<down>> t \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>I \<noteq> {}; finite I; t < Max I\<rbrakk> \<Longrightarrow> I \<down>> t \<noteq> {}
[PROOF STEP]
apply (simp add: i_cut_defs)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>I \<noteq> {}; finite I; t < Max I\<rbrakk> \<Longrightarrow> \<exists>x. x \<in> I \<and> t < x
[PROOF STEP]
apply (rule_tac x="Max I" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>I \<noteq> {}; finite I; t < Max I\<rbrakk> \<Longrightarrow> Max I \<in> I \<and> t < Max I
[PROOF STEP]
apply (simp add: MaxI_ex2)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma boundedI:
  assumes "\<And>x. x \<in> S \<Longrightarrow> norm x \<le> B"
  shows "bounded S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded S
[PROOF STEP]
using assms bounded_iff
[PROOF STATE]
proof (prove)
using this:
?x \<in> S \<Longrightarrow> norm ?x \<le> B
bounded ?S = (\<exists>a. \<forall>x\<in>?S. norm x \<le> a)

goal (1 subgoal):
 1. bounded S
[PROOF STEP]
by blast


[STATEMENT]
theorem Class_left_inverse:
  "a \<in> G \<Longrightarrow> Class (inverse a) [\<cdot>] Class a = Class \<one>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> G \<Longrightarrow> Class (inverse a) [\<cdot>] Class a = Class \<one>
[PROOF STEP]
by (simp add: Class_commutes_with_composition)


[STATEMENT]
lemma DERIV_continuous_on:
  "(\<And>x. x \<in> s \<Longrightarrow> (f has_field_derivative (D x)) (at x within s)) \<Longrightarrow> continuous_on s f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. x \<in> s \<Longrightarrow> (f has_field_derivative D x) (at x within s)) \<Longrightarrow> continuous_on s f
[PROOF STEP]
unfolding continuous_on_eq_continuous_within
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. x \<in> s \<Longrightarrow> (f has_field_derivative D x) (at x within s)) \<Longrightarrow> \<forall>x\<in>s. continuous (at x within s) f
[PROOF STEP]
by (intro continuous_at_imp_continuous_on ballI DERIV_continuous)


[STATEMENT]
lemma moebius_ocircline_comp_inv_left [simp]:
  shows "moebius_ocircline (moebius_inv M) (moebius_ocircline M H) = H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. moebius_ocircline (moebius_inv M) (moebius_ocircline M H) = H
[PROOF STEP]
by (subst moebius_ocircline_comp[symmetric]) simp


[STATEMENT]
lemma split_minus[simp]: "(\<lambda>(x, k). f x k) x - (\<lambda>(x, k). g x k) x = (\<lambda>(x, k). f x k - g x k) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (case x of (x, k) \<Rightarrow> f x k) - (case x of (x, k) \<Rightarrow> g x k) = (case x of (x, k) \<Rightarrow> f x k - g x k)
[PROOF STEP]
by (simp add: split_def)


[STATEMENT]
lemma tconcat_transfer [transfer_rule]:
  "(B ===> tllist_all2 (llist_all2 A) B ===> tllist_all2 A B) tconcat tconcat"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (B ===> tllist_all2 (llist_all2 A) B ===> tllist_all2 A B) tconcat tconcat
[PROOF STEP]
unfolding rel_fun_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y. B x y \<longrightarrow> (\<forall>xa ya. tllist_all2 (llist_all2 A) B xa ya \<longrightarrow> tllist_all2 A B (tconcat x xa) (tconcat y ya))
[PROOF STEP]
by transfer(auto intro: llist_all2_lconcatI dest: llist_all2_lfiniteD)


[STATEMENT]
lemma sorted_msort: "sorted (msort xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted (msort xs)
[PROOF STEP]
proof(induction xs rule: msort.induct)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xs. \<lbrakk>\<And>x. \<lbrakk>x = length xs; \<not> x \<le> 1\<rbrakk> \<Longrightarrow> sorted (msort (take (x div 2) xs)); \<And>x. \<lbrakk>x = length xs; \<not> x \<le> 1\<rbrakk> \<Longrightarrow> sorted (msort (drop (x div 2) xs))\<rbrakk> \<Longrightarrow> sorted (msort xs)
[PROOF STEP]
case (1 xs)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?x = length xs; \<not> ?x \<le> 1\<rbrakk> \<Longrightarrow> sorted (msort (take (?x div 2) xs))
\<lbrakk>?x = length xs; \<not> ?x \<le> 1\<rbrakk> \<Longrightarrow> sorted (msort (drop (?x div 2) xs))

goal (1 subgoal):
 1. \<And>xs. \<lbrakk>\<And>x. \<lbrakk>x = length xs; \<not> x \<le> 1\<rbrakk> \<Longrightarrow> sorted (msort (take (x div 2) xs)); \<And>x. \<lbrakk>x = length xs; \<not> x \<le> 1\<rbrakk> \<Longrightarrow> sorted (msort (drop (x div 2) xs))\<rbrakk> \<Longrightarrow> sorted (msort xs)
[PROOF STEP]
let ?n = "length xs"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xs. \<lbrakk>\<And>x. \<lbrakk>x = length xs; \<not> x \<le> 1\<rbrakk> \<Longrightarrow> sorted (msort (take (x div 2) xs)); \<And>x. \<lbrakk>x = length xs; \<not> x \<le> 1\<rbrakk> \<Longrightarrow> sorted (msort (drop (x div 2) xs))\<rbrakk> \<Longrightarrow> sorted (msort xs)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted (msort xs)
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> sorted (msort xs)
 2. \<not> ?P \<Longrightarrow> sorted (msort xs)
[PROOF STEP]
assume "?n \<le> 1"
[PROOF STATE]
proof (state)
this:
length xs \<le> 1

goal (2 subgoals):
 1. ?P \<Longrightarrow> sorted (msort xs)
 2. \<not> ?P \<Longrightarrow> sorted (msort xs)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
length xs \<le> 1

goal (1 subgoal):
 1. sorted (msort xs)
[PROOF STEP]
by(simp add: msort.simps[of xs] sorted01)
[PROOF STATE]
proof (state)
this:
sorted (msort xs)

goal (1 subgoal):
 1. \<not> length xs \<le> 1 \<Longrightarrow> sorted (msort xs)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> length xs \<le> 1 \<Longrightarrow> sorted (msort xs)
[PROOF STEP]
assume "\<not> ?n \<le> 1"
[PROOF STATE]
proof (state)
this:
\<not> length xs \<le> 1

goal (1 subgoal):
 1. \<not> length xs \<le> 1 \<Longrightarrow> sorted (msort xs)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> length xs \<le> 1

goal (1 subgoal):
 1. sorted (msort xs)
[PROOF STEP]
using "1.IH"
[PROOF STATE]
proof (prove)
using this:
\<not> length xs \<le> 1
\<lbrakk>?x = length xs; \<not> ?x \<le> 1\<rbrakk> \<Longrightarrow> sorted (msort (take (?x div 2) xs))
\<lbrakk>?x = length xs; \<not> ?x \<le> 1\<rbrakk> \<Longrightarrow> sorted (msort (drop (?x div 2) xs))

goal (1 subgoal):
 1. sorted (msort xs)
[PROOF STEP]
by(simp add: sorted_merge msort.simps[of xs])
[PROOF STATE]
proof (state)
this:
sorted (msort xs)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
sorted (msort xs)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fps_to_fls_minus [simp]: "fps_to_fls (f - g) = fps_to_fls f - fps_to_fls g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_to_fls (f - g) = fps_to_fls f - fps_to_fls g
[PROOF STEP]
by (intro fls_eqI) simp


[STATEMENT]
lemma InvariantVarsFAfterLearn:
  fixes F0 :: Formula and F :: Formula and F' :: Formula and C :: Clause
  assumes "InvariantVarsF F F0 Vbl" and
  "vars C \<subseteq> (vars F0) \<union> Vbl" and
  "F' = F @ [C]"
  shows "InvariantVarsF F' F0 Vbl"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. InvariantVarsF F' F0 Vbl
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
InvariantVarsF F F0 Vbl
vars C \<subseteq> vars F0 \<union> Vbl
F' = F @ [C]

goal (1 subgoal):
 1. InvariantVarsF F' F0 Vbl
[PROOF STEP]
using varsAppendFormulae[of "F" "[C]"]
[PROOF STATE]
proof (prove)
using this:
InvariantVarsF F F0 Vbl
vars C \<subseteq> vars F0 \<union> Vbl
F' = F @ [C]
vars (F @ [C]) = vars F \<union> vars [C]

goal (1 subgoal):
 1. InvariantVarsF F' F0 Vbl
[PROOF STEP]
unfolding InvariantVarsF_def
[PROOF STATE]
proof (prove)
using this:
vars F \<subseteq> vars F0 \<union> Vbl
vars C \<subseteq> vars F0 \<union> Vbl
F' = F @ [C]
vars (F @ [C]) = vars F \<union> vars [C]

goal (1 subgoal):
 1. vars F' \<subseteq> vars F0 \<union> Vbl
[PROOF STEP]
by auto


[STATEMENT]
lemma strict_mono_nth_prime: "strict_mono nth_prime"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. strict_mono nth_prime
[PROOF STEP]
proof (rule strict_monoI_Suc)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. nth_prime n < nth_prime (Suc n)
[PROOF STEP]
fix n :: nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. nth_prime n < nth_prime (Suc n)
[PROOF STEP]
have "Suc (nth_prime n) \<le> smallest_prime_beyond (Suc (nth_prime n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc (nth_prime n) \<le> smallest_prime_beyond (Suc (nth_prime n))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Suc (nth_prime n) \<le> smallest_prime_beyond (Suc (nth_prime n))

goal (1 subgoal):
 1. \<And>n. nth_prime n < nth_prime (Suc n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Suc (nth_prime n) \<le> smallest_prime_beyond (Suc (nth_prime n))

goal (1 subgoal):
 1. \<And>n. nth_prime n < nth_prime (Suc n)
[PROOF STEP]
have "\<dots> = nth_prime (Suc n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. smallest_prime_beyond (Suc (nth_prime n)) = nth_prime (Suc n)
[PROOF STEP]
by (simp add: nth_prime_Suc)
[PROOF STATE]
proof (state)
this:
smallest_prime_beyond (Suc (nth_prime n)) = nth_prime (Suc n)

goal (1 subgoal):
 1. \<And>n. nth_prime n < nth_prime (Suc n)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Suc (nth_prime n) \<le> nth_prime (Suc n)
[PROOF STEP]
show "nth_prime n < nth_prime (Suc n)"
[PROOF STATE]
proof (prove)
using this:
Suc (nth_prime n) \<le> nth_prime (Suc n)

goal (1 subgoal):
 1. nth_prime n < nth_prime (Suc n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
nth_prime n < nth_prime (Suc n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma outer_prod_add_right:
  fixes v::"complex Matrix.vec"
  assumes "dim_vec w = dim_vec x"
  shows "outer_prod v (w + x) = outer_prod v w + (outer_prod v x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. outer_prod v (w + x) = outer_prod v w + outer_prod v x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. outer_prod v (w + x) = outer_prod v w + outer_prod v x
[PROOF STEP]
define paw where "paw = outer_prod v (w+x)"
[PROOF STATE]
proof (state)
this:
paw = outer_prod v (w + x)

goal (1 subgoal):
 1. outer_prod v (w + x) = outer_prod v w + outer_prod v x
[PROOF STEP]
define apw where "apw = outer_prod v w + (outer_prod v x)"
[PROOF STATE]
proof (state)
this:
apw = outer_prod v w + outer_prod v x

goal (1 subgoal):
 1. outer_prod v (w + x) = outer_prod v w + outer_prod v x
[PROOF STEP]
have "paw = apw"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. paw = apw
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row apw; j < dim_col apw\<rbrakk> \<Longrightarrow> paw $$ (i, j) = apw $$ (i, j)
 2. dim_row paw = dim_row apw
 3. dim_col paw = dim_col apw
[PROOF STEP]
have rv: "dim_row paw = dim_vec v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row paw = dim_vec v
[PROOF STEP]
unfolding paw_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (outer_prod v (w + x)) = dim_vec v
[PROOF STEP]
using outer_prod_dim assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?v \<in> carrier_vec ?n; ?w \<in> carrier_vec ?m\<rbrakk> \<Longrightarrow> outer_prod ?v ?w \<in> carrier_mat ?n ?m
dim_vec w = dim_vec x

goal (1 subgoal):
 1. dim_row (outer_prod v (w + x)) = dim_vec v
[PROOF STEP]
by (metis carrier_matD(1) carrier_vec_dim_vec index_add_vec(2) paw_def)
[PROOF STATE]
proof (state)
this:
dim_row paw = dim_vec v

goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row apw; j < dim_col apw\<rbrakk> \<Longrightarrow> paw $$ (i, j) = apw $$ (i, j)
 2. dim_row paw = dim_row apw
 3. dim_col paw = dim_col apw
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dim_row paw = dim_vec v

goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row apw; j < dim_col apw\<rbrakk> \<Longrightarrow> paw $$ (i, j) = apw $$ (i, j)
 2. dim_row paw = dim_row apw
 3. dim_col paw = dim_col apw
[PROOF STEP]
have "... = dim_row apw"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec v = dim_row apw
[PROOF STEP]
unfolding apw_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec v = dim_row (outer_prod v w + outer_prod v x)
[PROOF STEP]
using outer_prod_dim assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?v \<in> carrier_vec ?n; ?w \<in> carrier_vec ?m\<rbrakk> \<Longrightarrow> outer_prod ?v ?w \<in> carrier_mat ?n ?m
dim_vec w = dim_vec x

goal (1 subgoal):
 1. dim_vec v = dim_row (outer_prod v w + outer_prod v x)
[PROOF STEP]
by (metis carrier_matD(1) carrier_vec_dim_vec index_add_mat(2))
[PROOF STATE]
proof (state)
this:
dim_vec v = dim_row apw

goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row apw; j < dim_col apw\<rbrakk> \<Longrightarrow> paw $$ (i, j) = apw $$ (i, j)
 2. dim_row paw = dim_row apw
 3. dim_col paw = dim_col apw
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
dim_row paw = dim_row apw
[PROOF STEP]
show dr: "dim_row paw = dim_row apw"
[PROOF STATE]
proof (prove)
using this:
dim_row paw = dim_row apw

goal (1 subgoal):
 1. dim_row paw = dim_row apw
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
dim_row paw = dim_row apw

goal (2 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row apw; j < dim_col apw\<rbrakk> \<Longrightarrow> paw $$ (i, j) = apw $$ (i, j)
 2. dim_col paw = dim_col apw
[PROOF STEP]
have cw: "dim_col paw = dim_vec w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_col paw = dim_vec w
[PROOF STEP]
unfolding paw_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_col (outer_prod v (w + x)) = dim_vec w
[PROOF STEP]
using outer_prod_dim assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?v \<in> carrier_vec ?n; ?w \<in> carrier_vec ?m\<rbrakk> \<Longrightarrow> outer_prod ?v ?w \<in> carrier_mat ?n ?m
dim_vec w = dim_vec x

goal (1 subgoal):
 1. dim_col (outer_prod v (w + x)) = dim_vec w
[PROOF STEP]
using carrier_vec_dim_vec
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?v \<in> carrier_vec ?n; ?w \<in> carrier_vec ?m\<rbrakk> \<Longrightarrow> outer_prod ?v ?w \<in> carrier_mat ?n ?m
dim_vec w = dim_vec x
?v \<in> carrier_vec (dim_vec ?v)

goal (1 subgoal):
 1. dim_col (outer_prod v (w + x)) = dim_vec w
[PROOF STEP]
by (metis carrier_matD(2) index_add_vec(2) paw_def)
[PROOF STATE]
proof (state)
this:
dim_col paw = dim_vec w

goal (2 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row apw; j < dim_col apw\<rbrakk> \<Longrightarrow> paw $$ (i, j) = apw $$ (i, j)
 2. dim_col paw = dim_col apw
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dim_col paw = dim_vec w

goal (2 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row apw; j < dim_col apw\<rbrakk> \<Longrightarrow> paw $$ (i, j) = apw $$ (i, j)
 2. dim_col paw = dim_col apw
[PROOF STEP]
have "... = dim_col apw"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec w = dim_col apw
[PROOF STEP]
unfolding apw_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec w = dim_col (outer_prod v w + outer_prod v x)
[PROOF STEP]
using outer_prod_dim
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?v \<in> carrier_vec ?n; ?w \<in> carrier_vec ?m\<rbrakk> \<Longrightarrow> outer_prod ?v ?w \<in> carrier_mat ?n ?m

goal (1 subgoal):
 1. dim_vec w = dim_col (outer_prod v w + outer_prod v x)
[PROOF STEP]
by (metis assms carrier_matD(2) carrier_vec_dim_vec index_add_mat(3))
[PROOF STATE]
proof (state)
this:
dim_vec w = dim_col apw

goal (2 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row apw; j < dim_col apw\<rbrakk> \<Longrightarrow> paw $$ (i, j) = apw $$ (i, j)
 2. dim_col paw = dim_col apw
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
dim_col paw = dim_col apw
[PROOF STEP]
show dc: "dim_col paw = dim_col apw"
[PROOF STATE]
proof (prove)
using this:
dim_col paw = dim_col apw

goal (1 subgoal):
 1. dim_col paw = dim_col apw
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
dim_col paw = dim_col apw

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row apw; j < dim_col apw\<rbrakk> \<Longrightarrow> paw $$ (i, j) = apw $$ (i, j)
[PROOF STEP]
show "\<And>i j. i < dim_row apw \<Longrightarrow> j < dim_col apw \<Longrightarrow> paw $$ (i, j) = apw $$ (i, j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row apw; j < dim_col apw\<rbrakk> \<Longrightarrow> paw $$ (i, j) = apw $$ (i, j)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row apw; j < dim_col apw\<rbrakk> \<Longrightarrow> paw $$ (i, j) = apw $$ (i, j)
[PROOF STEP]
fix i j
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row apw; j < dim_col apw\<rbrakk> \<Longrightarrow> paw $$ (i, j) = apw $$ (i, j)
[PROOF STEP]
assume  "i < dim_row apw" and "j < dim_col apw"
[PROOF STATE]
proof (state)
this:
i < dim_row apw
j < dim_col apw

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row apw; j < dim_col apw\<rbrakk> \<Longrightarrow> paw $$ (i, j) = apw $$ (i, j)
[PROOF STEP]
note ij = this
[PROOF STATE]
proof (state)
this:
i < dim_row apw
j < dim_col apw

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row apw; j < dim_col apw\<rbrakk> \<Longrightarrow> paw $$ (i, j) = apw $$ (i, j)
[PROOF STEP]
hence "paw $$ (i,j) = Matrix.vec_index v i *
        (cnj (Matrix.vec_index w j + (Matrix.vec_index x j)))"
[PROOF STATE]
proof (prove)
using this:
i < dim_row apw
j < dim_col apw

goal (1 subgoal):
 1. paw $$ (i, j) = v $ i * cnj (w $ j + x $ j)
[PROOF STEP]
using dr dc
[PROOF STATE]
proof (prove)
using this:
i < dim_row apw
j < dim_col apw
dim_row paw = dim_row apw
dim_col paw = dim_col apw

goal (1 subgoal):
 1. paw $$ (i, j) = v $ i * cnj (w $ j + x $ j)
[PROOF STEP]
unfolding  paw_def outer_prod_def
[PROOF STATE]
proof (prove)
using this:
i < dim_row apw
j < dim_col apw
dim_row (Matrix.mat (dim_vec v) 1 (\<lambda>(i, j). v $ i) * Matrix.mat 1 (dim_vec (w + x)) (\<lambda>(i, y). conjugate (w + x) $ y)) = dim_row apw
dim_col (Matrix.mat (dim_vec v) 1 (\<lambda>(i, j). v $ i) * Matrix.mat 1 (dim_vec (w + x)) (\<lambda>(i, y). conjugate (w + x) $ y)) = dim_col apw

goal (1 subgoal):
 1. (Matrix.mat (dim_vec v) 1 (\<lambda>(i, j). v $ i) * Matrix.mat 1 (dim_vec (w + x)) (\<lambda>(i, y). conjugate (w + x) $ y)) $$ (i, j) = v $ i * cnj (w $ j + x $ j)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
paw $$ (i, j) = v $ i * cnj (w $ j + x $ j)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row apw; j < dim_col apw\<rbrakk> \<Longrightarrow> paw $$ (i, j) = apw $$ (i, j)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
paw $$ (i, j) = v $ i * cnj (w $ j + x $ j)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row apw; j < dim_col apw\<rbrakk> \<Longrightarrow> paw $$ (i, j) = apw $$ (i, j)
[PROOF STEP]
have "... = Matrix.vec_index v i * cnj (Matrix.vec_index w j) +
        Matrix.vec_index v i * cnj (Matrix.vec_index x j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v $ i * cnj (w $ j + x $ j) = v $ i * cnj (w $ j) + v $ i * cnj (x $ j)
[PROOF STEP]
by (simp add: ring_class.ring_distribs(1))
[PROOF STATE]
proof (state)
this:
v $ i * cnj (w $ j + x $ j) = v $ i * cnj (w $ j) + v $ i * cnj (x $ j)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row apw; j < dim_col apw\<rbrakk> \<Longrightarrow> paw $$ (i, j) = apw $$ (i, j)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
v $ i * cnj (w $ j + x $ j) = v $ i * cnj (w $ j) + v $ i * cnj (x $ j)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row apw; j < dim_col apw\<rbrakk> \<Longrightarrow> paw $$ (i, j) = apw $$ (i, j)
[PROOF STEP]
have "... = (outer_prod v w) $$ (i,j) + (outer_prod v x) $$ (i,j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v $ i * cnj (w $ j) + v $ i * cnj (x $ j) = outer_prod v w $$ (i, j) + outer_prod v x $$ (i, j)
[PROOF STEP]
using rv cw dr dc ij assms
[PROOF STATE]
proof (prove)
using this:
dim_row paw = dim_vec v
dim_col paw = dim_vec w
dim_row paw = dim_row apw
dim_col paw = dim_col apw
i < dim_row apw
j < dim_col apw
dim_vec w = dim_vec x

goal (1 subgoal):
 1. v $ i * cnj (w $ j) + v $ i * cnj (x $ j) = outer_prod v w $$ (i, j) + outer_prod v x $$ (i, j)
[PROOF STEP]
unfolding outer_prod_def
[PROOF STATE]
proof (prove)
using this:
dim_row paw = dim_vec v
dim_col paw = dim_vec w
dim_row paw = dim_row apw
dim_col paw = dim_col apw
i < dim_row apw
j < dim_col apw
dim_vec w = dim_vec x

goal (1 subgoal):
 1. v $ i * cnj (w $ j) + v $ i * cnj (x $ j) = (Matrix.mat (dim_vec v) 1 (\<lambda>(i, j). v $ i) * Matrix.mat 1 (dim_vec w) (\<lambda>(i, y). conjugate w $ y)) $$ (i, j) + (Matrix.mat (dim_vec v) 1 (\<lambda>(i, j). v $ i) * Matrix.mat 1 (dim_vec x) (\<lambda>(i, y). conjugate x $ y)) $$ (i, j)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v $ i * cnj (w $ j) + v $ i * cnj (x $ j) = outer_prod v w $$ (i, j) + outer_prod v x $$ (i, j)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row apw; j < dim_col apw\<rbrakk> \<Longrightarrow> paw $$ (i, j) = apw $$ (i, j)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
v $ i * cnj (w $ j) + v $ i * cnj (x $ j) = outer_prod v w $$ (i, j) + outer_prod v x $$ (i, j)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row apw; j < dim_col apw\<rbrakk> \<Longrightarrow> paw $$ (i, j) = apw $$ (i, j)
[PROOF STEP]
have "... = apw $$ (i,j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. outer_prod v w $$ (i, j) + outer_prod v x $$ (i, j) = apw $$ (i, j)
[PROOF STEP]
using dr dc ij
[PROOF STATE]
proof (prove)
using this:
dim_row paw = dim_row apw
dim_col paw = dim_col apw
i < dim_row apw
j < dim_col apw

goal (1 subgoal):
 1. outer_prod v w $$ (i, j) + outer_prod v x $$ (i, j) = apw $$ (i, j)
[PROOF STEP]
unfolding apw_def outer_prod_def
[PROOF STATE]
proof (prove)
using this:
dim_row paw = dim_row (Matrix.mat (dim_vec v) 1 (\<lambda>(i, j). v $ i) * Matrix.mat 1 (dim_vec w) (\<lambda>(i, y). conjugate w $ y) + Matrix.mat (dim_vec v) 1 (\<lambda>(i, j). v $ i) * Matrix.mat 1 (dim_vec x) (\<lambda>(i, y). conjugate x $ y))
dim_col paw = dim_col (Matrix.mat (dim_vec v) 1 (\<lambda>(i, j). v $ i) * Matrix.mat 1 (dim_vec w) (\<lambda>(i, y). conjugate w $ y) + Matrix.mat (dim_vec v) 1 (\<lambda>(i, j). v $ i) * Matrix.mat 1 (dim_vec x) (\<lambda>(i, y). conjugate x $ y))
i < dim_row (Matrix.mat (dim_vec v) 1 (\<lambda>(i, j). v $ i) * Matrix.mat 1 (dim_vec w) (\<lambda>(i, y). conjugate w $ y) + Matrix.mat (dim_vec v) 1 (\<lambda>(i, j). v $ i) * Matrix.mat 1 (dim_vec x) (\<lambda>(i, y). conjugate x $ y))
j < dim_col (Matrix.mat (dim_vec v) 1 (\<lambda>(i, j). v $ i) * Matrix.mat 1 (dim_vec w) (\<lambda>(i, y). conjugate w $ y) + Matrix.mat (dim_vec v) 1 (\<lambda>(i, j). v $ i) * Matrix.mat 1 (dim_vec x) (\<lambda>(i, y). conjugate x $ y))

goal (1 subgoal):
 1. (Matrix.mat (dim_vec v) 1 (\<lambda>(i, j). v $ i) * Matrix.mat 1 (dim_vec w) (\<lambda>(i, y). conjugate w $ y)) $$ (i, j) + (Matrix.mat (dim_vec v) 1 (\<lambda>(i, j). v $ i) * Matrix.mat 1 (dim_vec x) (\<lambda>(i, y). conjugate x $ y)) $$ (i, j) = (Matrix.mat (dim_vec v) 1 (\<lambda>(i, j). v $ i) * Matrix.mat 1 (dim_vec w) (\<lambda>(i, y). conjugate w $ y) + Matrix.mat (dim_vec v) 1 (\<lambda>(i, j). v $ i) * Matrix.mat 1 (dim_vec x) (\<lambda>(i, y). conjugate x $ y)) $$ (i, j)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
outer_prod v w $$ (i, j) + outer_prod v x $$ (i, j) = apw $$ (i, j)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row apw; j < dim_col apw\<rbrakk> \<Longrightarrow> paw $$ (i, j) = apw $$ (i, j)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
paw $$ (i, j) = apw $$ (i, j)
[PROOF STEP]
show "paw $$ (i, j) = apw $$ (i, j)"
[PROOF STATE]
proof (prove)
using this:
paw $$ (i, j) = apw $$ (i, j)

goal (1 subgoal):
 1. paw $$ (i, j) = apw $$ (i, j)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
paw $$ (i, j) = apw $$ (i, j)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>?i < dim_row apw; ?j < dim_col apw\<rbrakk> \<Longrightarrow> paw $$ (?i, ?j) = apw $$ (?i, ?j)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
paw = apw

goal (1 subgoal):
 1. outer_prod v (w + x) = outer_prod v w + outer_prod v x
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
paw = apw

goal (1 subgoal):
 1. outer_prod v (w + x) = outer_prod v w + outer_prod v x
[PROOF STEP]
unfolding paw_def apw_def
[PROOF STATE]
proof (prove)
using this:
outer_prod v (w + x) = outer_prod v w + outer_prod v x

goal (1 subgoal):
 1. outer_prod v (w + x) = outer_prod v w + outer_prod v x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
outer_prod v (w + x) = outer_prod v w + outer_prod v x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma is_real_arg2:
  assumes "is_real z"
  shows "Arg z = 0 \<or> Arg z = pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Arg z = 0 \<or> Arg z = pi
[PROOF STEP]
proof (cases "z = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. z = 0 \<Longrightarrow> Arg z = 0 \<or> Arg z = pi
 2. z \<noteq> 0 \<Longrightarrow> Arg z = 0 \<or> Arg z = pi
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
z \<noteq> 0

goal (2 subgoals):
 1. z = 0 \<Longrightarrow> Arg z = 0 \<or> Arg z = pi
 2. z \<noteq> 0 \<Longrightarrow> Arg z = 0 \<or> Arg z = pi
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
z \<noteq> 0

goal (1 subgoal):
 1. Arg z = 0 \<or> Arg z = pi
[PROOF STEP]
using Arg_bounded[of z]
[PROOF STATE]
proof (prove)
using this:
z \<noteq> 0
- pi < Arg z \<and> Arg z \<le> pi

goal (1 subgoal):
 1. Arg z = 0 \<or> Arg z = pi
[PROOF STEP]
by (smt (verit, best) Im_sgn assms cis.simps(2) cis_Arg div_0 sin_zero_pi_iff)
[PROOF STATE]
proof (state)
this:
Arg z = 0 \<or> Arg z = pi

goal (1 subgoal):
 1. z = 0 \<Longrightarrow> Arg z = 0 \<or> Arg z = pi
[PROOF STEP]
qed (auto simp add: Arg_zero)


[STATEMENT]
lemma nextElem_nth:
 "\<And>i. \<lbrakk>distinct xs; i < length xs \<rbrakk>
   \<Longrightarrow> nextElem xs z (xs!i) = (if length xs = i+1 then z else xs!(i+1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. \<lbrakk>distinct xs; i < |xs|\<rbrakk> \<Longrightarrow> nextElem xs z (xs ! i) = (if |xs| = i + 1 then z else xs ! (i + 1))
[PROOF STEP]
apply(induct xs)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>i. \<lbrakk>distinct []; i < |[]|\<rbrakk> \<Longrightarrow> nextElem [] z ([] ! i) = (if |[]| = i + 1 then z else [] ! (i + 1))
 2. \<And>a xs i. \<lbrakk>\<And>i. \<lbrakk>distinct xs; i < |xs|\<rbrakk> \<Longrightarrow> nextElem xs z (xs ! i) = (if |xs| = i + 1 then z else xs ! (i + 1)); distinct (a # xs); i < |a # xs|\<rbrakk> \<Longrightarrow> nextElem (a # xs) z ((a # xs) ! i) = (if |a # xs| = i + 1 then z else (a # xs) ! (i + 1))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a xs i. \<lbrakk>\<And>i. \<lbrakk>distinct xs; i < |xs|\<rbrakk> \<Longrightarrow> nextElem xs z (xs ! i) = (if |xs| = i + 1 then z else xs ! (i + 1)); distinct (a # xs); i < |a # xs|\<rbrakk> \<Longrightarrow> nextElem (a # xs) z ((a # xs) ! i) = (if |a # xs| = i + 1 then z else (a # xs) ! (i + 1))
[PROOF STEP]
apply(case_tac i)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a xs i. \<lbrakk>\<And>i. \<lbrakk>distinct xs; i < |xs|\<rbrakk> \<Longrightarrow> nextElem xs z (xs ! i) = (if |xs| = i + 1 then z else xs ! (i + 1)); distinct (a # xs); i < |a # xs|; i = 0\<rbrakk> \<Longrightarrow> nextElem (a # xs) z ((a # xs) ! i) = (if |a # xs| = i + 1 then z else (a # xs) ! (i + 1))
 2. \<And>a xs i nat. \<lbrakk>\<And>i. \<lbrakk>distinct xs; i < |xs|\<rbrakk> \<Longrightarrow> nextElem xs z (xs ! i) = (if |xs| = i + 1 then z else xs ! (i + 1)); distinct (a # xs); i < |a # xs|; i = Suc nat\<rbrakk> \<Longrightarrow> nextElem (a # xs) z ((a # xs) ! i) = (if |a # xs| = i + 1 then z else (a # xs) ! (i + 1))
[PROOF STEP]
apply(simp split:list.split)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a xs i nat. \<lbrakk>\<And>i. \<lbrakk>distinct xs; i < |xs|\<rbrakk> \<Longrightarrow> nextElem xs z (xs ! i) = (if |xs| = i + 1 then z else xs ! (i + 1)); distinct (a # xs); i < |a # xs|; i = Suc nat\<rbrakk> \<Longrightarrow> nextElem (a # xs) z ((a # xs) ! i) = (if |a # xs| = i + 1 then z else (a # xs) ! (i + 1))
[PROOF STEP]
apply clarsimp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma substs_bd_fv: "length xs = length ys \<Longrightarrow> substs_bd z xs ys Q \<in> fv (Q[substs_src z xs ys Q \<^bold>\<rightarrow>\<^sup>* substs_dst z xs ys Q]) \<Longrightarrow> z \<in> fv Q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>length xs = length ys; substs_bd z xs ys Q \<in> fv (Q[substs_src z xs ys Q \<^bold>\<rightarrow>\<^sup>* substs_dst z xs ys Q])\<rbrakk> \<Longrightarrow> z \<in> fv Q
[PROOF STEP]
proof (induct xs ys arbitrary: z Q rule: list_induct2)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>z Q. substs_bd z [] [] Q \<in> fv (Q[substs_src z [] [] Q \<^bold>\<rightarrow>\<^sup>* substs_dst z [] [] Q]) \<Longrightarrow> z \<in> fv Q
 2. \<And>x xs y ys z Q. \<lbrakk>length xs = length ys; \<And>z Q. substs_bd z xs ys Q \<in> fv (Q[substs_src z xs ys Q \<^bold>\<rightarrow>\<^sup>* substs_dst z xs ys Q]) \<Longrightarrow> z \<in> fv Q; substs_bd z (x # xs) (y # ys) Q \<in> fv (Q[substs_src z (x # xs) (y # ys) Q \<^bold>\<rightarrow>\<^sup>* substs_dst z (x # xs) (y # ys) Q])\<rbrakk> \<Longrightarrow> z \<in> fv Q
[PROOF STEP]
case (Cons x xs y ys)
[PROOF STATE]
proof (state)
this:
length xs = length ys
substs_bd ?z xs ys ?Q \<in> fv (?Q[substs_src ?z xs ys ?Q \<^bold>\<rightarrow>\<^sup>* substs_dst ?z xs ys ?Q]) \<Longrightarrow> ?z \<in> fv ?Q
substs_bd z (x # xs) (y # ys) Q \<in> fv (Q[substs_src z (x # xs) (y # ys) Q \<^bold>\<rightarrow>\<^sup>* substs_dst z (x # xs) (y # ys) Q])

goal (2 subgoals):
 1. \<And>z Q. substs_bd z [] [] Q \<in> fv (Q[substs_src z [] [] Q \<^bold>\<rightarrow>\<^sup>* substs_dst z [] [] Q]) \<Longrightarrow> z \<in> fv Q
 2. \<And>x xs y ys z Q. \<lbrakk>length xs = length ys; \<And>z Q. substs_bd z xs ys Q \<in> fv (Q[substs_src z xs ys Q \<^bold>\<rightarrow>\<^sup>* substs_dst z xs ys Q]) \<Longrightarrow> z \<in> fv Q; substs_bd z (x # xs) (y # ys) Q \<in> fv (Q[substs_src z (x # xs) (y # ys) Q \<^bold>\<rightarrow>\<^sup>* substs_dst z (x # xs) (y # ys) Q])\<rbrakk> \<Longrightarrow> z \<in> fv Q
[PROOF STEP]
from Cons(1,3)
[PROOF STATE]
proof (chain)
picking this:
length xs = length ys
substs_bd z (x # xs) (y # ys) Q \<in> fv (Q[substs_src z (x # xs) (y # ys) Q \<^bold>\<rightarrow>\<^sup>* substs_dst z (x # xs) (y # ys) Q])
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
length xs = length ys
substs_bd z (x # xs) (y # ys) Q \<in> fv (Q[substs_src z (x # xs) (y # ys) Q \<^bold>\<rightarrow>\<^sup>* substs_dst z (x # xs) (y # ys) Q])

goal (1 subgoal):
 1. z \<in> fv Q
[PROOF STEP]
by (auto 0 4 simp: fv_subst fresh2 dest: Cons(2) sym split: if_splits)
[PROOF STATE]
proof (state)
this:
z \<in> fv Q

goal (1 subgoal):
 1. \<And>z Q. substs_bd z [] [] Q \<in> fv (Q[substs_src z [] [] Q \<^bold>\<rightarrow>\<^sup>* substs_dst z [] [] Q]) \<Longrightarrow> z \<in> fv Q
[PROOF STEP]
qed simp


[STATEMENT]
lemma gen_cong_transp[intro]: "gen_cong R x y \<Longrightarrow> gen_cong R y z \<Longrightarrow> gen_cong R x z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>gen_cong R x y; gen_cong R y z\<rbrakk> \<Longrightarrow> gen_cong R x z
[PROOF STEP]
unfolding gen_cong_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>R'. R \<le> R' \<and> local.cong R' \<longrightarrow> R' x y; \<forall>R'. R \<le> R' \<and> local.cong R' \<longrightarrow> R' y z\<rbrakk> \<Longrightarrow> \<forall>R'. R \<le> R' \<and> local.cong R' \<longrightarrow> R' x z
[PROOF STEP]
by (auto dest: cong_equivp equivp_transp)


[STATEMENT]
lemma emeasure_lborel_Ico[simp]:
  assumes [simp]: "l \<le> u"
  shows "emeasure lborel {l ..< u} = ennreal (u - l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure lborel {l..<u} = ennreal (u - l)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. emeasure lborel {l..<u} = ennreal (u - l)
[PROOF STEP]
have "emeasure lborel {l ..< u} = emeasure lborel {l .. u}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure lborel {l..<u} = emeasure lborel {l..u}
[PROOF STEP]
using AE_lborel_singleton[of u] AE_lborel_singleton[of l]
[PROOF STATE]
proof (prove)
using this:
AE x in lborel. x \<noteq> u
AE x in lborel. x \<noteq> l

goal (1 subgoal):
 1. emeasure lborel {l..<u} = emeasure lborel {l..u}
[PROOF STEP]
by (intro emeasure_eq_AE) auto
[PROOF STATE]
proof (state)
this:
emeasure lborel {l..<u} = emeasure lborel {l..u}

goal (1 subgoal):
 1. emeasure lborel {l..<u} = ennreal (u - l)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
emeasure lborel {l..<u} = emeasure lborel {l..u}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
emeasure lborel {l..<u} = emeasure lborel {l..u}

goal (1 subgoal):
 1. emeasure lborel {l..<u} = ennreal (u - l)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
emeasure lborel {l..<u} = ennreal (u - l)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma singleton_is_algebraic:
  assumes "as \<in> carrier (R\<^bsup>n\<^esup>)"
  shows "is_algebraic R n {as}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_algebraic R n {as}
[PROOF STEP]
apply(rule is_algebraicI[of "(set (point_to_polys as))"])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. finite (set (point_to_polys as))
 2. set (point_to_polys as) \<subseteq> carrier (R [\<X>\<^bsub>n\<^esub>])
 3. {as} = affine_alg_set R n (set (point_to_polys as))
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. set (point_to_polys as) \<subseteq> carrier (R [\<X>\<^bsub>n\<^esub>])
 2. {as} = affine_alg_set R n (set (point_to_polys as))
[PROOF STEP]
using point_to_polys_affine_alg_set
[PROOF STATE]
proof (prove)
using this:
?as \<in> carrier (R\<^bsup>?n\<^esup>) \<Longrightarrow> affine_alg_set R ?n (set (point_to_polys ?as)) = {?as}

goal (2 subgoals):
 1. set (point_to_polys as) \<subseteq> carrier (R [\<X>\<^bsub>n\<^esub>])
 2. {as} = affine_alg_set R n (set (point_to_polys as))
[PROOF STEP]
using assms point_to_polys_closed
[PROOF STATE]
proof (prove)
using this:
?as \<in> carrier (R\<^bsup>?n\<^esup>) \<Longrightarrow> affine_alg_set R ?n (set (point_to_polys ?as)) = {?as}
as \<in> carrier (R\<^bsup>n\<^esup>)
?as \<in> carrier (R\<^bsup>?n\<^esup>) \<Longrightarrow> set (point_to_polys ?as) \<subseteq> carrier (R [\<X>\<^bsub>?n\<^esub>])

goal (2 subgoals):
 1. set (point_to_polys as) \<subseteq> carrier (R [\<X>\<^bsub>n\<^esub>])
 2. {as} = affine_alg_set R n (set (point_to_polys as))
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {as} = affine_alg_set R n (set (point_to_polys as))
[PROOF STEP]
by (simp add: assms point_to_polys_affine_alg_set)


[STATEMENT]
lemma finite_imp_closed: "finite S \<Longrightarrow> closed S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite S \<Longrightarrow> closed S
[PROOF STEP]
by (induct pred: finite) simp_all


[STATEMENT]
lemma yun_polys: assumes "p \<noteq> 0"
  shows "poly p x = 0 \<longleftrightarrow> (\<exists> q \<in> set (polys_rf (yun_polys p)). poly (poly_rf q) x = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (poly p x = (0::'a)) = (\<exists>q\<in>set (polys_rf (yun_polys p)). poly (poly_rf q) x = (0::'a))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0

goal (1 subgoal):
 1. (poly p x = (0::'a)) = (\<exists>q\<in>set (polys_rf (yun_polys p)). poly (poly_rf q) x = (0::'a))
[PROOF STEP]
unfolding polys_rf_def o_def
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0

goal (1 subgoal):
 1. (poly p x = (0::'a)) = (\<exists>q\<in>set (map fst (snd (yun_rf (yun_polys p)))). poly (poly_rf q) x = (0::'a))
[PROOF STEP]
apply transfer
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>p x. p \<noteq> 0 \<Longrightarrow> (poly p x = (0::'a)) = (\<exists>q\<in>set (map fst (snd (yun_factorization gcd p))). poly q x = (0::'a))
[PROOF STEP]
subgoal for p x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> (poly p x = (0::'a)) = (\<exists>q\<in>set (map fst (snd (yun_factorization gcd p))). poly q x = (0::'a))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> (poly p x = (0::'a)) = (\<exists>q\<in>set (map fst (snd (yun_factorization gcd p))). poly q x = (0::'a))
[PROOF STEP]
assume p: "p \<noteq> 0"
[PROOF STATE]
proof (state)
this:
p \<noteq> 0

goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> (poly p x = (0::'a)) = (\<exists>q\<in>set (map fst (snd (yun_factorization gcd p))). poly q x = (0::'a))
[PROOF STEP]
obtain c ps where yun: "yun_factorization gcd p = (c,ps)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>c ps. yun_factorization gcd p = (c, ps) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
yun_factorization gcd p = (c, ps)

goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> (poly p x = (0::'a)) = (\<exists>q\<in>set (map fst (snd (yun_factorization gcd p))). poly q x = (0::'a))
[PROOF STEP]
from yun_factorization[OF this]
[PROOF STATE]
proof (chain)
picking this:
square_free_factorization p (c, ps)
(?b, ?i) \<in> set (snd (c, ps)) \<Longrightarrow> monic ?b
[PROOF STEP]
have sff: "square_free_factorization p (c, ps)"
[PROOF STATE]
proof (prove)
using this:
square_free_factorization p (c, ps)
(?b, ?i) \<in> set (snd (c, ps)) \<Longrightarrow> monic ?b

goal (1 subgoal):
 1. square_free_factorization p (c, ps)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
square_free_factorization p (c, ps)

goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> (poly p x = (0::'a)) = (\<exists>q\<in>set (map fst (snd (yun_factorization gcd p))). poly q x = (0::'a))
[PROOF STEP]
from square_free_factorizationD'(1)[OF sff] p
[PROOF STATE]
proof (chain)
picking this:
p = Polynomial.smult c (\<Prod>(a, i)\<leftarrow>ps. a ^ Suc i)
p \<noteq> 0
[PROOF STEP]
have c0: "c \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
p = Polynomial.smult c (\<Prod>(a, i)\<leftarrow>ps. a ^ Suc i)
p \<noteq> 0

goal (1 subgoal):
 1. c \<noteq> (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
c \<noteq> (0::'a)

goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> (poly p x = (0::'a)) = (\<exists>q\<in>set (map fst (snd (yun_factorization gcd p))). poly q x = (0::'a))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (poly p x = (0::'a)) = (\<exists>q\<in>set (map fst (snd (yun_factorization gcd p))). poly q x = (0::'a))
[PROOF STEP]
unfolding yun
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (poly p x = (0::'a)) = (\<exists>q\<in>set (map fst (snd (c, ps))). poly q x = (0::'a))
[PROOF STEP]
unfolding square_free_factorizationD'(1)[OF sff] poly_smult poly_prod_list snd_conv
      mult_eq_0_iff prod_list_zero_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (c = (0::'a) \<or> (0::'a) \<in> set (map (\<lambda>p. poly p x) (map (\<lambda>(a, i). a ^ Suc i) ps))) = (\<exists>q\<in>set (map fst ps). poly q x = (0::'a))
[PROOF STEP]
using c0
[PROOF STATE]
proof (prove)
using this:
c \<noteq> (0::'a)

goal (1 subgoal):
 1. (c = (0::'a) \<or> (0::'a) \<in> set (map (\<lambda>p. poly p x) (map (\<lambda>(a, i). a ^ Suc i) ps))) = (\<exists>q\<in>set (map fst ps). poly q x = (0::'a))
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
(poly p x = (0::'a)) = (\<exists>q\<in>set (map fst (snd (yun_factorization gcd p))). poly q x = (0::'a))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma interval_integral_FTC_finite:
  fixes f F :: "real \<Rightarrow> 'a::euclidean_space" and a b :: real
  assumes f: "continuous_on {min a b..max a b} f"
  assumes F: "\<And>x. min a b \<le> x \<Longrightarrow> x \<le> max a b \<Longrightarrow> (F has_vector_derivative (f x)) (at x within
    {min a b..max a b})"
  shows "(LBINT x=a..b. f x) = F b - F a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interval_lebesgue_integral lborel (ereal a) (ereal b) f = F b - F a
[PROOF STEP]
proof (cases "a \<le> b")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a \<le> b \<Longrightarrow> interval_lebesgue_integral lborel (ereal a) (ereal b) f = F b - F a
 2. \<not> a \<le> b \<Longrightarrow> interval_lebesgue_integral lborel (ereal a) (ereal b) f = F b - F a
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
a \<le> b

goal (2 subgoals):
 1. a \<le> b \<Longrightarrow> interval_lebesgue_integral lborel (ereal a) (ereal b) f = F b - F a
 2. \<not> a \<le> b \<Longrightarrow> interval_lebesgue_integral lborel (ereal a) (ereal b) f = F b - F a
[PROOF STEP]
have "(LBINT x=a..b. f x) = (LBINT x. indicat_real {a..b} x *\<^sub>R f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interval_lebesgue_integral lborel (ereal a) (ereal b) f = LBINT x. indicat_real {a..b} x *\<^sub>R f x
[PROOF STEP]
by (simp add: True interval_integral_Icc set_lebesgue_integral_def)
[PROOF STATE]
proof (state)
this:
interval_lebesgue_integral lborel (ereal a) (ereal b) f = LBINT x. indicat_real {a..b} x *\<^sub>R f x

goal (2 subgoals):
 1. a \<le> b \<Longrightarrow> interval_lebesgue_integral lborel (ereal a) (ereal b) f = F b - F a
 2. \<not> a \<le> b \<Longrightarrow> interval_lebesgue_integral lborel (ereal a) (ereal b) f = F b - F a
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
interval_lebesgue_integral lborel (ereal a) (ereal b) f = LBINT x. indicat_real {a..b} x *\<^sub>R f x

goal (2 subgoals):
 1. a \<le> b \<Longrightarrow> interval_lebesgue_integral lborel (ereal a) (ereal b) f = F b - F a
 2. \<not> a \<le> b \<Longrightarrow> interval_lebesgue_integral lborel (ereal a) (ereal b) f = F b - F a
[PROOF STEP]
have "\<dots> = F b - F a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LBINT x. indicat_real {a..b} x *\<^sub>R f x = F b - F a
[PROOF STEP]
proof (rule integral_FTC_atLeastAtMost [OF True])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>a \<le> x; x \<le> b\<rbrakk> \<Longrightarrow> (F has_vector_derivative f x) (at x within {a..b})
 2. continuous_on {a..b} f
[PROOF STEP]
show "continuous_on {a..b} f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on {a..b} f
[PROOF STEP]
using True f
[PROOF STATE]
proof (prove)
using this:
a \<le> b
continuous_on {min a b..max a b} f

goal (1 subgoal):
 1. continuous_on {a..b} f
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
continuous_on {a..b} f

goal (1 subgoal):
 1. \<And>x. \<lbrakk>a \<le> x; x \<le> b\<rbrakk> \<Longrightarrow> (F has_vector_derivative f x) (at x within {a..b})
[PROOF STEP]
show "\<And>x. \<lbrakk>a \<le> x; x \<le> b\<rbrakk> \<Longrightarrow> (F has_vector_derivative f x) (at x within {a..b})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>a \<le> x; x \<le> b\<rbrakk> \<Longrightarrow> (F has_vector_derivative f x) (at x within {a..b})
[PROOF STEP]
by (metis F True max.commute max_absorb1 min_def)
[PROOF STATE]
proof (state)
this:
\<lbrakk>a \<le> ?x; ?x \<le> b\<rbrakk> \<Longrightarrow> (F has_vector_derivative f ?x) (at ?x within {a..b})

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
LBINT x. indicat_real {a..b} x *\<^sub>R f x = F b - F a

goal (2 subgoals):
 1. a \<le> b \<Longrightarrow> interval_lebesgue_integral lborel (ereal a) (ereal b) f = F b - F a
 2. \<not> a \<le> b \<Longrightarrow> interval_lebesgue_integral lborel (ereal a) (ereal b) f = F b - F a
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
interval_lebesgue_integral lborel (ereal a) (ereal b) f = F b - F a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
interval_lebesgue_integral lborel (ereal a) (ereal b) f = F b - F a

goal (1 subgoal):
 1. interval_lebesgue_integral lborel (ereal a) (ereal b) f = F b - F a
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
interval_lebesgue_integral lborel (ereal a) (ereal b) f = F b - F a

goal (1 subgoal):
 1. \<not> a \<le> b \<Longrightarrow> interval_lebesgue_integral lborel (ereal a) (ereal b) f = F b - F a
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> a \<le> b \<Longrightarrow> interval_lebesgue_integral lborel (ereal a) (ereal b) f = F b - F a
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> a \<le> b

goal (1 subgoal):
 1. \<not> a \<le> b \<Longrightarrow> interval_lebesgue_integral lborel (ereal a) (ereal b) f = F b - F a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> a \<le> b
[PROOF STEP]
have "b \<le> a"
[PROOF STATE]
proof (prove)
using this:
\<not> a \<le> b

goal (1 subgoal):
 1. b \<le> a
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
b \<le> a

goal (1 subgoal):
 1. \<not> a \<le> b \<Longrightarrow> interval_lebesgue_integral lborel (ereal a) (ereal b) f = F b - F a
[PROOF STEP]
have "- interval_lebesgue_integral lborel (ereal b) (ereal a) f = - (LBINT x. indicat_real {b..a} x *\<^sub>R f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - interval_lebesgue_integral lborel (ereal b) (ereal a) f = - (LBINT x. indicat_real {b..a} x *\<^sub>R f x)
[PROOF STEP]
by (simp add: \<open>b \<le> a\<close> interval_integral_Icc set_lebesgue_integral_def)
[PROOF STATE]
proof (state)
this:
- interval_lebesgue_integral lborel (ereal b) (ereal a) f = - (LBINT x. indicat_real {b..a} x *\<^sub>R f x)

goal (1 subgoal):
 1. \<not> a \<le> b \<Longrightarrow> interval_lebesgue_integral lborel (ereal a) (ereal b) f = F b - F a
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
- interval_lebesgue_integral lborel (ereal b) (ereal a) f = - (LBINT x. indicat_real {b..a} x *\<^sub>R f x)

goal (1 subgoal):
 1. \<not> a \<le> b \<Longrightarrow> interval_lebesgue_integral lborel (ereal a) (ereal b) f = F b - F a
[PROOF STEP]
have "\<dots> = F b - F a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (LBINT x. indicat_real {b..a} x *\<^sub>R f x) = F b - F a
[PROOF STEP]
proof (subst integral_FTC_atLeastAtMost [OF \<open>b \<le> a\<close>])
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x. \<lbrakk>b \<le> x; x \<le> a\<rbrakk> \<Longrightarrow> (?F has_vector_derivative f x) (at x within {b..a})
 2. continuous_on {b..a} f
 3. - (?F a - ?F b) = F b - F a
[PROOF STEP]
show "continuous_on {b..a} f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on {b..a} f
[PROOF STEP]
using False f
[PROOF STATE]
proof (prove)
using this:
\<not> a \<le> b
continuous_on {min a b..max a b} f

goal (1 subgoal):
 1. continuous_on {b..a} f
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
continuous_on {b..a} f

goal (2 subgoals):
 1. \<And>x. \<lbrakk>b \<le> x; x \<le> a\<rbrakk> \<Longrightarrow> (?F has_vector_derivative f x) (at x within {b..a})
 2. - (?F a - ?F b) = F b - F a
[PROOF STEP]
show "\<And>x. \<lbrakk>b \<le> x; x \<le> a\<rbrakk>
         \<Longrightarrow> (F has_vector_derivative f x) (at x within {b..a})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>b \<le> x; x \<le> a\<rbrakk> \<Longrightarrow> (F has_vector_derivative f x) (at x within {b..a})
[PROOF STEP]
by (metis F False max_def min_def)
[PROOF STATE]
proof (state)
this:
\<lbrakk>b \<le> ?x; ?x \<le> a\<rbrakk> \<Longrightarrow> (F has_vector_derivative f ?x) (at ?x within {b..a})

goal (1 subgoal):
 1. - (F a - F b) = F b - F a
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
- (LBINT x. indicat_real {b..a} x *\<^sub>R f x) = F b - F a

goal (1 subgoal):
 1. \<not> a \<le> b \<Longrightarrow> interval_lebesgue_integral lborel (ereal a) (ereal b) f = F b - F a
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
- interval_lebesgue_integral lborel (ereal b) (ereal a) f = F b - F a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
- interval_lebesgue_integral lborel (ereal b) (ereal a) f = F b - F a

goal (1 subgoal):
 1. interval_lebesgue_integral lborel (ereal a) (ereal b) f = F b - F a
[PROOF STEP]
by (metis interval_integral_endpoints_reverse)
[PROOF STATE]
proof (state)
this:
interval_lebesgue_integral lborel (ereal a) (ereal b) f = F b - F a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "list_all2 P a b \<Longrightarrow> \<forall>(x,y) \<in> set (zip a b). P x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_all2 P a b \<Longrightarrow> \<forall>(x, y)\<in>set (zip a b). P x y
[PROOF STEP]
by (simp add: list_all2_iff)


[STATEMENT]
lemma level_all_eq:
  assumes "\<And>d. d < length p \<Longrightarrow> lv p d = lv p' d"
  and "length p = length p'"
  shows "level p' = level p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. level p' = level p
[PROOF STEP]
unfolding level_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum (lv p') {..<length p'} = sum (lv p) {..<length p}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?d < length p \<Longrightarrow> lv p ?d = lv p' ?d
length p = length p'

goal (1 subgoal):
 1. sum (lv p') {..<length p'} = sum (lv p) {..<length p}
[PROOF STEP]
by auto


[STATEMENT]
lemma uminus_eq_vec[simp]: "- (v::'a:: group_add vec) = - w \<longleftrightarrow> v = w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- v = - w) = (v = w)
[PROOF STEP]
by (metis uminus_uminus_vec)


[STATEMENT]
lemma i0_ne_infinity [simp]: "0 \<noteq> (\<infinity>::eint)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<noteq> \<infinity>
[PROOF STEP]
by (simp add: zero_eint_def)


[STATEMENT]
lemma vinsert_iff[simp]: "x \<in>\<^sub>\<circ> vinsert y A \<longleftrightarrow> x = y \<or> x \<in>\<^sub>\<circ> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in>\<^sub>\<circ> vinsert y A) = (x = y \<or> x \<in>\<^sub>\<circ> A)
[PROOF STEP]
by simp


[STATEMENT]
lemma is_dualD2:
  assumes "is_dual Vs' Bs'"
  shows  "ordered_incidence_system Vs' Bs'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ordered_incidence_system Vs' Bs'
[PROOF STEP]
using is_dual_def assms
[PROOF STATE]
proof (prove)
using this:
is_dual ?Vs' ?Bs' \<equiv> ordered_incidence_system ?Vs' ?Bs' \<and> inc_mat_of ?Vs' ?Bs' = N\<^sup>T
is_dual Vs' Bs'

goal (1 subgoal):
 1. ordered_incidence_system Vs' Bs'
[PROOF STEP]
by auto


[STATEMENT]
lemma ls_insls_map_of':
  assumes "ht_hash ls"
  assumes "ht_distinct ls"
  assumes "ht_hash ld"
  assumes "ht_distinct ld"
  assumes "1 < length ld"
  assumes "n < length ls"
  shows "map_of (concat (ls_insls (ls ! n) ld))
      ++ map_of (concat (take n ls))
    = map_of (concat ld) ++ map_of (concat (take (Suc n) ls))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_of (concat (ls_insls (ls ! n) ld)) ++ map_of (concat (take n ls)) = map_of (concat ld) ++ map_of (concat (take (Suc n) ls))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. map_of (concat (ls_insls (ls ! n) ld)) ++ map_of (concat (take n ls)) = map_of (concat ld) ++ map_of (concat (take (Suc n) ls))
[PROOF STEP]
from assms(2,6)
[PROOF STATE]
proof (chain)
picking this:
ht_distinct ls
n < length ls
[PROOF STEP]
have "distinct (map fst (ls ! n))"
[PROOF STATE]
proof (prove)
using this:
ht_distinct ls
n < length ls

goal (1 subgoal):
 1. distinct (map fst (ls ! n))
[PROOF STEP]
by (simp add: ht_distinct_def)
[PROOF STATE]
proof (state)
this:
distinct (map fst (ls ! n))

goal (1 subgoal):
 1. map_of (concat (ls_insls (ls ! n) ld)) ++ map_of (concat (take n ls)) = map_of (concat ld) ++ map_of (concat (take (Suc n) ls))
[PROOF STEP]
from ls_insls_map_of[OF assms(3-5) this] assms(6)
[PROOF STATE]
proof (chain)
picking this:
map_of (concat (ls_insls (ls ! n) ld)) = map_of (concat ld) ++ map_of (ls ! n)
n < length ls
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
map_of (concat (ls_insls (ls ! n) ld)) = map_of (concat ld) ++ map_of (ls ! n)
n < length ls

goal (1 subgoal):
 1. map_of (concat (ls_insls (ls ! n) ld)) ++ map_of (concat (take n ls)) = map_of (concat ld) ++ map_of (concat (take (Suc n) ls))
[PROOF STEP]
by (simp add: List.take_Suc_conv_app_nth)
[PROOF STATE]
proof (state)
this:
map_of (concat (ls_insls (ls ! n) ld)) ++ map_of (concat (take n ls)) = map_of (concat ld) ++ map_of (concat (take (Suc n) ls))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lemma_2_8_i:
  "a \<in> supremum A \<Longrightarrow> a l\<rightarrow> b \<in> infimum ((\<lambda> x . x l\<rightarrow> b)`A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> supremum A \<Longrightarrow> a l\<rightarrow> b \<in> infimum ((\<lambda>x. x l\<rightarrow> b) ` A)
[PROOF STEP]
apply (subst infimum_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> supremum A \<Longrightarrow> a l\<rightarrow> b \<in> {a \<in> lower_bound ((\<lambda>x. x l\<rightarrow> b) ` A). \<forall>x\<in>lower_bound ((\<lambda>x. x l\<rightarrow> b) ` A). x \<le> a}
[PROOF STEP]
apply safe
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. a \<in> supremum A \<Longrightarrow> a l\<rightarrow> b \<in> lower_bound ((\<lambda>x. x l\<rightarrow> b) ` A)
 2. \<And>x. \<lbrakk>a \<in> supremum A; x \<in> lower_bound ((\<lambda>x. x l\<rightarrow> b) ` A)\<rbrakk> \<Longrightarrow> x \<le> a l\<rightarrow> b
[PROOF STEP]
apply (simp add: supremum_def upper_bound_def lower_bound_def lemma_2_5_13_a)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>a \<in> supremum A; x \<in> lower_bound ((\<lambda>x. x l\<rightarrow> b) ` A)\<rbrakk> \<Longrightarrow> x \<le> a l\<rightarrow> b
[PROOF STEP]
apply (simp add: supremum_def upper_bound_def lower_bound_def left_residual  [THEN sym])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>(\<forall>x\<in>A. x \<le> a) \<and> (\<forall>x. (\<forall>xa\<in>A. xa \<le> x) \<longrightarrow> a \<le> x); \<forall>xa\<in>A. x * xa \<le> b\<rbrakk> \<Longrightarrow> x * a \<le> b
[PROOF STEP]
by (simp add: right_residual)


[STATEMENT]
lemma negligible_lowdim:
  fixes S :: "'N :: euclidean_space set"
  assumes "dim S < DIM('N)"
    shows "negligible S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. negligible S
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. negligible S
[PROOF STEP]
obtain a where "a \<noteq> 0" and a: "span S \<subseteq> {x. a \<bullet> x = 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a. \<lbrakk>a \<noteq> (0::'N); span S \<subseteq> {x. a \<bullet> x = 0}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using lowdim_subset_hyperplane [OF assms]
[PROOF STATE]
proof (prove)
using this:
\<exists>a. a \<noteq> (0::'N) \<and> span S \<subseteq> {x. a \<bullet> x = 0}

goal (1 subgoal):
 1. (\<And>a. \<lbrakk>a \<noteq> (0::'N); span S \<subseteq> {x. a \<bullet> x = 0}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
a \<noteq> (0::'N)
span S \<subseteq> {x. a \<bullet> x = 0}

goal (1 subgoal):
 1. negligible S
[PROOF STEP]
have "negligible (span S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. negligible (span S)
[PROOF STEP]
using \<open>a \<noteq> 0\<close> a negligible_hyperplane
[PROOF STATE]
proof (prove)
using this:
a \<noteq> (0::'N)
span S \<subseteq> {x. a \<bullet> x = 0}
?a \<noteq> (0::?'a) \<or> ?b \<noteq> 0 \<Longrightarrow> negligible {x. ?a \<bullet> x = ?b}

goal (1 subgoal):
 1. negligible (span S)
[PROOF STEP]
by (blast intro: negligible_subset)
[PROOF STATE]
proof (state)
this:
negligible (span S)

goal (1 subgoal):
 1. negligible S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
negligible (span S)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
negligible (span S)

goal (1 subgoal):
 1. negligible S
[PROOF STEP]
using span_base
[PROOF STATE]
proof (prove)
using this:
negligible (span S)
?a \<in> ?S \<Longrightarrow> ?a \<in> span ?S

goal (1 subgoal):
 1. negligible S
[PROOF STEP]
by (blast intro: negligible_subset)
[PROOF STATE]
proof (state)
this:
negligible S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma remdups_rev_append: "remdups_rev (rs @ rs2) = remdups_rev rs @ remdups_rev [r\<leftarrow>rs2 . r \<notin> set rs]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. remdups_rev (rs @ rs2) = remdups_rev rs @ remdups_rev (filter (\<lambda>r. r \<notin> set rs) rs2)
[PROOF STEP]
proof(induction rs arbitrary: rs2)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>rs2. remdups_rev ([] @ rs2) = remdups_rev [] @ remdups_rev (filter (\<lambda>r. r \<notin> set []) rs2)
 2. \<And>a rs rs2. (\<And>rs2. remdups_rev (rs @ rs2) = remdups_rev rs @ remdups_rev (filter (\<lambda>r. r \<notin> set rs) rs2)) \<Longrightarrow> remdups_rev ((a # rs) @ rs2) = remdups_rev (a # rs) @ remdups_rev (filter (\<lambda>r. r \<notin> set (a # rs)) rs2)
[PROOF STEP]
case Cons
[PROOF STATE]
proof (state)
this:
remdups_rev (rs_ @ ?rs2.0) = remdups_rev rs_ @ remdups_rev (filter (\<lambda>r. r \<notin> set rs_) ?rs2.0)

goal (2 subgoals):
 1. \<And>rs2. remdups_rev ([] @ rs2) = remdups_rev [] @ remdups_rev (filter (\<lambda>r. r \<notin> set []) rs2)
 2. \<And>a rs rs2. (\<And>rs2. remdups_rev (rs @ rs2) = remdups_rev rs @ remdups_rev (filter (\<lambda>r. r \<notin> set rs) rs2)) \<Longrightarrow> remdups_rev ((a # rs) @ rs2) = remdups_rev (a # rs) @ remdups_rev (filter (\<lambda>r. r \<notin> set (a # rs)) rs2)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
remdups_rev (rs_ @ ?rs2.0) = remdups_rev rs_ @ remdups_rev (filter (\<lambda>r. r \<notin> set rs_) ?rs2.0)

goal (1 subgoal):
 1. remdups_rev ((a_ # rs_) @ rs2) = remdups_rev (a_ # rs_) @ remdups_rev (filter (\<lambda>r. r \<notin> set (a_ # rs_)) rs2)
[PROOF STEP]
by(simp add: remdups_append rev_filter remdups_rev_def)
[PROOF STATE]
proof (state)
this:
remdups_rev ((a_ # rs_) @ rs2) = remdups_rev (a_ # rs_) @ remdups_rev (filter (\<lambda>r. r \<notin> set (a_ # rs_)) rs2)

goal (1 subgoal):
 1. \<And>rs2. remdups_rev ([] @ rs2) = remdups_rev [] @ remdups_rev (filter (\<lambda>r. r \<notin> set []) rs2)
[PROOF STEP]
qed(simp add: remdups_rev_def)


[STATEMENT]
lemma unit_disc_fix_moebius_inv [simp]:
  assumes "unit_disc_fix M"
  shows "unit_disc_fix (moebius_inv M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unit_disc_fix (moebius_inv M)
[PROOF STEP]
using unit_disc_fix_moebius_uminus[OF assms]
[PROOF STATE]
proof (prove)
using this:
unit_disc_fix (- M)

goal (1 subgoal):
 1. unit_disc_fix (moebius_inv M)
[PROOF STEP]
by simp


[STATEMENT]
lemma finite_ex_and1:
  assumes "finite {b. \<exists>a. P a b}" (is "finite ?A")
  shows "finite {b. \<exists>a. P a b \<and> Q a b}" (is "finite ?B")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {b. \<exists>a. P a b \<and> Q a b}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite {b. \<exists>a. P a b}

goal (1 subgoal):
 1. finite {b. \<exists>a. P a b \<and> Q a b}
[PROOF STEP]
by - finite


[STATEMENT]
lemma idiv_ile_mono2: "\<lbrakk> 0 < m; m \<le> (n::enat) \<rbrakk> \<Longrightarrow> k div n \<le> k div m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < m; m \<le> n\<rbrakk> \<Longrightarrow> k div n \<le> k div m
[PROOF STEP]
apply (case_tac "n = 0", simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < m; m \<le> n; n \<noteq> 0\<rbrakk> \<Longrightarrow> k div n \<le> k div m
[PROOF STEP]
apply (case_tac m, case_tac k, simp_all)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>nat nata. \<lbrakk>0 < nat; enat nat \<le> n; enat 0 < n; m = enat nat; k = enat nata\<rbrakk> \<Longrightarrow> enat nata div n \<le> enat (nata div nat)
[PROOF STEP]
apply (case_tac n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>nat nata natb. \<lbrakk>0 < nat; enat nat \<le> n; enat 0 < n; m = enat nat; k = enat nata; n = enat natb\<rbrakk> \<Longrightarrow> enat nata div n \<le> enat (nata div nat)
 2. \<And>nat nata. \<lbrakk>0 < nat; enat nat \<le> n; enat 0 < n; m = enat nat; k = enat nata; n = \<infinity>\<rbrakk> \<Longrightarrow> enat nata div n \<le> enat (nata div nat)
[PROOF STEP]
apply (simp add: div_le_mono2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>nat nata. \<lbrakk>0 < nat; enat nat \<le> n; enat 0 < n; m = enat nat; k = enat nata; n = \<infinity>\<rbrakk> \<Longrightarrow> enat nata div n \<le> enat (nata div nat)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma card_fset_gt_0:
  shows "x \<in> fset S \<Longrightarrow> 0 < card_fset S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> fset S \<Longrightarrow> 0 < card_fset S
[PROOF STEP]
by (descending) (auto simp add: card_gt_0_iff)


[STATEMENT]
lemma arcs_ends_app_iso_eq:
  assumes "digraph_isomorphism hom"
  shows "arcs_ends (app_iso hom G) = (\<lambda>(u,v). (iso_verts hom u, iso_verts hom v)) ` arcs_ends G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arcs_ends (app_iso hom G) = (\<lambda>(u, v). (iso_verts hom u, iso_verts hom v)) ` arcs_ends G
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
digraph_isomorphism hom

goal (1 subgoal):
 1. arcs_ends (app_iso hom G) = (\<lambda>(u, v). (iso_verts hom u, iso_verts hom v)) ` arcs_ends G
[PROOF STEP]
by (auto simp: arcs_ends_conv image_image iso_verts_head iso_verts_tail
      intro!: rev_image_eqI)


[STATEMENT]
lemma module_hom_neg: "module_hom s1 s2 f \<Longrightarrow> module_hom s1 s2 (\<lambda>x. - f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. module_hom s1 s2 f \<Longrightarrow> module_hom s1 s2 (\<lambda>x. - f x)
[PROOF STEP]
by (simp add: module_hom_iff module.scale_minus_right)


[STATEMENT]
lemma nn_integral_has_integral_lebesgue:
  fixes f :: "'a::euclidean_space \<Rightarrow> real"
  assumes nonneg: "\<And>x. 0 \<le> f x" and I: "(f has_integral I) \<Omega>"
  shows "integral\<^sup>N lborel (\<lambda>x. indicator \<Omega> x * f x) = I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real \<Omega> x * f x) \<partial>lborel = ennreal I
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real \<Omega> x * f x) \<partial>lborel = ennreal I
[PROOF STEP]
from I
[PROOF STATE]
proof (chain)
picking this:
(f has_integral I) \<Omega>
[PROOF STEP]
have "(\<lambda>x. indicator \<Omega> x *\<^sub>R f x) \<in> lebesgue \<rightarrow>\<^sub>M borel"
[PROOF STATE]
proof (prove)
using this:
(f has_integral I) \<Omega>

goal (1 subgoal):
 1. (\<lambda>x. indicat_real \<Omega> x *\<^sub>R f x) \<in> borel_measurable lebesgue
[PROOF STEP]
by (rule has_integral_implies_lebesgue_measurable)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. indicat_real \<Omega> x *\<^sub>R f x) \<in> borel_measurable lebesgue

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real \<Omega> x * f x) \<partial>lborel = ennreal I
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. indicat_real \<Omega> x *\<^sub>R f x) \<in> borel_measurable lebesgue
[PROOF STEP]
obtain f' :: "'a \<Rightarrow> real"
    where [measurable]: "f' \<in> borel \<rightarrow>\<^sub>M borel" and eq: "AE x in lborel. indicator \<Omega> x * f x = f' x"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. indicat_real \<Omega> x *\<^sub>R f x) \<in> borel_measurable lebesgue

goal (1 subgoal):
 1. (\<And>f'. \<lbrakk>f' \<in> borel_measurable borel; AE x in lborel. indicat_real \<Omega> x * f x = f' x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto dest: completion_ex_borel_measurable_real)
[PROOF STATE]
proof (state)
this:
f' \<in> borel_measurable borel
AE x in lborel. indicat_real \<Omega> x * f x = f' x

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real \<Omega> x * f x) \<partial>lborel = ennreal I
[PROOF STEP]
from I
[PROOF STATE]
proof (chain)
picking this:
(f has_integral I) \<Omega>
[PROOF STEP]
have "((\<lambda>x. abs (indicator \<Omega> x * f x)) has_integral I) UNIV"
[PROOF STATE]
proof (prove)
using this:
(f has_integral I) \<Omega>

goal (1 subgoal):
 1. ((\<lambda>x. \<bar>indicat_real \<Omega> x * f x\<bar>) has_integral I) UNIV
[PROOF STEP]
using nonneg
[PROOF STATE]
proof (prove)
using this:
(f has_integral I) \<Omega>
0 \<le> f ?x

goal (1 subgoal):
 1. ((\<lambda>x. \<bar>indicat_real \<Omega> x * f x\<bar>) has_integral I) UNIV
[PROOF STEP]
by (simp add: indicator_def of_bool_def if_distrib[of "\<lambda>x. x * f y" for y] cong: if_cong)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. \<bar>indicat_real \<Omega> x * f x\<bar>) has_integral I) UNIV

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real \<Omega> x * f x) \<partial>lborel = ennreal I
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((\<lambda>x. \<bar>indicat_real \<Omega> x * f x\<bar>) has_integral I) UNIV

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real \<Omega> x * f x) \<partial>lborel = ennreal I
[PROOF STEP]
have "((\<lambda>x. abs (indicator \<Omega> x * f x)) has_integral I) UNIV \<longleftrightarrow> ((\<lambda>x. abs (f' x)) has_integral I) UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. \<bar>indicat_real \<Omega> x * f x\<bar>) has_integral I) UNIV = ((\<lambda>x. \<bar>f' x\<bar>) has_integral I) UNIV
[PROOF STEP]
using eq
[PROOF STATE]
proof (prove)
using this:
AE x in lborel. indicat_real \<Omega> x * f x = f' x

goal (1 subgoal):
 1. ((\<lambda>x. \<bar>indicat_real \<Omega> x * f x\<bar>) has_integral I) UNIV = ((\<lambda>x. \<bar>f' x\<bar>) has_integral I) UNIV
[PROOF STEP]
by (intro has_integral_AE) auto
[PROOF STATE]
proof (state)
this:
((\<lambda>x. \<bar>indicat_real \<Omega> x * f x\<bar>) has_integral I) UNIV = ((\<lambda>x. \<bar>f' x\<bar>) has_integral I) UNIV

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real \<Omega> x * f x) \<partial>lborel = ennreal I
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x. \<bar>f' x\<bar>) has_integral I) UNIV
[PROOF STEP]
have "integral\<^sup>N lborel (\<lambda>x. abs (f' x)) = I"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. \<bar>f' x\<bar>) has_integral I) UNIV

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal \<bar>f' x\<bar> \<partial>lborel = ennreal I
[PROOF STEP]
by (rule nn_integral_has_integral_lborel[rotated 2]) auto
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal \<bar>f' x\<bar> \<partial>lborel = ennreal I

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real \<Omega> x * f x) \<partial>lborel = ennreal I
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal \<bar>f' x\<bar> \<partial>lborel = ennreal I

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real \<Omega> x * f x) \<partial>lborel = ennreal I
[PROOF STEP]
have "integral\<^sup>N lborel (\<lambda>x. abs (f' x)) = integral\<^sup>N lborel (\<lambda>x. abs (indicator \<Omega> x * f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal \<bar>f' x\<bar> \<partial>lborel = \<integral>\<^sup>+ x. ennreal \<bar>indicat_real \<Omega> x * f x\<bar> \<partial>lborel
[PROOF STEP]
using eq
[PROOF STATE]
proof (prove)
using this:
AE x in lborel. indicat_real \<Omega> x * f x = f' x

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal \<bar>f' x\<bar> \<partial>lborel = \<integral>\<^sup>+ x. ennreal \<bar>indicat_real \<Omega> x * f x\<bar> \<partial>lborel
[PROOF STEP]
by (intro nn_integral_cong_AE) auto
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal \<bar>f' x\<bar> \<partial>lborel = \<integral>\<^sup>+ x. ennreal \<bar>indicat_real \<Omega> x * f x\<bar> \<partial>lborel

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real \<Omega> x * f x) \<partial>lborel = ennreal I
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<integral>\<^sup>+ x. ennreal \<bar>indicat_real \<Omega> x * f x\<bar> \<partial>lborel = ennreal I
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+ x. ennreal \<bar>indicat_real \<Omega> x * f x\<bar> \<partial>lborel = ennreal I

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real \<Omega> x * f x) \<partial>lborel = ennreal I
[PROOF STEP]
using nonneg
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+ x. ennreal \<bar>indicat_real \<Omega> x * f x\<bar> \<partial>lborel = ennreal I
0 \<le> f ?x

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real \<Omega> x * f x) \<partial>lborel = ennreal I
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (indicat_real \<Omega> x * f x) \<partial>lborel = ennreal I

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma zero_ne_\<omega>\<^sub>z[simp]: "0 \<noteq> \<omega>\<^sub>z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<noteq> \<omega>\<^sub>z
[PROOF STEP]
using zero_lt_\<omega>\<^sub>z
[PROOF STATE]
proof (prove)
using this:
0 < \<omega>\<^sub>z

goal (1 subgoal):
 1. 0 \<noteq> \<omega>\<^sub>z
[PROOF STEP]
by linarith