[STATEMENT]
lemma uniformly_continuous_onD:
  "uniformly_continuous_on s f \<Longrightarrow> eventually E uniformity \<Longrightarrow>
    eventually (\<lambda>(x, y). x \<in> s \<longrightarrow> y \<in> s \<longrightarrow> E (f x, f y)) uniformity"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>uniformly_continuous_on s f; eventually E uniformity\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F (x, y) in uniformity. x \<in> s \<longrightarrow> y \<in> s \<longrightarrow> E (f x, f y)
[PROOF STEP]
by (simp add: uniformly_continuous_on_uniformity filterlim_iff
      eventually_inf_principal split_beta' mem_Times_iff imp_conjL)


[STATEMENT]
lemma open_subopen: "open S \<longleftrightarrow> (\<forall>x\<in>S. \<exists>T. open T \<and> x \<in> T \<and> T \<subseteq> S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open S = (\<forall>x\<in>S. \<exists>T. open T \<and> x \<in> T \<and> T \<subseteq> S)
[PROOF STEP]
by (auto intro: openI)


[STATEMENT]
lemma bij_betw_permutes_compose_left:
  assumes "\<pi> permutes A"
  shows   "bij_betw (\<lambda>\<sigma>. \<pi> \<circ> \<sigma>) {\<sigma>. \<sigma> permutes A} {\<sigma>. \<sigma> permutes A}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw ((\<circ>) \<pi>) {\<sigma>. \<sigma> permutes A} {\<sigma>. \<sigma> permutes A}
[PROOF STEP]
proof (rule bij_betwI)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. (\<circ>) \<pi> \<in> {\<sigma>. \<sigma> permutes A} \<rightarrow> {\<sigma>. \<sigma> permutes A}
 2. ?g \<in> {\<sigma>. \<sigma> permutes A} \<rightarrow> {\<sigma>. \<sigma> permutes A}
 3. \<And>x. x \<in> {\<sigma>. \<sigma> permutes A} \<Longrightarrow> ?g (\<pi> \<circ> x) = x
 4. \<And>y. y \<in> {\<sigma>. \<sigma> permutes A} \<Longrightarrow> \<pi> \<circ> ?g y = y
[PROOF STEP]
show "(\<circ>) \<pi> \<in> {\<sigma>. \<sigma> permutes A} \<rightarrow> {\<sigma>. \<sigma> permutes A}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<circ>) \<pi> \<in> {\<sigma>. \<sigma> permutes A} \<rightarrow> {\<sigma>. \<sigma> permutes A}
[PROOF STEP]
by (auto intro: permutes_compose assms)
[PROOF STATE]
proof (state)
this:
(\<circ>) \<pi> \<in> {\<sigma>. \<sigma> permutes A} \<rightarrow> {\<sigma>. \<sigma> permutes A}

goal (3 subgoals):
 1. ?g \<in> {\<sigma>. \<sigma> permutes A} \<rightarrow> {\<sigma>. \<sigma> permutes A}
 2. \<And>x. x \<in> {\<sigma>. \<sigma> permutes A} \<Longrightarrow> ?g (\<pi> \<circ> x) = x
 3. \<And>y. y \<in> {\<sigma>. \<sigma> permutes A} \<Longrightarrow> \<pi> \<circ> ?g y = y
[PROOF STEP]
show "(\<circ>) (inv_into UNIV \<pi>) \<in> {\<sigma>. \<sigma> permutes A} \<rightarrow> {\<sigma>. \<sigma> permutes A}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<circ>) (inv \<pi>) \<in> {\<sigma>. \<sigma> permutes A} \<rightarrow> {\<sigma>. \<sigma> permutes A}
[PROOF STEP]
by (auto intro: permutes_compose assms permutes_inv)
[PROOF STATE]
proof (state)
this:
(\<circ>) (inv \<pi>) \<in> {\<sigma>. \<sigma> permutes A} \<rightarrow> {\<sigma>. \<sigma> permutes A}

goal (2 subgoals):
 1. \<And>x. x \<in> {\<sigma>. \<sigma> permutes A} \<Longrightarrow> inv \<pi> \<circ> (\<pi> \<circ> x) = x
 2. \<And>y. y \<in> {\<sigma>. \<sigma> permutes A} \<Longrightarrow> \<pi> \<circ> (inv \<pi> \<circ> y) = y
[PROOF STEP]
qed (use permutes_inverses[OF assms] in auto)


[STATEMENT]
lemma union_le_diff_plus: "P \<subseteq># M \<Longrightarrow> N < P \<Longrightarrow> M - P + N < M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>P \<subseteq># M; N < P\<rbrakk> \<Longrightarrow> M - P + N < M
[PROOF STEP]
by (drule subset_mset.diff_add[symmetric]) (metis union_le_mono2)


[STATEMENT]
lemma differentiable_imp_piecewise_differentiable:
    "(\<And>x. x \<in> S \<Longrightarrow> f differentiable (at x within S))
         \<Longrightarrow> f piecewise_differentiable_on S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. x \<in> S \<Longrightarrow> f differentiable at x within S) \<Longrightarrow> f piecewise_differentiable_on S
[PROOF STEP]
by (auto simp: piecewise_differentiable_on_def differentiable_imp_continuous_on differentiable_on_def
         intro: differentiable_within_subset)


[STATEMENT]
lemma count_of_map_default [simp]:
  "count_of (map_default x b (\<lambda>x. x + b) xs) y =
    (if x = y then count_of xs x + b else count_of xs y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count_of (map_default x b (\<lambda>x. x + b) xs) y = (if x = y then count_of xs x + b else count_of xs y)
[PROOF STEP]
unfolding count_of_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (case map_of (map_default x b (\<lambda>x. x + b) xs) y of None \<Rightarrow> 0 | Some n \<Rightarrow> n) = (if x = y then (case map_of xs x of None \<Rightarrow> 0 | Some n \<Rightarrow> n) + b else case map_of xs y of None \<Rightarrow> 0 | Some n \<Rightarrow> n)
[PROOF STEP]
by (simp add: map_of_map_default split: option.split)


[STATEMENT]
lemma S5n_rels_closed:
  "S5n M \<Longrightarrow> relations M a `` (relations M a `` X) \<subseteq> relations M a `` X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S5n M \<Longrightarrow> relations M a `` relations M a `` X \<subseteq> relations M a `` X
[PROOF STEP]
apply (drule S5nD[where a=a])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. equiv (worlds M) (relations M a) \<Longrightarrow> relations M a `` relations M a `` X \<subseteq> relations M a `` X
[PROOF STEP]
apply (erule equivE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>refl_on (worlds M) (relations M a); sym (relations M a); trans (relations M a)\<rbrakk> \<Longrightarrow> relations M a `` relations M a `` X \<subseteq> relations M a `` X
[PROOF STEP]
apply (auto dest: refl_onD symD transD)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma mtx3_to_mtx: "mtx
  ([a\<^sub>1\<^sub>1, a\<^sub>1\<^sub>2, a\<^sub>1\<^sub>3] #
   [a\<^sub>2\<^sub>1, a\<^sub>2\<^sub>2, a\<^sub>2\<^sub>3] #
   [a\<^sub>3\<^sub>1, a\<^sub>3\<^sub>2, a\<^sub>3\<^sub>3] # []) =
  to_mtx (\<chi> i j::3. if i=1 \<and> j=1 then a\<^sub>1\<^sub>1
  else (if i=1 \<and> j=2 then a\<^sub>1\<^sub>2
  else (if i=1 \<and> j=3 then a\<^sub>1\<^sub>3
  else (if i=2 \<and> j=1 then a\<^sub>2\<^sub>1
  else (if i=2 \<and> j=2 then a\<^sub>2\<^sub>2
  else (if i=2 \<and> j=3 then a\<^sub>2\<^sub>3
  else (if i=3 \<and> j=1 then a\<^sub>3\<^sub>1
  else (if i=3 \<and> j=2 then a\<^sub>3\<^sub>2
  else a\<^sub>3\<^sub>3))))))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mtx [[a\<^sub>1\<^sub>1, a\<^sub>1\<^sub>2, a\<^sub>1\<^sub>3], [a\<^sub>2\<^sub>1, a\<^sub>2\<^sub>2, a\<^sub>2\<^sub>3], [a\<^sub>3\<^sub>1, a\<^sub>3\<^sub>2, a\<^sub>3\<^sub>3]] = to_mtx (\<chi>i j. if i = 1 \<and> j = 1 then a\<^sub>1\<^sub>1 else if i = 1 \<and> j = 2 then a\<^sub>1\<^sub>2 else if i = 1 \<and> j = 3 then a\<^sub>1\<^sub>3 else if i = 2 \<and> j = 1 then a\<^sub>2\<^sub>1 else if i = 2 \<and> j = 2 then a\<^sub>2\<^sub>2 else if i = 2 \<and> j = 3 then a\<^sub>2\<^sub>3 else if i = 3 \<and> j = 1 then a\<^sub>3\<^sub>1 else if i = 3 \<and> j = 2 then a\<^sub>3\<^sub>2 else a\<^sub>3\<^sub>3)
[PROOF STEP]
apply(simp add: sq_mtx_eq_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i. (i = 3 \<longrightarrow> (\<forall>j. j \<noteq> 3 \<longrightarrow> j \<noteq> 2 \<longrightarrow> j \<noteq> 1 \<longrightarrow> a\<^sub>3\<^sub>3 = 0)) \<and> (i \<noteq> 3 \<longrightarrow> (i = 2 \<longrightarrow> (\<forall>j. j \<noteq> 3 \<longrightarrow> j \<noteq> 2 \<longrightarrow> j \<noteq> 1 \<longrightarrow> a\<^sub>3\<^sub>3 = 0)) \<and> (i \<noteq> 2 \<longrightarrow> (i = 1 \<longrightarrow> (\<forall>j. j \<noteq> 3 \<longrightarrow> j \<noteq> 2 \<longrightarrow> j \<noteq> 1 \<longrightarrow> a\<^sub>3\<^sub>3 = 0)) \<and> (i \<noteq> 1 \<longrightarrow> a\<^sub>3\<^sub>3 = 0)))
[PROOF STEP]
using exhaust_3
[PROOF STATE]
proof (prove)
using this:
?x = 1 \<or> ?x = 2 \<or> ?x = 3

goal (1 subgoal):
 1. \<forall>i. (i = 3 \<longrightarrow> (\<forall>j. j \<noteq> 3 \<longrightarrow> j \<noteq> 2 \<longrightarrow> j \<noteq> 1 \<longrightarrow> a\<^sub>3\<^sub>3 = 0)) \<and> (i \<noteq> 3 \<longrightarrow> (i = 2 \<longrightarrow> (\<forall>j. j \<noteq> 3 \<longrightarrow> j \<noteq> 2 \<longrightarrow> j \<noteq> 1 \<longrightarrow> a\<^sub>3\<^sub>3 = 0)) \<and> (i \<noteq> 2 \<longrightarrow> (i = 1 \<longrightarrow> (\<forall>j. j \<noteq> 3 \<longrightarrow> j \<noteq> 2 \<longrightarrow> j \<noteq> 1 \<longrightarrow> a\<^sub>3\<^sub>3 = 0)) \<and> (i \<noteq> 1 \<longrightarrow> a\<^sub>3\<^sub>3 = 0)))
[PROOF STEP]
by force


[STATEMENT]
lemma closed_components: "\<lbrakk>closed s; c \<in> components s\<rbrakk> \<Longrightarrow> closed c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>closed s; c \<in> components s\<rbrakk> \<Longrightarrow> closed c
[PROOF STEP]
by (metis closed_connected_component components_iff)


[STATEMENT]
lemma [code]:
  "all_n_lists P n \<longleftrightarrow> (if n = 0 then P [] else enum_all (%x. all_n_lists (%xs. P (x # xs)) (n - 1)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. all_n_lists P n = (if n = 0 then P [] else enum_all (\<lambda>x. all_n_lists (\<lambda>xs. P (x # xs)) (n - 1)))
[PROOF STEP]
unfolding all_n_lists_def enum_all
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ball (set (List.n_lists n enum)) P = (if n = 0 then P [] else \<forall>x. \<forall>xs\<in>set (List.n_lists (n - 1) enum). P (x # xs))
[PROOF STEP]
by (cases n) (auto simp add: enum_UNIV)


[STATEMENT]
lemma paramsts_subset: \<open>set A \<subseteq> set B \<Longrightarrow> paramsts A \<subseteq> paramsts B\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set A \<subseteq> set B \<Longrightarrow> paramsts A \<subseteq> paramsts B
[PROOF STEP]
by (induct A) auto


[STATEMENT]
lemma hcmod_mult_i2 [simp]: "\<And>y. hcmod (hcomplex_of_hypreal y * iii) = \<bar>y\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y. hcmod (hcomplex_of_hypreal y * iii) = \<bar>y\<bar>
[PROOF STEP]
by transfer (simp add: norm_complex_def)


[STATEMENT]
lemma minus_add_uminus_vec: "(v :: 'a :: group_add vec) \<in> carrier_vec n \<Longrightarrow>
  w \<in> carrier_vec n \<Longrightarrow> v - w = v + (- w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>v \<in> carrier_vec n; w \<in> carrier_vec n\<rbrakk> \<Longrightarrow> v - w = v + - w
[PROOF STEP]
by (intro eq_vecI, auto)


[STATEMENT]
lemma word_less_add_right: "x < y - z \<Longrightarrow> z \<le> y \<Longrightarrow> x + z < y"
  for x y z :: "'a::len word"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x < y - z; z \<le> y\<rbrakk> \<Longrightarrow> x + z < y
[PROOF STEP]
by uint_arith


[STATEMENT]
lemma Sigma_Suc[elim]: "\<forall>k<Suc w. f (xs @ [k]) = Suc 0
        \<Longrightarrow> Sigma f (xs @ [w]) = Suc w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>k<Suc w. f (xs @ [k]) = Suc 0 \<Longrightarrow> UF.Sigma f (xs @ [w]) = Suc w
[PROOF STEP]
apply(induct w)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<forall>k<Suc 0. f (xs @ [k]) = Suc 0 \<Longrightarrow> UF.Sigma f (xs @ [0]) = Suc 0
 2. \<And>w. \<lbrakk>\<forall>k<Suc w. f (xs @ [k]) = Suc 0 \<Longrightarrow> UF.Sigma f (xs @ [w]) = Suc w; \<forall>k<Suc (Suc w). f (xs @ [k]) = Suc 0\<rbrakk> \<Longrightarrow> UF.Sigma f (xs @ [Suc w]) = Suc (Suc w)
[PROOF STEP]
apply(simp add: Sigma.simps, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>w. \<lbrakk>UF.Sigma f (xs @ [w]) = Suc w; \<forall>k<Suc (Suc w). f (xs @ [k]) = Suc 0\<rbrakk> \<Longrightarrow> UF.Sigma f (xs @ [Suc w]) = Suc (Suc w)
[PROOF STEP]
apply(simp add: Sigma.simps)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma sup_continuous_nn_integral[order_continuous_intros]:
  assumes f: "\<And>y. sup_continuous (f y)"
  assumes [measurable]: "\<And>x. (\<lambda>y. f y x) \<in> borel_measurable M"
  shows "sup_continuous (\<lambda>x. (\<integral>\<^sup>+y. f y x \<partial>M))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sup_continuous (\<lambda>x. \<integral>\<^sup>+ y. f y x \<partial>M)
[PROOF STEP]
unfolding sup_continuous_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>Ma. incseq Ma \<longrightarrow> \<integral>\<^sup>+ y. f y (Sup (range Ma)) \<partial>M = (SUP i. \<integral>\<^sup>+ y. f y (Ma i) \<partial>M)
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>Ma. incseq Ma \<Longrightarrow> \<integral>\<^sup>+ y. f y (Sup (range Ma)) \<partial>M = (SUP i. \<integral>\<^sup>+ y. f y (Ma i) \<partial>M)
[PROOF STEP]
fix C :: "nat \<Rightarrow> 'b"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>Ma. incseq Ma \<Longrightarrow> \<integral>\<^sup>+ y. f y (Sup (range Ma)) \<partial>M = (SUP i. \<integral>\<^sup>+ y. f y (Ma i) \<partial>M)
[PROOF STEP]
assume C: "incseq C"
[PROOF STATE]
proof (state)
this:
incseq C

goal (1 subgoal):
 1. \<And>Ma. incseq Ma \<Longrightarrow> \<integral>\<^sup>+ y. f y (Sup (range Ma)) \<partial>M = (SUP i. \<integral>\<^sup>+ y. f y (Ma i) \<partial>M)
[PROOF STEP]
with sup_continuous_mono[OF f]
[PROOF STATE]
proof (chain)
picking this:
mono (f ?y1)
incseq C
[PROOF STEP]
show "(\<integral>\<^sup>+ y. f y (Sup (C ` UNIV)) \<partial>M) = (SUP i. \<integral>\<^sup>+ y. f y (C i) \<partial>M)"
[PROOF STATE]
proof (prove)
using this:
mono (f ?y1)
incseq C

goal (1 subgoal):
 1. \<integral>\<^sup>+ y. f y (Sup (range C)) \<partial>M = (SUP i. \<integral>\<^sup>+ y. f y (C i) \<partial>M)
[PROOF STEP]
unfolding sup_continuousD[OF f C]
[PROOF STATE]
proof (prove)
using this:
mono (f ?y1)
incseq C

goal (1 subgoal):
 1. \<integral>\<^sup>+ y. (SUP i. f y (C i)) \<partial>M = (SUP i. \<integral>\<^sup>+ y. f y (C i) \<partial>M)
[PROOF STEP]
by (subst nn_integral_monotone_convergence_SUP) (auto simp: mono_def le_fun_def)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ y. f y (Sup (range C)) \<partial>M = (SUP i. \<integral>\<^sup>+ y. f y (C i) \<partial>M)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Lambert_W'_times_exp_self':
  assumes "x \<in> {-exp (-1)..<0}"
  shows   "exp (Lambert_W' x) * Lambert_W' x = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp (Lambert_W' x) * Lambert_W' x = x
[PROOF STEP]
using Lambert_W'_times_exp_self[of x] assms
[PROOF STATE]
proof (prove)
using this:
x \<in> {- exp (- 1)..<0} \<Longrightarrow> Lambert_W' x * exp (Lambert_W' x) = x
x \<in> {- exp (- 1)..<0}

goal (1 subgoal):
 1. exp (Lambert_W' x) * Lambert_W' x = x
[PROOF STEP]
by (simp add: mult_ac)


[STATEMENT]
lemma LIM_D: "f \<midarrow>a\<rightarrow> L \<Longrightarrow> 0 < r \<Longrightarrow> \<exists>s>0.\<forall>x. x \<noteq> a \<and> norm (x - a) < s \<longrightarrow> norm (f x - L) < r"
  for a :: "'a::real_normed_vector" and L :: "'b::real_normed_vector"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<midarrow>a\<rightarrow> L; 0 < r\<rbrakk> \<Longrightarrow> \<exists>s>0. \<forall>x. x \<noteq> a \<and> norm (x - a) < s \<longrightarrow> norm (f x - L) < r
[PROOF STEP]
by (simp add: LIM_eq)


[STATEMENT]
lemma tuple_disj[simp]:
  shows "{y. y = x \<or> y = z} = {x,z}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {y. y = x \<or> y = z} = {x, z}
[PROOF STEP]
by auto


[STATEMENT]
lemma open_subopen: "open S \<longleftrightarrow> (\<forall>x\<in>S. \<exists>T. open T \<and> x \<in> T \<and> T \<subseteq> S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open S = (\<forall>x\<in>S. \<exists>T. open T \<and> x \<in> T \<and> T \<subseteq> S)
[PROOF STEP]
by (auto intro: openI)


[STATEMENT]
lemma complex_norm_square: "of_real ((norm z)\<^sup>2) = z * cnj z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. complex_of_real ((cmod z)\<^sup>2) = z * cnj z
[PROOF STEP]
by (cases z)
    (auto simp: complex_eq_iff norm_complex_def power2_eq_square[symmetric] of_real_power[symmetric]
      simp del: of_real_power)


[STATEMENT]
lemma deriv_pderiv:
  "deriv (poly p) = poly (pderiv p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deriv (poly p) = poly (pderiv p)
[PROOF STEP]
apply (rule ext)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. deriv (poly p) x = poly (pderiv p) x
[PROOF STEP]
apply (rule DERIV_imp_deriv)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. (poly p has_field_derivative poly (pderiv p) x) (at x)
[PROOF STEP]
using poly_DERIV
[PROOF STATE]
proof (prove)
using this:
(poly ?p has_field_derivative poly (pderiv ?p) ?x) (at ?x)

goal (1 subgoal):
 1. \<And>x. (poly p has_field_derivative poly (pderiv p) x) (at x)
[PROOF STEP]
.


[STATEMENT]
lemma alternating_S_no_flip:
  assumes "s\<in>S" "t\<in>S" "n > 0" "n < relfun s t \<or> relfun s t = 0"
  shows   "sum_list (alternating_list n s t) \<noteq> sum_list (alternating_list n t s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (alternating_list n s t) \<noteq> sum_list (alternating_list n t s)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sum_list (alternating_list n s t) = sum_list (alternating_list n t s) \<Longrightarrow> False
[PROOF STEP]
assume "sum_list (alternating_list n s t) = sum_list (alternating_list n t s)"
[PROOF STATE]
proof (state)
this:
sum_list (alternating_list n s t) = sum_list (alternating_list n t s)

goal (1 subgoal):
 1. sum_list (alternating_list n s t) = sum_list (alternating_list n t s) \<Longrightarrow> False
[PROOF STEP]
hence "sum_list (alternating_list n s t) + - sum_list (alternating_list n t s) = 0"
[PROOF STATE]
proof (prove)
using this:
sum_list (alternating_list n s t) = sum_list (alternating_list n t s)

goal (1 subgoal):
 1. sum_list (alternating_list n s t) + - sum_list (alternating_list n t s) = (0::'w)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum_list (alternating_list n s t) + - sum_list (alternating_list n t s) = (0::'w)

goal (1 subgoal):
 1. sum_list (alternating_list n s t) = sum_list (alternating_list n t s) \<Longrightarrow> False
[PROOF STEP]
with assms(1,2)
[PROOF STATE]
proof (chain)
picking this:
s \<in> S
t \<in> S
sum_list (alternating_list n s t) + - sum_list (alternating_list n t s) = (0::'w)
[PROOF STEP]
have "sum_list (alternating_list (2*n) s t) = 0"
[PROOF STATE]
proof (prove)
using this:
s \<in> S
t \<in> S
sum_list (alternating_list n s t) + - sum_list (alternating_list n t s) = (0::'w)

goal (1 subgoal):
 1. sum_list (alternating_list (2 * n) s t) = (0::'w)
[PROOF STEP]
by  (cases "even n")
        (auto simp add:
          genset_order2_add uminus_sum_list_alternating_order2
          sum_list.append[THEN sym]
          alternating_list_append mult_2
        )
[PROOF STATE]
proof (state)
this:
sum_list (alternating_list (2 * n) s t) = (0::'w)

goal (1 subgoal):
 1. sum_list (alternating_list n s t) = sum_list (alternating_list n t s) \<Longrightarrow> False
[PROOF STEP]
with assms(3,4) less_add_order_eq_0_contra add_order_eq0
[PROOF STATE]
proof (chain)
picking this:
0 < n
n < add_order (s + t) \<or> add_order (s + t) = 0
\<lbrakk>0 < ?k; ?k < add_order ?a\<rbrakk> \<Longrightarrow> ?a +^ ?k \<noteq> (0::?'a)
\<lbrakk>add_order ?a = 0; 0 < ?n\<rbrakk> \<Longrightarrow> ?a +^ ?n \<noteq> (0::?'a)
sum_list (alternating_list (2 * n) s t) = (0::'w)
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
0 < n
n < add_order (s + t) \<or> add_order (s + t) = 0
\<lbrakk>0 < ?k; ?k < add_order ?a\<rbrakk> \<Longrightarrow> ?a +^ ?k \<noteq> (0::?'a)
\<lbrakk>add_order ?a = 0; 0 < ?n\<rbrakk> \<Longrightarrow> ?a +^ ?n \<noteq> (0::?'a)
sum_list (alternating_list (2 * n) s t) = (0::'w)

goal (1 subgoal):
 1. False
[PROOF STEP]
by (auto simp add: alternating_sum_list_conv_nataction)
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma add_independentS_double_iff :
  "add_independentS [A,B] = (\<forall>b\<in>B. \<forall>a\<in>A. a + b = 0 \<longrightarrow> a = 0 )"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. add_independentS [A, B] = (\<forall>b\<in>B. \<forall>a\<in>A. a + b = (0::'a) \<longrightarrow> a = (0::'a))
[PROOF STEP]
using add_independentS_doubleI add_independentS_doubleD
[PROOF STATE]
proof (prove)
using this:
(\<And>b a. \<lbrakk>b \<in> ?B; a \<in> ?A; a + b = (0::?'a)\<rbrakk> \<Longrightarrow> a = (0::?'a)) \<Longrightarrow> add_independentS [?A, ?B]
\<lbrakk>add_independentS [?A, ?B]; ?b \<in> ?B; ?a \<in> ?A; ?a + ?b = (0::?'a)\<rbrakk> \<Longrightarrow> ?a = (0::?'a)

goal (1 subgoal):
 1. add_independentS [A, B] = (\<forall>b\<in>B. \<forall>a\<in>A. a + b = (0::'a) \<longrightarrow> a = (0::'a))
[PROOF STEP]
by fast


[STATEMENT]
lemma lang_deriv: "lang (deriv c r) = Deriv c (lang r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lang (deriv c r) = Deriv c (lang r)
[PROOF STEP]
by (induct r) (simp_all add: nullable_iff)


[STATEMENT]
lemma upt_append: "m \<le> n \<Longrightarrow> [0..<m] @ [m..<n] = [0..<n]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m \<le> n \<Longrightarrow> [0..<m] @ [m..<n] = [0..<n]
[PROOF STEP]
by (insert upt_add_eq_append[of 0 m "n - m"], simp)


[STATEMENT]
lemma conjs_ci: "(\<forall>q \<in> set (conjs p). Ifm vs bs q) = Ifm vs bs p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>q\<in>set (conjs p). Ifm vs bs q) = Ifm vs bs p
[PROOF STEP]
by (induct p rule: conjs.induct) auto


[STATEMENT]
lemma uniformly_continuous_onD:
  "uniformly_continuous_on s f \<Longrightarrow> eventually E uniformity \<Longrightarrow>
    eventually (\<lambda>(x, y). x \<in> s \<longrightarrow> y \<in> s \<longrightarrow> E (f x, f y)) uniformity"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>uniformly_continuous_on s f; eventually E uniformity\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F (x, y) in uniformity. x \<in> s \<longrightarrow> y \<in> s \<longrightarrow> E (f x, f y)
[PROOF STEP]
by (simp add: uniformly_continuous_on_uniformity filterlim_iff
      eventually_inf_principal split_beta' mem_Times_iff imp_conjL)


[STATEMENT]
lemma  I_XpZ_hermitian:
  shows "hermitian I_XpZ"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hermitian I_XpZ
[PROOF STEP]
unfolding I_XpZ_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hermitian (1\<^sub>m 2 \<Otimes> XpZ)
[PROOF STEP]
using tensor_mat_hermitian[of "1\<^sub>m 2" 2 XpZ 2]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>1\<^sub>m 2 \<in> carrier_mat 2 2; XpZ \<in> carrier_mat 2 2; 0 < 2; 0 < 2; hermitian (1\<^sub>m 2); hermitian XpZ\<rbrakk> \<Longrightarrow> hermitian (1\<^sub>m 2 \<Otimes> XpZ)

goal (1 subgoal):
 1. hermitian (1\<^sub>m 2 \<Otimes> XpZ)
[PROOF STEP]
by (simp add: XpZ_carrier XpZ_hermitian hermitian_one)


[STATEMENT]
lemma  inf_bres: "x \<cdot> y = \<Sqinter>{z. y \<le> x \<rightarrow> z}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<cdot> y = \<Sqinter> {z. y \<le> x \<rightarrow> z}
[PROOF STEP]
using bres_galois fres_galois inf_fres
[PROOF STATE]
proof (prove)
using this:
(?x \<cdot> ?y \<le> ?z) = (?y \<le> ?x \<rightarrow> ?z)
(?x \<cdot> ?y \<le> ?z) = (?x \<le> ?z \<leftarrow> ?y)
?y \<cdot> ?x = \<Sqinter> {z. ?y \<le> z \<leftarrow> ?x}

goal (1 subgoal):
 1. x \<cdot> y = \<Sqinter> {z. y \<le> x \<rightarrow> z}
[PROOF STEP]
by force


[STATEMENT]
lemma liouville_lambda_power_even:
  "n > 0 \<Longrightarrow> even m \<Longrightarrow> liouville_lambda (n ^ m) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < n; even m\<rbrakk> \<Longrightarrow> liouville_lambda (n ^ m) = (1::'a)
[PROOF STEP]
by (subst liouville_lambda.power) (auto elim!: evenE simp: liouville_lambda_def power_neg_one_If)


[STATEMENT]
lemma (in abelian_group) a_lcos_mult_one:
     "M \<subseteq> carrier G ==> \<zero> <+ M = M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M \<subseteq> carrier G \<Longrightarrow> \<zero> <+ M = M
[PROOF STEP]
by (rule group.lcos_mult_one [OF a_group,
    folded a_l_coset_def, simplified monoid_record_simps])


[STATEMENT]
lemma integrable_divide_zero[simp, intro]:
  fixes c :: "_::{real_normed_field, field, second_countable_topology}"
  shows "(c \<noteq> 0 \<Longrightarrow> integrable M f) \<Longrightarrow> integrable M (\<lambda>x. f x / c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (c \<noteq> (0::'b) \<Longrightarrow> integrable M f) \<Longrightarrow> integrable M (\<lambda>x. f x / c)
[PROOF STEP]
unfolding integrable.simps
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (c \<noteq> (0::'b) \<Longrightarrow> Ex (has_bochner_integral M f)) \<Longrightarrow> Ex (has_bochner_integral M (\<lambda>x. f x / c))
[PROOF STEP]
by fastforce


[STATEMENT]
lemma word_int_case_wi:
  "word_int_case f (word_of_int i :: 'b word) = f (i mod 2 ^ LENGTH('b::len))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. word_int_case f (word_of_int i) = f (i mod 2 ^ LENGTH('b))
[PROOF STEP]
by transfer (simp add: take_bit_eq_mod)


[STATEMENT]
lemma exp_times_self_antimono:
  assumes "y \<le> -1" "x \<le> (y :: real)"
  shows   "x * exp x \<ge> y * exp y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y * exp y \<le> x * exp x
[PROOF STEP]
using exp_times_self_strict_antimono[of y x] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>y \<le> - 1; x < y\<rbrakk> \<Longrightarrow> y * exp y < x * exp x
y \<le> - 1
x \<le> y

goal (1 subgoal):
 1. y * exp y \<le> x * exp x
[PROOF STEP]
by (cases "x = y") auto


[STATEMENT]
lemma MPoly_power: "MPoly (x ^ n) = MPoly x ^ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. MPoly (x ^ n) = MPoly x ^ n
[PROOF STEP]
by (induction n) (auto simp: one_mpoly_def times_mpoly.abs_eq[symmetric])


[STATEMENT]
lemma length_interact_ge:
  assumes "xs \<in> lists (- {[]})" "ys \<in> lists (- {[]})"
  shows "length (interact xs ys) \<ge> length xs + length ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length xs + length ys \<le> length (interact xs ys)
[PROOF STEP]
by (metis add_mono assms length_concat length_concat_ge length_interact)


[STATEMENT]
lemma square_mod_existence:
  fixes n k :: nat
  assumes "\<exists>q. q\<^sup>2 = n"
  shows "\<exists>q. n mod k = q\<^sup>2 mod k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>q. n mod k = q\<^sup>2 mod k
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<exists>q. q\<^sup>2 = n

goal (1 subgoal):
 1. \<exists>q. n mod k = q\<^sup>2 mod k
[PROOF STEP]
by auto


[STATEMENT]
theorem lfp_f_hospital_optimal:
  assumes "stable_pair_on ds XD_XH"
  assumes "x \<in> Ch h (match (lfp_F ds))"
  shows "x \<in> Ch h (match (lfp_F ds) \<union> match XD_XH)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> Ch h (match (lfp_F ds) \<union> match XD_XH)
[PROOF STEP]
proof %invisible -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<in> Ch h (match (lfp_F ds) \<union> match XD_XH)
[PROOF STEP]
from \<open>stable_pair_on ds XD_XH\<close>
[PROOF STATE]
proof (chain)
picking this:
stable_pair_on ds XD_XH
[PROOF STEP]
have "match (lfp_F ds) \<union> match XD_XH \<subseteq> snd (lfp_F ds)"
[PROOF STATE]
proof (prove)
using this:
stable_pair_on ds XD_XH

goal (1 subgoal):
 1. match (lfp_F ds) \<union> match XD_XH \<subseteq> snd (lfp_F ds)
[PROOF STEP]
by (simp add: XD_XH_lfp_F(2) le_infI2)
[PROOF STATE]
proof (state)
this:
match (lfp_F ds) \<union> match XD_XH \<subseteq> snd (lfp_F ds)

goal (1 subgoal):
 1. x \<in> Ch h (match (lfp_F ds) \<union> match XD_XH)
[PROOF STEP]
with \<open>x \<in> Ch h (match (lfp_F ds))\<close> lfp_F_stable_pair_on stable_pair_on_Ch Ch_range
[PROOF STATE]
proof (chain)
picking this:
x \<in> Ch h (match (lfp_F ds))
stable_pair_on ?ds (lfp_F ?ds)
stable_pair_on ?ds ?XD_XH \<Longrightarrow> Ch ?h (snd ?XD_XH) = match ?XD_XH \<inter> {x. Xh x = ?h}
\<forall>h X. Ch h X \<subseteq> {x \<in> X. Xh x = h}
match (lfp_F ds) \<union> match XD_XH \<subseteq> snd (lfp_F ds)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<in> Ch h (match (lfp_F ds))
stable_pair_on ?ds (lfp_F ?ds)
stable_pair_on ?ds ?XD_XH \<Longrightarrow> Ch ?h (snd ?XD_XH) = match ?XD_XH \<inter> {x. Xh x = ?h}
\<forall>h X. Ch h X \<subseteq> {x \<in> X. Xh x = h}
match (lfp_F ds) \<union> match XD_XH \<subseteq> snd (lfp_F ds)

goal (1 subgoal):
 1. x \<in> Ch h (match (lfp_F ds) \<union> match XD_XH)
[PROOF STEP]
by - (rule iia_onD[OF Ch_iia[where h=h], where B="snd (lfp_F ds)", simplified]; blast)
[PROOF STATE]
proof (state)
this:
x \<in> Ch h (match (lfp_F ds) \<union> match XD_XH)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in Corps) Vr_ideal_npowf_closed:"\<lbrakk>valuation K v; ideal (Vr K v) I;
       x \<in> I; 0 < n\<rbrakk> \<Longrightarrow> x\<^bsub>K\<^esub>\<^bsup>n\<^esup> \<in> I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>valuation K v; ideal (Vr K v) I; x \<in> I; 0 < n\<rbrakk> \<Longrightarrow> x\<^bsub>K\<^esub>\<^bsup>n\<^esup> \<in> I
[PROOF STEP]
by (simp add:npowf_def, frule Vr_ring[of v],
      frule Ring.ideal_npow_closed[of "Vr K v" "I" "x" "nat n"], assumption+,
      simp, frule Ring.ideal_subset[of "Vr K v" "I" "x"], assumption+,
      simp add:Vr_exp_f_exp)


[STATEMENT]
lemma content_1 [simp]: "content 1 = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. content 1 = (1::'a)
[PROOF STEP]
by (simp add: content_def)


[STATEMENT]
lemma len_takeWhile_lt: "x \<in> set xs \<Longrightarrow> length (takeWhile ((\<noteq>) x) xs) < length xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> set xs \<Longrightarrow> length (takeWhile ((\<noteq>) x) xs) < length xs
[PROOF STEP]
by (induct xs) auto


[STATEMENT]
lemma mem_ord_of_nat_iff [simp]: "x \<in> elts (ord_of_nat n) \<longleftrightarrow> (\<exists>m<n. x = ord_of_nat m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> elts (ord_of_nat n)) = (\<exists>m<n. x = ord_of_nat m)
[PROOF STEP]
by (subst ord_of_nat_eq_initial) auto


[STATEMENT]
lemma floor_less_numeral [simp]: "\<lfloor>x\<rfloor> < numeral v \<longleftrightarrow> x < numeral v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lfloor>x\<rfloor> < numeral v) = (x < numeral v)
[PROOF STEP]
by (simp add: floor_less_iff)


[STATEMENT]
lemma (in ell_field) padd_proj_eq_cong:
  "a \<in> carrier R \<Longrightarrow> b \<in> carrier R \<Longrightarrow> on_curvep a b p\<^sub>1 \<Longrightarrow> on_curvep a b p\<^sub>1' \<Longrightarrow>
   on_curvep a b p\<^sub>2 \<Longrightarrow> on_curvep a b p\<^sub>2' \<Longrightarrow> proj_eq p\<^sub>1 p\<^sub>1' \<Longrightarrow> proj_eq p\<^sub>2 p\<^sub>2' \<Longrightarrow>
   proj_eq (padd a p\<^sub>1 p\<^sub>2) (padd a p\<^sub>1' p\<^sub>2')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier R; b \<in> carrier R; on_curvep a b p\<^sub>1; on_curvep a b p\<^sub>1'; on_curvep a b p\<^sub>2; on_curvep a b p\<^sub>2'; proj_eq p\<^sub>1 p\<^sub>1'; proj_eq p\<^sub>2 p\<^sub>2'\<rbrakk> \<Longrightarrow> proj_eq (padd a p\<^sub>1 p\<^sub>2) (padd a p\<^sub>1' p\<^sub>2')
[PROOF STEP]
by (simp add: make_affine_proj_eq_iff padd_in_carrierp padd_correct)


[STATEMENT]
lemma embed_measure_prod:
  assumes f: "inj f" and g: "inj g" and [simp]: "sigma_finite_measure M" "sigma_finite_measure N"
  shows "embed_measure M f \<Otimes>\<^sub>M embed_measure N g = embed_measure (M \<Otimes>\<^sub>M N) (\<lambda>(x, y). (f x, g y))"
    (is "?L = _")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. embed_measure M f \<Otimes>\<^sub>M embed_measure N g = embed_measure (M \<Otimes>\<^sub>M N) (\<lambda>(x, y). (f x, g y))
[PROOF STEP]
unfolding map_prod_def[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. embed_measure M f \<Otimes>\<^sub>M embed_measure N g = embed_measure (M \<Otimes>\<^sub>M N) (map_prod f g)
[PROOF STEP]
proof (rule pair_measure_eqI)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. sigma_finite_measure (embed_measure M f)
 2. sigma_finite_measure (embed_measure N g)
 3. sets (embed_measure M f \<Otimes>\<^sub>M embed_measure N g) = sets (embed_measure (M \<Otimes>\<^sub>M N) (map_prod f g))
 4. \<And>A B. \<lbrakk>A \<in> sets (embed_measure M f); B \<in> sets (embed_measure N g)\<rbrakk> \<Longrightarrow> emeasure (embed_measure M f) A * emeasure (embed_measure N g) B = emeasure (embed_measure (M \<Otimes>\<^sub>M N) (map_prod f g)) (A \<times> B)
[PROOF STEP]
have fg[simp]: "\<And>A. inj_on (map_prod f g) A" "\<And>A. inj_on f A" "\<And>A. inj_on g A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>A. inj_on (map_prod f g) A) &&& (\<And>A. inj_on f A) &&& (\<And>A. inj_on g A)
[PROOF STEP]
using f g
[PROOF STATE]
proof (prove)
using this:
inj f
inj g

goal (1 subgoal):
 1. (\<And>A. inj_on (map_prod f g) A) &&& (\<And>A. inj_on f A) &&& (\<And>A. inj_on g A)
[PROOF STEP]
by (auto simp: inj_on_def)
[PROOF STATE]
proof (state)
this:
inj_on (map_prod f g) ?A
inj_on f ?A
inj_on g ?A

goal (4 subgoals):
 1. sigma_finite_measure (embed_measure M f)
 2. sigma_finite_measure (embed_measure N g)
 3. sets (embed_measure M f \<Otimes>\<^sub>M embed_measure N g) = sets (embed_measure (M \<Otimes>\<^sub>M N) (map_prod f g))
 4. \<And>A B. \<lbrakk>A \<in> sets (embed_measure M f); B \<in> sets (embed_measure N g)\<rbrakk> \<Longrightarrow> emeasure (embed_measure M f) A * emeasure (embed_measure N g) B = emeasure (embed_measure (M \<Otimes>\<^sub>M N) (map_prod f g)) (A \<times> B)
[PROOF STEP]
note complete_lattice_class.Sup_insert[simp del] ccSup_insert[simp del]
     ccSUP_insert[simp del]
[PROOF STATE]
proof (state)
this:
Sup (insert ?a ?A) = sup ?a (Sup ?A)
countable ?A \<Longrightarrow> Sup (insert ?a ?A) = sup ?a (Sup ?A)
countable ?A \<Longrightarrow> Sup (?f ` insert ?a ?A) = sup (?f ?a) (Sup (?f ` ?A))

goal (4 subgoals):
 1. sigma_finite_measure (embed_measure M f)
 2. sigma_finite_measure (embed_measure N g)
 3. sets (embed_measure M f \<Otimes>\<^sub>M embed_measure N g) = sets (embed_measure (M \<Otimes>\<^sub>M N) (map_prod f g))
 4. \<And>A B. \<lbrakk>A \<in> sets (embed_measure M f); B \<in> sets (embed_measure N g)\<rbrakk> \<Longrightarrow> emeasure (embed_measure M f) A * emeasure (embed_measure N g) B = emeasure (embed_measure (M \<Otimes>\<^sub>M N) (map_prod f g)) (A \<times> B)
[PROOF STEP]
show sets: "sets ?L = sets (embed_measure (M \<Otimes>\<^sub>M N) (map_prod f g))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sets (embed_measure M f \<Otimes>\<^sub>M embed_measure N g) = sets (embed_measure (M \<Otimes>\<^sub>M N) (map_prod f g))
[PROOF STEP]
unfolding map_prod_def[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sets (embed_measure M f \<Otimes>\<^sub>M embed_measure N g) = sets (embed_measure (M \<Otimes>\<^sub>M N) (map_prod f g))
[PROOF STEP]
apply (simp add: sets_pair_eq_sets_fst_snd sets_embed_eq_vimage_algebra
      cong: vimage_algebra_cong)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sets (Sup {vimage_algebra (f ` space M \<times> g ` space N) fst (vimage_algebra (f ` space M) (the_inv_into (space M) f) M), vimage_algebra (f ` space M \<times> g ` space N) snd (vimage_algebra (g ` space N) (the_inv_into (space N) g) N)}) = sets (vimage_algebra (map_prod f g ` space (M \<Otimes>\<^sub>M N)) (the_inv_into (space (M \<Otimes>\<^sub>M N)) (map_prod f g)) (Sup {vimage_algebra (space M \<times> space N) fst M, vimage_algebra (space M \<times> space N) snd N}))
[PROOF STEP]
apply (subst sets_vimage_Sup_eq[where Y="space (M \<Otimes>\<^sub>M N)"])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. {vimage_algebra (space M \<times> space N) fst M, vimage_algebra (space M \<times> space N) snd N} \<noteq> {}
 2. the_inv_into (space (M \<Otimes>\<^sub>M N)) (map_prod f g) \<in> map_prod f g ` space (M \<Otimes>\<^sub>M N) \<rightarrow> space (M \<Otimes>\<^sub>M N)
 3. \<And>m. m \<in> {vimage_algebra (space M \<times> space N) fst M, vimage_algebra (space M \<times> space N) snd N} \<Longrightarrow> space m = space (M \<Otimes>\<^sub>M N)
 4. sets (Sup {vimage_algebra (f ` space M \<times> g ` space N) fst (vimage_algebra (f ` space M) (the_inv_into (space M) f) M), vimage_algebra (f ` space M \<times> g ` space N) snd (vimage_algebra (g ` space N) (the_inv_into (space N) g) N)}) = sets (Sup (vimage_algebra (map_prod f g ` space (M \<Otimes>\<^sub>M N)) (the_inv_into (space (M \<Otimes>\<^sub>M N)) (map_prod f g)) ` {vimage_algebra (space M \<times> space N) fst M, vimage_algebra (space M \<times> space N) snd N}))
[PROOF STEP]
apply (simp_all add: space_pair_measure[symmetric])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. the_inv_into (space (M \<Otimes>\<^sub>M N)) (map_prod f g) \<in> map_prod f g ` space (M \<Otimes>\<^sub>M N) \<rightarrow> space (M \<Otimes>\<^sub>M N)
 2. \<And>m. m = vimage_algebra (space (M \<Otimes>\<^sub>M N)) fst M \<or> m = vimage_algebra (space (M \<Otimes>\<^sub>M N)) snd N \<Longrightarrow> space m = space (M \<Otimes>\<^sub>M N)
 3. sets (Sup {vimage_algebra (f ` space M \<times> g ` space N) fst (vimage_algebra (f ` space M) (the_inv_into (space M) f) M), vimage_algebra (f ` space M \<times> g ` space N) snd (vimage_algebra (g ` space N) (the_inv_into (space N) g) N)}) = sets (Sup {vimage_algebra (map_prod f g ` space (M \<Otimes>\<^sub>M N)) (the_inv_into (space (M \<Otimes>\<^sub>M N)) (map_prod f g)) (vimage_algebra (space (M \<Otimes>\<^sub>M N)) fst M), vimage_algebra (map_prod f g ` space (M \<Otimes>\<^sub>M N)) (the_inv_into (space (M \<Otimes>\<^sub>M N)) (map_prod f g)) (vimage_algebra (space (M \<Otimes>\<^sub>M N)) snd N)})
[PROOF STEP]
apply (auto simp add: the_inv_into_f_f
                simp del: map_prod_simp
                del: prod_fun_imageE) []
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>m. m = vimage_algebra (space (M \<Otimes>\<^sub>M N)) fst M \<or> m = vimage_algebra (space (M \<Otimes>\<^sub>M N)) snd N \<Longrightarrow> space m = space (M \<Otimes>\<^sub>M N)
 2. sets (Sup {vimage_algebra (f ` space M \<times> g ` space N) fst (vimage_algebra (f ` space M) (the_inv_into (space M) f) M), vimage_algebra (f ` space M \<times> g ` space N) snd (vimage_algebra (g ` space N) (the_inv_into (space N) g) N)}) = sets (Sup {vimage_algebra (map_prod f g ` space (M \<Otimes>\<^sub>M N)) (the_inv_into (space (M \<Otimes>\<^sub>M N)) (map_prod f g)) (vimage_algebra (space (M \<Otimes>\<^sub>M N)) fst M), vimage_algebra (map_prod f g ` space (M \<Otimes>\<^sub>M N)) (the_inv_into (space (M \<Otimes>\<^sub>M N)) (map_prod f g)) (vimage_algebra (space (M \<Otimes>\<^sub>M N)) snd N)})
[PROOF STEP]
apply auto []
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sets (Sup {vimage_algebra (f ` space M \<times> g ` space N) fst (vimage_algebra (f ` space M) (the_inv_into (space M) f) M), vimage_algebra (f ` space M \<times> g ` space N) snd (vimage_algebra (g ` space N) (the_inv_into (space N) g) N)}) = sets (Sup {vimage_algebra (map_prod f g ` space (M \<Otimes>\<^sub>M N)) (the_inv_into (space (M \<Otimes>\<^sub>M N)) (map_prod f g)) (vimage_algebra (space (M \<Otimes>\<^sub>M N)) fst M), vimage_algebra (map_prod f g ` space (M \<Otimes>\<^sub>M N)) (the_inv_into (space (M \<Otimes>\<^sub>M N)) (map_prod f g)) (vimage_algebra (space (M \<Otimes>\<^sub>M N)) snd N)})
[PROOF STEP]
apply (subst (1 2 3 4 ) vimage_algebra_vimage_algebra_eq)
[PROOF STATE]
proof (prove)
goal (8 subgoals):
 1. the_inv_into (space (M \<Otimes>\<^sub>M N)) (map_prod f g) \<in> map_prod f g ` space (M \<Otimes>\<^sub>M N) \<rightarrow> space (M \<Otimes>\<^sub>M N)
 2. snd \<in> space (M \<Otimes>\<^sub>M N) \<rightarrow> space N
 3. fst \<in> space (M \<Otimes>\<^sub>M N) \<rightarrow> space M
 4. snd \<in> f ` space M \<times> g ` space N \<rightarrow> g ` space N
 5. the_inv_into (space N) g \<in> g ` space N \<rightarrow> space N
 6. fst \<in> f ` space M \<times> g ` space N \<rightarrow> f ` space M
 7. the_inv_into (space M) f \<in> f ` space M \<rightarrow> space M
 8. sets (Sup {vimage_algebra (f ` space M \<times> g ` space N) (\<lambda>x. the_inv_into (space M) f (fst x)) M, vimage_algebra (f ` space M \<times> g ` space N) (\<lambda>x. the_inv_into (space N) g (snd x)) N}) = sets (Sup {vimage_algebra (map_prod f g ` space (M \<Otimes>\<^sub>M N)) (\<lambda>x. fst (the_inv_into (space (M \<Otimes>\<^sub>M N)) (map_prod f g) x)) M, vimage_algebra (map_prod f g ` space (M \<Otimes>\<^sub>M N)) (\<lambda>x. snd (the_inv_into (space (M \<Otimes>\<^sub>M N)) (map_prod f g) x)) N})
[PROOF STEP]
apply (simp_all add: the_inv_into_in_Pi Pi_iff[of snd] Pi_iff[of fst] space_pair_measure)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sets (Sup {vimage_algebra (f ` space M \<times> g ` space N) (\<lambda>x. the_inv_into (space M) f (fst x)) M, vimage_algebra (f ` space M \<times> g ` space N) (\<lambda>x. the_inv_into (space N) g (snd x)) N}) = sets (Sup {vimage_algebra (map_prod f g ` (space M \<times> space N)) (\<lambda>x. fst (the_inv_into (space M \<times> space N) (map_prod f g) x)) M, vimage_algebra (map_prod f g ` (space M \<times> space N)) (\<lambda>x. snd (the_inv_into (space M \<times> space N) (map_prod f g) x)) N})
[PROOF STEP]
apply (simp_all add: Pi_iff[of snd] Pi_iff[of fst] the_inv_into_in_Pi vimage_algebra_vimage_algebra_eq
       space_pair_measure[symmetric] map_prod_image[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sets (Sup {vimage_algebra (map_prod f g ` space (M \<Otimes>\<^sub>M N)) (\<lambda>x. the_inv_into (space M) f (fst x)) M, vimage_algebra (map_prod f g ` space (M \<Otimes>\<^sub>M N)) (\<lambda>x. the_inv_into (space N) g (snd x)) N}) = sets (Sup {vimage_algebra (map_prod f g ` space (M \<Otimes>\<^sub>M N)) (\<lambda>x. fst (the_inv_into (space (M \<Otimes>\<^sub>M N)) (map_prod f g) x)) M, vimage_algebra (map_prod f g ` space (M \<Otimes>\<^sub>M N)) (\<lambda>x. snd (the_inv_into (space (M \<Otimes>\<^sub>M N)) (map_prod f g) x)) N})
[PROOF STEP]
apply (intro arg_cong[where f=sets] arg_cong[where f=Sup] arg_cong2[where f=insert] vimage_algebra_cong)
[PROOF STATE]
proof (prove)
goal (7 subgoals):
 1. map_prod f g ` space (M \<Otimes>\<^sub>M N) = map_prod f g ` space (M \<Otimes>\<^sub>M N)
 2. \<And>x. x \<in> map_prod f g ` space (M \<Otimes>\<^sub>M N) \<Longrightarrow> the_inv_into (space M) f (fst x) = fst (the_inv_into (space (M \<Otimes>\<^sub>M N)) (map_prod f g) x)
 3. M = M
 4. map_prod f g ` space (M \<Otimes>\<^sub>M N) = map_prod f g ` space (M \<Otimes>\<^sub>M N)
 5. \<And>x. x \<in> map_prod f g ` space (M \<Otimes>\<^sub>M N) \<Longrightarrow> the_inv_into (space N) g (snd x) = snd (the_inv_into (space (M \<Otimes>\<^sub>M N)) (map_prod f g) x)
 6. N = N
 7. {} = {}
[PROOF STEP]
apply (auto simp: map_prod_image the_inv_into_f_f
                simp del: map_prod_simp del: prod_fun_imageE)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a b aa ba. \<lbrakk>(a, b) = map_prod f g (aa, ba); (aa, ba) \<in> space (M \<Otimes>\<^sub>M N)\<rbrakk> \<Longrightarrow> the_inv_into (space M) f (f aa) = aa
 2. \<And>a b aa ba. \<lbrakk>(a, b) = map_prod f g (aa, ba); (aa, ba) \<in> space (M \<Otimes>\<^sub>M N)\<rbrakk> \<Longrightarrow> the_inv_into (space N) g (g ba) = ba
[PROOF STEP]
apply (simp_all add: the_inv_into_f_f space_pair_measure)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
sets (embed_measure M f \<Otimes>\<^sub>M embed_measure N g) = sets (embed_measure (M \<Otimes>\<^sub>M N) (map_prod f g))

goal (3 subgoals):
 1. sigma_finite_measure (embed_measure M f)
 2. sigma_finite_measure (embed_measure N g)
 3. \<And>A B. \<lbrakk>A \<in> sets (embed_measure M f); B \<in> sets (embed_measure N g)\<rbrakk> \<Longrightarrow> emeasure (embed_measure M f) A * emeasure (embed_measure N g) B = emeasure (embed_measure (M \<Otimes>\<^sub>M N) (map_prod f g)) (A \<times> B)
[PROOF STEP]
note measurable_embed_measure2[measurable]
[PROOF STATE]
proof (state)
this:
inj ?f \<Longrightarrow> ?f \<in> ?M \<rightarrow>\<^sub>M embed_measure ?M ?f

goal (3 subgoals):
 1. sigma_finite_measure (embed_measure M f)
 2. sigma_finite_measure (embed_measure N g)
 3. \<And>A B. \<lbrakk>A \<in> sets (embed_measure M f); B \<in> sets (embed_measure N g)\<rbrakk> \<Longrightarrow> emeasure (embed_measure M f) A * emeasure (embed_measure N g) B = emeasure (embed_measure (M \<Otimes>\<^sub>M N) (map_prod f g)) (A \<times> B)
[PROOF STEP]
fix A B
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. sigma_finite_measure (embed_measure M f)
 2. sigma_finite_measure (embed_measure N g)
 3. \<And>A B. \<lbrakk>A \<in> sets (embed_measure M f); B \<in> sets (embed_measure N g)\<rbrakk> \<Longrightarrow> emeasure (embed_measure M f) A * emeasure (embed_measure N g) B = emeasure (embed_measure (M \<Otimes>\<^sub>M N) (map_prod f g)) (A \<times> B)
[PROOF STEP]
assume AB: "A \<in> sets (embed_measure M f)" "B \<in> sets (embed_measure N g)"
[PROOF STATE]
proof (state)
this:
A \<in> sets (embed_measure M f)
B \<in> sets (embed_measure N g)

goal (3 subgoals):
 1. sigma_finite_measure (embed_measure M f)
 2. sigma_finite_measure (embed_measure N g)
 3. \<And>A B. \<lbrakk>A \<in> sets (embed_measure M f); B \<in> sets (embed_measure N g)\<rbrakk> \<Longrightarrow> emeasure (embed_measure M f) A * emeasure (embed_measure N g) B = emeasure (embed_measure (M \<Otimes>\<^sub>M N) (map_prod f g)) (A \<times> B)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
A \<in> sets (embed_measure M f)
B \<in> sets (embed_measure N g)

goal (3 subgoals):
 1. sigma_finite_measure (embed_measure M f)
 2. sigma_finite_measure (embed_measure N g)
 3. \<And>A B. \<lbrakk>A \<in> sets (embed_measure M f); B \<in> sets (embed_measure N g)\<rbrakk> \<Longrightarrow> emeasure (embed_measure M f) A * emeasure (embed_measure N g) B = emeasure (embed_measure (M \<Otimes>\<^sub>M N) (map_prod f g)) (A \<times> B)
[PROOF STEP]
have "f -` A \<times> g -` B \<inter> space (M \<Otimes>\<^sub>M N) = (f -` A \<inter> space M) \<times> (g -` B \<inter> space N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f -` A \<times> g -` B \<inter> space (M \<Otimes>\<^sub>M N) = (f -` A \<inter> space M) \<times> (g -` B \<inter> space N)
[PROOF STEP]
by (auto simp: space_pair_measure)
[PROOF STATE]
proof (state)
this:
f -` A \<times> g -` B \<inter> space (M \<Otimes>\<^sub>M N) = (f -` A \<inter> space M) \<times> (g -` B \<inter> space N)

goal (3 subgoals):
 1. sigma_finite_measure (embed_measure M f)
 2. sigma_finite_measure (embed_measure N g)
 3. \<And>A B. \<lbrakk>A \<in> sets (embed_measure M f); B \<in> sets (embed_measure N g)\<rbrakk> \<Longrightarrow> emeasure (embed_measure M f) A * emeasure (embed_measure N g) B = emeasure (embed_measure (M \<Otimes>\<^sub>M N) (map_prod f g)) (A \<times> B)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
A \<in> sets (embed_measure M f)
B \<in> sets (embed_measure N g)
f -` A \<times> g -` B \<inter> space (M \<Otimes>\<^sub>M N) = (f -` A \<inter> space M) \<times> (g -` B \<inter> space N)
[PROOF STEP]
show "emeasure (embed_measure M f) A * emeasure (embed_measure N g) B =
                     emeasure (embed_measure (M \<Otimes>\<^sub>M N) (map_prod f g)) (A \<times> B)"
[PROOF STATE]
proof (prove)
using this:
A \<in> sets (embed_measure M f)
B \<in> sets (embed_measure N g)
f -` A \<times> g -` B \<inter> space (M \<Otimes>\<^sub>M N) = (f -` A \<inter> space M) \<times> (g -` B \<inter> space N)

goal (1 subgoal):
 1. emeasure (embed_measure M f) A * emeasure (embed_measure N g) B = emeasure (embed_measure (M \<Otimes>\<^sub>M N) (map_prod f g)) (A \<times> B)
[PROOF STEP]
by (simp add: map_prod_vimage sets[symmetric] emeasure_embed_measure
                  sigma_finite_measure.emeasure_pair_measure_Times)
[PROOF STATE]
proof (state)
this:
emeasure (embed_measure M f) A * emeasure (embed_measure N g) B = emeasure (embed_measure (M \<Otimes>\<^sub>M N) (map_prod f g)) (A \<times> B)

goal (2 subgoals):
 1. sigma_finite_measure (embed_measure M f)
 2. sigma_finite_measure (embed_measure N g)
[PROOF STEP]
qed (insert assms, simp_all add: sigma_finite_embed_measure)


[STATEMENT]
lemma (in monoid_add) sum_list_map_filter':
  "sum_list (map f (filter P xs)) = sum_list (map (\<lambda>x. if P x then f x else 0) xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (map f (filter P xs)) = (\<Sum>x\<leftarrow>xs. if P x then f x else (0::'a))
[PROOF STEP]
by (induction xs) simp_all


[STATEMENT]
lemma set_dom_\<Phi>:
    assumes "S.arr f"
    shows "S'.set (S'.dom (\<Phi> f)) = \<phi> ` (S.set (S.dom f))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S'.set (S'.dom (\<Phi> f)) = \<phi> ` S.set (S.dom f)
[PROOF STEP]
using assms S.ide_dom \<Phi>_in_hom \<Phi>_ide set_\<Phi>o
[PROOF STATE]
proof (prove)
using this:
S.arr f
S.arr ?f \<Longrightarrow> S.ide (S.dom ?f)
S.arr ?f \<Longrightarrow> \<Phi> ?f \<in> S'.hom (\<Phi>o (S.dom ?f)) (\<Phi>o (S.cod ?f))
S.ide ?a \<Longrightarrow> \<Phi> ?a = \<Phi>o ?a
S.ide ?a \<Longrightarrow> S'.set (\<Phi>o ?a) = \<phi> ` S.set ?a

goal (1 subgoal):
 1. S'.set (S'.dom (\<Phi> f)) = \<phi> ` S.set (S.dom f)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma Sup_pres_sup:
  fixes f :: "'a::complete_lattice \<Rightarrow> 'b::complete_lattice"
  shows "Sup_pres f \<Longrightarrow> Sup_pres g \<Longrightarrow> Sup_pres (f \<squnion> g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Sup_pres f; Sup_pres g\<rbrakk> \<Longrightarrow> Sup_pres (f \<squnion> g)
[PROOF STEP]
by (metis Sup_pres_Sup insert_iff singletonD sup_Sup)


[STATEMENT]
lemma Abs_ordinal_oStrictLimit:
"Abs_ordinal (ord0rel `` {ord0_Lim f})
  = oStrictLimit (\<lambda>n. Abs_ordinal (ord0rel `` {f n}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Abs_ordinal (ord0rel `` {ord0_Lim f}) = oStrictLimit (\<lambda>n. Abs_ordinal (ord0rel `` {f n}))
[PROOF STEP]
apply (simp add: oStrictLimit_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ord0_Lim f \<le> ord0_Lim (\<lambda>n. SOME x. (f n, x) \<in> ord0rel) \<and> ord0_Lim (\<lambda>n. SOME x. (f n, x) \<in> ord0rel) \<le> ord0_Lim f
[PROOF STEP]
apply (rule ord0relD)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ord0_Lim f, ord0_Lim (\<lambda>n. SOME x. (f n, x) \<in> ord0rel)) \<in> ord0rel
[PROOF STEP]
apply (rule ord0_Lim_ord0rel)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n. (f n, SOME x. (f n, x) \<in> ord0rel) \<in> ord0rel
[PROOF STEP]
apply (simp add: some_ord0rel)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma lhopital_left_at_top_at_top:
  fixes f g :: "real \<Rightarrow> real"
  assumes f_0: "LIM x at_left a. f x :> at_top"
  assumes g_0: "LIM x at_left a. g x :> at_top"
    and ev:
      "eventually (\<lambda>x. DERIV f x :> f' x) (at_left a)"
      "eventually (\<lambda>x. DERIV g x :> g' x) (at_left a)"
    and lim: "filterlim (\<lambda> x. (f' x / g' x)) at_top (at_left a)"
  shows "filterlim (\<lambda> x. f x / g x) at_top (at_left a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LIM x at_left a. f x / g x :> at_top
[PROOF STEP]
by (insert assms, unfold eventually_at_left_to_right filterlim_at_left_to_right DERIV_mirror,
      rule lhopital_right_at_top_at_top[where f'="\<lambda>x. - f' (- x)"])
     (insert assms, auto simp: DERIV_mirror)


[STATEMENT]
lemma (in Corps) v_hdeg_p_pOp:"\<lbrakk>valuation K v; PolynRg R (Vr K v) X;
      p \<in> carrier R; q \<in> carrier R; deg R (Vr K v) X p \<le> an (Suc d);
      deg R (Vr K v) X q \<le> an (Suc d)\<rbrakk> \<Longrightarrow> (hdeg_p R (Vr K v) X (Suc d) p) \<plusminus>\<^bsub>R\<^esub>
      (hdeg_p R (Vr K v) X (Suc d) q) = hdeg_p R (Vr K v) X (Suc d) (p \<plusminus>\<^bsub>R\<^esub> q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>valuation K v; PolynRg R (Vr K v) X; p \<in> carrier R; q \<in> carrier R; deg R (Vr K v) X p \<le> an (Suc d); deg R (Vr K v) X q \<le> an (Suc d)\<rbrakk> \<Longrightarrow> hdeg_p R (Vr K v) X (Suc d) p \<plusminus>\<^bsub>R\<^esub> hdeg_p R (Vr K v) X (Suc d) q = hdeg_p R (Vr K v) X (Suc d) (p \<plusminus>\<^bsub>R\<^esub> q)
[PROOF STEP]
by (simp add:PolynRg.hdeg_p_pOp[of R "Vr K v" X p q d])


[STATEMENT]
lemma drop_tl: "drop n (tl xs) = tl(drop n xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. drop n (tl xs) = tl (drop n xs)
[PROOF STEP]
by(induct xs arbitrary: n, simp_all add:drop_Cons drop_Suc split:nat.split)


[STATEMENT]
lemma "filterlim (\<lambda>x::real. exp (exp (exp x)) / (exp (exp (exp (x - exp (-exp x)))))) at_top at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LIM x at_top. exp (exp (exp x)) / exp (exp (exp (x - exp (- exp x)))) :> at_top
[PROOF STEP]
by real_asymp


[STATEMENT]
lemma ordinal_of_nat_exp [simp]:
"ordinal_of_nat x ** ordinal_of_nat y = ordinal_of_nat (x ^ y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ordinal_of_nat x ** ordinal_of_nat y = ordinal_of_nat (x ^ y)
[PROOF STEP]
by (induct y, cases x) (simp_all add: mult.commute)


[STATEMENT]
lemma mult_scalar_left_diff_distrib [algebra_simps]: "(p - q) \<odot> r = p \<odot> r - q \<odot> r"
  for p::"_ \<Rightarrow>\<^sub>0 'b::ring"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (p - q) \<odot> r = p \<odot> r - q \<odot> r
[PROOF STEP]
using mult_scalar_distrib_right [of p "- q" r]
[PROOF STATE]
proof (prove)
using this:
(p + - q) \<odot> r = p \<odot> r + - q \<odot> r

goal (1 subgoal):
 1. (p - q) \<odot> r = p \<odot> r - q \<odot> r
[PROOF STEP]
by simp


[STATEMENT]
lemma last_bin_last: "size xs > 0 \<Longrightarrow> last xs \<longleftrightarrow> odd (bl_to_bin xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < length xs \<Longrightarrow> last xs = odd (bl_to_bin xs)
[PROOF STEP]
unfolding bl_to_bin_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < length xs \<Longrightarrow> last xs = odd (bl_to_bin_aux xs 0)
[PROOF STEP]
by (erule last_bin_last')


[STATEMENT]
lemma con_char\<^sub>Q\<^sub>C\<^sub>N:
    shows "con \<T> \<U> \<longleftrightarrow>
           N.is_Cong_class \<T> \<and> N.is_Cong_class \<U> \<and> (\<exists>t u. t \<in> \<T> \<and> u \<in> \<U> \<and> t \<frown> u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. con \<T> \<U> = (N.is_Cong_class \<T> \<and> N.is_Cong_class \<U> \<and> (\<exists>t u. t \<in> \<T> \<and> u \<in> \<U> \<and> t \<frown> u))
[PROOF STEP]
by (metis Con_char conE conI null_char)


[STATEMENT]
lemma in_sorted_domain_iff_lookup: "k \<in> set (sorted_domain ko xs) \<longleftrightarrow> (lookup xs k \<noteq> 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (k \<in> set (sorted_domain ko xs)) = (lookup xs k \<noteq> (0::'b))
[PROOF STEP]
unfolding sorted_domain_def lookup_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (k \<in> set (sorted_domain_raw ko (list_of_oalist xs))) = (lookup_raw (list_of_oalist xs) k \<noteq> (0::'b))
[PROOF STEP]
using oalist_inv_list_of_oalist
[PROOF STATE]
proof (prove)
using this:
oalist_inv (list_of_oalist ?x)

goal (1 subgoal):
 1. (k \<in> set (sorted_domain_raw ko (list_of_oalist xs))) = (lookup_raw (list_of_oalist xs) k \<noteq> (0::'b))
[PROOF STEP]
by (rule in_sorted_domain_raw_iff_lookup_raw)


[STATEMENT]
lemma simplex_map_id_gen:
   "\<lbrakk>singular_simplex p X c;
     \<And>x. x \<in> topspace X \<Longrightarrow> f x = x\<rbrakk>
    \<Longrightarrow> simplex_map p f c = c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>singular_simplex p X c; \<And>x. x \<in> topspace X \<Longrightarrow> f x = x\<rbrakk> \<Longrightarrow> simplex_map p f c = c
[PROOF STEP]
unfolding singular_simplex_def simplex_map_def continuous_map_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>((\<forall>x\<in>topspace (subtopology (powertop_real UNIV) (standard_simplex p)). c x \<in> topspace X) \<and> (\<forall>U. openin X U \<longrightarrow> openin (subtopology (powertop_real UNIV) (standard_simplex p)) {x \<in> topspace (subtopology (powertop_real UNIV) (standard_simplex p)). c x \<in> U})) \<and> c \<in> extensional (standard_simplex p); \<And>x. x \<in> topspace X \<Longrightarrow> f x = x\<rbrakk> \<Longrightarrow> restrict (f \<circ> c) (standard_simplex p) = c
[PROOF STEP]
using extensional_arb
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?f \<in> extensional ?A; ?x \<notin> ?A\<rbrakk> \<Longrightarrow> ?f ?x = undefined

goal (1 subgoal):
 1. \<lbrakk>((\<forall>x\<in>topspace (subtopology (powertop_real UNIV) (standard_simplex p)). c x \<in> topspace X) \<and> (\<forall>U. openin X U \<longrightarrow> openin (subtopology (powertop_real UNIV) (standard_simplex p)) {x \<in> topspace (subtopology (powertop_real UNIV) (standard_simplex p)). c x \<in> U})) \<and> c \<in> extensional (standard_simplex p); \<And>x. x \<in> topspace X \<Longrightarrow> f x = x\<rbrakk> \<Longrightarrow> restrict (f \<circ> c) (standard_simplex p) = c
[PROOF STEP]
by fastforce


[STATEMENT]
lemma sq_mtx_mult_diagl: "(\<d>\<i>\<a>\<g> i. f i) * A = to_mtx (\<chi> i j. f i * A $$ i $ j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<d>\<i>\<a>\<g> i. f i) * A = to_mtx (\<chi>i j. f i * A $$ i $ j)
[PROOF STEP]
by transfer (simp add: matrix_mul_diag_matl)


[STATEMENT]
lemma wf_app: "wf r \<Longrightarrow> wf {(x, y). (f x, f y) \<in> r}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wf r \<Longrightarrow> wf {(x, y). (f x, f y) \<in> r}
[PROOF STEP]
unfolding wf_eq_minimal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>Q x. x \<in> Q \<longrightarrow> (\<exists>z\<in>Q. \<forall>y. (y, z) \<in> r \<longrightarrow> y \<notin> Q) \<Longrightarrow> \<forall>Q x. x \<in> Q \<longrightarrow> (\<exists>z\<in>Q. \<forall>y. (y, z) \<in> {(x, y). (f x, f y) \<in> r} \<longrightarrow> y \<notin> Q)
[PROOF STEP]
by (intro allI, drule spec[of _ "f ` Q" for Q]) fast


[STATEMENT]
lemma hermitian_eigenvalue_real:
  assumes dim: "(A::complex mat) \<in> carrier_mat n n"
    and hA: "hermitian A"
    and c: "char_poly A = (\<Prod> (e :: complex) \<leftarrow> es. [:- e, 1:])"
    and B: "unitary_schur_decomposition A es = (B,P,Q)"
  shows "similar_mat_wit A B P (adjoint P) \<and> diagonal_mat B \<and> diag_mat B = es
    \<and> unitary P \<and> (\<forall>i < n. B$$(i, i) \<in> Reals)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. similar_mat_wit A B P (adjoint P) \<and> diagonal_mat B \<and> diag_mat B = es \<and> unitary P \<and> (\<forall>i<n. B $$ (i, i) \<in> \<real>)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. similar_mat_wit A B P (adjoint P) \<and> diagonal_mat B \<and> diag_mat B = es \<and> unitary P \<and> (\<forall>i<n. B $$ (i, i) \<in> \<real>)
[PROOF STEP]
have normal: "A * adjoint A = adjoint A * A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A * adjoint A = adjoint A * A
[PROOF STEP]
using hA hermitian_is_normal
[PROOF STATE]
proof (prove)
using this:
hermitian A
hermitian ?A \<Longrightarrow> ?A * adjoint ?A = adjoint ?A * ?A

goal (1 subgoal):
 1. A * adjoint A = adjoint A * A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A * adjoint A = adjoint A * A

goal (1 subgoal):
 1. similar_mat_wit A B P (adjoint P) \<and> diagonal_mat B \<and> diag_mat B = es \<and> unitary P \<and> (\<forall>i<n. B $$ (i, i) \<in> \<real>)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
A * adjoint A = adjoint A * A
[PROOF STEP]
have schur: "similar_mat_wit A B P (adjoint P) \<and> diagonal_mat B \<and> diag_mat B = es \<and> unitary P"
[PROOF STATE]
proof (prove)
using this:
A * adjoint A = adjoint A * A

goal (1 subgoal):
 1. similar_mat_wit A B P (adjoint P) \<and> diagonal_mat B \<and> diag_mat B = es \<and> unitary P
[PROOF STEP]
using normal_complex_mat_has_spectral_decomposition[OF dim normal c B]
[PROOF STATE]
proof (prove)
using this:
A * adjoint A = adjoint A * A
similar_mat_wit A B P (adjoint P) \<and> diagonal_mat B \<and> diag_mat B = es \<and> unitary P

goal (1 subgoal):
 1. similar_mat_wit A B P (adjoint P) \<and> diagonal_mat B \<and> diag_mat B = es \<and> unitary P
[PROOF STEP]
by (simp)
[PROOF STATE]
proof (state)
this:
similar_mat_wit A B P (adjoint P) \<and> diagonal_mat B \<and> diag_mat B = es \<and> unitary P

goal (1 subgoal):
 1. similar_mat_wit A B P (adjoint P) \<and> diagonal_mat B \<and> diag_mat B = es \<and> unitary P \<and> (\<forall>i<n. B $$ (i, i) \<in> \<real>)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
similar_mat_wit A B P (adjoint P) \<and> diagonal_mat B \<and> diag_mat B = es \<and> unitary P
[PROOF STEP]
have "similar_mat_wit A B P (adjoint P)"
    and uP: "unitary P" and dB: "diag_mat B = es"
[PROOF STATE]
proof (prove)
using this:
similar_mat_wit A B P (adjoint P) \<and> diagonal_mat B \<and> diag_mat B = es \<and> unitary P

goal (1 subgoal):
 1. similar_mat_wit A B P (adjoint P) &&& unitary P &&& diag_mat B = es
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
similar_mat_wit A B P (adjoint P) \<and> diagonal_mat B \<and> diag_mat B = es \<and> unitary P
A \<in> carrier_mat n n
hermitian A
char_poly A = (\<Prod>e\<leftarrow>es. [:- e, 1:])
unitary_schur_decomposition A es = (B, P, Q)

goal (1 subgoal):
 1. similar_mat_wit A B P (adjoint P) &&& unitary P &&& diag_mat B = es
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
similar_mat_wit A B P (adjoint P)
unitary P
diag_mat B = es

goal (1 subgoal):
 1. similar_mat_wit A B P (adjoint P) \<and> diagonal_mat B \<and> diag_mat B = es \<and> unitary P \<and> (\<forall>i<n. B $$ (i, i) \<in> \<real>)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
similar_mat_wit A B P (adjoint P)
unitary P
diag_mat B = es
[PROOF STEP]
have A: "A = P * B * (adjoint P)"
    and dimB: "B \<in> carrier_mat n n" and dimP: "P \<in> carrier_mat n n"
[PROOF STATE]
proof (prove)
using this:
similar_mat_wit A B P (adjoint P)
unitary P
diag_mat B = es

goal (1 subgoal):
 1. A = P * B * adjoint P &&& B \<in> carrier_mat n n &&& P \<in> carrier_mat n n
[PROOF STEP]
unfolding similar_mat_wit_def Let_def
[PROOF STATE]
proof (prove)
using this:
{A, B, P, adjoint P} \<subseteq> carrier_mat (dim_row A) (dim_row A) \<and> P * adjoint P = 1\<^sub>m (dim_row A) \<and> adjoint P * P = 1\<^sub>m (dim_row A) \<and> A = P * B * adjoint P
unitary P
diag_mat B = es

goal (1 subgoal):
 1. A = P * B * adjoint P &&& B \<in> carrier_mat n n &&& P \<in> carrier_mat n n
[PROOF STEP]
using dim
[PROOF STATE]
proof (prove)
using this:
{A, B, P, adjoint P} \<subseteq> carrier_mat (dim_row A) (dim_row A) \<and> P * adjoint P = 1\<^sub>m (dim_row A) \<and> adjoint P * P = 1\<^sub>m (dim_row A) \<and> A = P * B * adjoint P
unitary P
diag_mat B = es
A \<in> carrier_mat n n

goal (1 subgoal):
 1. A = P * B * adjoint P &&& B \<in> carrier_mat n n &&& P \<in> carrier_mat n n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A = P * B * adjoint P
B \<in> carrier_mat n n
P \<in> carrier_mat n n

goal (1 subgoal):
 1. similar_mat_wit A B P (adjoint P) \<and> diagonal_mat B \<and> diag_mat B = es \<and> unitary P \<and> (\<forall>i<n. B $$ (i, i) \<in> \<real>)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
A = P * B * adjoint P
B \<in> carrier_mat n n
P \<in> carrier_mat n n
[PROOF STEP]
have dimaB: "adjoint B \<in> carrier_mat n n"
[PROOF STATE]
proof (prove)
using this:
A = P * B * adjoint P
B \<in> carrier_mat n n
P \<in> carrier_mat n n

goal (1 subgoal):
 1. adjoint B \<in> carrier_mat n n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
adjoint B \<in> carrier_mat n n

goal (1 subgoal):
 1. similar_mat_wit A B P (adjoint P) \<and> diagonal_mat B \<and> diag_mat B = es \<and> unitary P \<and> (\<forall>i<n. B $$ (i, i) \<in> \<real>)
[PROOF STEP]
have "adjoint A = adjoint (adjoint P) * adjoint (P * B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. adjoint A = adjoint (adjoint P) * adjoint (P * B)
[PROOF STEP]
apply (subst A)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. adjoint (P * B * adjoint P) = adjoint (adjoint P) * adjoint (P * B)
[PROOF STEP]
apply (subst adjoint_mult[of "P * B" n n "adjoint P" n])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. P * B \<in> carrier_mat n n
 2. adjoint P \<in> carrier_mat n n
 3. adjoint (adjoint P) * adjoint (P * B) = adjoint (adjoint P) * adjoint (P * B)
[PROOF STEP]
apply (insert dimB dimP, auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
adjoint A = adjoint (adjoint P) * adjoint (P * B)

goal (1 subgoal):
 1. similar_mat_wit A B P (adjoint P) \<and> diagonal_mat B \<and> diag_mat B = es \<and> unitary P \<and> (\<forall>i<n. B $$ (i, i) \<in> \<real>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
adjoint A = adjoint (adjoint P) * adjoint (P * B)

goal (1 subgoal):
 1. similar_mat_wit A B P (adjoint P) \<and> diagonal_mat B \<and> diag_mat B = es \<and> unitary P \<and> (\<forall>i<n. B $$ (i, i) \<in> \<real>)
[PROOF STEP]
have "\<dots> = P * adjoint (P * B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. adjoint (adjoint P) * adjoint (P * B) = P * adjoint (P * B)
[PROOF STEP]
by (auto simp add: adjoint_adjoint)
[PROOF STATE]
proof (state)
this:
adjoint (adjoint P) * adjoint (P * B) = P * adjoint (P * B)

goal (1 subgoal):
 1. similar_mat_wit A B P (adjoint P) \<and> diagonal_mat B \<and> diag_mat B = es \<and> unitary P \<and> (\<forall>i<n. B $$ (i, i) \<in> \<real>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
adjoint (adjoint P) * adjoint (P * B) = P * adjoint (P * B)

goal (1 subgoal):
 1. similar_mat_wit A B P (adjoint P) \<and> diagonal_mat B \<and> diag_mat B = es \<and> unitary P \<and> (\<forall>i<n. B $$ (i, i) \<in> \<real>)
[PROOF STEP]
have "\<dots> = P * (adjoint B * adjoint P)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P * adjoint (P * B) = P * (adjoint B * adjoint P)
[PROOF STEP]
using dimB dimP
[PROOF STATE]
proof (prove)
using this:
B \<in> carrier_mat n n
P \<in> carrier_mat n n

goal (1 subgoal):
 1. P * adjoint (P * B) = P * (adjoint B * adjoint P)
[PROOF STEP]
by (auto simp add: adjoint_mult)
[PROOF STATE]
proof (state)
this:
P * adjoint (P * B) = P * (adjoint B * adjoint P)

goal (1 subgoal):
 1. similar_mat_wit A B P (adjoint P) \<and> diagonal_mat B \<and> diag_mat B = es \<and> unitary P \<and> (\<forall>i<n. B $$ (i, i) \<in> \<real>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
P * adjoint (P * B) = P * (adjoint B * adjoint P)

goal (1 subgoal):
 1. similar_mat_wit A B P (adjoint P) \<and> diagonal_mat B \<and> diag_mat B = es \<and> unitary P \<and> (\<forall>i<n. B $$ (i, i) \<in> \<real>)
[PROOF STEP]
have "\<dots> = P * adjoint B * adjoint P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P * (adjoint B * adjoint P) = P * adjoint B * adjoint P
[PROOF STEP]
using dimB dimP
[PROOF STATE]
proof (prove)
using this:
B \<in> carrier_mat n n
P \<in> carrier_mat n n

goal (1 subgoal):
 1. P * (adjoint B * adjoint P) = P * adjoint B * adjoint P
[PROOF STEP]
by (subst assoc_mult_mat[symmetric, of P n n "adjoint B" n "adjoint P" n], auto)
[PROOF STATE]
proof (state)
this:
P * (adjoint B * adjoint P) = P * adjoint B * adjoint P

goal (1 subgoal):
 1. similar_mat_wit A B P (adjoint P) \<and> diagonal_mat B \<and> diag_mat B = es \<and> unitary P \<and> (\<forall>i<n. B $$ (i, i) \<in> \<real>)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
adjoint A = P * adjoint B * adjoint P
[PROOF STEP]
have aA: "adjoint A = P * adjoint B * adjoint P"
[PROOF STATE]
proof (prove)
using this:
adjoint A = P * adjoint B * adjoint P

goal (1 subgoal):
 1. adjoint A = P * adjoint B * adjoint P
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
adjoint A = P * adjoint B * adjoint P

goal (1 subgoal):
 1. similar_mat_wit A B P (adjoint P) \<and> diagonal_mat B \<and> diag_mat B = es \<and> unitary P \<and> (\<forall>i<n. B $$ (i, i) \<in> \<real>)
[PROOF STEP]
have "A = adjoint A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A = adjoint A
[PROOF STEP]
using hA hermitian_def[of A]
[PROOF STATE]
proof (prove)
using this:
hermitian A
hermitian A = (adjoint A = A)

goal (1 subgoal):
 1. A = adjoint A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A = adjoint A

goal (1 subgoal):
 1. similar_mat_wit A B P (adjoint P) \<and> diagonal_mat B \<and> diag_mat B = es \<and> unitary P \<and> (\<forall>i<n. B $$ (i, i) \<in> \<real>)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
A = adjoint A
[PROOF STEP]
have "P * B * adjoint P = P * adjoint B * adjoint P"
[PROOF STATE]
proof (prove)
using this:
A = adjoint A

goal (1 subgoal):
 1. P * B * adjoint P = P * adjoint B * adjoint P
[PROOF STEP]
using A aA
[PROOF STATE]
proof (prove)
using this:
A = adjoint A
A = P * B * adjoint P
adjoint A = P * adjoint B * adjoint P

goal (1 subgoal):
 1. P * B * adjoint P = P * adjoint B * adjoint P
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
P * B * adjoint P = P * adjoint B * adjoint P

goal (1 subgoal):
 1. similar_mat_wit A B P (adjoint P) \<and> diagonal_mat B \<and> diag_mat B = es \<and> unitary P \<and> (\<forall>i<n. B $$ (i, i) \<in> \<real>)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
P * B * adjoint P = P * adjoint B * adjoint P
[PROOF STEP]
have BaB: "B = adjoint B"
[PROOF STATE]
proof (prove)
using this:
P * B * adjoint P = P * adjoint B * adjoint P

goal (1 subgoal):
 1. B = adjoint B
[PROOF STEP]
using unitary_elim[OF dimB dimaB dimP] uP
[PROOF STATE]
proof (prove)
using this:
P * B * adjoint P = P * adjoint B * adjoint P
\<lbrakk>unitary P; P * B * adjoint P = P * adjoint B * adjoint P\<rbrakk> \<Longrightarrow> B = adjoint B
unitary P

goal (1 subgoal):
 1. B = adjoint B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
B = adjoint B

goal (1 subgoal):
 1. similar_mat_wit A B P (adjoint P) \<and> diagonal_mat B \<and> diag_mat B = es \<and> unitary P \<and> (\<forall>i<n. B $$ (i, i) \<in> \<real>)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
B = adjoint B

goal (1 subgoal):
 1. similar_mat_wit A B P (adjoint P) \<and> diagonal_mat B \<and> diag_mat B = es \<and> unitary P \<and> (\<forall>i<n. B $$ (i, i) \<in> \<real>)
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. similar_mat_wit A B P (adjoint P) \<and> diagonal_mat B \<and> diag_mat B = es \<and> unitary P \<and> (\<forall>i<n. B $$ (i, i) \<in> \<real>)
[PROOF STEP]
assume "i < n"
[PROOF STATE]
proof (state)
this:
i < n

goal (1 subgoal):
 1. similar_mat_wit A B P (adjoint P) \<and> diagonal_mat B \<and> diag_mat B = es \<and> unitary P \<and> (\<forall>i<n. B $$ (i, i) \<in> \<real>)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i < n
[PROOF STEP]
have "B$$(i, i) = conjugate (B$$(i, i))"
[PROOF STATE]
proof (prove)
using this:
i < n

goal (1 subgoal):
 1. B $$ (i, i) = conjugate (B $$ (i, i))
[PROOF STEP]
apply (subst BaB)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < n \<Longrightarrow> adjoint B $$ (i, i) = conjugate (B $$ (i, i))
[PROOF STEP]
by (insert dimB, simp add: adjoint_eval)
[PROOF STATE]
proof (state)
this:
B $$ (i, i) = conjugate (B $$ (i, i))

goal (1 subgoal):
 1. similar_mat_wit A B P (adjoint P) \<and> diagonal_mat B \<and> diag_mat B = es \<and> unitary P \<and> (\<forall>i<n. B $$ (i, i) \<in> \<real>)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
B $$ (i, i) = conjugate (B $$ (i, i))
[PROOF STEP]
have "B$$(i, i) \<in> Reals"
[PROOF STATE]
proof (prove)
using this:
B $$ (i, i) = conjugate (B $$ (i, i))

goal (1 subgoal):
 1. B $$ (i, i) \<in> \<real>
[PROOF STEP]
unfolding conjugate_complex_def
[PROOF STATE]
proof (prove)
using this:
B $$ (i, i) = cnj (B $$ (i, i))

goal (1 subgoal):
 1. B $$ (i, i) \<in> \<real>
[PROOF STEP]
using Reals_cnj_iff
[PROOF STATE]
proof (prove)
using this:
B $$ (i, i) = cnj (B $$ (i, i))
(?z \<in> \<real>) = (cnj ?z = ?z)

goal (1 subgoal):
 1. B $$ (i, i) \<in> \<real>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
B $$ (i, i) \<in> \<real>

goal (1 subgoal):
 1. similar_mat_wit A B P (adjoint P) \<and> diagonal_mat B \<and> diag_mat B = es \<and> unitary P \<and> (\<forall>i<n. B $$ (i, i) \<in> \<real>)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?i2 < n \<Longrightarrow> B $$ (?i2, ?i2) \<in> \<real>

goal (1 subgoal):
 1. similar_mat_wit A B P (adjoint P) \<and> diagonal_mat B \<and> diag_mat B = es \<and> unitary P \<and> (\<forall>i<n. B $$ (i, i) \<in> \<real>)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?i2 < n \<Longrightarrow> B $$ (?i2, ?i2) \<in> \<real>
[PROOF STEP]
have "\<forall>i<n. B$$(i, i) \<in> Reals"
[PROOF STATE]
proof (prove)
using this:
?i2 < n \<Longrightarrow> B $$ (?i2, ?i2) \<in> \<real>

goal (1 subgoal):
 1. \<forall>i<n. B $$ (i, i) \<in> \<real>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>i<n. B $$ (i, i) \<in> \<real>

goal (1 subgoal):
 1. similar_mat_wit A B P (adjoint P) \<and> diagonal_mat B \<and> diag_mat B = es \<and> unitary P \<and> (\<forall>i<n. B $$ (i, i) \<in> \<real>)
[PROOF STEP]
with schur
[PROOF STATE]
proof (chain)
picking this:
similar_mat_wit A B P (adjoint P) \<and> diagonal_mat B \<and> diag_mat B = es \<and> unitary P
\<forall>i<n. B $$ (i, i) \<in> \<real>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
similar_mat_wit A B P (adjoint P) \<and> diagonal_mat B \<and> diag_mat B = es \<and> unitary P
\<forall>i<n. B $$ (i, i) \<in> \<real>

goal (1 subgoal):
 1. similar_mat_wit A B P (adjoint P) \<and> diagonal_mat B \<and> diag_mat B = es \<and> unitary P \<and> (\<forall>i<n. B $$ (i, i) \<in> \<real>)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
similar_mat_wit A B P (adjoint P) \<and> diagonal_mat B \<and> diag_mat B = es \<and> unitary P \<and> (\<forall>i<n. B $$ (i, i) \<in> \<real>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma closed_nonpos_Ints [simp]: "closed (\<int>\<^sub>\<le>\<^sub>0 :: 'a :: real_normed_algebra_1 set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed \<int>\<^sub>\<le>\<^sub>0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. closed \<int>\<^sub>\<le>\<^sub>0
[PROOF STEP]
have "\<int>\<^sub>\<le>\<^sub>0 = (of_int ` {n. n \<le> 0} :: 'a set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<int>\<^sub>\<le>\<^sub>0 = of_int ` {n. n \<le> 0}
[PROOF STEP]
by (auto elim!: nonpos_Ints_cases intro!: nonpos_Ints_of_int)
[PROOF STATE]
proof (state)
this:
\<int>\<^sub>\<le>\<^sub>0 = of_int ` {n. n \<le> 0}

goal (1 subgoal):
 1. closed \<int>\<^sub>\<le>\<^sub>0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<int>\<^sub>\<le>\<^sub>0 = of_int ` {n. n \<le> 0}

goal (1 subgoal):
 1. closed \<int>\<^sub>\<le>\<^sub>0
[PROOF STEP]
have "closed \<dots>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed (of_int ` {n. n \<le> 0})
[PROOF STEP]
by (rule closed_of_int_image)
[PROOF STATE]
proof (state)
this:
closed (of_int ` {n. n \<le> 0})

goal (1 subgoal):
 1. closed \<int>\<^sub>\<le>\<^sub>0
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
closed \<int>\<^sub>\<le>\<^sub>0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
closed \<int>\<^sub>\<le>\<^sub>0

goal (1 subgoal):
 1. closed \<int>\<^sub>\<le>\<^sub>0
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
closed \<int>\<^sub>\<le>\<^sub>0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma int_rdvd_real:
  "real_of_int (i::int) rdvd x = (i dvd \<lfloor>x\<rfloor> \<and> real_of_int \<lfloor>x\<rfloor> = x)" (is "?l = ?r")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (real_of_int i rdvd x) = (i dvd \<lfloor>x\<rfloor> \<and> real_of_int \<lfloor>x\<rfloor> = x)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. real_of_int i rdvd x \<Longrightarrow> i dvd \<lfloor>x\<rfloor> \<and> real_of_int \<lfloor>x\<rfloor> = x
 2. i dvd \<lfloor>x\<rfloor> \<and> real_of_int \<lfloor>x\<rfloor> = x \<Longrightarrow> real_of_int i rdvd x
[PROOF STEP]
assume "?l"
[PROOF STATE]
proof (state)
this:
real_of_int i rdvd x

goal (2 subgoals):
 1. real_of_int i rdvd x \<Longrightarrow> i dvd \<lfloor>x\<rfloor> \<and> real_of_int \<lfloor>x\<rfloor> = x
 2. i dvd \<lfloor>x\<rfloor> \<and> real_of_int \<lfloor>x\<rfloor> = x \<Longrightarrow> real_of_int i rdvd x
[PROOF STEP]
hence th: "\<exists> k. x=real_of_int (i*k)"
[PROOF STATE]
proof (prove)
using this:
real_of_int i rdvd x

goal (1 subgoal):
 1. \<exists>k. x = real_of_int (i * k)
[PROOF STEP]
by (simp add: rdvd_def)
[PROOF STATE]
proof (state)
this:
\<exists>k. x = real_of_int (i * k)

goal (2 subgoals):
 1. real_of_int i rdvd x \<Longrightarrow> i dvd \<lfloor>x\<rfloor> \<and> real_of_int \<lfloor>x\<rfloor> = x
 2. i dvd \<lfloor>x\<rfloor> \<and> real_of_int \<lfloor>x\<rfloor> = x \<Longrightarrow> real_of_int i rdvd x
[PROOF STEP]
hence th': "real_of_int \<lfloor>x\<rfloor> = x"
[PROOF STATE]
proof (prove)
using this:
\<exists>k. x = real_of_int (i * k)

goal (1 subgoal):
 1. real_of_int \<lfloor>x\<rfloor> = x
[PROOF STEP]
by (auto simp del: of_int_mult)
[PROOF STATE]
proof (state)
this:
real_of_int \<lfloor>x\<rfloor> = x

goal (2 subgoals):
 1. real_of_int i rdvd x \<Longrightarrow> i dvd \<lfloor>x\<rfloor> \<and> real_of_int \<lfloor>x\<rfloor> = x
 2. i dvd \<lfloor>x\<rfloor> \<and> real_of_int \<lfloor>x\<rfloor> = x \<Longrightarrow> real_of_int i rdvd x
[PROOF STEP]
with th
[PROOF STATE]
proof (chain)
picking this:
\<exists>k. x = real_of_int (i * k)
real_of_int \<lfloor>x\<rfloor> = x
[PROOF STEP]
have "\<exists> k. real_of_int \<lfloor>x\<rfloor> = real_of_int (i*k)"
[PROOF STATE]
proof (prove)
using this:
\<exists>k. x = real_of_int (i * k)
real_of_int \<lfloor>x\<rfloor> = x

goal (1 subgoal):
 1. \<exists>k. real_of_int \<lfloor>x\<rfloor> = real_of_int (i * k)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<exists>k. real_of_int \<lfloor>x\<rfloor> = real_of_int (i * k)

goal (2 subgoals):
 1. real_of_int i rdvd x \<Longrightarrow> i dvd \<lfloor>x\<rfloor> \<and> real_of_int \<lfloor>x\<rfloor> = x
 2. i dvd \<lfloor>x\<rfloor> \<and> real_of_int \<lfloor>x\<rfloor> = x \<Longrightarrow> real_of_int i rdvd x
[PROOF STEP]
hence "\<exists>k. \<lfloor>x\<rfloor> = i*k"
[PROOF STATE]
proof (prove)
using this:
\<exists>k. real_of_int \<lfloor>x\<rfloor> = real_of_int (i * k)

goal (1 subgoal):
 1. \<exists>k. \<lfloor>x\<rfloor> = i * k
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
\<exists>k. \<lfloor>x\<rfloor> = i * k

goal (2 subgoals):
 1. real_of_int i rdvd x \<Longrightarrow> i dvd \<lfloor>x\<rfloor> \<and> real_of_int \<lfloor>x\<rfloor> = x
 2. i dvd \<lfloor>x\<rfloor> \<and> real_of_int \<lfloor>x\<rfloor> = x \<Longrightarrow> real_of_int i rdvd x
[PROOF STEP]
thus ?r
[PROOF STATE]
proof (prove)
using this:
\<exists>k. \<lfloor>x\<rfloor> = i * k

goal (1 subgoal):
 1. i dvd \<lfloor>x\<rfloor> \<and> real_of_int \<lfloor>x\<rfloor> = x
[PROOF STEP]
using th'
[PROOF STATE]
proof (prove)
using this:
\<exists>k. \<lfloor>x\<rfloor> = i * k
real_of_int \<lfloor>x\<rfloor> = x

goal (1 subgoal):
 1. i dvd \<lfloor>x\<rfloor> \<and> real_of_int \<lfloor>x\<rfloor> = x
[PROOF STEP]
by (simp add: dvd_def)
[PROOF STATE]
proof (state)
this:
i dvd \<lfloor>x\<rfloor> \<and> real_of_int \<lfloor>x\<rfloor> = x

goal (1 subgoal):
 1. i dvd \<lfloor>x\<rfloor> \<and> real_of_int \<lfloor>x\<rfloor> = x \<Longrightarrow> real_of_int i rdvd x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. i dvd \<lfloor>x\<rfloor> \<and> real_of_int \<lfloor>x\<rfloor> = x \<Longrightarrow> real_of_int i rdvd x
[PROOF STEP]
assume "?r"
[PROOF STATE]
proof (state)
this:
i dvd \<lfloor>x\<rfloor> \<and> real_of_int \<lfloor>x\<rfloor> = x

goal (1 subgoal):
 1. i dvd \<lfloor>x\<rfloor> \<and> real_of_int \<lfloor>x\<rfloor> = x \<Longrightarrow> real_of_int i rdvd x
[PROOF STEP]
hence "(i::int) dvd \<lfloor>x::real\<rfloor>"
[PROOF STATE]
proof (prove)
using this:
i dvd \<lfloor>x\<rfloor> \<and> real_of_int \<lfloor>x\<rfloor> = x

goal (1 subgoal):
 1. i dvd \<lfloor>x\<rfloor>
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
i dvd \<lfloor>x\<rfloor>

goal (1 subgoal):
 1. i dvd \<lfloor>x\<rfloor> \<and> real_of_int \<lfloor>x\<rfloor> = x \<Longrightarrow> real_of_int i rdvd x
[PROOF STEP]
hence "\<exists>k. real_of_int \<lfloor>x\<rfloor> = real_of_int (i*k)"
[PROOF STATE]
proof (prove)
using this:
i dvd \<lfloor>x\<rfloor>

goal (1 subgoal):
 1. \<exists>k. real_of_int \<lfloor>x\<rfloor> = real_of_int (i * k)
[PROOF STEP]
by (metis (no_types) dvd_def)
[PROOF STATE]
proof (state)
this:
\<exists>k. real_of_int \<lfloor>x\<rfloor> = real_of_int (i * k)

goal (1 subgoal):
 1. i dvd \<lfloor>x\<rfloor> \<and> real_of_int \<lfloor>x\<rfloor> = x \<Longrightarrow> real_of_int i rdvd x
[PROOF STEP]
thus ?l
[PROOF STATE]
proof (prove)
using this:
\<exists>k. real_of_int \<lfloor>x\<rfloor> = real_of_int (i * k)

goal (1 subgoal):
 1. real_of_int i rdvd x
[PROOF STEP]
using \<open>?r\<close>
[PROOF STATE]
proof (prove)
using this:
\<exists>k. real_of_int \<lfloor>x\<rfloor> = real_of_int (i * k)
i dvd \<lfloor>x\<rfloor> \<and> real_of_int \<lfloor>x\<rfloor> = x

goal (1 subgoal):
 1. real_of_int i rdvd x
[PROOF STEP]
by (simp add: rdvd_def)
[PROOF STATE]
proof (state)
this:
real_of_int i rdvd x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma diag_block_mat_cong_tl:
  assumes "0 < length Al"
  and "length Al = length Bl"
  and "dim_row (hd Al) = dim_row (hd Bl)"
  and "dim_col (hd Al) = dim_col (hd Bl)"
  and "diag_block_mat Al = diag_block_mat Bl"
shows "diag_block_mat (tl Al) = diag_block_mat (tl Bl)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diag_block_mat (tl Al) = diag_block_mat (tl Bl)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. diag_block_mat (tl Al) = diag_block_mat (tl Bl)
[PROOF STEP]
have "Al \<noteq> []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Al \<noteq> []
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < length Al
length Al = length Bl
dim_row (hd Al) = dim_row (hd Bl)
dim_col (hd Al) = dim_col (hd Bl)
diag_block_mat Al = diag_block_mat Bl

goal (1 subgoal):
 1. Al \<noteq> []
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Al \<noteq> []

goal (1 subgoal):
 1. diag_block_mat (tl Al) = diag_block_mat (tl Bl)
[PROOF STEP]
hence "Al = hd Al#(tl Al)"
[PROOF STATE]
proof (prove)
using this:
Al \<noteq> []

goal (1 subgoal):
 1. Al = hd Al # tl Al
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Al = hd Al # tl Al

goal (1 subgoal):
 1. diag_block_mat (tl Al) = diag_block_mat (tl Bl)
[PROOF STEP]
hence da:"diag_block_mat Al =
    four_block_diag (hd Al) (diag_block_mat (tl Al))"
[PROOF STATE]
proof (prove)
using this:
Al = hd Al # tl Al

goal (1 subgoal):
 1. diag_block_mat Al = four_block_diag (hd Al) (diag_block_mat (tl Al))
[PROOF STEP]
using diag_block_mat.simps(2)[of "hd Al" "tl Al"]
[PROOF STATE]
proof (prove)
using this:
Al = hd Al # tl Al
diag_block_mat (hd Al # tl Al) = Let (diag_block_mat (tl Al)) (four_block_diag (hd Al))

goal (1 subgoal):
 1. diag_block_mat Al = four_block_diag (hd Al) (diag_block_mat (tl Al))
[PROOF STEP]
unfolding Let_def
[PROOF STATE]
proof (prove)
using this:
Al = hd Al # tl Al
diag_block_mat (hd Al # tl Al) = four_block_diag (hd Al) (diag_block_mat (tl Al))

goal (1 subgoal):
 1. diag_block_mat Al = four_block_diag (hd Al) (diag_block_mat (tl Al))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
diag_block_mat Al = four_block_diag (hd Al) (diag_block_mat (tl Al))

goal (1 subgoal):
 1. diag_block_mat (tl Al) = diag_block_mat (tl Bl)
[PROOF STEP]
have  "Bl \<noteq> []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Bl \<noteq> []
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < length Al
length Al = length Bl
dim_row (hd Al) = dim_row (hd Bl)
dim_col (hd Al) = dim_col (hd Bl)
diag_block_mat Al = diag_block_mat Bl

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

goal (1 subgoal):
 1. diag_block_mat (tl Al) = diag_block_mat (tl Bl)
[PROOF STEP]
hence "Bl = hd Bl#(tl Bl)"
[PROOF STATE]
proof (prove)
using this:
Bl \<noteq> []

goal (1 subgoal):
 1. Bl = hd Bl # tl Bl
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Bl = hd Bl # tl Bl

goal (1 subgoal):
 1. diag_block_mat (tl Al) = diag_block_mat (tl Bl)
[PROOF STEP]
hence "diag_block_mat Bl = four_block_diag (hd Bl) (diag_block_mat (tl Bl))"
[PROOF STATE]
proof (prove)
using this:
Bl = hd Bl # tl Bl

goal (1 subgoal):
 1. diag_block_mat Bl = four_block_diag (hd Bl) (diag_block_mat (tl Bl))
[PROOF STEP]
using diag_block_mat.simps(2)[of "hd Bl" "tl Bl"]
[PROOF STATE]
proof (prove)
using this:
Bl = hd Bl # tl Bl
diag_block_mat (hd Bl # tl Bl) = Let (diag_block_mat (tl Bl)) (four_block_diag (hd Bl))

goal (1 subgoal):
 1. diag_block_mat Bl = four_block_diag (hd Bl) (diag_block_mat (tl Bl))
[PROOF STEP]
unfolding Let_def
[PROOF STATE]
proof (prove)
using this:
Bl = hd Bl # tl Bl
diag_block_mat (hd Bl # tl Bl) = four_block_diag (hd Bl) (diag_block_mat (tl Bl))

goal (1 subgoal):
 1. diag_block_mat Bl = four_block_diag (hd Bl) (diag_block_mat (tl Bl))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
diag_block_mat Bl = four_block_diag (hd Bl) (diag_block_mat (tl Bl))

goal (1 subgoal):
 1. diag_block_mat (tl Al) = diag_block_mat (tl Bl)
[PROOF STEP]
hence "four_block_diag (hd Al) (diag_block_mat (tl Al)) =
    four_block_diag (hd Bl) (diag_block_mat (tl Bl))"
[PROOF STATE]
proof (prove)
using this:
diag_block_mat Bl = four_block_diag (hd Bl) (diag_block_mat (tl Bl))

goal (1 subgoal):
 1. four_block_diag (hd Al) (diag_block_mat (tl Al)) = four_block_diag (hd Bl) (diag_block_mat (tl Bl))
[PROOF STEP]
using da assms
[PROOF STATE]
proof (prove)
using this:
diag_block_mat Bl = four_block_diag (hd Bl) (diag_block_mat (tl Bl))
diag_block_mat Al = four_block_diag (hd Al) (diag_block_mat (tl Al))
0 < length Al
length Al = length Bl
dim_row (hd Al) = dim_row (hd Bl)
dim_col (hd Al) = dim_col (hd Bl)
diag_block_mat Al = diag_block_mat Bl

goal (1 subgoal):
 1. four_block_diag (hd Al) (diag_block_mat (tl Al)) = four_block_diag (hd Bl) (diag_block_mat (tl Bl))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
four_block_diag (hd Al) (diag_block_mat (tl Al)) = four_block_diag (hd Bl) (diag_block_mat (tl Bl))

goal (1 subgoal):
 1. diag_block_mat (tl Al) = diag_block_mat (tl Bl)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
four_block_diag (hd Al) (diag_block_mat (tl Al)) = four_block_diag (hd Bl) (diag_block_mat (tl Bl))

goal (1 subgoal):
 1. diag_block_mat (tl Al) = diag_block_mat (tl Bl)
[PROOF STEP]
using four_block_diag_cong_comp' assms
[PROOF STATE]
proof (prove)
using this:
four_block_diag (hd Al) (diag_block_mat (tl Al)) = four_block_diag (hd Bl) (diag_block_mat (tl Bl))
\<lbrakk>dim_row ?A1.0 = dim_row ?B1.0; dim_col ?A1.0 = dim_col ?B1.0; four_block_diag ?A1.0 ?A2.0 = four_block_diag ?B1.0 ?B2.0\<rbrakk> \<Longrightarrow> ?A2.0 = ?B2.0
0 < length Al
length Al = length Bl
dim_row (hd Al) = dim_row (hd Bl)
dim_col (hd Al) = dim_col (hd Bl)
diag_block_mat Al = diag_block_mat Bl

goal (1 subgoal):
 1. diag_block_mat (tl Al) = diag_block_mat (tl Bl)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
diag_block_mat (tl Al) = diag_block_mat (tl Bl)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma set_tries_empty[simp]: "set_tries (Trie None []) = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_tries (Trie None []) = {}
[PROOF STEP]
by(simp add: set_tries_def)


[STATEMENT]
lemma vector_matrix_mul_rid [simp]:
  fixes v :: "('a::semiring_1)^'n"
  shows "v v* mat 1 = v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v v* mat (1::'a) = v
[PROOF STEP]
by (metis matrix_vector_mul_lid transpose_mat vector_transpose_matrix)


[STATEMENT]
lemma delete_list_length[simp]:
  assumes "sorted_less ks"
  shows "length (delete_list k ks) = length ks - (if k \<in> set ks then 1 else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (delete_list k ks) = length ks - (if k \<in> set ks then 1 else 0)
[PROOF STEP]
using insert_list_req
[PROOF STATE]
proof (prove)
using this:
sorted_less ?ks \<Longrightarrow> isin_list ?x ?ks = (?x \<in> set ?ks)
sorted_less ?ks \<Longrightarrow> insert_list ?x ?ks = ins_list ?x ?ks
sorted_less ?ks \<Longrightarrow> delete_list ?x ?ks = del_list ?x ?ks

goal (1 subgoal):
 1. length (delete_list k ks) = length ks - (if k \<in> set ks then 1 else 0)
[PROOF STEP]
by (simp add: assms)


[STATEMENT]
lemma converse_rtrancl_on_cases:
  assumes "(a, b) \<in> rtrancl_on F r"
  obtains (base) "a = b" "b \<in> F"
    | (step) c where "(a,c) \<in> r" "(c,b) \<in> rtrancl_on F r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<lbrakk>a = b; b \<in> F\<rbrakk> \<Longrightarrow> thesis; \<And>c. \<lbrakk>(a, c) \<in> r; (c, b) \<in> rtrancl_on F r\<rbrakk> \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(a, b) \<in> rtrancl_on F r

goal (1 subgoal):
 1. \<lbrakk>\<lbrakk>a = b; b \<in> F\<rbrakk> \<Longrightarrow> thesis; \<And>c. \<lbrakk>(a, c) \<in> r; (c, b) \<in> rtrancl_on F r\<rbrakk> \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by induct auto